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

Integration

The following sections explain you can design your system and integrate with Alipay.

Calling APIs

The following sequence diagram illustrates the message flow and time order of the Wi-Fi connection solution:

Wi-Fi.jpg

Figure 1. Alipay Wi-Fi solution sequence flow

 

  1. The user connects with Alipay SSID.
  2. After the user connected with Alipay SSID, the mobile automatically requests the captive login page from Wi-Fi provider’s server. This page is displayed in the default browser on the user's mobile.
  3. In the meantime, the Wi-Fi provider needs to enable temporary Internet connection for the login process, at least for the Alipay app. This process can be performed by allowing Internet connection for a period of time or whitelisting Alipay’s IP addresses. Allowing Internet connection for a period time might cause confusion and users might abandon the login process, therefore, whitelisting Alipay’s IP address is preferred.
  4. The Wi-Fi provider returns the URL scheme, which can be used for invoking the authorization page in Alipay app.
  5. The user browser uses the returned URL scheme to invoke the Alipay app.
  6. The user can confirm to share personal data with the Wi-Fi provider in the Alipay app.
  7. After the user confirms to share personal data, Alipay server is called for an access code.
  8. Alipay browser appends the access code returned from Alipay server to the redirection URL and sends to the Wi-Fi provider’s server.
  9. The Wi-Fi provider calls the alipay.system.oauth.token interface to get the access token with the access code.
  10. Alipay server returns the access token to the Wi-Fi provider.
  11. With the access token, the Wi-Fi provide is able to get user data by using the alipay.user.info.share interface.
  12. At the end of the procedure, a page that shows the connection result is displayed to the user in Alipay app. Marketing information, vouchers, or even other Alipay applications can be presented in this page as well.
  13. Wi-Fi provider enables the Wi-Fi connection to the user so that the user can start to use the Wi-Fi network.

Note:

The Alipay interface alipay.user.info.share only provides basic information such as login name, or gender. If you need additional user data, contact Alipay technical support to get your needs reviewed by Alipay's security and legal teams.