Alipay
Basic information
The customer selects Alipay on the hosted checkout page and pays with an Alipay wallet.
- Integration path: Checkout (desktop browser)
- Transaction type: One-time payment
lpmsInfo.lpmsType:Alipay
| Payer wallet market | Order currency |
|---|---|
| 🇨🇳 CN | CNY |
This guide applies to merchants enabled for this flow.
For payments where the customer chooses a wallet on the Alipay+ payment page, see Alipay+. For the Hong Kong wallet, see AlipayHK.
Before you begin
Complete Setup and confirm that Alipay is enabled for your merchant and application. Confirm the supported order currencies, transaction limits, payment expiry, settlement arrangements, and available test procedure with Onerway. This flow uses CNY; follow Currency and amount validation for amount formatting.
Prepare the customer's actual billing details, including name, email, country, and address. Supply shipping and product details according to the API requirements. This flow provides customer details when creating the order, without relying on Checkout to collect missing information. Configure your return page and notification endpoint, and store the mapping between your order and the Onerway payment identifiers.
Start the payment through Checkout
- On your server, call Create Checkout Payment with
productType=ALL,subProductType=DIRECT,txnType=SALE,paymentMode=WEB, andorderCurrency=CNY. To show only Alipay, setlpmsInfo.lpmsTypetoAlipay, sendinglpmsInfoas a JSON string. If you omitlpmsInfo, the customer chooses from the methods available for the order. - Supply the prepared billing details and the shipping, product, notification, and return URL fields required by the API. Encode
billingInformation,shippingInformation, andtxnOrderMsgas JSON strings. Keep product and order currencies consistent and ensure the product amounts, discounts, and shipping charges totalorderAmount.
Select the request example “Unified Checkout with all available payment methods”. Replace its placeholders with your actual order and customer data, use CNY, and removecardInfofor this flow. Add this method'slpmsInfoif you want to show only Alipay. The example shows the shared Checkout request structure. - Select the response example “Unified Checkout session created”. Store the returned
paymentIdandtransactionIdagainst your order, then redirect the customer's browser toredirectUrl. The initialstatus=Umeans the payment is unpaid. - The customer selects or confirms Alipay in Checkout. Checkout handles the next payment page or wallet interaction. If Alipay is absent, contact Onerway to check the application enablement and order conditions.
See Checkout integration for request authentication and return-page handling. List available payment methods can check an order's available methods before creating it; Checkout also filters the methods it displays for that order.
Customer actions and final result
The customer follows the payment page instructions, reviews the amount, and completes the authorization requested by Alipay. Your application does not collect the customer's wallet password or verification code.
Returning to your website does not confirm payment success. Process the signature-verified Payment Result notification on your server. If the notification is missing or you need to check the result, call Query payments with the saved paymentId. Fulfil the order only after your server confirms payment success. See Webhooks for verification, acknowledgement, idempotency, and query fallback.
If the customer closes the page or leaves payment incomplete, check the existing payment before creating a replacement. Keep your order aligned with the notification or query result.
Refunds and disputes
Confirm the refund capabilities, partial-refund support, request deadlines, and dispute process enabled for your account with Onerway. If refunds are enabled, follow Refunds and track the refund result separately from the payment result.
Testing and go-live
Confirm the Alipay test environment and wallet procedure with Onerway, then follow Sandbox testing.
- Create a CNY order with the required customer details. Verify that the returned URL opens Checkout and Alipay is available for the order.
- Select Alipay, check the displayed amount, and complete the agreed test procedure. Retain the notification and acknowledgement for the same order, then query the payment and check that the results agree.
- Test cancelling or leaving payment incomplete and returning before the final result. Confirm that returning alone never marks the order paid, duplicate notifications are handled idempotently, and a missing notification can be reconciled by querying the payment.
- Before launch, verify production enablement, notification and return URLs, order currencies, limits, and expiry. Test refunds separately if enabled.