公众账号ID
仿真模式开关
密钥
测试用验签密钥
商户号
证书
拼接路径
生成 FetchOptions 数据
获取私钥
查询代金券批次
pay.queryCouponStock({
coupon_stock_id: "1757"
});
查询代金券信息
pay.queryCouponsInfo({
coupon_id: "1565",
openid: "onqOjjrXT-776SpHnfexGm1_P7iE",
stock_id: "58818"
});
发放代金券
pay.sendCoupon({
coupon_stock_id: "1757",
openid_count: 1,
partner_trade_no: "1000009820141203515766",
openid: "onqOjjrXT-776SpHnfexGm1_P7iE"
});
仿真模式开关
校验 sign
Generated using TypeDoc
代金券
const pay = new Coupon({ appId: "wxb80e5bddb2d804f3", key: "6Q9VX4N3WTBM9G9XBL7H1L9PB9ANHLY7", mchId: "1434712502", pfx: fs.readFileSync(path.resolve(__dirname, "cert.p12")) });
https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_1