🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

fanqier-wxredpack

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fanqier-wxredpack

微信发企业红包 for node.js

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

weixin-redpack

微信发企业红包 for node.js

Installation

npm install fanqier-wxredpack

Usage

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

var Redpack = require('fanqier-wxredpack').Redpack;

var redpack = Redpack({
	mch_id: 'xxx',
	partner_key: 'xxxxxx',
	pfx: fs.readFileSync('./wxpay_cert.p12'),
	wxappid: 'wxxxxxxx'
});

//发红包
redpack.send({
	mch_billno: '123426900220150325'+Math.random().toString().substr(2,10),
	send_name: '红包来自',
	wishing: '收好不谢!',
	re_openid: '红包接收人openid',
	total_amount: 100,
	total_num: 1,
	client_ip: '14.23.102.146',
	nick_name: 'XXXX',
	act_name: '发测试红包',
	remark: 'remark'
})
.then(function(res){
  console.log(res)
})
.catch(function(err){
  console.log(err)
});

查询红包记录

redpack
    .check({
        mch_billno: '1357035902201622191047290884',
        bill_type:'MCHT',
    })
    .then(function(res) {
        console.log(res)
        process.exit();
    }, function(err) {
        console.log(err)
        process.exit();
    });

Keywords

weixin

FAQs

Package last updated on 20 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts