Loading…

Alipay Mini ProgramPayment

# Get payment initiation parameters ```javascript WXAPI.alipayMP({ token: '000', money: 0.01, remark: 'Preferential payment: 0.01', payName: 'Preferential payment' }) ``` + token login credentials + money payment amount + payName The purchase name displayed on the payment interface + remark remark information will be recorded in the remark field in the background payment record. It does not need to be passed. + nextAction After the payment is successful, the next operation that needs to be performed does not need to be passed. + shopId the payment store ID, optional # Mini program launches payment ## Native development [https://opendocs.alipay.com/mini/api/openapi-pay?pathHash=e964f41e](https://opendocs.alipay.com/mini/api/openapi-pay?pathHash=e964f41e) ```javascript my.tradePay ({ tradeNO: res.data.tradeNo, success: res => { my.alert ({ content: JSON.stringify (res), }); }, fail: error => { console.error('Failed to call my.tradePay: ', JSON.stringify(error)); }, }); ``` ## uni-app development [https://uniapp.dcloud.net.cn/api/plugins/payment.html](https://uniapp.dcloud.net.cn/api/plugins/payment.html) ```javascript uni.requestPayment({ provider: 'alipay', orderInfo: res.data.tradeNo, success: () => { // todo }, fail: (err) => { console.error(err) } }) ```