Testing
You can perform the following flows to test Alipay+ on our platform:
Positive scenarios
To test different scenarios, use the API Explorer available through your Configuration Center account. Depending on your integration option, you can use different API calls for testing.
- For MyCheckout hosted payment pages, send POST /hostedcheckouts API request and validate response:
- HTTP status code=201
- partialRedirectUrl contains a link
{
"hostedCheckoutSpecificInput": {
"locale": "en_GB",
"variant": "105"
},
"order": {
"amountOfMoney": {
"currencyCode": "HKD",
"amount": 2499
},
"customer": {
"merchantCustomerId": "123456547",
"billingAddress": {
"countryCode": "HK"
}
}
}
}
- Click the link in the response to be redirected to a hosted page that displays the selected variant you sent in the request.
- Select Alipay+ from the list of available payment products.
- For your own payment pages testing, send Create payment POST /v1/{merchantId}/payments API request and validate response:
- HTTP status code=201
- merchantAction.redirectURL contains a link to the provider's page
- payment.statusOutput.statusCode=50
{
"order": {
"amountOfMoney": {
"currencyCode": "HKD",
"amount": 2499
},
"customer": {
"billingAddress": {
"countryCode": "HK"
}
}
},
"redirectPaymentMethodSpecificInput": {
"paymentProductId": "866",
"redirectionData": {
"returnUrl": "https://example.com"
}
}
}
{
"creationOutput" : {
"additionalReference" : "00000880051000015778",
"externalReference" : "000008800510000157780000100001"
},
"merchantAction" : {
"actionType" : "REDIRECT",
"redirectData" : {
"RETURNMAC" : "f1f2993f-7302-4079-a9c4-080d147c3493",
"redirectURL" : "https://open-sea-global.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=2816660400931cMV1k6ZI9h9KF0bbmsv5PDX&loadMode=2"
},
"showData" : [ ]
},
"payment" : {
"id" : "000008800510000157780000100001",
"paymentOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006X0GA"
},
"paymentMethod" : "redirect",
"redirectPaymentMethodSpecificOutput" : {
"paymentProductId" : 866
}
},
"status" : "REDIRECTED",
"statusOutput" : {
"isCancellable" : false,
"isRetriable" : false,
"statusCategory" : "PENDING_PAYMENT",
"statusCode" : 50,
"statusCodeChangeDateTime" : "20241217171553",
"isAuthorized" : false,
"isRefundable" : false
}
}
}
- Get redirected to Alipay+ page to proceed with your test payment.
- Select a suitable e-wallet from the provided options.
- Open the ALinker app and select the same e-wallet as in the previous step.
- Scan the QR code and complete the payment.


