Payment capability
Users can trigger the wallet cashier page on a mini program. The payment process and user experience on the mini program are similar to those of the native app.
Prerequisites
This capability is open to a merchant with a valid business license that is verified by its wallet. The merchant website should be accessible and provide clear business content and complete product information.
User experience
The overall payment process includes the following steps:
- A user selects a product in the mini program and places an order.
- The user confirms the purchase and enters the payment page that is triggered by the mini program.
- The user confirms the payee and amount on the checkout page, then confirms the payment.
- The payment success page is displayed.
Procedures
To develop the payment capability, follow the steps below:
1. Create a mini program
The merchant/ISV gets started with the workspace and publishes a mini program in the Mini Program Platform. For more information, see the product guide overview and the developer guide.
2. Add features (Optional)
By default, the payment capability is available. For other features, you need to add a feature and define the details according to your business requirements. For more information, see Features.
3. Call APIs
- The wallet user creates a payment order in a mini program.
- The merchant or ISV server creates the order by calling the
/{version}/payments/pay
OpenAPI from the wallet server. - The wallet server returns parameters such as
acquirementId
and checkout URL to the mini program. - The mini program calls the
tradePay
JSAPI by triggering the wallet payment process and other return parameters and then gets the response. - The user confirms the payment. Then the wallet server calls the
/{version}/payments/notifyPayment
OpenAPI and sends the order status notification to the min program server. - The user is redirected to the payment result page in the mini program.
Note:
- The
version
is the version of Open APIs, for example,Âv1
 orÂv2
. - The parameter
userId
oruid
is fetched by calling theapplyToken
OpenAPI. For more information, see User information capability.
API list
JSAPI | Description |
Trigger the cashier page from the wallet. | |
OpenAPI | Description |
/  The | For details, see the Open APIs for Merchants chapter. |