UNPKG

@liuhlightning/wx-pay

Version:
15 lines 624 B
"use strict"; 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