Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solutionDOCS

      Instruction for iMock

      #Before you start

      Before using iTest, go to Alipay Developers Center, enter the Integration Settings section, and configure your settings for the sandbox environment.

      1. Click Sandbox tab and click Edit public key.

      image.png


      1. Enter your public key and click Submit.

      image.png


      If you do not have one, you can download the tool for generating RSA2 keys and use it to generate your keys.

      image.png


      1. Enter your notification URL. The notification URL is used for receiving notifications.

      image.png


      #Use iMock

      iMock provides simulations of different API results and returns the specified response for integration testing.


      iMock can simulate all the result codes, including production environment scenarios that are rare but not entirely impossible. This helps developers to work with the same corresponding system logic processing in sandbox. The effective time of the mock results can be changed by adjusting the mock time.


      All types of responses are designed by Alipay for indicating different result codes. No response is specified by default. If you specify the response, this type of response for the corresponding API is always returned when iMock is turned on.

      image.png


      API Mock will be turned off automatically when the time is up. The duration can be set as 30mins, 60mins, 90mins or 120mins. The user can set the time for automatic shutdown manually.

      image.png


      To start using the iMock tool for simulations of different API results, go to Alipay Developers Center, create an application, and then locate iMock under Development Tools.