/endpay-js

Implementación de la API REST de EndPay en JavaScript

Primary LanguageJavaScript

EndPay Node JS

Complete documentation

This library is an implementation made in javascript of the EndPay API

Support Version

Current support EndPay API version 1.0

Install

Npm:

npm install --save endpay

Yarn:

yarn add endpay

Getting started

Authenticate with your Commerce ID Key, and Secret Key

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'
})

Payments

Create payment

endPay.payments
  .create({
    subject: 'First Product',
    amount: '1000'
  })
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Read payment

endPay.payments
  .read(paymentId)
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.