iValidate
What is iValidate
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.
How to use iValidate
Before using iValidate, you must have an Alipay merchant account. Go to Alipay portal to sign up.
The following video explains how to use the iValidate function in sandbox:
To use the iValidate function, see iValidate Guide for details.
iValidate guide
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.
Scenario description
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.
a. If the test result is Passed, it means your integration system satisfies the integration test goal.
b. If the test result is Failed, see the failure reason provided on the screen to make corresponding changes.