Confirm payments
Confirm Tap to Pay payments on your backend with notifications.
The app can be closed, lose the network or be tampered with. For backend integrations, subscribe to Tap to Pay events and use the captured order status to confirm payment.
Create the listener directly in your back office on app.paygreen.fr, or with the API (see Listeners).
Tap to Pay has its own eventsA listener on
payment_order.authorizedorpayment_order.successeddoes not receive Tap to Pay payments. Subscribe to thepayment_order.tap_to_pay.*events below.
Payment Order events
| Event | When |
|---|---|
payment_order.tap_to_pay.pending | The Payment Order was created. |
payment_order.tap_to_pay.authorized | The payment is authorized and still awaits capture. |
payment_order.tap_to_pay.successed | The payment is captured. Use this event to confirm a successful payment. |
payment_order.tap_to_pay.refused | The card was declined. The Payment Order is closed. |
payment_order.tap_to_pay.canceled | The payment was canceled. |
payment_order.tap_to_pay.expired | The Payment Order expired before being paid. |
payment_order.tap_to_pay.error | The payment failed. |
payment_order.tap_to_pay.refunded | The payment was refunded. |
Transaction and operation events
Transactions:
transaction.tap_to_pay.pendingtransaction.tap_to_pay.authorizedtransaction.tap_to_pay.capturedtransaction.tap_to_pay.refusedtransaction.tap_to_pay.canceledtransaction.tap_to_pay.expiredtransaction.tap_to_pay.errortransaction.tap_to_pay.refundedtransaction.tap_to_pay.partly_refunded
Operations:
operation.tap_to_pay.pendingoperation.tap_to_pay.authorizedoperation.tap_to_pay.capturedoperation.tap_to_pay.refusedoperation.tap_to_pay.canceledoperation.tap_to_pay.expiredoperation.tap_to_pay.erroroperation.tap_to_pay.refund
A listener can mix standard and Tap to Pay events, for example payment_order.authorized and payment_order.tap_to_pay.authorized if you also take online payments.
Check the Payment Order
When collectPayment() reports PAYMENT_RESULT_UNKNOWN, keep the purchase pending and query the same order on your backend or from the app.
const { id, status } = await LemonwayTerminal.getPaymentOrder({ id: orderId, objectSecret });The SDK sends the configured public key and the order’s object_secret. Keep the order secret in secure storage and out of logs. The returned status omits the payment_order. prefix.
| Status | What to do |
|---|---|
successed | Complete the purchase. |
refused, canceled, expired | The order is closed. Use a new order if the customer tries again. |
pending, authorized, or any other status | Keep the existing purchase unresolved and check again. |
The order status comes from the API and reflects updates as they arrive. Poll with a bounded delay. If reads fail or the status stays unresolved, keep the order and reconcile it before any new charge.
See Notifications for the event payload, signature header and retries.
Updated 8 days ago