@dark/payment
Install service
$ yarn add @darkpos/payment
1. Create an instance of payment client
import PaymentClient from '@darkpos/payment';
const paymentClient = new PaymentClient();
paymentClient.init(<Provider Config>)
.then((data) => {
console.log(data);
}).catch(err => console.log(err));
2. Call createSingleUseToken or createCustomerToken
paymentClient.createSingleUseToken(<source>).then(data => console.log(data)).catch(err => console.log(err));
paymentClient.createCustomerToken(
<customerToken>,
<source>
).then(data => console.log(data)).catch(err => console.log(err));