@lunipay/js
v0.1.0
Published
The LuniPay browser SDK — redirect or mount the hosted checkout widget on any webpage.
Maintainers
Readme
@lunipay/js
LuniPay Browser SDK — accept payments in the Caribbean through code.
Install
npm install @lunipay/jsOr via CDN:
<script src="https://lunipay.io/js/v1/lunipay.js"></script>Quick start
import LuniPay from '@lunipay/js';
const lunipay = LuniPay('pk_test_your_publishable_key');
// Option A: redirect to hosted checkout
lunipay.checkout.redirectToCheckout({ sessionId: 'cs_xxx' });
// Option B: mount an embedded widget
const handle = lunipay.checkout.mount('#payment-container', {
sessionId: 'cs_xxx',
theme: { primaryColor: '#E11D48' },
onReady: () => console.log('ready'),
onSuccess: ({ payment }) => console.log('paid', payment),
onError: (err) => console.error(err),
});
// Later: handle.destroy();Docs
Full docs: https://lunipay.io/docs/sdks/javascript
License
MIT
