@liuhlightning/wx-pay
Version:
communicate to wx pay
15 lines • 624 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.notifyTransactionBuilder = notifyTransactionBuilder;
function notifyTransactionBuilder() {
return (headers, body) => {
const { "wechatpay-timestamp": time, "wechatpay-nonce": nonceStr, "wechatpay-signature": signature, } = headers;
const c = this.checkSignature(time, nonceStr, body, signature);
if (!c)
return;
const r = body.resource;
const d = this.decrypto(r.nonce, r.ciphertext, r.associated_data ?? "");
return JSON.parse(d);
};
}
//# sourceMappingURL=notify.js.map