Skip to main content
Checkout Mode is the simplest integration method. The merchant’s server calls the Collection Apply API, then uses the returned 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, and callback URLs. 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 and sends an async notification to notifyUrl.

Example Code

// Assume the server has called the Collection Apply API and returned payUrl to the frontend
const payUrl = response.data.payUrl;

// Redirect in the current window
window.location.href = payUrl;

// Or open in a new window
// window.open(payUrl, '_blank');

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.
Last modified on July 9, 2026