- The payment result will be visible in the browser. Once the countdown is complete or the Return to Merchant button is clicked, you will be redirected back to the website.
- Based on the integration option you're testing, the redirection can happen in 2 different ways:
-
- When using MyCheckout hosted payment pages, after completing the payment, you will be redirected to the payment status page. Please note that updating the status may take some time, and the actual consumer might need to wait between 1 to 5 minutes.
-
- When using your own checkout page and server-to-server integration, you will be redirected to the link you specified in the initial request: https://example.com/?REF=000008800510000157920000100001&RETURNMAC=6d7cdbbf-17cf-4b14-b5ea-d4823286202e&paymentId=000008800510000157920000100001
Getting the payment status
To retrieve information about the status of a transaction made with MyCheckout hosted payment pages, send a GET /v1/{merchantId}/hostedcheckouts/{hostedCheckoutId} API request including the hostedCheckoutId and check the response.
{
"createdPaymentOutput" : {
"payment" : {
"id" : "000008800510000157930000100001",
"hostedCheckoutSpecificOutput" : {
"hostedCheckoutId" : "06762985-75d3-71ff-8186-b93e4c64f48a",
"variant" : "105"
},
"paymentOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XFUA"
},
"paymentMethod" : "redirect",
"redirectPaymentMethodSpecificOutput" : {
"paymentProductId" : 866
}
},
"status" : "CAPTURED",
"statusOutput" : {
"isCancellable" : false,
"isRetriable" : false,
"statusCategory" : "COMPLETED",
"statusCode" : 800,
"statusCodeChangeDateTime" : "20241218105858",
"isAuthorized" : true,
"isRefundable" : false
}
},
"paymentCreationReferences" : {
"additionalReference" : "00000880051000015793",
"externalReference" : "000008800510000157930000100001"
},
"paymentStatusCategory" : "SUCCESSFUL"
},
"status" : "PAYMENT_CREATED"
}
To get the status of a transaction made with Create payment call, send a GET https://{domainname}/v1/{merchantId}/payments/{paymentId} API request with a payment ID copied from the Create payments request, then see the response.
{
"id" : "000008800510000157920000100001",
"paymentOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XESA"
},
"paymentMethod" : "redirect",
"redirectPaymentMethodSpecificOutput" : {
"paymentProductId" : 866
}
},
"status" : "CAPTURED",
"statusOutput" : {
"isCancellable" : false,
"isRetriable" : false,
"statusCategory" : "COMPLETED",
"statusCode" : 800,
"statusCodeChangeDateTime" : "20241218094435",
"isAuthorized" : true,
"isRefundable" : false
}
}
Another option is to subscribe to webhook notifications to get updates on payment statuses. You can find more details about webhooks in our documentation.
The hosted checkout ID is valid for only 2 hours. We strongly recommend saving the paymentId from the response for future reference regarding this transaction.
Testing refunds with Alipay+
The refund functionality is available only for transactions that reached the status PAID (1000). Typically, it takes 1-3 business days for a transaction to update from status 800 to status 1000.
Full refund test
- Find a transaction with status 1000
- Send POST /v1/{merchantId}/payments/{paymentId}/refund API request with empty JSON body request. Find the example response below.
{
"id" : "00000880051000015792000-100001",
"refundOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XESA"
},
"paymentMethod" : "redirect",
"eWalletRefundMethodSpecificOutput" : {
"refundProductId" : 866,
"totalAmountPaid" : 2499
}
},
"status" : "REFUND_REQUESTED",
"statusOutput" : {
"isCancellable" : false,
"statusCategory" : "PENDING_CONNECT_OR_3RD_PARTY",
"statusCode" : 625,
"statusCodeChangeDateTime" : "20241218094435"
}
}
You have several ways to initiate a full refund for a specific transaction. The simplest method is to send a request with an empty body. For other options, please refer to our API documentation.
Partial refund test
- Find a transaction with status 1000
- Send POST /v1/{merchantId}/payments/{paymentId}/refund API request.
{
"amountOfMoney": {
"currencyCode": "HKD",
"amount": 1499
},
"customer": {
"address": {
"countryCode": "HK"
}
}
}
{
"id" : "00000880051000015793000-100001",
"refundOutput" : {
"amountOfMoney" : {
"amount" : 1499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XESA"
},
"paymentMethod" : "redirect",
"eWalletRefundMethodSpecificOutput" : {
"refundProductId" : 866,
"totalAmountPaid" : 2499
}
},
"status" : "REFUND_REQUESTED",
"statusOutput" : {
"isCancellable" : false,
"statusCategory" : "PENDING_CONNECT_OR_3RD_PARTY",
"statusCode" : 625,
"statusCodeChangeDateTime" : "20241218094435"
}
}
To get the refund status for both cases of a full refund and partial refund, you can send a GET /v1/{merchantId}/refunds/{refundId} API request.
{
"id" : "00000880051000015792000-100001",
"refundOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XESA"
},
"paymentMethod" : "redirect",
"eWalletRefundMethodSpecificOutput" : {
"refundProductId" : 866,
"totalAmountPaid" : 2499
}
},
"status" : "REFUND_REQUESTED",
"statusOutput" : {
"isCancellable" : false,
"statusCategory" : "PENDING_CONNECT_OR_3RD_PARTY",
"statusCode" : 800,
"statusCodeChangeDateTime" : "20241218094435"
}
}
Negative scenarios
Conducting negative testing is limited at the moment. You can test a scenario when the transaction is expired on Alipay+ side.
- Send Create payment POST /v1/{merchantId}payments API request and validate response:
- HTTP status code=201
- merchantAction.redirectURL contains a link to the provider's page
- payment.statusOutput.statusCode=50
{
"order": {
"amountOfMoney": {
"currencyCode": "HKD",
"amount": 2499
},
"customer": {
"billingAddress": {
"countryCode": "HK"
}
}
},
"redirectPaymentMethodSpecificInput": {
"paymentProductId": "866",
"redirectionData": {
"returnUrl": "https://example.com"
}
}
}
{
"creationOutput" : {
"additionalReference" : "00000880051000015778",
"externalReference" : "000008800510000157780000100001"
},
"merchantAction" : {
"actionType" : "REDIRECT",
"redirectData" : {
"RETURNMAC" : "f1f2993f-7302-4079-a9c4-080d147c3493",
"redirectURL" : "https://open-sea-global.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=2816660400931cMV1k6ZI9h9KF0bbmsv5PDX&loadMode=2"
},
"showData" : [ ]
},
"payment" : {
"id" : "000008800510000157780000100001",
"paymentOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006X0GA"
},
"paymentMethod" : "redirect",
"redirectPaymentMethodSpecificOutput" : {
"paymentProductId" : 866
}
},
"status" : "REDIRECTED",
"statusOutput" : {
"isCancellable" : false,
"isRetriable" : false,
"statusCategory" : "PENDING_PAYMENT",
"statusCode" : 50,
"statusCodeChangeDateTime" : "20241217171553",
"isAuthorized" : false,
"isRefundable" : false
}
}
}
- Go to the Alipay+ page and wait for the timer to appear.
- Once the countdown is complete, information about the transaction expiration will be displayed. The user will be redirected to the page that was sent in the original request via returnUrl property.
- Send GET /v1/{merchantId}/payments/{paymentId} API request and validate response:
- HTTP status code = 200
- statusOutput.statusCode = 140
{
"id" : "000008800510000158000000100001",
"paymentOutput" : {
"amountOfMoney" : {
"amount" : 2499,
"currencyCode" : "HKD"
},
"references" : {
"paymentReference" : "T8850006XNAA"
},
"paymentMethod" : "redirect",
"redirectPaymentMethodSpecificOutput" : {
"paymentProductId" : 866
}
},
"status" : "REJECTED",
"statusOutput" : {
"isCancellable" : false,
"isRetriable" : false,
"statusCategory" : "UNSUCCESSFUL",
"statusCode" : 140,
"statusCodeChangeDateTime" : "20241218121530",
"isAuthorized" : false,
"isRefundable" : false
}
}