payUrl to redirect the user to a HaiPay-hosted payment page where the user completes payment and authorization.
Integration Flow
1
Server calls the Collection Apply API
The merchant’s server sends a collection request to HaiPay with required parameters such as transaction amount, payment method, callback URLs, and optional
cancelUrl. For the apply endpoints of each payment method, see: Credit Card, Apple Pay, Google Pay, MIT.2
Get payUrl and redirect
The API response contains a
payUrl field. Redirect the user’s browser to this URL.3
User completes payment and authorization
The user completes payment and authorization on the HaiPay-hosted page. After payment, HaiPay redirects the user back to the merchant’s
callBackUrl; if the user cancels payment on the payment page and cancelUrl is provided, the user can click back and be redirected to that URL; HaiPay also sends an async notification to notifyUrl.Example Code
Recommendations
- Best for the fastest payment integration with minimal frontend changes.
- When there is no strong requirement for custom payment page UI.
- In mobile H5 scenarios, the redirect experience typically meets requirements.

