# Alipay {#pm_alipay} An article about the payment method which allows you to process payments in different currencies by using e-wallets in China and supports purchases and refunds. **Parent topic:**[Digital wallet payments](en_pm_ewallet.md) ## Overview {#en_pm_alipay_overview} An article about the payment method which allows you to process payments in different currencies by using e-wallets in China and supports purchases and refunds. ### Introduction {#section_t5z_rlg_ytb .section} Alipay is a payment method which allows you to process payments in different currencies by using e-wallets in China.This method supports purchasesand refunds. This article provides information about working with the Alipay method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow. ### General information {#section_tbf_2zk_ggb .section} |Payment method type|digital wallet payments| |Payment instruments|digital wallets| |Countries and regions|[CN](references/en/countries/CN.md)| |Payment currencies|[AUD](references/en/currencies/AUD.md), [CAD](references/en/currencies/CAD.md), [CNY](references/en/currencies/CNY.md), [EUR](references/en/currencies/EUR.md), [GBP](references/en/currencies/GBP.md), [HKD](references/en/currencies/HKD.md), [JPY](references/en/currencies/JPY.md), [SGD](references/en/currencies/SGD.md), [USD](references/en/currencies/USD.md) \*| |Currency conversion|–| |One-time purchases|+| |Credential-on-file purchases|–| |Full refunds|Refer to your Ecommpay key account manager| |Partial refunds|Refer to your Ecommpay key account manager| |Payouts|–| |Chargebacks|–| |Notes|- Alipay supports purchases via *web* and *mobile* application versions by using QR code - in some cases there is a limit for payment lifetime—30 minutes. For more information refer to the Ecommpay key account manager | |Onboarding and access fee|refer to your Ecommpay key account manager; additional information is available in [ecommshop](https://ecommpay.com/shop/payment-methods/alipay/)| **Note:** \* For information about available currenciesand availability of refunds, refer to your Ecommpay key account manager. ### Interaction diagram {#section_tsp_gzk_ggb .section} Payment processing by using the Alipay method involves the merchant's web service, one of Ecommpay interfaces, the Ecommpay payment platform, and technical facilities of the Alipay service. ![](images/pm/eng_alipay_functional.svg) ### Operations support {#section_rnx_4cl_ggb .section} Various platform interfaces can be used to process payments and perform operations using the Alipay method. Purchases can be processed by using Payment Page, Gate and Dashboard \(using payment links\), refunds—by using Gate and Dashboard. At the same time, regardless of the interfaces used, the following properties and limitations are applicable. | |Amounts|Times¹| |minimum|maximum|basic|threshold| |--|-------|------| |-------|-------|-----|---------| |Purchases|10.00 [CNY](references/en/currencies/CNY.md) or 1,00 [USD](references/en/currencies/USD.md)|5,000.00 [CNY](references/en/currencies/CNY.md)or unlimited [USD](references/en/currencies/USD.md)|up to one hour|\*| |Refunds|–|–|\*|\*| \* For more information refer to your Ecommpay key account manager. **Note:** 1. The base and threshold times are defined as follows: - *The base time* is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the web service. The base time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour. Use the base time to estimate when to react to the absence of payment result callbacks or when to check payment status \([details](en_Gate_payment_status_request.md)\). - *The threshold time* is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the web service receives the callback with the payment result. A payment is automatically assigned the `decline` status if it wasn't processed within the threshold time. For individual customisation of the threshold time limit, contact Ecommpay technical support. ### Processing scenarios {#section_fgt_sdl_ggb .section} To perform a purchase by using the Alipay method, you need to redirect the customer to the Alipay service, while to make a refund, you need to receive a request from the customer and notify the customer about the result of the refund via the web service. ![](images/pm/eng_alipay_interfaces_pp.svg "Purchase by using Payment Page") ![](images/pm/eng_alipay_interfaces_gate.svg "Purchase by using Gate") ![](images/pm/eng_alipay_interfaces_gate_refund.svg "Refund via Gate") ## Purchases via Payment Page {#en_pm_alipay_pp_purchase} ### General information {#section_gtg_vxk_m2b .section} To process a purchase through Payment Pageby using the Alipay method, the merchant's web service is required to send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result.The full sequence and special aspects of purchase processing are provided below. ![](images/pm/eng_alipay_uml_pp.svg) 1. A customer initiates a purchase in the web service. 2. The web service sends the request for opening Payment Page to the specified Ecommpay URL. 3. The request for opening Payment Page is sent to the payment platform. 4. The payment platform receives the request and validates the required parameters and signature. 5. Payment Page is generated based on the project and request parameters. 6. Payment Page is displayed to the customer. 7. The customer selects the Alipay method. 8. The payment platform receives the request for processing the payment by using the Alipay method. 9. The payment platform processes the request and sends it to the Alipay service. 10. The request is processed on the Alipay service side. 11. The data for redirecting the customer to the Alipay service is sent from the Alipay service to the payment platform. 12. The data for redirecting the customer is sent from the payment platform to Payment Page. 13. The customer is redirected to the Alipay service. 14. The customer completes all required payment steps. 15. The purchase is processed in the Alipay service. 16. The Alipay service sends a notification about the result to the payment platform. 17. The payment platform sends the payment result callback to the web service. 18. The payment platform sends the result information to Payment Page. 19. The result information is displayed to the customer on Payment Page. Information about the formats of requests and callbacks used for processing payments by using the Alipay method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in [Interaction concepts](en_pp_interaction_organisation.md). ### Request format {#section_p5j_fgl_ggb .section} There are several things you need to consider when sending purchase requests by using the Alipay method: 1. The following parameters required for any payment must be specified: - `project_id`—project identifier obtained from Ecommpay during integration - `payment_id`—payment identifier unique within the project - `payment_currency`—payment currency code in the ISO-4217 alpha-3 format - `payment_amount`—payment amount in the smallest currency unit - `customer_id`—customer identifier unique within the project 2. The available currencies of purchase specify with Ecommpay key account manager. 3. There is one more mandatory parameter—language\_code. In the language\_code parameter, you must use `zh` code of Payment Page. 4. If you need to have the payment form displayed with the Alipay method selected, set the `force_payment_method` parameter to `alipay`. 5. Additionally, any other parameters available for working with Payment Page can be used \([details](en_PP_Parameters.md)\). 6. After all target parameters are specified, generate a signature \([details](en_platform_signature.md)\). Thus, a correct request for opening the payment form using the Alipay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier, language code and signature. ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "CNY", "customer_id": "customer1", "language_code": "zh", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" } ``` ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "CNY", "customer_id": "customer1", "language_code": "zh", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" } ``` ### Callback format {#section_dpx_2hl_ggb .section} The Alipay method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md). The following is the example of a callback with information about a `10.00 CNY` purchase made by the `125` customer in the `201` project. ```language-json { "project_id": 201, "payment": { "id": "ECT_TEST_155125514200636", "type": "purchase", "status": "success", "date": "2019-02-27T16:01:25+0000", "method": "alipay", "sum": { "amount": 1000, "currency": "CNY" }, "description": "ECT_TEST_1551255142006" }, "customer": { "id": "125" }, "operation": { "id": 20891000000045, "type": "sale", "status": "success", "date": "2019-02-27T16:01:25+0000", "created_date": "2019-02-27T15:46:21+0000", "request_id": "85d4801f8fa9dead54d315ae19ecb4550201cdcafab", "sum_initial": { "amount": 1000, "currency": "CNY" }, "sum_converted": { "amount": 1000, "currency": "CNY" }, "provider": { "id": 1189, "payment_id": "Abe9VAEokJyIqyRcX10TLkz30XQbmK3f", "date": "2019-02-27T16:01:24+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "T/v8rquB+C0K7TR7sz1vvOrpCsV1/hr9LhIh27fY9PF7Q==" } ``` The following is the example of a callback with information about a declined purchase. ```language-json { "id": "ECT_TEST_1551103453746538344", "type": "purchase", "status": "decline", "date": "2019-02-27T14:41:30+0000", "method": "alipay", "sum": { "amount": 10000, "currency": "CNY" }, "description": "" }, "operation": { "id": 20370000000023, "type": "sale", "status": "decline", "date": "2019-02-27T14:41:30+0000", "created_date": "2019-02-26T13:39:44+0000", "request_id": "36e07e85504ec76924432b3d6e59e5d5066ebb", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1189, "payment_id": "g4Ld5b6iSuzTmukZUj1RVkXNMuYSj07I", "date": "2019-02-27T14:41:29+0000", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "EezTcWDrcp8RW2Wb+bLmytXRRWctzaanCrzhw==" } ``` ### Useful links {#section_xpz_thl_ggb .section} The following articles can be useful when implementing purchases via Payment Page: - [Interaction concepts](en_pp_interaction_organisation.md)—about the interaction with the payment platform by using Payment Page. - [Signature generation and verification](en_platform_signature.md)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Payment Page. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Purchases via Gate {#en_pm_alipay_gate_purchase} ### General information {#section_lsx_3jl_ggb .section} To process a purchase through Gate by using the Alipay method, the merchant's web service is required to do the following: 1. Send a request with all the required parameters and signature to the Ecommpay URL. 2. Receive an intermediate callback from the payment platform and redirect the customer to the Alipay service. 3. Receive the final callback from the payment platform. The full sequence and special aspects of purchase processing are provided below. ![](images/pm/alipay_gate_uml_en.svg) 1. A customer initiates a purchase by using the Alipay method in the web service. 2. The web service sends the request for processing the purchase by using Gate to the specified Ecommpay URL. 3. The payment platform receives the request. 4. The payment platform validates the required parameters and signature in the request. 5. The payment platform sends the response to the web service with information about the receipt of the request and its validity \([details](en_gate_interaction_organisation.md)\). 6. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the Alipay service. 7. The request is processed on the Alipay service side. 8. The Alipay service sends the redirection data to the payment platform. 9. The payment platform sends the callback with the redirection data to the web service. 10. The customer is redirected to the Alipay service. 11. The customer completes all required payment steps. 12. The purchase is processed in the Alipay service. 13. The Alipay service sends the payment result notification to the payment platform. 14. The payment platform sends the payment result callback to the web service. 15. The customer receives the payment result information from the web service. Information about the formats of requests and callbacks used for processing payments by using the Alipay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md). ### Request format {#section_osx_3jl_ggb .section} There are several things you need to consider when sending purchase requests by using the Alipay method: 1. To initiate each purchase, send a separate POST request to the `/v2/payment/wallet/alipay/sale` endpoint. This endpoint belongs to the group [/v2/payment/wallet/\{payment\_method\}/sale](https://api-developers.ecommpay.com/api-specification/wallet/post-v2-payment-wallet-payment-method-sale). 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - `description`\*—description or comment to the payment - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant for the initiated payment - `first_name`\*—customer first name - `last_name`\*—customer last name - `phone`\*—customer phone number without + - `email`\*—customer email - `zip`\*—customer postal code - `country`\*—customer country of residence in the ISO 3166-1 alpha-2 format - `city`\*—customer city of residence in Chinese - `street`\*—customer address of residence in Chinese - Object `return_url`—contains the URLs to which customer is redirected during or after payment processing: - `success`\*—URL for redirecting a customer after a performed purchase - `return`—URL for redirecting a customer during a purchase **Note:** \* Refer to your Ecommpay key account manager for more information on the necessity of using these parameters. If any of these parameters are missing, the payment platform may send the list of missing parameters in a callback requesting additional information submission \(details are available in [Submission of additional payment information](en_Gate_Clarification.md)\). 3. The available currencies of purchase specify with Ecommpay key account manager. 4. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Alipay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer information, URLs for redirection and signature. ```language-json { "general": { "project_id": 201, "payment_id": "ECT_TEST_155125514400636", "signature": "cMlzFj8zqZJbum1w62aewWX7xcG+Ttb0fhuenWNptFZg==" }, "customer": { "id": "123", "ip_address": "192.0.2.0", "first_name": "之的", "last_name": "张", "phone": "13632264148", "email": "2524243674@example.com", "street":"street", "city": "city", "zip": "123045608", "country": "CH" }, "payment": { "amount": 1000, "currency": "CNY", "description": "test payment" }, "return_url": { "return": "http://example.com/return", "success": "http://example.com/success" } } ``` ```language-json { "general": { "project_id": 201, "payment_id": "ECT_TEST_155125514400636", "signature": "cMlzFj8zqZJbum1w62aewWX7xcG+Ttb0fhuenWNptFZg==" }, "customer": { "id": "123", "ip_address": "192.0.2.0", "first_name": "之的", "last_name": "张", "phone": "13632264148", "email": "2524243674@example.com", "street":"street", "city": "city", "zip": "123045608", "country": "CH" }, "payment": { "amount": 1000, "currency": "CNY", "description": "test payment" }, "return_url": { "return": "http://example.com/return", "success": "http://example.com/success" } } ``` ### Formats of intermediate callbacks for customer redirection {#section_nxg_hmn_zgb .section} To redirect a customer from the web service to the Alipay service, a callback containing redirection data is sent to the web service. Depending on the provider processing the payment a URL or a QR code can be used for customer redirection: - URL—in this case the callback contains the `redirect_data` object - QR code—in this case the callback contains the `display_data` array Refer to your Ecommpay key account manager regarding the appropriate redirection type. **Object `redirect_data`** Each payment made with the Alipay method requires redirection of customers from the merchant's web service to the Alipay service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the `redirect_data` object. The format of such callbacks is standard \([details](en_platform_callbacks.md)\), and the following objects and parameters are included in the `redirect_data` object: - `body`—object with data to be sent in the request body - `method`—parameter specifying the HTTP method for sending the request \(`GET` or `POST`\) - `url`—parameter containing a link for redirection Additionally, the `redirect_data` object may include the `encrypted` parameter containing service information. ```language-json "redirect_data": { "method": "POST", "body": { "order_no": "29895000000582", "amount": "13.00", "payment_channel": "ALIPAY", "sign": "****************", "return_url": "https://example.com/process/wsid=njf2h9cd3", "signType": "RSA", "currency": "CNY", "body": "ECT_TEST_1552972940011", "app_id": "4391" }, "encrypted": [], "url": "https://example.com:443/payment/otoSoft/v3/h5.html" } ``` **Array `display_data`** To redirect a customer from the web service to the Alipay site, you must receive a callback from the payment platform containing the `display_data` array. This array can contain one or more objects with the following parameters: - `type`—object type - `title`—object title - `data`—data corresponding to the object type The `display_data` array is formed taking into account the following conditions: - The object containing data for displaying the QR code is always present in the array. The value of the `data` parameter depends on the value of the `type` parameter which can have one of the following values: - `qr_url`—QR code is passed as a link the image. In this case the `data` parameter contains a URL. - `qr_img`—QR code is passed as an image. In this case the `data` parameter contains a string encoded using the Base64 scheme. - `qr_data`—QR code is passed as a string. In this case the `data` parameter contains a string which should be used to generate a QR code on the web service side. - In addition to the object containing the data for displaying the QR-code the `display_data` array can contain one or several objects with additional information. The `type` parameter of such objects is assigned the `add_info` value, while the `data` parameter can contain various information. - If the array contains one or more objects with additional information, then the array includes an object with the information on the lifespan of the QR code \(starting when the code is created on the Alipay side\). The `title` parameter of such an object is assigned the `QR Code Timeout` value, while the lifespan is specified in seconds in the `data` parameter. The following is the callback fragment containing the string to be used to generate a QR code as well as the lifespan of the code. ```language-json "display_data": [ { "type": "qr_data", "title": "QR code", "data": "weixin://wxpay/bizpayurl?pr=dMrSpJG" }, { "type": "add_info", "title": "QR Code Timeout", "data": "600" } ] ``` ### Callback format {#section_wsx_3jl_ggb .section} The Alipay method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md). The following is the example of a callback with information about a `10.00 CNY` purchase made by the `125` customer in the `201` project. ```language-json { "project_id": 201, "payment": { "id": "ECT_TEST_155125514200636", "type": "purchase", "status": "success", "date": "2019-02-27T16:01:25+0000", "method": "alipay", "sum": { "amount": 1000, "currency": "CNY" }, "description": "ECT_TEST_1551255142006" }, "customer": { "id": "125" }, "operation": { "id": 20891000000045, "type": "sale", "status": "success", "date": "2019-02-27T16:01:25+0000", "created_date": "2019-02-27T15:46:21+0000", "request_id": "85d4801f8fa9dead54d315ae19ecb4550201cdcafab", "sum_initial": { "amount": 1000, "currency": "CNY" }, "sum_converted": { "amount": 1000, "currency": "CNY" }, "provider": { "id": 1189, "payment_id": "Abe9VAEokJyIqyRcX10TLkz30XQbmK3f", "date": "2019-02-27T16:01:24+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "T/v8rquB+C0K7TR7sz1vvOrpCsV1/hr9LhIh27fY9PF7Q==" } ``` The following is the example of a callback with information about a declined purchase. ```language-json { "id": "ECT_TEST_1551103453746538344", "type": "purchase", "status": "decline", "date": "2019-02-27T14:41:30+0000", "method": "alipay", "sum": { "amount": 10000, "currency": "CNY" }, "description": "" }, "operation": { "id": 20370000000023, "type": "sale", "status": "decline", "date": "2019-02-27T14:41:30+0000", "created_date": "2019-02-26T13:39:44+0000", "request_id": "36e07e85504ec76924432b3d6e59e5d5066ebb", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1189, "payment_id": "g4Ld5b6iSuzTmukZUj1RVkXNMuYSj07I", "date": "2019-02-27T14:41:29+0000", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "EezTcWDrcp8RW2Wb+bLmytXRRWctzaanCrzhw==" } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing purchases via Gate: - [Interaction concepts](en_gate_interaction_organisation.md)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Refunds by using Gate {#en_pm_alipay_gate_refund} ### General information {#section_lsx_3jl_ggb .section} To perform a refund through Gate by using the Alipay method, send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result.The full sequence and special aspects of refund performing are provided below. ![](images/pm/eng_alipay_uml_gate_refund.svg) 1. A customer initiates a refund. 2. The web service sends the request for performing the refund by using Gate to the specified Ecommpay URL. 3. The payment platform receives the request. 4. The payment platform validates the required parameters and signature in the request. 5. The payment platform sends the response to the web service with information about the receipt of the request and its validity \([details](en_gate_interaction_organisation.md)\). 6. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the Alipay service. 7. The refund is processed on the side of the Alipay service. 8. The Alipay service sends the result notification to the payment platform. 9. The payment platform sends the result callback to the web service. 10. The customer receives the refund result information from the web service. Information about the formats of requests and callbacks used for performing refunds by using the Alipay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md). ### Request format {#section_osx_3jl_ggb .section} There are several things you need to consider when sending refund requests by using the Alipay method: 1. To initiate each refund, send a separate POST request to the `/v2/payment/wallet/alipay/refund` endpoint. This endpoint belongs to the group [/v2/payment/wallet/\{payment\_method\}/refund](https://api-developers.ecommpay.com/api-specification/wallet/post-v2-payment-wallet-payment-method-refund). 2. Each request must include the following objects and parameters: - Object `general`—general refund information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—identifier of the payment that needs to be refunded - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md)\) - Object `payment`—refund information: - `description`—refund description or comment - `amount`—refund amount in the smallest currency unit \(required for a partial refund\) - Object `customer`—customer information: - `ip_address`—customer IP addressrelevant for the initiated refund 3. Additionally, any other parameters included in the specification can be used. Thus, a correct refund request by using the Alipay method must contain the project and payment identifiers, description of the refund, the customer IP address, signature, and, if necessary, refund amount. ```language-json "general": { "project_id": 239, "payment_id": "refund_02", "signature": "of8k9xerKSK40CIcjmOwSwKJ7KLTZYO56lCv+f1M0Sf/7eg==" }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 10000, "description": "refund_02" } ``` ```language-json "general": { "project_id": 239, "payment_id": "refund_02", "signature": "of8k9xerKSK40CIcjmOwSwKJ7KLTZYO56lCv+f1M0Sf/7eg==" }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 10000, "description": "refund_02" } ``` ### Callback format {#section_wsx_3jl_ggb .section} The Alipay method uses the standard format for callbacks to deliver refund results. For more information, see [Handling callbacks](en_platform_callbacks.md). ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing refunds via Gate: - [Interaction concepts](en_gate_interaction_organisation.md)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Purchase refunds](en_Gate_Refund.md)—about performing of refunds by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Testing {#en_pm_alipay_testing} ### General information {#section_zqw_xfw_xjb .section} For the Alipay method, it is possible to test purchases by using Payment Page and Gate, as well as refunds by using Gate. To enable and disable testing, as well getting assistance with setting up a test project, refer to Ecommpay technical support. When testing payments and operations keep in mind that the test project identifier must be indicated in requests, the interfaces of the emulator of Payment Page and Alipay payment forms can differ from the production environment. ### Statuses of test payments and operations {#section_j1z_1s5_zjb .section} The final status of test payments and operations is determined by the amount specified in the request. Test purchases: - `decline` status with `40000` or `40400` amount - `success` status with any other amount Test refunds: - `decline` status with `50000` or `50500` amount - `success` status with any other amount ### Purchases by using Payment Page {#section_wlk_dgw_xjb .section} To perform a test purchase by using Payment Page: 1. Send a correct test request for opening Payment Page to the payment platform. 2. If the `alipay` method was not specified in the request—select the method on the emulator page. 3. Make sure that the payment instructions are displayed and click the **Pay** button. 4. Specify a random last name in the data entry field. 5. Click the **Success** or **Decline** button \(depending on the amount specified in the request\). 6. Receive the final callback with information about the payment result. More information about processing purchases by using the Alipay method via Payment Page is provided in the [Purchases via Payment Page](pm_alipay.md) section. ### Purchases by using Gate {#section_uvm_ngw_xjb .section} To perform a test purchase by using Gate, do the following: 1. Send a correct test request for purchase to the payment platform. 2. Receive the intermediate callback with the redirection data. 3. Go to the received URL and click the **Success** or **Decline** button \(depending on the amount specified in the request\). 4. Receive the final callback with information about the payment result. More information about processing purchases by using the Alipay method via Gate is provided in the [Purchases via Gate](pm_alipay.md) section. ### Refunds by using Gate {#section_tzl_5hw_xjb .section} To perform a test refund by using Gate, send a valid test request for a refund of a previously processed test purchase to the payment platform and receive a final callback with information about the refund result. More information about performing refunds by using the Alipay method via Gate is provided in the [Refunds by using Gate](pm_alipay.md) section. ## Analysis of payments results {#en_pm_alipay_dash_analysis} To analyse information about payments made with the Alipay method and other methods, you can use: - Dashboardinterface toolkitwith various lists and analytic panels. - Reports in CSV file format, available via the **Reports** section \(one-time and periodically\). - Data in JSON format, sent by program requests to a specified URL by using the Data API interface. If you have any questions, refer to the documentation \([Dashboard](en_dbl_about.md) and [Using Data API](en_dbl_api_protocol.md)\) and Ecommpay technical support.