iValidate is a function provided by Alipay sandbox to help you check the correctness of your integration process and improve the integration efficiency. By analyzing the logs of your API call in sandbox, iValidate can automatically diagnose whether your integration satisfies the requirements suggested by Alipay.
By now, iValidate supports the following 6 typical iValidate. By running iValidate, you can check whether your system properly handles the corresponding scenario.
SPOT-001: Direct payment This is the most typical payment case where, with a scanner to scan the customer's payment code, the payment succeeds without validating the customer’s payment password. By running an iValidate test, you can check whether your system can properly handle the payment without a password entered.
SPOT-002 24-digit barcode payment When dealing with the payment, some Alipay users might present a 24-digit barcode. By running an iValidate test, you can check whether your system can properly handle the 24-digit barcode.
SPOT-003 Payment with password authentication triggered Sometimes Alipay users might be asked to enter the password to complete the payment. By running an iValidate test, you can check whether your system can properly handle the payment with a password entered.
SPOT-004 Payment expires Sometimes Alipay users might choose not to continue when they are asked to enter the password to complete the payment, and the payment finally expires. This test case is to check whether your system can properly handle the payment expiration.
SPOT-005 Payment failed with SYSTEM_ERROR returned SYSTEM_ERROR is returned when a payment request goes wrong. This test case is to check whether the system can handle the SYSTEM_ERROR according to the best practices recommended by Alipay.
SPOT-006 Payment timeouts A payment request might timeout because of poor network or Alipay system error. This test case is to check whether the system can handle timeout errors according to the best practices recommended by Alipay.
Watch the video below to get an overview of using the iValidate function in sandbox. To use the iValidate function, see iValidate Guide for details.
Watch the following video to have a quick overview of how to use iValidate:
By now, Alipay sandbox provides 6 test cases. Refer to the following step-by-step guide for details:
The process of using iValidate for 6 cases are similar. We take the SPOT-001 Direct payment case as an example.
This test case applies to a scenario where the payment succeeds by scanning the customer’s payment code with a scanner, no need to validate the customer’s payment password. The checkout terminal presents a successful payment status and the payment receipt (if any) can be printed out successfully.
Integration Test Goal
Implement the integration test to check whether your system satisfies the following two items:
The status of the transaction in Alipay server is TRADE_SUCCESS.
store_id and secondary_merchant_id parameters are passed in the request message.
Integration Test Steps
Leave the checkbox unselected to ensure that the password authentication switch was turned off, and click Next.
Create a payment request from your checkout terminal, use your scanner to scan the payment code of your test buyer account, and complete the payment successfully.
Ensure that the payment status shown on your checkout terminal is success and the payment receipt (if any) can be printed out correctly, then click Next.
Fulfill the partner_trans_id of the transaction, and then click Check. The iValidate function can then analyze and check your transaction request and data status.
The iValidate function collects related data, processes the corresponding calculations, and in the end delivers a test result.