---
title: "Alipay+"
canonical_url: https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect
---

* [Overview](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/overview.md)
* [Countries \& currencies](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/countries-and-currencies.md)
* [Integration](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration.md)
* [Process flows](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/process-flows.md)
* [Testing](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing.md)
* [Additional information](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/additional-information.md)
* [Consumer experience](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/consumer-experience.md)
* [Reporting](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/reporting.md)
* [FAQ](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/faqs.md)

# Testing

You can perform the following flows to test Alipay+ on our platform:

* [Positive scenarios](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect.md#positive-scenarios)
* [Full refund test](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect.md#full-refund-test)
* [Partial refund test](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect.md#partial-refund-test)
* [Negative scenarios](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect.md#negative-scenarios)

# Positive scenarios

To test different scenarios, use the [API Explorer](https://docs.connect.worldline-solutions.com/documentation/api-explorer.md) available through your [Configuration Center](https://docs.connect.worldline-solutions.com/documentation/configuration-center.md) account. Depending on your integration option, you can use different API calls for testing.

1. For MyCheckout hosted payment pages, send [POST /hostedcheckouts](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/create.html?paymentPlatform=ALL) API request and validate response:

* HTTP status code=201
* partialRedirectUrl contains a link

Post hostedcheckouts requestCopy code

```hljs javascript language-javascript
{
    "hostedCheckoutSpecificInput": {
        "locale": "en_GB",
        "variant": "105"
    },
   "order": {
    "amountOfMoney": {
      "currencyCode": "HKD",
      "amount": 2499
    },
    "customer": {
      "merchantCustomerId": "123456547",
      "billingAddress": {
        "countryCode": "HK"
      }
    }
  }
}
```

1. Click the link in the response to be redirected to a hosted page that displays the selected variant you sent in the request.
2. Select Alipay+ from the list of available payment products.

![Checkout page showing order total of HKD 24.99 and payment product list with PayPal, Alipay+, Alipay, Skrill, and UnionPay](https://docs.connect.worldline-solutions.com/dA/371f00bac7/fileAsset/Alipay-plus-positive-testing-checkout-page.png)

1. For your own payment pages testing, send Create payment [POST /v1/{merchantId}/payments](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL) API request and validate response:

* HTTP status code=201
* merchantAction.redirectURL contains a link to the provider's page
* payment.statusOutput.statusCode=50

Post payments requestCopy code

```hljs javascript language-javascript
{
  "order": {
    "amountOfMoney": {
      "currencyCode": "HKD",
      "amount": 2499
    },
    "customer": {
      "billingAddress": {
        "countryCode": "HK"
      }
    }
  },
  "redirectPaymentMethodSpecificInput": {
    "paymentProductId": "866",
    "redirectionData": {
      "returnUrl": "https://example.com"
    }
  }
}
```

Post payments responseCopy code

```hljs javascript language-javascript
{
   "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
      }
   }
}
```

1. Get redirected to Alipay+ page to proceed with your test payment.

![Alipay+ sandbox page showing wallet selection options including AlipayHK, GCash, DANA, Boost, and others for HKD 24.99](https://docs.connect.worldline-solutions.com/dA/a0339694d8/fileAsset/Alipay-plus-positive-testing-provider-page.png)

1. Select a suitable e-wallet from the provided options.

![Alipay+ payment page with AlipayHK selected from the wallet grid and a QR code displayed for scanning to pay HKD 24.99](https://docs.connect.worldline-solutions.com/dA/999fa78188/fileAsset/Alipay-plus-positive-testing-QR-code-on-provider-page.png)

1. Open the ALinker app and select the same e-wallet as in the previous step.

![ALinker app showing ALIPAY_HK selected with Scan and Payment Code options, environment set to PRE](https://docs.connect.worldline-solutions.com/dA/cfb08b2c94/fileAsset/Alipay-plus-positive-testing-app-for-testing.png)

1. Scan the QR code and complete the payment.

![AlipayHK mobile payment confirmation screen showing order amount HKD 24.99 and a Pay Now button](https://docs.connect.worldline-solutions.com/dA/4466fb7c2f/fileAsset/Alipay-plus-positive-testing-app-for-testing-payment-confirmation.png)  
![AlipayHK Payment Result screen showing a blue checkmark, Payment Successful message, and HKD 24.99 amount](https://docs.connect.worldline-solutions.com/dA/7d1cb9a2d3/fileAsset/Alipay-plus-positive-testing-app-for-testing-payment-result-done.png)

1. 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.

![Alipay+ payment confirmation page showing HKD 24.99 payment successful with transaction details and Return to Merchant button](https://docs.connect.worldline-solutions.com/dA/112156f9cd/fileAsset/Alipay-plus-positive-testing-return-to-merchant-button-page.png)

1. Based on the integration option you're testing, the redirection can happen in 2 different ways:

*
  * **[When using MyCheckout hosted payment pages](https://docs.connect.worldline-solutions.com/documentation/hosted-payment-pages/.md)**, 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.

![MyCheckout payment status page showing order total HKD 24.99 and Your payment is successful confirmation message](https://docs.connect.worldline-solutions.com/dA/400b370eb5/fileAsset/Alipay-plus-positive-testing-successful-payment-page.png)

*
  * **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

![Browser showing example.com landing page after redirect with REF, RETURNMAC, and paymentId query parameters in the URL.](https://docs.connect.worldline-solutions.com/dA/cba9b2cbf2/fileAsset/Alipay-plus-positive-testing-example-domain.png)

## 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}](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/get.html?paymentPlatform=ALL) API request including the hostedCheckoutId and check the response.  
Get hostedcheckouts responseCopy code

```hljs javascript language-javascript
{
   "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}](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/get.html?paymentPlatform=ALL) API request with a payment ID copied from the Create payments request, then see the response.  
Get payments responseCopy code

```hljs javascript language-javascript
{
   "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

1. Find a transaction with status 1000
2. Send [POST /v1/{merchantId}/payments/{paymentId}/refund](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/refund.html?paymentPlatform=ALL) API request with empty JSON body request. Find the example response below.

Create refund responseCopy code

```hljs javascript language-javascript
{
   "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](https://apireference.connect.worldline-solutions.com/?paymentPlatform=ALL).

## Partial refund test

1. Find a transaction with status 1000
2. Send [POST /v1/{merchantId}/payments/{paymentId}/refund](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/refund.html?paymentPlatform=ALL) API request.

Create refund requestCopy code

```hljs javascript language-javascript
{
    "amountOfMoney": {
        "currencyCode": "HKD",
        "amount": 1499
    },
    "customer": {
        "address": {
            "countryCode": "HK"
        }
    }
}
```

Create refund responseCopy code

```hljs javascript language-javascript
{
   "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}](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/refunds/get.html?paymentPlatform=ALL) API request.  
Create refund responseCopy code

```hljs javascript language-javascript
{
   "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.

1. Send [Create payment POST /v1/{merchantId}payments](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL) API request and validate response:

* HTTP status code=201
* merchantAction.redirectURL contains a link to the provider's page
* payment.statusOutput.statusCode=50

Create payment requestCopy code

```hljs javascript language-javascript
{
  "order": {
    "amountOfMoney": {
      "currencyCode": "HKD",
      "amount": 2499
    },
    "customer": {
      "billingAddress": {
        "countryCode": "HK"
      }
    }
  },
  "redirectPaymentMethodSpecificInput": {
    "paymentProductId": "866",
    "redirectionData": {
      "returnUrl": "https://example.com"
    }
  }
}
```

Create payment responseCopy code

```hljs javascript language-javascript
{
   "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
      }
   }
}
```

1. Go to the Alipay+ page and wait for the timer to appear.
2. 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.
3. Send [GET /v1/{merchantId}/payments/{paymentId}](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/get.html?paymentPlatform=ALL) API request and validate response:

* HTTP status code = 200
* statusOutput.statusCode = 140

Get payment responseCopy code

```hljs javascript language-javascript
{
   "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
   }
}
```

[Next Additional information](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/additional-information.md)
