This library is an implementation made in javascript of the EndPay API
Current support EndPay API version 1.0
Npm:
npm install --save endpay
Yarn:
yarn add endpay
Make sure you have created your free account on EndPay and that you have your Credentials.
// CommonJS
const EndPay = require('endpay');
// ES6 / Typescript
import EndPay from 'endpay'
const endPay = new EndPay({
commerceId: 'COMMERCE_ID',
apiKey: 'YOUR_API_KEY'
})
endPay.payments
.create({
subject: 'First Product',
amount: '1000'
})
.then(response => {})
.catch(error => console.log(error)) // Handle the error.
endPay.payments
.read(paymentId)
.then(response => {})
.catch(error => console.log(error)) // Handle the error.