As Alipay adds the concept of open platform, payment application and call have been greatly updated and upgraded. This article will introduce the differences between the payment application method and the new payment interface of open platform.

Series of articles

Series 1 wechat App payment full resolution series 2 Alipay App Payment full resolution series 3 wechat public account payment full resolution series 4 wechat scan code payment full resolution series 5 Alipay instant payment full resolution series 6 wechat refund full resolution series 7 Alipay refund full resolution series 8 Full analysis of alipay open platform payment updates and upgrades

1 Background

Alipay is now focusing on the concept of development platform, with open platform for developers and merchant platform for non-developers. (very similar to wechat) I suggest that you first go to understand the introduction and functions of the two platforms.

Click to jump to alipay open platform

Alipay open platform

Click here to jump to alipay merchant platform

Alipay merchant platform

When we click on the payment document, we’ll see all redirects to the open platform. Therefore, Alipay will gradually open the ability to pay in the open platform. Several payment methods have been updated.

2 Payment Method

The payment way that pays treasure has the following kinds altogether

  1. Pay in person – scan code payment – bar code payment
  2. App to pay
  3. Mobile website payment
  4. Payment on arrival

We can take a look at the payment document entry of open platform and merchant platform respectively:

Open platform document entry

Open platform payment documentation

Merchant platform document entry

Merchant platform payment documents

Click on it and browse it. Several payment methods are still in transition from merchant platform to open platform. (It’s a little confusing.)

  1. Face to face payment can only be used after applying for an AppId on the open platform (should be released after the open platform).
  2. Instant payment is not integrated into the open platform, it can only be called through the old interface, and the entrance is still only in the merchant platform.
  3. App payment and mobile website payment are the new version and the old version of the points.

The new version of the document is shown below:

Introduction of the new version of mobile payment

The document of an earlier version is as follows:

Old version of mobile payment document

What are the differences between the old version and the new version of the two updated payment methods

3. Payment difference between new and old versions

Completing a complete payment involves the following process:

  1. Access to pay
  2. Create transaction information
  3. The client initiates the payment
  4. Receiving information asynchronously
  5. Query transactions
  6. A refund

The old version of the process was explained in detail in the previous series of articles, but the new version of the process is described below.

3.1 Access Payment

In the development platform, you need to create applications. Specific creation and configuration guide the official document is as follows: openhome.alipay.com/platform/cu…

After creating and configuring the application, you need to open the payment service. Enter the specific application – Function Information – Application function

To apply for payment

After the application is approved, payment can be made through the interface.

3.2 Create transaction payment

The new version of transaction creation payment mainly changes the partner into appID, that is to say, each payment not only belongs to alipay account, but also belongs to the specific application. The other is some fine tuning of parameters and interface name replacement. I won’t repeat it here.

PS: Alipay provides the SDK of the server side. It is recommended to refer to it directly, without the need for stitching parameters and requests

3.3 Client Initiates payment

It is recommended to download the latest client and replace it with the latest method. After replacement, it is found to be compatible with the parameters generated by the interface of the earlier version.

My Github client has also been updated:

  1. The Android client: PayAndroid
  2. The iOS side: PayiOS

3.4 Receiving Information Asynchronously

The new version of the documentation is more explicit about receiving information asynchronously and processing descriptions. Compared with the previous version, there are modifications to the parameters, such as the parameter name of the amount. Also added a reminder of how to handle authentication information:

Asynchronous message notification

3.5 refund

In my opinion, the most convenient way to update the interface is refund. The old version of the refund process looked like this:

Old version refund process

PS: the refund flow chart of Ping++ is stolen here. Official Refund Document

That is to say, you need to use the interface to initiate a refund request, and then it will return to you an address, you need to open this address to enter the alipay cashier to enter the payment password to refund.

It’s safer, but it’s too much trouble. Each refund must be confirmed manually.

But!!! When you pay to update to use the new interface, you will find that there is a refund interface

New refund interface

This means that when called, synchronization can return the refund result. I don’t know how many… Greatly reduce the amount of development and Bug rate of refund verification. (The old version of the refund code is Bug prone)

4 summarizes

To sum up, it is strongly recommended to use the new open platform interface if there are conditions or new access to Alipay payment. Those who have received it also suggest updating the upgrade code. (if the client is compatible) We will continue to pay attention to payment related updates and issues.

At the end

More articles follow my public account

My official account