tiny-weixin-pay
Advanced tools
+8
-0
@@ -30,2 +30,10 @@ | ||
| //res加密 | ||
| exports.resencrypt = function (wxconfig, data) { | ||
| var nodeRSA = require('node-rsa'); | ||
| var crt = new nodeRSA(wxconfig.publicpem); | ||
| var rsaed = crt.encrypt(data, 'base64', 'utf8'); | ||
| return rsaed; | ||
| }; | ||
| exports.pipe = function(stream, fn){ | ||
@@ -32,0 +40,0 @@ var buffers = []; |
+65
-0
@@ -148,3 +148,68 @@ | ||
| // 企业付款到银行卡 | ||
| // { | ||
| // partner_trade_no: order.partner_trade_no, | ||
| // enc_bank_no: bank_no, | ||
| // enc_true_name: name, | ||
| // bank_code: order.bank_code, | ||
| // amount: parseInt(order.amount * 100) | ||
| // } | ||
| WXPay.mix('payBank', function (opts, fn) { | ||
| opts.nonce_str = opts.nonce_str || util.generateNonceString(); | ||
| opts.enc_bank_no = util.resencrypt(this.options, opts.enc_bank_no); | ||
| opts.enc_true_name = util.resencrypt(this.options, opts.enc_true_name); | ||
| opts.sign = this.sign(opts); | ||
| request({ | ||
| url: "https://api.mch.weixin.qq.com/mmpaysptrans/pay_bank", | ||
| method: 'POST', | ||
| body: util.buildXML(opts), | ||
| agentOptions: { | ||
| pfx: this.options.pfx, | ||
| passphrase: this.options.mch_id | ||
| } | ||
| }, function (err, response, body) { | ||
| util.parseXML(body, fn); | ||
| }); | ||
| }); | ||
| // 企业付款到银行卡查询 | ||
| // { | ||
| // partner_trade_no: order.partner_trade_no | ||
| // } | ||
| WXPay.mix('payBankQuery', function (opts, fn) { | ||
| opts.nonce_str = opts.nonce_str || util.generateNonceString(); | ||
| opts.sign = this.sign(opts); | ||
| request({ | ||
| url: "https://api.mch.weixin.qq.com/mmpaysptrans/query_bank", | ||
| method: 'POST', | ||
| body: util.buildXML(opts), | ||
| agentOptions: { | ||
| pfx: this.options.pfx, | ||
| passphrase: this.options.mch_id | ||
| } | ||
| }, function (err, response, body) { | ||
| util.parseXML(body, fn); | ||
| }); | ||
| }); | ||
| WXPay.mix('payBankGetPublickey', function (opts, fn) { | ||
| opts.nonce_str = opts.nonce_str || util.generateNonceString(); | ||
| opts.sign = this.sign(opts); | ||
| request({ | ||
| url: "https://fraud.mch.weixin.qq.com/risk/getpublickey", | ||
| method: 'POST', | ||
| body: util.buildXML(opts), | ||
| agentOptions: { | ||
| pfx: this.options.pfx, | ||
| passphrase: this.options.mch_id | ||
| } | ||
| }, function (err, response, body) { | ||
| util.parseXML(body, fn); | ||
| }); | ||
| }); | ||
| WXPay.mix('getBrandWCPayRequestParams', function(order, fn){ | ||
@@ -151,0 +216,0 @@ |
+3
-2
| { | ||
| "name": "tiny-weixin-pay", | ||
| "version": "1.2.5", | ||
| "version": "1.3.1", | ||
| "description": "weixin payment", | ||
@@ -10,4 +10,5 @@ "main": "index.js", | ||
| "dependencies": { | ||
| "MD5": "^1.2.1", | ||
| "node-rsa": "^0.4.2", | ||
| "request": "^2.54.0", | ||
| "MD5": "^1.2.1", | ||
| "xml2js": "^0.4.6" | ||
@@ -14,0 +15,0 @@ }, |
+2
-4
| # weixin-pay | ||
| 微信支付 for node.js | ||
| [](http://badge.fury.io/js/weixin-pay) | ||
| ## Installation | ||
| ``` | ||
| npm install weixin-pay | ||
| npm install tiny-weixin-pay | ||
| ``` | ||
@@ -15,3 +13,3 @@ | ||
| ```js | ||
| var WXPay = require('weixin-pay'); | ||
| var WXPay = require('tiny-weixin-pay'); | ||
@@ -18,0 +16,0 @@ var wxpay = WXPay({ |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
16182
12.92%349
23.32%4
33.33%136
-1.45%+ Added
+ Added
+ Added
- Removed