Giter Club home page Giter Club logo

wechat-redpack's Introduction

使用 Node.js 调用微信发送红包

使用

var redpack = require('redpack');

redpack({
    // 公众号appid
    wxappid: 'xxx',
    // 商户号
    mch_id: 'xxx',
    // 商户API密钥
    apiSecret: 'xxx',
    // 商户证书
    pfx: __dirname + '/cert/apiclient_cert.p12',
    // 随机字符串 可空
    nonce_str:'',
    // 商户订单号 可空
    mch_billno:'',
    // 红包商户名称
    send_name: '红包商户名称',
    // 用户openid
    re_openid: 'xxx',
    // 付款金额,单位分
    total_amount: 100,
    // 红包发放总人数
    total_num: 1,
    // 红包祝福语
    wishing: '感谢您参加猜灯谜活动,祝您元宵节快乐!',
    // Ip地址
    client_ip: '127.0.0.1',
    // 活动名称
    act_name: '活动名称',
    // 备注
    remark: '备注',
}, function(err, result) {
   console.log(result);
})

微信接口详细介绍

https://pay.weixin.qq.com/wiki/doc/api/cash_coupon.php?chapter=13_5

微信在线签名验证工具

https://pay.weixin.qq.com/wiki/tools/signverify/

wechat-redpack's People

Contributors

gyllz avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.