Skip to content
New issue

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

平台证书序列号Wechatpay-Serial错误 #63

Open
Jensoner opened this issue Nov 9, 2023 · 2 comments
Open

平台证书序列号Wechatpay-Serial错误 #63

Jensoner opened this issue Nov 9, 2023 · 2 comments

Comments

@Jensoner
Copy link

Jensoner commented Nov 9, 2023

pay.batches_transfer这个方法会报平台证书序列号Wechatpay-Serial错误
去平台下载的证书如何在调用时携带呢

@klover2
Copy link
Owner

klover2 commented Dec 14, 2023

batches_transfer

// 使用的同学可以自己增加定时器去维护这个微信平台公钥证书
// 使用最新的平台证书(即:证书启用时间较晚的证书)
const certificates = await pay.get_certificates("APIv3密钥");
// 我这里取最后一个
const certificate = certificates.pop();

const res = await pay.batches_transfer({
out_batch_no: 'plfk2020042013',
batch_name: '2019年1月深圳分部报销单',
batch_remark: '2019年1月深圳分部报销单',
total_amount: 4000000,
total_num: 200,
wx_serial_no: certificate.serial_no, // 当你需要传user_name时 需要传当前参数
transfer_detail_list: [
{
out_detail_no: 'x23zy545Bd5436',
transfer_amount: 200000,
transfer_remark: '2020年4月报销',
openid: 'o-MYE42l80oelYMDE34nYD456Xoy',
user_name: pay.publicEncrypt('张三', Buffer.from(certificate.publicKey)),
}
],
});

@guojingwen
Copy link

batches_transfer

// 使用的同学可以自己增加定时器去维护这个微信平台公钥证书 // 使用最新的平台证书(即:证书启用时间较晚的证书) const certificates = await pay.get_certificates("APIv3密钥"); // 我这里取最后一个 const certificate = certificates.pop();

const res = await pay.batches_transfer({ out_batch_no: 'plfk2020042013', batch_name: '2019年1月深圳分部报销单', batch_remark: '2019年1月深圳分部报销单', total_amount: 4000000, total_num: 200, wx_serial_no: certificate.serial_no, // 当你需要传user_name时 需要传当前参数 transfer_detail_list: [ { out_detail_no: 'x23zy545Bd5436', transfer_amount: 200000, transfer_remark: '2020年4月报销', openid: 'o-MYE42l80oelYMDE34nYD456Xoy', user_name: pay.publicEncrypt('张三', Buffer.from(certificate.publicKey)), } ], });

这个证书更新应该内置到sdk中, 其他语言版本的sdk 如java 都是这样的做的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants