@zippie/pay-button
v1.0.5
Published
Integrate Zippie Pay to your website
Downloads
6
Readme
Zippie Pay (Button)
Integrate Zippie Pay to your website
Usage
npm
e.g. React
npm install @zippie/pay-button
import { paymentRequest } from '@zippie/pay-button'
const paymentData = {
merchantId: 'test.merchant',
orderId: 'MY_ORDER_ID',
amount: 1,
currency: 'KSH',
}
const request = paymentRequest(paymentData)
const result = await request.show()
html+js
using unpkg.com (@zippie/pay-button version 1.0.0)
<script src="https://unpkg.com/@zippie/[email protected]/dist/zippie-pay.js"></script>
const paymentData = {
merchantId: 'test.merchant',
orderId: 'MY_ORDER_ID',
amount: 1,
currency: 'KSH',
}
const request = zippie.paymentRequest(paymentData)
request
.show()
.then(function (result) {
// Payment succesful
})
.catch(function (error) {
// Payment failed (e.g. cancel)
})