名称:my.tradePay
类型:小程序接口
功能:支付订单字符串通过小程序方式唤起支付
注意:接口为通用接口,该场景下,请参考如下编写:
<pre class=" language-js" style="box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; margin: 0.5em 0px; overflow: auto; color: rgb(102, 102, 102); background: rgb(247, 247, 247); text-shadow: rgb(255, 255, 255) 0px 1px; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; overflow-wrap: normal; line-height: 1.5em; tab-size: 4; hyphens: none; padding: 0px; display: block; max-width: 100%; border-radius: 4px; border: 1px solid rgb(238, 238, 238); position: relative; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`my.tradePay({
orderStr: 'myOrderStr', //完整的支付参数拼接成的字符串,从服务端获取
success: (res) => {
my.alert({
content: JSON.stringify(res),
});
},
fail: (res) => {
my.alert({
content: JSON.stringify(res),
});
}
});