Skip to content

Implementación de la API REST de EndPay en JavaScript

Notifications You must be signed in to change notification settings

endpay/endpay-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.