Payment process
A payment is the most important thing of all. It is validated by Qerko, then by POS then by payment gateway. Any subject can cancel the payment.
-
Validation at Qerko
-
After the customer selects items and swipes, Qerko calls the method paymentStart(...). POS validates the payment as described by the method. This is the easiest phase for cancellation. We recommend locking related items so the restaurant can not manipulate with them. Or at least visually mark them as there is a payment in progress. Any error or missing answer cancels the payment on Qerko side.
-
Qerko transfers funds and waits for payment gateway(s) confirmation. Qerko calls the method paymentProcessed(...). POS returns receipt details to Qerko. Any error or missing answer cancels the payment on Qerko side. If the payment gets canceled in this step, it takes some time to revoke the funds blocation. Exact revocation time depends on card issuer, bank, etc.
-
Qerko generates the receipt and sends it to the customer by email.
-
Qerko calls the method paymentClosed(...). The payment has reached its final state. POS checks this final state and unlocks items locked in step 2. If the payment was successful, POS should send notification to waiters and makes internal steps to mark items as paid. We strongly recommend to implement some form of notification for staff. Method getTableContents(...) nor getBill(...) must not return paid items any more. If the payment was not successful (payment is canceled), POS must internally cancel the payment and cancel any tax related reports.
Qerko serializes concurrent payments, so there will never be multiple payments in progress on one bill at the same time.