We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
”特约商户进件API“中要求
商户上送敏感信息时使用微信支付平台公钥加密,证书序列号包含在请求HTTP头部的Wechatpay-Serial,
请问可以从哪里进行这一步操作,向http header 中添加自定义的内容? 我在./lib/interceptor.js中找到的一部分代码
config.headers = { ...config.headers, 'User-Agent': utils.userAgent(), 'Content-Type': `application/json`, Accept: `application/json`, // @see {fmt.authorization} APIv3 `Authorization` schema Authorization: fmt.authorization(mchid, nonce, signature, timestamp, serial), }
直接添加字段是可以的。
config.headers = { ...config.headers, 'User-Agent': utils.userAgent(), 'Content-Type': `application/json`, Accept: `application/json`, // @see {fmt.authorization} APIv3 `Authorization` schema Authorization: fmt.authorization(mchid, nonce, signature, timestamp, serial), 'wechatpay-serial': '1234567890', }
不过我如何在应用程序中做这个添加的动作?
this.wxapi = new Wechatpay({ mchid: '1270921201', serial: '623FFEC95EF4B583D2157DFE81E66FFA15DE88C3', certs: { '1C38E366EE3D40AF84E321A2B2A371B8CED57255': '-----BEGIN CERTIFICATE-----\n' + `...` + '\n-----END CERTIFICATE-----', }, privateKey: '-----BEGIN PRIVATE KEY-----\n' + `...` + '\n-----END PRIVATE KEY-----', });
初始化的时候提供了平台证书,是否应该自己在需要的时候在interceptor.js中自行添加? 还是有其他的配置,可以在接口调用的时候通过配置来添加? 谢谢。
The text was updated successfully, but these errors were encountered:
以 #16 为例:
try { const result = await this.wxapi.v3.applyment4sub.applyment.$noop$({}, { noop: '', headers: { 'Wechatpay-Serial': '123456' } }); return console.log(result); } catch (err) { return console.error(err) }
Sorry, something went wrong.
非常感谢!
QA special cases, refs #16, #17
ca94399
No branches or pull requests
”特约商户进件API“中要求
请问可以从哪里进行这一步操作,向http header 中添加自定义的内容?
我在./lib/interceptor.js中找到的一部分代码
直接添加字段是可以的。
不过我如何在应用程序中做这个添加的动作?
初始化的时候提供了平台证书,是否应该自己在需要的时候在interceptor.js中自行添加?
还是有其他的配置,可以在接口调用的时候通过配置来添加?
谢谢。
The text was updated successfully, but these errors were encountered: