1.0.0 • Published 5 years ago

icbc-open v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

NPM version node version npm download npm license

node-icbc-open

掌上生活开放平台( https://open.cmbchina.com/Platform/ ) Node.js SDK

安装

npm install icbc-open --save

使用

const ICBC = require("icbc-open");

const icbc = new ICBC({
  appId: "10000000000000",
  mertId: "00000000",
  aesKey: "xxxx", // base64 aseKey
  icbcPublicKey: "",
  privateKey: fs.readFileSync("prod.key").toString(),
});

// 登录获取用户信息
const userInfo = icbc.getUserInfo("xxxx"); // Base64 from APP

// 手机号发券
await icbc.sendEcouponByMobile("XXX", 1234566, "13800138000");
// 手机号发券查询
await icbc.queryEcouponByMobile("XXX", 1234566, "13800138000");