To integrate a merchant’s system with Alipay to run the Barcode payment method, the merchant basically needs to implement functions of purchase, payment reversal, refund, order query, and settlement. These function flows are respectively explained in the following topics.
Merchants can call alipay.intl.acquiring.offline.pay to place an order and initiate a charge request.
The following diagram shows a full purchase flow:
To protect users from fraud, occasionally, the system might require the user to be authenticated before making a purchase. Users will be prompted to enter the payment password for various reasons, for example:
Alipay risk engine determines a payment looks suspicious
Regulatory requirements demand an authentication step
Transaction currencies supported: USD, EUR, GBP, HKD, CHF, SGD, JPY, CAD, AUD, SEK, DKK, NOK, NZD, KRW, THB, MYR, and IDR.
FX rate used at the transaction time is valid throughout the entire transaction lifetime.
If the payment status is unknown or if the transaction times out, call alipay.intl.acquiring.offline.payQuery to check the exact status.
Payment reversal flow
During the purchase process, it is possible to encounter issues such as system exception or network accessibility problems. In such cases, merchants can reverse the transaction by using the alipay.intl.acquiring.common.payCancel API.
The following diagram shows the payment reversal flow:
For a transaction that has been successfully paid, the alipay.intl.acquiring.common.payCancel API can only refund the transaction within 24 hours since the time of payment.
If a transaction is refunded by using this interface, the transaction fee that has been charged by Alipay will be refunded as well.
If problems occur when the customer pay for a transaction, use this interface to roll back all actions that have already been performed in Alipay system regarding the specific transaction.
For more information about the parameters and error codes, see alipay.intl.acquiring.common.payCancel.
For a transaction that has been successfully paid, customers can request the merchant for refunding all of, or a portion of the transaction. Merchants can call alipay.intl.acquiring.common.refund to issue the refund.
The following diagram shows the refund flow:
Unless otherwise stated in the contract, the transaction fee charged by Alipay will not be refunded.
Merchants can use this interface to request refund at any time within the refunding period.
Using the same FX rate as the transaction.
The refund amount must NOT be more than the original transaction amount.
If a refunding request fails, try again instead of cancelling the failed request.
For more information about the parameters and error codes, see alipay.intl.acquiring.common.refund.
Order query flow
You can query the status of a transaction order by using the alipay.intl.acquiring.offline.payQuery interface.
The following diagram shows the order query flow:
For more information about the parameters and error codes, see alipay.intl.acquiring.offline.payQuery.
Alipay performs a merchant settlement at the end of each settlement period, which brings merchants into balance. This process occurs at the end of each settlement cycle, or occurs when the settlement amount reaches some pre-defined level of inbalance (trigger-point).
Currently, the cut off time is 23:59:59 Beijing TZ (GMT+8), and the standard settlement cycle for the transactions is one business day, known as T+1. However, for transactions made on Friday, weekend, and certain holidays, more time is required for settlement. See the following table for details:
Monday - Thursday
Friday, Saturday, Sunday
Spring Festival, Chinese National Day Holiday
The first working day after the holiday
For the exact settlement period, refer to your contract with Alipay for details.
The transaction files are generated on T+1; and the settlement files are generated at the next day of the settlement (S+1). For more information about how to fetch the settlement file, see Viewing reconciliation files.