Working with two-stage payments
Two-stage payments separate authorization from capture. Authorization reserves funds on the customer's payment method; capture collects them later. With single-stage payments, authorization and capture happen as part of the same payment flow.
Before capture, you can cancel the authorization instead of refunding a completed payment. This is simpler and generally cheaper than a refund; exact fees depend on your payment provider and pricing terms.
1. Enable two-stage payments
Contact Truegate technical support and ask us to enable two-stage payments for your project.
2. Handle the payment webhooks
With single-stage payments, a successful payment is reported as type: PAYMENT_SUCCESS with status: SUCCESS.
With two-stage payments, handle authorization and the subsequent capture or cancellation separately:
| Stage | Webhook type and status | What to do |
|---|---|---|
| Authorized payment | PAYMENT_AUTHORIZED / AUTHORIZED | Record that funds are reserved. They have not been collected yet. |
| Captured payment | PAYMENT_SUCCESS / CAPTURED | Record that funds have been collected. |
| Canceled payment | PAYMENT_SUCCESS / CANCELED | Record that the payment or authorization was canceled. |
Match notifications using transactionId and inspect both type and status. Process each stage separately and handle repeated deliveries idempotently: authorization and capture refer to the same payment, so do not discard capture merely because you have already processed its transactionId.
For orders that require collected funds, wait for CAPTURED before fulfillment. See the Webhooks guide for signature verification and delivery handling.
3. Automatic capture
You do not need to capture payments manually or call a capture endpoint. Truegate automatically captures authorized payments according to the configured schedule.
The capture delay is configurable. Contact Truegate technical support to set or change the timing for your project.
4. Cancel a payment
To cancel a payment, use POST /api/v1/pay/start-cancellation.
Before capture, this cancels the authorization. After capture, it requests a refund instead. Confirm cancellation through the Canceled payment webhook, or check the Refund webhook if capture has already occurred.
Updated 2 months ago