Acceptance test tool instructions

Before migrating to the production environment, use the sandbox acceptance tool to complete the acceptance testing process. The acceptance testing is based on Alipay's integration specifications, and used to verify:

  • Whether the requests that call Alipay services comply with the specifications.
  • Whether the responses from Alipay are handled correctly.

Complete acceptance testing will increase the robustness and usability of the developed system. To perform acceptance testing, go to Alipay Developers Center, create an application, and then locate Test Suites under Acceptance Test. Then, perform acceptance testing according to the prompts.

image.png

Figure 1. Test suites

Take Payment success as an example. The acceptance testing helps developers simulate the main process of a payment. The developer initiates a payment, enters the authentication information, and completes the payment successfully. To begin this test, click Start and follow the instructions of each step. You can also cancel the test while the case is running. The acceptance testing consists of 5 steps. The instructions in each step is what to do and the expected results in each step are the checkpoint.

Step 1: Upload the image of checkout page

First, the developer initiates a payment request. The developer selects the product and then goes to the checkout page. Next, the developer needs to upload the image of checkout page. Please note that the uploaded image needs to meet the requirements, such as number of pictures, size limitation, format, and so on. After the image is uploaded, click Confirm and wait for Alipay to check. Alipay checks whether the Alipay payment method with a local wallet icon exists in the payment methods. After the image is verified, the developer can continue the acceptance testing.

image.png

Figure 2. Upload the image of checkout page

Step 2: Select the payment method and submit the payment request

The developer submits the payment request by clicking on the local wallet's icon. When the local wallet's cashier page is displayed, the developer can continue the acceptance testing.

image.png

Figure 3. Select the payment method and submit the payment request

Step 3: Upload the image of a success result page

The developer enters the authentication information and completes the payment successfully. The developer can enter any authentication information and the sandbox will return a success result by default. The developer is redirected to the merchant page after the payment is completed. Next, the developer needs to upload the image of a success result page. Please note that the uploaded image needs to meet the requirements, such as number of pictures, size limitation, format, and so on. After the image is verified, the developer can continue the acceptance testing.

image.png

Figure 4. Upload the image of a success result page

Step 4: Receive the payment notification

After the payment is succeeded, the merchant receives the SUCCESS notification on server side and returns resultStatus is S. Alipay needs to check that the merchant receives the SUCCESS notification on server side, the merchant returns the /v1/payments/notifyPayment response that is correctly signed.

image.png

Figure 5. Receive the payment notification

Step 5: Upload the image of the order status page

The merchant updates the status to goods delivery after receiving the successful payment notification. Next, the developer needs to upload the image of the order status page. Please note that the uploaded image needs to meet the requirements, such as number of pictures, size limitation, format, and so on. After the image is uploaded, click Confirm and wait for Alipay to check. Alipay needs to check that the merchant updates the order status to Goods delivery. Now, you complete all the acceptance testing steps for Payment success.

image.png

Figure 6. Upload the image of the order status page

The acceptance testing provides test cases for checking whether your processing logic handles normal and abnormal responses from Alipay correctly. Normal responses include successful payments and refund results, and abnormal responses include failed payments and refund results. All the acceptance testing is required to be completed, which will increase the robustness and usability of your developed system. Test cases are also sorted into different sets for different products. For specific acceptance testing steps, refer to the test cases in Acceptance Platform. If you have any questions during the acceptance testing process, please contact the Alipay Technical Support.