Skip to main content
The HaiPay Front-End Component is a pre-built payment UI solution for securely accepting payments on merchant websites. With the Front-End Component, sensitive information (card numbers, CVV, etc.) is collected and hosted by HaiPay components, so merchants do not need to apply for PCI DSS certification. Adding new payment methods later requires only a contract — no additional development needed.

Front-End Component

Merchants can embed the payment component directly into their own pages. The merchant’s server calls the Collection Apply API to obtain a clientToken, and the front-end uses this token to initialize the component. Users can complete payment on the current page without redirection. A single container displays Google Pay, Apple Pay, and credit cards simultaneously, with a mode parameter to switch between collection payments and MIT payments. Ideal for merchants who need unified management of multiple payment scenarios.

Script

https://cashier.haipay.top/js/composite-component_1.0.0.min.js

Parameters

Events

  • ready — Component rendered and ready for interaction
  • error — Initialization failure or payment error
  • confirm — Form submission result (success/failure)
  • paymentStatus — Payment result notification; returns error info on failure (component auto-handles result display when not listened to)
  • paymentMethodType — Currently selected payment method

Recommendations

  • Recommended as the default choice for new checkout pages — cleaner structure, lower development cost.
  • When only a subset of payment methods is needed, pass the desired combination.

Common Errors

Last modified on July 9, 2026