Postpaid Bill Payment
For postpaid orders, 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.
This diagram is logical. It omits delivery-mode details; see Architecture for the delivery model.
Message types:
| Message type | Direction | Purpose |
|---|---|---|
| BillPreparationRequested | OpenApp -> POS | Ask the POS to prepare or freeze a postpaid bill. |
| BillPreparationResult | POS -> OpenApp | Return prepared bill details or rejection details. |
| BillPaymentCompleted | OpenApp -> POS | Tell the POS that later OpenApp payment succeeded. |
| BillPaymentFailed | OpenApp -> POS | Tell the POS that OpenApp payment failed and prepared state should be released. |
| BillPaymentResult | POS -> OpenApp | Confirm or reject applying the OpenApp payment in the POS. |
Bill preparation rejection vocabulary: see Bill preparation rejection reasons.
For table postpaid orders, after successful payment application, the POS should notify OpenApp that the table order is closed by sending TableOrderSnapshotChanged with changeType=ORDER_CLOSED.