Giter VIP home page Giter VIP logo

weixin-enterprisepay's Introduction

weixin-enterprisepay

修改自 weixin-redpack (https://github.com/tvrcgo/weixin-redpack) 微信发企业钱 for node.js

Installation

npm install weixin-enterprisepay

Usage

先创建一个付款实例 Payment,再调用 send() 发送付款,减少每次发付款的参数。

var Payment = require('weixin-enterprisepay').Payment;

var payment = Payment({
	mchid: 'xxx',
	partner_key: 'xxxxxx',
	pfx: fs.readFileSync('./wxpay_cert.p12'),
	mch_appid: 'wxxxxxxx'
});

payment.send({
	partner_trade_no: '123426900220150325',
	openid: '接收人openid',
	check_name: 'NO_CHECK',
	amount: 100,
	spbill_create_ip: '14.23.102.146',
	desc: 'remark'
}, function(err, result){
	console.log(result);
})

直接调用 sendPayment() 输入所有参数。

var entpayment = require('weixin-enterprisepay');

entpayment.sendPayment({
  mchid: 'xxx',
  partner_key: 'xxxxxxx',
  pfx: fs.readFileSync('./application_cert.p12'),
  mch_appid: 'wxxxxxx',
  partner_trade_no: '1234567890201503251234567890',
  openid: '接收人openid',
  check_name: 'NO_CHECK',
  amount: 100,
  spbill_create_ip: '14.23.102.146',
  desc: 'remark'
}, function(err, result){
  console.log(result);
});

weixin-enterprisepay's People

Contributors

ityao avatar tvrcgo avatar

Stargazers

Jim Liu avatar 子纲|Rahul avatar

Watchers

 avatar James Cloos avatar 子纲|Rahul avatar

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.