1.0.8 • Published 1 year ago
@mentiumio/mentium-pay v1.0.8
Mentium Pay
Getting started
How to use mentium pay
1 - Install required packages
$ npm install @mentiumio/mentium-pay
or
$ yarn add @mentiumio/mentium-pay
2 - On your website, add a container to hold mentium widget. The id attribute must be mentium-pay
e.g:
<div id="mentium-pay"></div>
3 - Create a checkout session in your backend using the API key provided in your dashboard.
4 - Open the widget with your session token
NOTE: If you are working on
sandbox
environment, you can addenvironment: "sandbox"
to your config.
<script type="module">
import MentiumPay from '/src/index.tsx';
const config = {
session: '<session_token>',
onSuccess: function () {
console.log('Success!');
},
onFailure: function () {
console.log('Failure!');
},
onExit: function () {
console.log('Exit!');
},
};
MentiumPay.open(config);
</script>