Alipay+Alipay+

Accept payments with Mini Program

This topic provides a step-by-step guide for Acquiring Partners (ACQPs) on how to accept a payment with a merchant mini program that is deployed in the mobile apps of Mobile Payment Partners (MPPs).

Before you begin

Before you begin, you need to familiarize yourself with the procedure of implementing Cashier Payment on merchant platforms such as App, Web, or WAP. For more information, see Integration overview.

About the task

This task is applicable to the scenario where a consumer places an order on a merchant mini program that runs in an MPP app.

User experience

The following figure illustrates the user experience for this scenario:

image

Figure 1. Pay via merchant mini program

The following steps describe the user experience for this scenario:

  1. The consumer places an order on a merchant mini program that runs in a wallet app. The wallet that hosts the merchant mini program is automatically selected as the payment method.
  2. The consumer is redirected to the payment confirmation page of the wallet app to confirm the payment.
  3. The consumer completes the payment and is then redirected to the payment result page in the wallet app.
  4. The consumer returns to the merchant mini program.

Workflow

The following figure illustrates the workflow of accepting a payment with a merchant mini program:

image

Figure 2. Workflow of accepting a payment with merchant mini program

Procedure

Step 1. Instruct your merchants to get onboarded to Mini Program Platform

You need to instruct your merchants to get onboarded to Alipay+ Mini Program Platform and then build their mini programs on the platform. For more information about the onboarding process, see Merchant onboarding.

Step 2. Instruct your merchants to implement Cashier Payment capability

After your merchants have created mini programs, you need to provide instructions to help your merchants implement Cashier Payment capability. For more information about the procedure that the merchants need to follow when implementing Cashier Payment capability in their mini programs, see Cashier Payment.

Step 3. Accept a payment

This step focuses on the differences that the ACQP needs to pay attention to when accepting payments with mini-programs in comparison with other merchant platforms (App, Web, or WAP). For the complete procedure of implementing Cashier Payment on merchant platforms such as App, Web, or WAP, see Integration overview.

The differences lie in the following steps:

  1. Consult payment method information
  2. Integrate the pay API

Consult payment method information

In the mini program scenario, you do not need to consult the payment method because the wallet that hosts the merchant mini program is used as the payment method.

Integrate the pay API

When calling the pay API in the mini program scenario, pay attention to the following differences when specifying the request parameters:

Request parameter

Merchant platform

App, Web, and WAP

Mini Program

order.env.terminalType

Specify APP, WEB, or WAP.

Specify MINI_APP.

paymentMethod.paymentMethodType

Specify CONNECT_WALLET.

Specify the wallet that hosts the mini program. Valid values are:

  • TRUEMONEY: Indicates the TrueMoney Wallet
  • ALIPAY_HK: Indicates the AlipayHK Wallet
  • TNG: Indicates the Touch 'n Go eWallet
  • ALIPAY_CN: Indicates the AlipayCN Wallet
  • GCASH: Indicates the GCash Wallet
  • DANA: Indicates the DANA Wallet

After processing your request, Alipay+ returns the MPP's cashier page URL in the normalUrl parameter. You need to pass the normalUrl parameter to your merchant side for subsequent steps.