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 is used for the following verifications:
- Verify whether the requests that call Alipay services comply with the specifications.
- Verify 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.
Figure 1. Test suites
Take Payment success as an example. 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. In each step, Instruction explains the required actions and Expected Result is the checkpoint following the actions.
Step 1: Upload the image of the 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 the checkout page. Please note that the uploaded image needs to meet requirements such as the number of pictures, size, 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.
Figure 2. Upload the image of the 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.
Figure 3. Select the payment method and submit the payment request
Step 3: Upload the image of a successful 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 successful 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 successful result page. Please note that the uploaded image needs to meet requirements such as the number of pictures, size, format, and so on. After the image is verified, the developer can continue the acceptance testing.
Figure 4. Upload the image of a successful result page
Step 4: Receive the payment notification
After the payment succeeded, the merchant receives the SUCCESS notification on the server side and returns resultStatus is S
. Alipay needs to check that the merchant receives the SUCCESS notification on the server side, the merchant returns the /v1/payments/notifyPayment
response that is correctly signed.
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 requirements such as the number of pictures, size, 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.
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 payment and refund results, and abnormal responses include failed payment and refund results. It is required to complete all the acceptance testing, 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 Alipay Technical Support.