文章目录
1、创建商户API证书
链接地址:商户API证书
2、获取证书序列号
openssl x509 -in xxxxx.pem -noout -serial
其中 xxxxx.pem
是你的私钥证书地址。
3、在商户平台绑定一个appid
需要提前创建一个小程序或者公众号,将您的商户号与其appid
进行绑定。
4、生成一个时间戳和随机字符串
下面以node为例:
// 时间戳
const timestamp = Math.floor(Date.now() / 1000).toString();
// 随机字符串
const nonceStr = crypto