@moruwallet/moru-web-sdk
v1.0.2
Published
Moru Payment Gateway
Downloads
13
Readme
@moruwallet/moru-web-sdk
Moru Payment Gateway web sdk Read Full Documentation.
Installation
yarn add @moruwallet/moru-web-sdk
npm install @moruwallet/moru-web-sdk
Usage
import { MoruCheckout } from '@moruwallet/moru-web-sdk';
function App() {
const options = {
access_key: 'test_9425294388834bdface7d1b58fd538bf67627d9408fe4f2589820cf550a5003d',
transaction_id: '1',
additional_fields: {
name: 'Firstname Lastname',
email: '[email protected]',
},
callback_handler: {
onSuccess: (response) => {
console.log(response);
// call your api
alert('success');
},
onError: (error) => {
console.log(error);
alert('failure');
},
onClose: (error) => {
console.log(error);
},
},
};
const checkout = new MoruCheckout(options);
const handleMoruPayment = () => {
checkout.open({ amount: 100 });
};
return (
<div>
<button onClick={handleMoruPayment}>Pay with Moru</button>
</div>
);
}
export default App;