1.0.20 • Published 8 months ago
scash-nodejs v1.0.20
Scash-nodejs
Scash-nodejs is a js-based library allowing you to integrate more easily our payment integrator
Installation
Use the package manager pip to install scash-nodejs.
npm i scash-nodejs
Use the package manager yarn to install scash-nodejs.
yarn add scash-nodejs
Usage
import { openScashWidget, addScashListener, closeWidget } from 'scash-nodejs';
# open payment iframe
openScashWidget({
amount: 50,
reference: 'ref-scash-00033',
publicKey: 'SCASH-......',
phoneNumber: '0777865857',
errorUrl: "https://www.s-cash.co",
successUrl: "https://www.s-cash.co"
})
# listen payment response
addScashListener()
.subscribe(
(data: any) => {
console.log('payment response :::> ', data)
}
)
# close widget
closeWidget()
Payment Status
- PENDING
- FAILURE
- SUCCESSFUL