Payment capability
Users can trigger the super app 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 Claro. 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 Super APP user creates a payment order in a mini program.
- The merchant or ISV server creates the order by calling the /v2/payments/pay OpenAPI from the super app server.
- The super app server returns parameters such as checkout URL to the mini program.
- The mini program calls the tradePay JSAPI by triggering the Super APP payment process and other return parameters and then gets the response.
- The user confirms the payment. Then the super app server calls the /v2/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 parameter userId or uid is fetched by calling the applyToken OpenAPI. For more information, see User information capability.
API list
JSAPI | Description |
Trigger the cashier page from the Super APP. | |
OpenAPI | Description |
/v2/payments/{apiName} | For details, see the Open APIs for Merchants chapter. |