0.0.1 • Published 3 years ago
@shoopiapp/paguelo-facil v0.0.1
Paguelo Facil Node.js Library
The PagueloFacil Node library provides convenient access to the PagueloFacil API from applications written in server-side JavaScript.
You can read the full documentation of PagueloFacil
Installation
Install PagueloFacil with npm
npm install @shoopiapp/paguelo-facil
Usage/Examples
import PagueloFacil from '@shoopiapp/paguelo-facil';
const pagueloFacil = new PagueloFacil(<cclw>, <token>, 'development');
- Authorization
const paymentInfo = {
amount: 1,
taxAmount: 0.0,
email: "email@mail.com",
phone: "61234567",
concept: "concept",
description: "description",
}
const cardInfo = {
cardNumber: "xxxxxxxxxxxxxxxx",
expMonth: "1",
expYear: "30",
cvv: "123",
firstName: "FirstName",
lastName: "LastName",
cardType: "MASTERCARD"
}
const response = await pagueloFacil.Authorization(paymentInfo, cardInfo);
- Reverse Authorization
const reverseInfo = {
amount: 1,
description: 'description',
codOper: 'SANDBOX_AUTH-XXXXXXXXX'
}
const response = await pagueloFacil.ReverseAuthorization(reverseInfo);
- Capture
const paymentInfo = {
amount: 1,
taxAmount: 0.0,
email: "email@mail.com",
phone: "61234567",
concept: "concept",
description: "description",
}
const cardInfo = {
cardNumber: "xxxxxxxxxxxxxxxx",
expMonth: "1",
expYear: "30",
cvv: "123",
firstName: "FirstName",
lastName: "LastName",
cardType: "MASTERCARD"
}
const response = await pagueloFacil.Capture(paymentInfo, cardInfo);
- Reverse Capture
const reverseInfo = {
amount: 1,
description: 'description',
codOper: 'SANDBOX_AUTH-XXXXXXXXX'
}
const response = await pagueloFacil.ReverseCapture(reverseInfo);
- Authorize and Capture
const paymentInfo = {
amount: 1,
taxAmount: 0.0,
email: "email@mail.com",
phone: "61234567",
concept: "concept",
description: "description",
}
const cardInfo = {
cardNumber: "xxxxxxxxxxxxxxxx",
expMonth: "1",
expYear: "30",
cvv: "123",
firstName: "FirstName",
lastName: "LastName",
cardType: "MASTERCARD"
}
const response = await pagueloFacil.AuthCapture(paymentInfo, cardInfo);
- Recurrent
const recurrentInfo = {
amount: 1,
taxAmount: 0.0,
email: 'email@mail.com',
phone: '61234567',
concept: 'concept',
description: 'description',
codOper: 'SANDBOX_AUTH-XXXXXXXXX'
}
const response = await pagueloFacil.Recurrent(recurrentInfo);
API Reference
Constructor
new PagueloFacil(cclw, token, environment)
Parameter | Type | Description |
---|---|---|
cclw | string | Required. Your cclw key |
token | string | Required. Your token key |
environment | development or production | Optional. Type of environment |
PaymentInformation
Parameter | Type | Description |
---|---|---|
amount | number | Required. Transaction amount |
taxAmount | number | Required. Trax amount |
email | string | Required. Client email |
phone | string | Required. Client phone |
concept | string | Required. Transaction concept |
description | string | Required. Transaction description |
lang | string | Optional. Language |
customFieldValues | Array<[string, string, string]> | Optional. Optional fields (id, label, value) |
CardInformation
Parameter | Type | Description |
---|---|---|
cardNumber | string | Required. Client card number |
expMonth | string | Required. The expiration month |
expYear | string | Optional. The expiration year |
cvv | string | Optional. The cvv or cvc |
firstName | string | Optional. The client first name |
lastName | string | Optional. The client last name |
cardType | VISA or MASTERCARD | Optional. The card type |
ReverseInformation
Parameter | Type | Description |
---|---|---|
codOper | string | Required. codOper return by the transaction |
amount | number | Required. Transaction amount |
description | string | Required. Transaction description |
lang | string | Optional. Language |
customFieldValues | Array<[string, string, string]> | Optional. Optional fields (id, label, value) |
CaptureInformation
Parameter | Type | Description |
---|---|---|
amount | number | Required. Transaction amount |
taxAmount | number | Required. Trax amount |
email | string | Required. Client email |
phone | string | Required. Client phone |
concept | string | Required. Transaction concept |
description | string | Required. Transaction description |
lang | string | Optional. Language |
customFieldValues | Array<[string, string, string]> | Optional. Optional fields (id, label, value) |
codOper | string | Required. codOper return by the transaction |
Running Tests
To run tests, run the following command
npm run test
🚀 About US
We are Shoopi a Panamanian Marketplace for everyone.
0.0.1
3 years ago