Overview
Alipay Cashier Payment is a simple, secure payment experience that allows consumers to make purchases with their digital wallet on your site. Consumers can conveniently select the specific digital wallet payment method to make payments. The advantages of the Cashier Payment product include:
- True glocalization (global + local)
With both local settlement and cross-border settlement supported, you can accept payments in multiple currencies across the world and allow customers to pay in their local currencies.
- Secure transactions
Alipay evaluates the risk of every transaction with its built-in security mechanism and rule-based risk management system. This ensures that each transaction is highly secured and executed hassle-free.
- Easy integration
You can rapidly build production-ready integrations by using Alipay APIs and Alipay Developer Center. In addition, integration costs are limited when you add a new wallet to expand your business in the future.
User experience
A user's complete experience of placing an order, making the payment, and receiving the payment result are illustrated in User experience, including all the possible redirection processes between the merchant and digital wallet.
Product functionalities
Alipay Cashier Payment provides several functionalities to facilitate your business:
The following functionalities related to the payment are provided:
- Make a payment: After the user places an order, you can take a series of integration steps to enable the user to complete the whole payment process.
- Inquire about payment status: You can get the payment result by inquiring via the inquiryPayment API.
- Receive payment notification: You can get notified of the payment result by providing the URL to receive the payment notification from Alipay notifyPayment SPI.
- Cancel the transaction: You can cancel the transactions when necessary by using the cancel API. Transactions on T day can be canceled before T+1 00:15 UTC+8:00.
Integration solution introduction
This section provides general steps for you to go through the whole integration process. Read this topic to get started with Alipay integration.
Cooperation process
If you want to cooperate with Alipay and use the Alipay Cashier Payment product, follow the cooperation process below:
- Sign a contract.
- Start integration (set up, integrate in the sandbox, go live, and conduct pilot testing).
- Start your business.
Integration process
The general integration procedure that applies to all Alipay products consists of the following phases. For more details about configurations for each phase, see Integration guide.
Figure 1. Integration procedure
To integrate in the sandbox and then go live, it is suggested to follow these steps:
- Read Best practice to understand the API interaction logic so that you can improve the integration efficiency and avoid payment disputes. All APIs and SPIs provided for Cashier Payment are displayed in the APIs and SPIs section.
- Integrate the product functionalities listed in Product functionalities. When using APIs to integrate, you need to make a POST request to the corresponding address with the identity information, signature, and business parameters in the HTTP request. After receiving the request, Alipay verifies the signature of the request. If the signature verification is passed, Alipay returns the corresponding response to you. After your server receives the response, you also need to verify the signature of the response to check whether the response is sent by Alipay. If the signature verification is passed, you can take further actions in your system. These topics will help you tackle problems that you might encounter when calling the APIs:
- Use test wallets and accounts to simulate real scenarios in the sandbox. When creating and debugging the application in the sandbox environment, remember to use Alipay-provided tools to facilitate the integration process.
- Once you have completed the go-live tasks, use the real wallet app and live account to conduct pilot testing. Contact Alipay Technical Support if you need help creating a live wallet account. Ensure your applications are running smoothly end-to-end by performing production test cases in the production environment with the live account.
- Before diving into the details about how to integrate, prepare yourself with some basic information about API call and Alipay API features.
APIs and SPIs
The following table lists the APIs that are used for Cashier Payment, and you can call these APIs by sending a request to the corresponding endpoint with the correct address format:
API name | Endpoint |
consult | |
pay | |
inquiryPayment | |
cancel | |
refund | |
inquiryRefund | |
declare | /ams/api/v1/customs/declare |
inquiryDeclarationRequests | /ams/api/v1/customs/inquiryDeclarationRequests |
registration | /v1/merchants/registration |
inquiryRegistrationStatus | /v1/merchants/inquiryRegistrationStatus |
inquiryRegistrationInfo | /v1/merchants/inquiryRegistrationInfo |
Table 1. Cashier Payment API list
The following table lists SPIs that are used for Cashier Payment. Alipay uses these SPIs to send you notifications after you make the corresponding configuration.
SPI name | Endpoint |
notifyPayment | |
notifyRefund | /v1/payments/notifyRefund |
notifyRegistrationStatus | /v1/merchants/notifyRegistrationStatus |
Table 2. Cashier Payment SPI list
SDKs
In addition to API integration via customized coding, you can also integrate via Alipay SDKs. The Alipay SDKs provide a standardized way to help merchants build software applications faster. Currently, SDKs for Java, Python, and PHP are provided with varying scopes:
- Java SDK: Supports all the same functionalities as the API solution.
- Python, PHP, and .Net SDKs: Supports only part of the functionalities that the API solution provides. The following table shows the functionalities that Python, PHP, and .Net SDKs currently support:
Functionality | SDK integration |
pay | ✅ |
inquiryPayment | ✅ |
cancel | ✅ |
refund | ✅ |
inquiryRefund | |
declare | |
inquiryDeclarationRequests |
Table 3. Supported SDK integration for each functionality