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

Overview

Chinese Document

Checkout 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 .

 image

Figure 1. Integration procedure

Interfaces

The following table lists all the APIs used for Checkout Payment and their corresponding endpoints. You can click the API link to view the details of each API.

API

Endpoint

Obtain available payment methods: consult

/v1/payments/consult

Initiate a payment request: pay

/v1/payments/pay

Create a payment session:  createPaymentSession

/v1/payments/createPaymentSession

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 Checkout Payment

The notifications used for Checkout Payment are listed as follows. Alipay sends asynchronous notifications using these interfaces:

SDK

In addition to API integration through custom coding, you can also integrate client and server SDKs provided by Alipay. You can use the following client SDKs to integrate card payment methods and authorization payments:

Note : You can download the SDK package in Antom Dashboard .

The server SDK provides a standardized way to help you build software applications faster. 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