nodejs-payment
payment nodejs library
Install
> npm install nodejs-payment --save-dev
Usage
app.js
// app.jsconst config = ;const Payment = ;let type = "wepay"; // or "alipay"let client_ip = "127.0.0.1";let order_id = Date;let title = "payment test";let amount = 1;// create payment urlconfig;
config.js
// config.js'use strict'; moduleexports = alipay: sandbox: false appId: "--appId--" publicKey: "--publicKey--" privateKey: "--privateKey--" notifyUrl: "--notifyUrl--" returnUrl: "--returnUrl--" signType: "RSA2" wepay: mchId: "--mchId--" appId: "--appId--" appKey: "--appKey--" notifyUrl: "--notifyUrl--" redirectUrl: "--redirectUrl--" certPem: "--publicKey--" keyPem: "--privateKey--"
Features
Api | Status |
---|---|
webPay(out_trade_id, title, amount, client_ip) |
✔ |
queryPay(trade_id) |
✔ |
transfers(trans_trade_id, account, realname, title, amount, client_ip) |
✔ |
queryTransfers(trans_trade_id) |
✔ |