EcommPay Javascript package
What is it?
It is package that will help you with generating payment URL according to EcommPay documentation.
How to use?
Get payment page URL
- Install the package (with your package manager):
npm install ecommpayyarn add ecommpay
- Require somewhere in your code, set parameters and get the URL:
const Payment = ; // create ECP object with your account ID and secret saltconst e = '112' 'my_secret'; // set payment details epaymentAmount = 1000;epaymentId = 'FFCD12-30';epaymentCurrency = 'USD'; // set another parameters, like success or fail callback URL, customer details, etc. // get payment URLconst url = e;
Now your can render payment url
somewhere on your checkout page.
Receive callback from Ecommpay
Example with Express:
const Callback = ; app;
Note that Callback
constructor throws Error if signature isn't valid.