1.0.14 • Published 2 years ago

nume-pay v1.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

NumePay Checkout

Installing

Using npm

npm install nume-pay

Using jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/nume-pay"></script>	

Usage

import 'nume-pay/index.css'
const { checkoutWithNume, renderBtn } = require('nume-pay');

const handleSubmit = () => {
	const payload = {
		referenceId: 'ref',
		amountUsd: 1.5,
		products: [
			{
				skuId: 'he',
				count: 4,
			},
		],
		clientId: process.env.REACT_APP_NUME_CLIENT_ID,
		clientSecret: process.env.REACT_APP_NUME_CLIENT_SECRET
	};
	checkoutWithNume(payload).then((res) => {
		console.log(res);
		if (res.orderStatus === 'APPROVED') {
			window.location.href = 'success';
		}
	}).catch((err) => {
		console.log(err);
	});
};

// Render NumePay Checkout button
<div id="nume-pay-checkout"></div>
renderBtn('#nume-pay-checkout', {full: true, onSubmit: handleSubmit})

Checkout button options

PropertyDescription
onSubmit functionRequired: true. Function to call on button click
full booleanDefault: false. Button full text
helperText booleanDefault: false. Bottom helper text
1.0.14

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago