- PCI Compliance: Direct violation of PCI DSS requirements
- Security Risks: WebView and iframe may not provide sufficient security isolation
- Man-in-the-Middle Attacks: Malicious applications may intercept or tamper with payment data
- Phishing Risks: Cannot ensure users are entering sensitive information in a trusted environment
Device Environment Requirements
Regional Restrictions
Unsupported Regions List
Unsupported Regions List
AD - AndorraAE - United Arab EmiratesAF - AfghanistanAG - Antigua and BarbudaAI - AnguillaAL - AlbaniaAM - ArmeniaAO - AngolaAQ - AntarcticaAR - ArgentinaAS - American SamoaAW - ArubaAX - Åland IslandsBA - Bosnia and HerzegovinaBB - BarbadosBD - BangladeshBF - Burkina FasoBH - BahrainBI - BurundiBJ - BeninBL - Saint BarthélemyBM - BermudaBN - BruneiBQ - Bonaire, Sint Eustatius, and SabaBS - BahamasBT - BhutanBV - Bouvet IslandBW - BotswanaBY - BelarusBZ - BelizeCC - Cocos (Keeling) IslandsCD - Democratic Republic of the CongoCF - Central African RepublicCG - Republic of the CongoCI - Ivory CoastCK - Cook IslandsCM - CameroonCO - ColombiaCU - CubaCV - Cape VerdeCW - CuraçaoCX - Christmas IslandCY - CyprusDJ - DjiboutiDM - DominicaDO - Dominican RepublicDZ - AlgeriaEC - EcuadorEE - EstoniaEG - EgyptEH - Western SaharaER - EritreaET - EthiopiaFJ - FijiFK - Falkland IslandsFM - Federated States of MicronesiaFO - Faroe IslandsGA - GabonGD - GrenadaGE - GeorgiaGF - French GuianaGG - GuernseyGH - GhanaGI - GibraltarGL - GreenlandGM - GambiaGN - GuineaGP - GuadeloupeGQ - Equatorial GuineaGS - South Georgia and the South Sandwich IslandsGT - GuatemalaGW - Guinea-BissauHK - Hong KongHM - Heard Island and McDonald IslandsHN - HondurasHT - HaitiID - IndonesiaIL - IsraelIM - Isle of ManIN - IndiaIO - British Indian Ocean TerritoryIQ - IraqIR - IranJM - JamaicaJO - JordanJP - JapanKE - KenyaKH - CambodiaKI - KiribatiKM - ComorosKN - Saint Kitts and NevisKP - North KoreaKR - South KoreaKW - KuwaitKY - Cayman IslandsKZ - KazakhstanLA - LaosLB - LebanonLC - Saint LuciaLI - LiechtensteinLK - Sri LankaLR - LiberiaLS - LesothoLV - LatviaLY - LibyaMD - MoldovaME - MontenegroMF - Saint Martin (French part)MG - MadagascarMH - Marshall IslandsMK - North MacedoniaML - MaliMM - MyanmarMN - MongoliaMP - Northern Mariana IslandsMQ - MartiniqueMR - MauritaniaMS - MontserratMU - MauritiusMV - MaldivesMW - MalawiMY - MalaysiaMZ - MozambiqueNA - NamibiaNC - New CaledoniaNE - NigerNF - Norfolk IslandNG - NigeriaNI - NicaraguaNP - NepalNR - NauruNU - NiueOM - OmanPA - PanamaPE - PeruPF - French PolynesiaPG - Papua New GuineaPH - PhilippinesPK - PakistanPM - Saint Pierre and MiquelonPN - Pitcairn IslandsPR - Puerto RicoPS - PalestinePW - PalauRE - RéunionRU - RussiaRW - RwandaSA - Saudi ArabiaSB - Solomon IslandsSC - SeychellesSD - SudanSH - Saint HelenaSJ - Svalbard and Jan MayenSK - SlovakiaSL - Sierra LeoneSM - San MarinoSN - SenegalSO - SomaliaSR - SurinameSS - South SudanST - São Tomé and PríncipeSV - El SalvadorSX - Sint Maarten (Dutch part)SY - SyriaSZ - EswatiniTC - Turks and Caicos IslandsTD - ChadTF - French Southern TerritoriesTG - TogoTH - ThailandTK - TokelauTL - East TimorTM - TurkmenistanTN - TunisiaTO - TongaTR - TurkeyTT - Trinidad and TobagoTV - TuvaluTW - TaiwanTZ - TanzaniaUA - UkraineUG - UgandaUM - United States Minor Outlying IslandsUY - UruguayUZ - UzbekistanVA - Vatican CityVC - Saint Vincent and the GrenadinesVE - VenezuelaVG - British Virgin IslandsVI - U.S. Virgin IslandsVN - VietnamVU - VanuatuWF - Wallis and FutunaWS - SamoaYE - YemenYT - MayotteZA - South AfricaZM - ZambiaZW - Zimbabwe
HaiPay.js Integration (Apple Pay & Google Pay)
HaiPay provides a convenient Apple Pay and Google Pay payment integration solution that allows you to quickly integrate payment functionality into web pages through simple configuration.- Import HaiPay script ([https://cashier.haipay.top/js/applePayGooglePay_1.0.0.min.js])
- Page structure requirements
- Payment button container: Used for rendering Apple Pay/Google Pay buttons.
- Quick integration example
- Parameter description
-
- Initialization configuration parameters (HaiPay constructor parameters)
-
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| sandbox | Yes | Boolean | Environment type,default value true, optional values: - true: Test environment (for integration testing) - false: Production environment (for live use) |
| clientToken | Yes | String | Client Toke(clientToken) |
| buttonType | No | String | Button text type, default value buy, optional values: - plain: “Display payment logo only, no text” - add-money: “Add funds” - book: “Book” - buy: “Buy” (default) - check-out: “Checkout” - contribute: “Donate” - order: “Order” - reload: “Reload” - rent: “Rent” - subscribe: “Subscribe” - support: “Support” - tip: “Tip” - top-up: “Top-up” |
| buttonTheme | No | String | Button theme style, default value black, optional values: - black: Black background - white: White background |
| buttonHeight | No | number | Button height, default value 50 |
-
- Common error types and solutions
| Error Message | Error Cause | Solution |
|---|---|---|
| Missing required parameters: clientToken | Missing required initialization parameters | Check if parameters clientToken are passed |
| Unsupported region: CN | Production environment does not support China region | Check if there is a DOM element with the corresponding ID in the page |
HaiPay.js Integration (creditCard)
HaiPay provides a convenient creditCard payment integration solution that allows you to quickly integrate payment functionality into web pages through simple configuration.- Import HaiPay script ([https://cashier.haipay.top/js/creditCard_1.0.0.min.js])
- Page structure requirements
- Page Container: used for rendering the creditCard page.
- Quick integration example
- Parameter description
-
- Initialization configuration parameters (HaiPay constructor parameters)
-
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| sandbox | Yes | Boolean | Environment type,default value true, optional values: - true: Test environment (for integration testing) - false: Production environment (for live use) |
| clientToken | Yes | String | Client Toke(clientToken) |
| cardTheme | No | String | Theme style, default value white, optional values: - black: Black background - white: White background |
-
- Common error types and solutions
| Error Message | Error Cause | Solution |
|---|---|---|
| Missing required parameters: clientToken | Missing required initialization parameters | Check if parameters clientToken are passed |
| Unsupported region: CN | Production environment does not support China region | Check if there is a DOM element with the corresponding ID in the page |
Transaction Limits
| Transaction Type | Limit (USD) |
|---|---|
| Collection | 0.99-1000 |
Collection API
1. Collection Application
Brief Description:- Create a collection order
/usd/collect/apply
Note: appId for USD, amount in USD, settlement in USD
Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | Long | Business ID (obtained from backend, must pass corresponding business ID based on currency in URL) |
| orderId | Yes | String | Merchant order number (must be unique, length not exceeding 48) |
| name | Yes | String | User name, recommended to use real name, format: firstName and lastName separated by space, example: Donald John Trump |
| phone | Yes | String | Real phone number (format reference Phone Number Format) |
| Yes | String | Real email address | |
| amount | Yes | String | Transaction amount (accurate to two decimal places; do not add punctuation, e.g., ”,“) |
| payType | Yes | String | Payment method type |
| inBankCode | Yes | String | Payment method code |
| clientIp | No | String | Client IP address |
| callBackUrl | Yes | String | URL to redirect after successful payment |
| callBackFailUrl | Yes | String | URL to redirect after failed payment |
| notifyUrl | No | String | Callback URL |
| subject | Yes | String | Payment remark |
| body | No | String | Remark details |
| partnerUserId | Yes | String | Unique user identifier (e.g., userId), used for risk control, must be real and valid, otherwise it will affect transactions. Format requirements: digits, uppercase and lowercase letters or common symbols -~!@#$%&*()_. |
| sign | Yes | String | Signature |
| Parameter Name | Type | Description |
|---|---|---|
| orderId | String | Merchant order number (must be unique) |
| orderNo | String | Platform order number |
| payUrl | String | Payment link |
| bankCode | String | Payment Method Code |
| clientToken | String | Client token used in JavaScript Web SDK (see HaiPaySDK.js) |
| sign | String | Signature |
2. Collection Application MIT Mode
Brief Description:- Create MIT mode collection order
/usd/mit/apply
Note: appId for USD, amount in USD, settlement in USD
Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | Long | Business ID (obtained from backend, must pass corresponding business ID based on currency in URL) |
| orderId | Yes | String | Merchant order number (must be unique, length not exceeding 48) |
| name | No | String | User name, recommended to use real name, format: firstName and lastName separated by space, example: Donald John Trump |
| phone | No | String | Real phone number (format reference Phone Number Format) |
| No | String | Real email address | |
| amount | Yes | String | Transaction amount (accurate to two decimal places; do not add punctuation, e.g., ”,“) |
| payType | Yes | String | Payment method type |
| inBankCode | Yes | String | Payment method code |
| clientIp | No | String | Client IP address |
| callBackUrl | Yes | String | URL to redirect after successful payment |
| callBackFailUrl | Yes | String | URL to redirect after failed payment |
| notifyUrl | No | String | Callback URL |
| subject | Yes | String | Payment remark |
| body | No | String | Remark details |
| partnerUserId | Yes | String | Unique user identifier (e.g., userId), used for risk control, must be real and valid, otherwise it will affect transactions. Format requirements: digits, uppercase and lowercase letters or common symbols -~!@#$%&*()_. |
| tokenID | No | String | Payment token, not required for first transaction, required for subsequent active deductions, obtained through callback |
| token | No | String | Apple Pay / Google Pay Token, you can obtain and transfer the data yourself or use the HaiPay page., How to get? |
| loadingType | No | Integer | 0 (default) – Display the current/normal payment result view; 1 – Show a loading spinner with no order information. |
| cancelUrl | No | String | If provided, the user can click “Back” on the payment page to return to this URL after canceling the payment. |
| sign | Yes | String | Signature |
| Parameter Name | Type | Description |
|---|---|---|
| orderId | String | Merchant order number (must be unique) |
| orderNo | String | Platform order number |
| payUrl | String | Payment link |
| clientToken | String | Client token used in JavaScript Web SDK (see HaiPaySDK.js) |
| sign | String | Signature |
3. Collection Query
Brief Description:- Query collection order
/usd/collect/query
Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | Long | Business ID (obtained from backend, must pass corresponding business ID based on currency in URL) |
| orderId | Yes | String | Merchant order number |
| orderNo | No | String | Platform order number (faster response) |
| sign | Yes | String | Signature |
| Parameter Name | Type | Description |
|---|---|---|
| orderId | String | Merchant order number (must be unique) |
| orderNo | String | Platform order number |
| amount | String | Transaction amount |
| actualAmount | String | Amount received |
| fee | String | Handling fee |
| status | Integer | Status (0 - Not started, 1 - In progress, 2 - Success (final), 3 - Failure (final), -1 - Pending confirmation) |
| payTime | String | Payment success time (present when status=2) (local time), format: yyyy-MM-dd HH:mm:ss |
| errorMsg | String | Payment failure reason (present when status=3) |
| sign | String | Signature |
4. Refund Application
Brief Description:- Initiate a refund operation for the original credit card transaction order. Please pay attention to the status values returned synchronously. It is recommended to use the query interface for status checks.
/usd/refund/apply
Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | Long | Business ID (obtained from backend, must pass corresponding business ID based on currency in URL) |
| orderId | Yes | String | Merchant refund application order number (new merchant order number, cannot use original collection merchant order number) |
| orderNo | Yes | String | Platform order number (original collection platform order number returned) |
| sign | Yes | String | Signature |
| Parameter Name | Type | Description |
|---|---|---|
| appId | String | Business ID |
| orderNo | String | Platform order number (original collection platform order number returned) |
| orderId | String | Merchant refund application order number |
| refundNo | String | Platform refund number for this refund |
| status | String | Refund status: 1 indicates refund application success, 0 indicates processing, 2 indicates failure. Initially returns processing, status needs to be checked via query interface later |
| errorMsg | String | Error message (may not always have a value) |
| sign | String | Signature |
5. Refund Query
Brief Description:- Query the result of the refunded order.
/usd/refund/refundQuery
Parameters:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | Long | Business ID (obtained from backend, must pass corresponding business ID based on currency in URL) |
| orderId | No | String | Merchant refund application order number |
| refundNo | No | String | Platform refund number (platform order number returned when refund was applied, if provided, prioritize checking this field) |
| sign | Yes | String | Signature |
| Parameter Name | Type | Description |
|---|---|---|
| appId | String | Merchant order number (must be unique) |
| orderNo | String | Platform order number (original collection platform order number) |
| orderId | String | Merchant application order number |
| refundNo | String | Platform refund number |
| status | String | Refund status: 1 indicates refund application success, 0 indicates processing, 2 indicates failure. Refund result is based on this status |
| errorMsg | String | Error message (may not always have a value) |
| sign | String | Signature |
6. Payment Methods
| Currency | Payment Type (payType) | Payment Code (inBankCode) | Limits | Status | Description |
|---|---|---|---|---|---|
| USD | BANK_TRANSFER | CREDIT_CARD | 0.99-1000 | Available | VISA |
| USD | BANK_TRANSFER | CREDIT_CARD | 0.99-1000 | Available | MasterCard |
| USD | BANK_TRANSFER | CREDIT_CARD | 0.99-1000 | Available | JCB |
| USD | EWALLET | GOOGLE_PAY | 0.99-1000 | Available | Google Pay |
| USD | EWALLET | APPLE_PAY | 0.99-1000 | Available | Apple Pay |
7. Test Card Numbers
Simulate Successful Payment
Use the following test card numbers, enter any CVC (3-digit number) and expiration date (future date) to simulate successful payment:- Card Number 1: 4242424242424242
Simulate Payment Failure
Use the following test card numbers with invalid data to simulate payment failure:- Card Number 1: 4000000000009995
- Invalid month: 13
- Invalid CVV: 99
8. MIT (Merchant Initiated Transaction) Mode Description
MIT (Merchant Initiated Transaction) Refers to transactions that merchants can initiate without the user being present after the user completes a one-time payment authorization. This mode is widely used in business scenarios such as subscription payments, installment payments, membership renewals, delayed deductions, etc.Basic Process
-
User Authorization
- User enters payment information during the first payment and completes necessary identity verification.
- Merchant saves the user’s payment credentials for subsequent deduction requests.
-
Merchant-Initiated Deduction
- Merchant directly uses saved payment credentials to initiate deduction requests based on agreed cycles or conditions.
- Since the transaction is an offline scenario (off-session), meaning the user is not involved in the transaction, the system will complete processing based on user authorization and compliance requirements.
-
Authentication Requirements
- In most cases, transactions will complete directly.
- If the issuing bank or risk control system requires re-verification, the transaction may enter a pending user confirmation state, requiring user supplementary verification to complete.
Mode Features
- Enhanced Experience: Users don’t need to manually enter payment information each time.
- Compliant and Secure: Meets international payment regulations and Strong Customer Authentication (SCA) requirements.
- Wide Application: Suitable for subscription billing, auto-renewal, installment deductions, delayed settlement, etc.
MIT Flow Diagram
9. Apple Pay / Google Pay Token Acquisition Method Description
Integration Process
- No need to apply for an Apple Pay or Google Pay developer account — HaiPay handles it for you.
- Include the JavaScript script ([https://js.stripe.com/v3/])
- Page structure requirements:
- Payment button container: used for rendering the Apple Pay / Google Pay button.
- Quick integration example
Full code reference (JavaScript)
Full code reference (JavaScript)

