Code Monkey home page Code Monkey logo

node-wxpay's Issues

支付方式及入参相关问题

请问支持小程序的支付方式吗?
JSAPI支付发起的时候
商户订单号 | out_trade_no 这个参数 不需要传吗?

decodeCertificates() in constructor

decodeCertificates 是异步函数

constructor({appid, mchid, private_key, serial_no,apiv3_private_key,notify_url} = {}) {
....
this.decodeCertificates(); // pending , 无法加载 certificates
}

throw new Error('获取证书列表失败')

const Payment = require("wxpay-v3");
const payment = new Payment({
appid: "xxxx",
mchid: "xxx",
private_key: require("fs")
.readFileSync("./cert/apiclient_key.pem")
.toString(), //或者直接复制证书文件内容
serial_no: "3xxxxxxxC0DFDB7CF67B901A5A5746A",
apiv3_private_key: "xxxxxx",
notify_url: "https://f.tuoyal.com/beta-api/version",
});
// const config = {
// mchid: '1633213487', // 商户号
// serial: '36DA2A3BF839A4FC0C0DFDB7CF67B901A5A5746A', // 商户API证书序列号
// privateKey: readFileSync('./cert/apiclient_key.pem'), // 商户API私钥
// publicKey: readFileSync('./cert/apiclient_cert.pem'), // 微信支付平台公钥
// appid: 'wx7331e7f65737fd9a', // 微信支付应用ID
// };

let test = async () => {
let result = await payment.app({
description: "点存云-测试支付",
out_trade_no: Date.now().toString(),
amount: {
total: 1,
},
});
console.log("result", result);
};

/Users/liuzukuan/Desktop/wechat/node_modules/wxpay-v3/lib/index.js:231
throw new Error('获取证书列表失败')
^

Error: 获取证书列表失败
at Payment.decodeCertificates (/Users/liuzukuan/Desktop/wechat/node_modules/wxpay-v3/lib/index.js:231:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.