Best practices
Create optimal online advanced tax refund experiences for your customers by following these integration best practices. These best practices need to be implemented not only between the server and Alipay sides, but also between the terminals.
Timeout when creating advanced tax refund transactions
Two timeout settings exist, front end cashier timeout and back end transaction timeout. The front end cashier has a timeout of 15 minutes, after which the customer is not able to authorize the transaction. The tax refund company is able to refresh the order string by calling the alipay.overseas.tax.advanced.create API with the same request parameters. Then, the cashier can be triggered again by the customer's retry. In the create API, pay_timeout
regulates the maximum time that is allowed for the advanced tax refund transaction. This value can be set by the tax refund company to indicate the maximum retry period for a particular transaction number. After pay_timeout
is expired, it is not allowed to refresh the order string.
Query the transaction status and error handling
Since a transaction cannot be cancelled, the tax refund company has to query the status until a final status is returned from H5 cashier. The create API includes two actions, freeze the authorized funds and issue a tax refund in advance, errors need to be analyzed and handled as per business logic. Check the status
and status_msg
fields in the response of query.
The query API is not only used after creating a transaction, but also required for unfreeze, pay and refund API in case of timeout or exceptions are returned.