Transaction Flow – Direct
This flow is only necessary if you would like to implement the refund/capture or tokenization payment.
In most scenario, the result can be direct returned in the API request. However, there are some transactions that will not have a immediately result (listed as below), a webhook will be expected for the notification for result. Merchant can also use query API to check for the transaction status if webhook cannot be received.
Transactions without immediately result:
1. Refund of Octopus Payment
2. Refund of Checkout.com
3. Refund of HSBC FPS
4. Refund of UPOP
5. Refund of WeChat Pay
Step 1: Create Order Session
Merchant's backend server should send the transaction operation API (except cmd=SALESESSION or AUTHSESSION) and order information (e.g. amount, merchant reference) to Spiral PG, and Spiral PG will return the transaction result directly.
Receive Notification (webhook)
The webhook will only happened when the webhookUrl is provided and the status of the response of step 1 is 'Unconfirmed'.
Only some of the specified transaction and payment type will have this 'unconfirmed' scenario.
For payment, it is very important to identify a specified transactions among a batch of records. Thus, it is very important to know how to use the proper reference to match your record.
Merchant Reference (merchantRef) – The reference created by merchants on this order which must be unique for every transaction. If refund/capture is going to be made, a new merchant reference must be provided which is different from the original sale/authorization transaction.
Format: Max. 25 characters. [A-Za-z0-9_-] but the last 3 characters cannot be ‘_’.
Transaction ID (txnId) – similar to merchant reference, but is generated by Spiral instead of merchant.
Order ID (orderId) – generated by Spiral which is same as transaction ID, however, for a series of transactions (e.g. capture/refund) which is ride on the same sale/authorization transaction, they will share the same Order Id. Order Id is also needed to be provided when doing capture/refund to indicate the original order.
The difference scenario between Checkout Session flow and Direct Transaction.
Direct Transaction | Checkout Session Transaction |
|
|