Bill Preparation And Payment
For table postpay flows, OpenApp first asks the POS to prepare the bill. The POS should freeze or protect the bill state enough to ensure that the amount shown to the customer can be paid safely.
After the bill is prepared, OpenApp executes the customer payment. If payment succeeds, OpenApp tells the POS to apply the completed payment. If payment fails, OpenApp tells the POS to release the prepared state.
Message types:
| Message type | Direction | Purpose |
|---|---|---|
| BillRequested | OpenApp -> POS | Ask the POS to prepare or freeze a table bill. |
| BillPreparationResult | POS -> OpenApp | Return prepared bill details or rejection details. |
| PaymentCompleted | OpenApp -> POS | Tell the POS that OpenApp payment succeeded. |
| PaymentFailed | OpenApp -> POS | Tell the POS that OpenApp payment failed and prepared state should be released. |
| PosPaymentResult | POS -> OpenApp | Confirm or reject applying the OpenApp payment in the POS. |
Bill preparation rejection vocabulary: see Bill preparation rejection reasons.
After successful payment application, the POS should notify OpenApp that the table order is closed by sending TableOrderSnapshotChanged with changeType=ORDER_CLOSED.