Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Coupon

代金券

const pay = new Coupon({
  appId: "wxb80e5bddb2d804f3",
  key: "6Q9VX4N3WTBM9G9XBL7H1L9PB9ANHLY7",
  mchId: "1434712502",
  pfx: fs.readFileSync(path.resolve(__dirname, "cert.p12"))
});
see

https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_1

Hierarchy

Index

Constructors

constructor

Properties

appId

appId: string

公众账号ID

debug

debug: boolean = false

仿真模式开关

key

key: string

密钥

keyForDebug

keyForDebug: string

测试用验签密钥

mchId

mchId: string

商户号

pfx

pfx: Buffer

证书

Methods

Protected completeURL

  • completeURL(base: string): string

Protected createFetchOptions

  • createFetchOptions(url: string, usePfx?: boolean): Promise<FetchOptions>

Protected getKey

  • getKey(): string

queryCouponStock

queryCouponsInfo

sendCoupon

setDebug

  • setDebug(useDebug: boolean): Promise<void>

verifySign

  • verifySign(data: object, signType?: SignType): boolean

Generated using TypeDoc