Payment
The Dojo Tables API covers integrations for both in-person and remote payments.
- In-person payments are made at Dojo Go card machines.
- Remote payments are made using the Dojo mobile app, either on iOS or Android. For more information about configuring remote payments, visit the SDK documentation.
Record payment operation
Because Tables is a WebSockets Async API, the RecordPayment
operation
has both a SUB (subscribe) as well as a PUB (publish) message. The subscribe messages are
requests sent from Dojo to your EPOS, while the publish messages are the response sent from your EPOS to Dojo.
Payment ID
Each payment sent to the POS system must be assigned a UUID (Universally Unique Identifier). Even if a meal is
split into multiple equal payments, each of those payments should be differentiated with a unique id
.
It is the responsibility of the POS system to ensure that no other payment with the same id
exists, maintaining proper
identification and uniqueness for each transaction.
While the chance of a duplicate UUID being used for two separate transaction is highly unlikely, it isn't
impossible. If you receive a duplicate transaction id
, the POS should validate the amounts and attemptedAt
timestamp to rule out a duplicate transaction. If all the values do match, the POS should treat this as a duplicate transaction and return an Error Response with an error code of PAYMENT_ALREADY_RECORDED
.
Amounts
Each payment consists of three "amount" fields that, when combined, make up the payment total for the transaction:
baseAmount
: The total cost of the purchased items.tipsAmount
: Any additional amount added by the customer as a gratuity or tip.cashbackAmount
: The amount of cashback requested by the customer, if applicable.
Status
When recording payments on the POS system, refer to the boolean payment.paymentSuccessful
to determine whether the payment was successful or not. You can filter payment statuses by requestor. This will provide you with more specific details about any unsuccessful payments.
In-person payment responses will contain one of the following payment.methodDetails.cardPresentPaymentInfo
statuses:
CARD_PRESENT_PAYMENT_STATUS_CANCELLED
CARD_PRESENT_PAYMENT_STATUS_DECLINED
CARD_PRESENT_PAYMENT_STATUS_SUCCESSFUL
CARD_PRESENT_PAYMENT_STATUS_UNKNOWN
Remote payment responses will contain one of the following payment.methodDetails.remotePaymentStatus
statuses:
REMOTE_PAYMENT_STATUS_CANCELLED
REMOTE_PAYMENT_STATUS_SUCCESSFUL
REMOTE_PAYMENT_STATUS_UNKNOWN