Loading…
⚡
apifm
Frontend PaaS & AI Dev Platform
SDK
Homepage
Open Source
Help center
Cases
Contact
Backend management
In the merchant transfer user confirmation mode, the WeChat client opens the page through the mini program to request the user to confirm the payment.
In the merchant transfer user confirmation mode, the WeChat client opens the page through the mini program to request the user to confirm the payment.
SDK
apifm
Development reference
```javascript WXAPI.wxpayRequestMerchantTransferV2({ token: 'Current user login token', number: 'Withdrawal number' }) ``` Interface return value: ```json { "code": 0, "data": { "appId": "wxa46b09d413fbcaff", "mchId": "1418156202", "openId": "om3AQ0YaRp3RZtFuZ1Wgk0OdQjvA", "package": "ABBQO+oYAAABAAAAAADGU73BpJl8kAuAPOCIZxAAAADnGpepZahT9IkJjn90+1qgLUvtneDSVndAK2 6hwZ7l4khsAzhV1u3ri0wmcTvckfsuMDnkuP2F6Lw+h5hLdUjMpEFX6bMg+E8IP9ouHr77C6DcRd8=" }, "msg": "success" } ``` Then call the WeChat interface and the payment confirmation interface will pop up: [https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestMerchantTransfer.html](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestMerchantTransfer.html) Here is the reference code: ```json async confirmTX(e) { const item = e.currentTarget.dataset.item wx.showLoading({ title: '', }) const res = await WXAPI.wxpayRequestMerchantTransfer({ token: wx.getStorageSync('token'), number: item.number }) wx.hideLoading() if (res.code != 0) { wx.showToast({ title: res.msg, icon: 'none' }) return } wx.requestMerchantTransfer({ mchId: res.data.mchId, appId: res.data.appId, package: res.data.package, openId: res.data.openId, success: res => { console.log(res); }, fail: res => { console.error(res); }, }) }, ```