NPM Library - Echezona Pop
A framework-agnostic JavaScript library for integrating with the Echezona API, a payment solution for seamless online transactions.
Installation
npm install echezona-pop
Usage
import EchezonaPayPop from "echezona-pop";
const payPop = new EchezonaPayPop();
payPop.newTransaction({
onSuccess: (transaction) => {
// Payment complete! transactionId: transaction.transactionId
},
onError: (error) => {
// Payment failed! Error message: error.message
},
onCancel: () => {
// user closed the popup
},
request: {
amount: "2000.00",
transactionId: Math.floor(Math.random() * 1000000),
email: "sample@mail.com",
publicKey: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
currency: "NGN",
mode: "Live",
productId: "1001",
applyConviniencyCharge: true,
productDescription: "MTN",
bodyColor: "#0000",
buttonColor: "#0000",
footerText: "Powered by Echezona Ltd",
footerLink: "http://my-site.com",
footerLogo: "http://my-site.com/logo.png",
metadata: [
{
name: "sample",
value: "test",
},
],
},
});