模拟外部 App 后端向支付中台发起签名请求并拉起微信收银台
计算签名并向中台请求创建订单,获取唤起小程序的 DeepLink
在手机浏览器中打开本页,点击下方按钮唤起微信小程序完成支付
// Node.js 示例
const crypto = require('crypto');
const timestamp = Math.floor(Date.now() / 1000);
const nonce = crypto.randomBytes(4).toString('hex');
const str = app_id + uid + plan + timestamp + nonce;
const sign = crypto.createHmac('sha256', app_secret).update(str).digest('hex');
// 然后 POST 到中台:
{
app_id, uid, plan,
timestamp, nonce, sign
}