在根目录下创建wechat.config.json
文件,格式如下:
{
"appid": "<appid>",
"app_secret": "<app安全码>",
"mch_id": "商户号",
"mch_key": "商户秘钥",
"body": "默认商品描述信息",
"pay_notify_url": "支付成功通知地址",
"refund_notify_url": "退款成功通知地址",
"api_cert": "HTTPS证书路径",
"term_ip": "终端IPv4地址"
}
await wechatClient.trade.<操作>(<参数>: ***Request).then((response?: ***Response) => {
//你的处理代码
}).catch( (e) => {
//异常处理
});
await wechatClient.sheet.<操作>(<参数>: ***Request).then((response?: ***Response) => {
//你的处理代码
}).catch( (e) => {
//异常处理
});
wechatClient.notifier.onPayed(<回调时POST的内容>);
wechatClient.notifier.onRefunded(<回调时POST的内容>);