1.1.2 • Published 3 years ago

@kawkab-oss/stcpay-node v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

STC Pay Node.js SDK

STC Pay direct payment implementation for Node.

Installation

npm install @kawkab-oss/stcpay-node
yarn add @kawkab-oss/stcpay-node

Usage

const stcpay = new STCPay({
  merchantId: YOUR_MERCHANT_ID,
  cert: readFileSync('cert.pem', 'utf8'),
  key: readFileSync('key.pem', 'utf8'),
  testing: true
});

const response = await stcpay.authorize(CUSTOMER_PHONE_NUMBER, PAYMENT_AMOUNT, {
  BranchID: 'string',
  TellerID: 'string',
  DeviceID: 'string',
  RefNum: 'string',
  BillNumber: 'string'
});

await stcpay.confirm(response.STCPayPmtReference, response.OtpReference, OTP_FROM_CUSTOMER);
1.1.2

3 years ago

1.1.0

3 years ago