Skip to main content

Record Payment

Pay at Table integrations are currently standalone from Pay at Counter and Online payments. This is because the current version of the Tables API uses an asynchronous WebSocket protocol for its messaging.

A successful RecordPayment operation confirms to the EPOS that a payment (full or partial) has been processed. The message is sent from the terminal to the EPOS and the request body includes all relevant transaction data from the Tables API session.

A request from Dojo to record a payment:

  1. Receive a recordPaymentRequest from Dojo.
  2. If the specified session does not exist, the EPOS should respond with an Error response with the code SESSION_NO_SUCH_SESSION.
  3. Otherwise, if the specified session exists and is not locked, the EPOS should respond with an Error response with the code SESSION_NOT_LOCKED.
  4. Otherwise, if the session exists AND is locked AND the session has already been recorded, the EPOS should respond with an Error response with the code PAYMENT_ALREADY_RECORDED.
  5. Otherwise, if the session exists AND is locked AND is yet to be recorded AND fails to record on the EPOS, the EPOS should respond with an Error response with the code PAYMENT_NOT_RECORDED.
  6. Otherwise, if the session exists AND is locked AND has not already been recorded AND is successfully recorded on the EPOS, the EPOS should respond with a recordPaymentResponse.

The recordPaymentRequest body includes a full payment schema object as part of its parameters.

{
"jsonrpc": "2.0",
"id": "400b3fce-2017-4cca-8285-4c225a13f668",
"method": "RecordPayment",
"params": {
"payment": {
"id": "bc7ba973-2a96-473b-9f90-426fed2d7646 ",
"sessionId": "6c133121-8423-48af-b9c1-ce6741f224da",
"waiterId": 1,
"currency": "GBP",
"baseAmount": 100,
"tipsAmount": 200,
"cashbackAmount": 300,
"paymentSuccessful": true,
"methodDetails": {
"method": "PAYMENT_METHOD_CARD_PRESENT",
"cardPresentPaymentInfo": {
"authCode": "ABC123",
"entryMode": "ENTRY_MODE_CONTACTLESS",
"card": {
"scheme": "CARD_SCHEME_AMEX",
"last4PAN": "1234",
"expiryDate": {
"month": 12,
"year": 2032
},
"fundingType": "CARD_FUNDING_TYPE_CREDIT"
},
"cardholderVerificationMethod": "CARDHOLDER_VERIFICATION_METHOD_PIN",
"terminalId": "12345678",
"merchantId": "12341234",
"acquirerTransactionId": "01234567-0123-0123-0123-0123456789ab"
},
"cardPresentPaymentStatus": "CARD_PRESENT_PAYMENT_STATUS_SUCCESSFUL"
},
"attemptedAt": "2021-01-01T15:00:00.123+02:00"
},
"requestorInfo": {
"requestorType": "REQUESTOR_TYPE_CARD_MACHINE",
"cardMachineRequestorInfo": {
"terminalId": "123123",
"waiterId": 1
}
}
}
}