// 使用的同学可以自己增加定时器去维护这个微信平台公钥证书
// 使用最新的平台证书(即:证书启用时间较晚的证书)
const certificates = await pay.get_certificates('APIv3密钥');
// 我这里取最后一个
const certificate = certificates.pop();
const res = await pay.create_profitsharing_orders({
transaction_id: '4208450740201411110007820472',
out_order_no: 'P20150806125346',
receivers: [
{
type: 'MERCHANT_ID',
account: '86693852',
name: pay.publicEncrypt('张三', certificate.publicKey),
amount: 888,
description: '分给商户A',
},
],
unfreeze_unsplit: true,
wx_serial_no: certificate.serial_no, // 当你需要传name时 需要传当前参数
});
const res = await pay.query_profitsharing_orders('4208450740201411110007820472', 'P20150806125346');
// https://api.mch.weixin.qq.com/v3/profitsharing/orders/P20150806125346?transaction_id=4208450740201411110007820472
const res = await pay.profitsharing_return_orders(...)
const res = await pay.query_profitsharing_return_orders(...)
const res = await pay.profitsharing_orders_unfreeze(...)
const res = await pay.query_profitsharing_amounts(...)
// 使用的同学可以自己增加定时器去维护这个微信平台公钥证书
// 使用最新的平台证书(即:证书启用时间较晚的证书)
const certificates = await pay.get_certificates('APIv3密钥');
// 我这里取最后一个
const certificate = certificates.pop();
const res = await pay.profitsharing_receivers_add({
appid: 'wx8888888888888888',
type: 'MERCHANT_ID',
account: '86693852',
name: pay.publicEncrypt('张三', certificate.publicKey),
relation_type: 'STORE',
custom_relation: '代理商',
});
const res = await pay.profitsharing_receivers_delete(...)
参考回调解签
const result = pay.decipher_gcm(ciphertext, associated_data, nonce, key);
const res = await pay.profitsharing_bills(...)
参考下载账单
const data = await pay.downloadbill(download_url);