Skip to content

maichong/libwx

Repository files navigation

libwx

NodeJs端微信SDK

Installation

npm i libwx

Usage

import { Weixin } from 'libwx';

const wx = new Weixin({
  type: 'h5',
  appid: '',
  secret: '',
  mch_id: '',
  pay_key: '',
  // xxxx
});

let accessToken = await wx.getAccessToken(code);

API

  • setOptions(config) 设置
  • getGlobalToken() 获取公众平台全局Token
  • getTicket() 获取公众平台JSSDK ticket
  • getJsConfig(options) 获取JSSDK配置
  • getAccessToken(code) 微信登录后将用户的code转化为access_token
  • getAuthInfo(openid, accessToken) 获取网页授权用户信息,小程序平台不可用
  • getUserInfo(openid) 获取微信关注者的用户信息
  • downloadMedia(media_id) 从微信服务器上下载媒体文件
  • orderquery(orderId) 查询订单信息
  • unifiedorder(data) 统一下单
  • createPayReq(data) 创建支付参数

Contribute

Maichong Software

Liang Xingchen

License

This project is licensed under the terms of the MIT license

About

Weixin sdk for node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published