Check-in terminal workflow example
This example will demonstrate how to implement a work-flow for a check-in terminal application. Specifically, we assume a guest wants to load additional credits on a Camp-Card.
Exemplary user interaction:
- Select “charge card” from UI
- Insert card
- Select credit value and perform payment
- Remove card
This requires interaction with a payment terminal as well as a CampCard dispenser.
In the following section we will use the phrase “wait for the command to complete” or “wait for the status to become […]”. This means your application will need to use webhooks, subscriptions or polling to find out when a command is completed or when the device reached the expected state.
Note, that in this example, we will not cover error handling in detail.
1. Configure the Dispenser to accept cards
After the user has selected the option to load additional credits onto their CampCard, use the campCardDispenserSetConfig
with enableCardEntry: true to enable card acceptance on the dispenser and allow users to insert their card.
Wait for this command to complete.
2. Wait for the user to input their card
Once the user inserts their card into the card slot, the dispenser will automatically move it to the “reader” position
and read the data. Once this is complete, the latestReport on the dispenser will have cardPresence set to AT_READER as well as
cardId and cardData representing the card that was inserted.
If the user inserts an invalid card, the dispenser will automatically eject it, reporting cardPresence set
to AT_PRESENTER. An appropriate errorCode will be set.
3. Accept payment
Start the payment process on the payment terminal using the initiatePayment mutation.
Wait for this command to complete. Once the payment command has succeeded, you know the user’s card has been charged and you can write the increased balance to the Camp-Card.
While waiting for the user to perform payment, periodically issue the campCardDispenserMoveCard mutation with HOLD option
to have the dispenser keeping the card in its current position. If this is not done, the dispenser will automatically return the
card to the user after a timeout, to prevent cards from getting stuck in the device in case communication issues.
4. Write the card
Use the campCardDispenserWriteCard mutation to write the new balance to the card. Wait for this command to complete.
5. Return the card to the user and disable card acceptance
Use the campCardDispenserMoveCard mutation with PRESENT option to present the card to the user.
Wait for this command to complete.
Disable further card acceptance, using campCardDispenserSetConfig mutation with enableCardEntry: false.
6. Wait for the user to take the card
Wait for the dispenser to report that the card has been removed (cardPresence set to NO_CARD).
If the user does not take the card, the dispenser may automatically capture it after a timeout. This could
also be handled by the application after a desired duration, moving the card to the CAPTURE position manually,
assuming the guest forgot his card.