Overview
Cashier Payment helps you develop acquiring capability on your websites or in your apps. It allows you to receive online payments made via various clients including desktop websites, mobile websites, and mobile applications. You only need to cost a one-time integration effort to add multiple payment methods such as wallet payment methods, bank transfer payment methods, and card payment methods to your pages. And users can pay securely and easily by using their preferred payment methods, thus delivering an incredible payment experience.
Capabilities
- Obtain available payment methods: You can call the consult API to obtain the available payment methods that are specified in your contract. Alipay uses the API to return you a list of payment methods that are sorted according to payment information such as payment amount and the user's region. You can display the payment methods based on the provided list on your page.
- Initiate a payment: After a user chooses a payment method for a submitted order and clicks or taps Go to Pay, you must call the pay API to send a payment request to Alipay to obtain a payment link and continue the payment process. For card payment methods, the following functions are provided:
- Request to capture an authorized payment: You can call the capture API to request to capture an authorized payment.
- Receive the capture result: Alipay uses the notifyCapture notification to send you the capture result.
- Receive information about a chargeback: Alipay uses the notifyDispute notification to notify you of an occurred chargeback or the liability judgment of the chargeback.
- Obtain the payment result:
- Synchronous response: After a user completes a payment, they are redirected to Alipay's payment result page.
- Asynchronous notification: After you set an asynchronous notification address by specifying paymentNotifyUrl in the pay API, Alipay uses the notifyPayment notification to send you an asynchronous notification when a payment is successful or expired.
- Payment inquiry result: You can call the inquiryPayment API to inquire about the payment status.
Integration
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
APIs
The following table lists all the APIs that are used for Cashier Payment. You can call these APIs by sending a correct request to the corresponding request URLs:
API | Endpoint |
Obtain available payment methods: consult | /v1/payments/consult |
Initiate a payment request: pay | /v1/payments/pay |
Request to capture an authorized payment: capture | /v1/payments/capture |
Inquire about a payment status: inquiryPayment | /v1/payments/inquiryPayment |
Cancel a payment: cancel | /v1/payments/cancel |
Refund a payment: refund | /v1/payments/refund |
Inquire about a refund status: inquiryRefund | /v1/payments/inquiryRefund |
Declare goods: declare | /v1/customs/declare |
Inquire about a declaration status: inquiryDeclarationRequests | /v1/customs/inquiryDeclarationRequests |
Table 1. APIs used for Cashier Payment
Notifications
The notifications used for Cashier Payment are listed as follows, which are used by Alipay to send you asynchronous notifications:
- Notification of the payment result: notifyPayment
- Notifications of the refund result: notifyRefund
- Notifications of the capture result: notifyCapture
- Notifications of the chargeback result: notifyDispute
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 2. Supported SDK integration for each functionality