1.0.8 • Published 2 months ago

library-paguelofacil-js v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

PagueloFacil Javascript SDK

The PagueloFacil Node library provides convenient access to the PagueloFacil API from applications written in JavaScript/Typescript

You can read the full documentation of PagueloFacil.

Content

Installation

Usage Examples

API Reference

Running Tests

Installation

Install PagueloFacil with npm

npm i library-paguelofacil-js

Usage Examples

import  PagueloFacilSDK  from  'library-paguelofacil-js';
const  pagueloFacilSDK  =  new  PagueloFacilSDK({cclw, token, 'development'}); //change to 'produciton' for production environment
  • Payment Authorization

const  paymentInfo  =  {
    amount:  100,
    taxAmount:  0.0,
    email:  "correo@gmail.com",
    phone:  "59128732734",
    concept:  "concept",
    description:  "description",
    lang: 'ES'
}

const  cardInfo  =  {
    cardNumber:  "411111111111",
    expMonth:  "12",
    expYear:  "30",
    cvv:  "123",
    firstName:  "Jhoson",
    lastName:  "Gibson",
    cardType:  "MASTERCARD"  // or VISA
}
const  response  =  await pagueloFacilSDK.TrasanccionAutorization(paymentInfo, cardInfo);
  • Reverse Payment Authorization

const  reverseInfo  =  {
    amount:  100,
    description:  'description',
    codOper:  'SANDBOX_AUTH-XXXXXXXXX'
}
const  response  =  await pagueloFacilSDK.TrasanccionReverseAutorization(reverseInfo);
  • Capture Payment

const  paymentInfo  =  {
    amount:  100,
    taxAmount:  0.0,
    email:  "correo@gmail.com",
    phone:  "59128732734",
    concept:  "concept",
    description:  "description",
    lang: 'ES',
    codOper: "SANDBOX_AUTH-XXXXXXXXX"
}
const  response  =  await pagueloFacilSDK.TrasanccionCapture(paymentInfo);
  • Reverse Capture

const  reverseInfo  =  {
    amount:  100,
    description:  'description',
    codOper:  'SANDBOX_AUTH-XXXXXXXXX'
}
const  response  =  await pagueloFacilSDK.TrasanccionReverseCapture(reverseInfo);
  • Authorize and Capture Payment (preferred)

const  paymentInfo  =  {
    amount:  100,
    taxAmount:  0.0,
    email:  "correo@gmail.com",
    phone:  "59128732734",
    concept:  "concept",
    description:  "description",
    lang: 'ES'
} 

const  cardInfo  =  {
    cardNumber:  "411111111111",
    expMonth:  "12",
    expYear:  "30",
    cvv:  "123",
    firstName:  "Jhoson",
    lastName:  "Gibson",
    cardType:  "MASTERCARD"  // or VISA
}
const  response  =  await pagueloFacilSDK.TrasanccionAuthCapture(paymentInfo, cardInfo);

API Reference

Constructor

new PagueloFacilSDK({cclw, token, environment})
ParameterTypeDescription
cclwstringRequired. Your cclw key
tokenstringRequired. Your token key
environmentdevelopment or productionOptional. Type of environment

PaymentInformation

ParameterTypeDescription
amountnumberRequired. Transaction amount
taxAmountnumberRequired. Trax amount
emailstringRequired. Client email
phonestringRequired. Client phone
conceptstringRequired. Transaction concept
descriptionstringRequired. Transaction description
langstringOptional. Language
customFieldValuesArray<[string, string, string]>Optional. Optional fields (id, label, value)

CardInformation

ParameterTypeDescription
cardNumberstringRequired. Client card number
expMonthstringRequired. The expiration month
expYearstringOptional. The expiration year
cvvstringOptional. The cvv or cvc
firstNamestringOptional. The client first name
lastNamestringOptional. The client last name
cardTypeVISA or MASTERCARDOptional. The card type

ReverseInformation

ParameterTypeDescription
codOperstringRequired. codOper return by the transaction
amountnumberRequired. Transaction amount
descriptionstringRequired. Transaction description
langstringOptional. Language
customFieldValuesArray<[string, string, string]>Optional. Optional fields (id, label, value)

CaptureInformation

ParameterTypeDescription
amountnumberRequired. Transaction amount
taxAmountnumberRequired. Trax amount
emailstringRequired. Client email
phonestringRequired. Client phone
conceptstringRequired. Transaction concept
descriptionstringRequired. Transaction description
langstringOptional. Language
customFieldValuesArray<[string, string, string]>Optional. Optional fields (id, label, value)
codOperstringRequired. codOper return by the transaction

ServerResponse

ParameterTypeDescription
codenumbercode Transaction
successbooleanServer response if is success or not
messagestring or nullServer message
dataDataTransaction data

Data

ParameterTypeDescription
datestringTransaction date
authStatusstringServer session status
cardTypeVISA or MASTERCARDType of card for the transaction
typeVISA or MASTERCARDCard provider for the transaction
idtxnumberId identifier for the transaction
cardTokenstringToken generated by the transaction
totalPaystringTotal amount of the transaction
binInfoObjectInformation of card provider
namestringCard name
displayNumstringLast fourth number of the card
operationTypestringType of operation
returnUrlstringCallback URL
requestPayAmountnumberAmount to pay of the request
emailstringClient email
codOperstringOperation code of the transaction
statusbooleanShow if the transaction was successfull or not
messageSysbooleanShow the system message

PaidLink

Object Name: paidLinkInfo | Parameter | Type | Description | | :----------------- | :-------------------- | :--------------------------------------------- | | amount | decimal | Required. Amount to pay in the payment link | | description | string | Required. Description for payment | | urlResponse | string | Required. url where you will respond when confirming the payment | | expiration | integer | Optional Link lifetime in seconds| | cardType | string | Optional It is used to determine which payment methods we want to show in our payment link. Values: NEQUI, CASH, KEY, CARD, CRYPTO| | tax | decimal | Optional. Amount corresponding to the ITBMS within the transaction amount|

Running Tests

Remember to set environment variables CCLW and TOKEN

1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago