npm package: @pagofacil/api_pago_facil
Description: API_de_Pago_Fcil
Author: Cristian Tala Sánchez
Latest version: 2.1.4

# Javascript SDK for Pago Fácil API

ApiPagoFacil - JavaScript client for api_pago_facil
API de Pago Fácil
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 2.1.4
- Package version: 2.1.4
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install @pagofacil/api_pago_facil --save
```

Finally, you need to build the module:

```shell
npm run build
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

To use the link you just defined in your project, switch to the directory you want to use your api_pago_facil from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

#### git

If the library is hosted at a git repository, e.g.https://github.com/PSTPAGOFACIL/sdk-apis-javascript
then install it via:

```shell
    npm install PSTPAGOFACIL/sdk-apis-javascript --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
//DOTENV es una librería que nos ayudar a cargar variables de entorno desde un archivo .env
require('dotenv').config();
const ApiPagoFacil = require('@pagofacil/api_pago_facil');
//Obtenemos el usuario y la clave desde el archivo .env
const username = process.env.PF_USERNAME;
const password = process.env.PF_PASSWORD;

const loginBody = new ApiPagoFacil.LoginBody(username, password);

const api = new ApiPagoFacil.AuthApi()
var opts = {
    'loginBody': loginBody
};
var callback = function (error, data, response) {
    if (error) {
        console.error(error);
    } else {
        console.log('API called successfully. Returned data: ');
        const loginResponse = data;
        const dataLoginResponse = loginResponse.data;
        const access_token_jwt = dataLoginResponse.access_token_jwt;

        console.log("LOGIN RESPONSE", loginResponse.message, dataLoginResponse, access_token_jwt);
    }
};
api.usersLoginPost(opts, callback);

```

## Documentation for API Endpoints

All URIs are relative to *https://apis.pgf.cl*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ApiPagoFacil.AuthApi* | [**usersLoginPost**](docs/AuthApi.md#usersLoginPost) | **POST** /users/login | Autentificación con usuario y clave.
*ApiPagoFacil.IndicatorsApi* | [**indicatorsRemittancesGet**](docs/IndicatorsApi.md#indicatorsRemittancesGet) | **GET** /indicators/remittances | Obtiene los datos de los abonos (remittances) realizados en una fecha específica y los futuros, además del saldo disponible
*ApiPagoFacil.PaymentsApi* | [**paymentsGet**](docs/PaymentsApi.md#paymentsGet) | **GET** /payments | 
*ApiPagoFacil.RemittancesApi* | [**remittancesConciliationGet**](docs/RemittancesApi.md#remittancesConciliationGet) | **GET** /remittances/conciliation | 
*ApiPagoFacil.TrxsApi* | [**trxsIdGet**](docs/TrxsApi.md#trxsIdGet) | **GET** /trxs/{id} | Obtiene la informacion de la transacción exitosa, asociada a un id
*ApiPagoFacil.TrxsApi* | [**trxsIdTrxNullificationGet**](docs/TrxsApi.md#trxsIdTrxNullificationGet) | **GET** /trxs/{idTrx}/nullification/ | 
*ApiPagoFacil.TrxsApi* | [**trxsIdTrxNullificationPost**](docs/TrxsApi.md#trxsIdTrxNullificationPost) | **POST** /trxs/{idTrx}/nullification | 
*ApiPagoFacil.TrxsApi* | [**trxsIdTrxNullificationStatusGet**](docs/TrxsApi.md#trxsIdTrxNullificationStatusGet) | **GET** /trxs/{idTrx}/nullification/status | 
*ApiPagoFacil.TrxsApi* | [**trxsPost**](docs/TrxsApi.md#trxsPost) | **POST** /trxs | 
*ApiPagoFacil.UsersApi* | [**usersGet**](docs/UsersApi.md#usersGet) | **GET** /users | Obtener informacion del usuario.
*ApiPagoFacil.WebhooksApi* | [**webhooksIdUserGet**](docs/WebhooksApi.md#webhooksIdUserGet) | **GET** /webhooks/{idUser} | 
*ApiPagoFacil.WebhooksApi* | [**webhooksIdUserWebhookDelete**](docs/WebhooksApi.md#webhooksIdUserWebhookDelete) | **DELETE** /webhooks/{idUser}/{webhook} | 
*ApiPagoFacil.WebhooksApi* | [**webhooksIdUserWebhookPut**](docs/WebhooksApi.md#webhooksIdUserWebhookPut) | **PUT** /webhooks/{idUser}/{webhook} | 
*ApiPagoFacil.WebhooksApi* | [**webhooksPost**](docs/WebhooksApi.md#webhooksPost) | **POST** /webhooks | 


## Documentation for Models

 - [ApiPagoFacil.BillingDetails](docs/BillingDetails.md)
 - [ApiPagoFacil.DataLoginResponse](docs/DataLoginResponse.md)
 - [ApiPagoFacil.Document](docs/Document.md)
 - [ApiPagoFacil.FutureRemittances](docs/FutureRemittances.md)
 - [ApiPagoFacil.InlineObject](docs/InlineObject.md)
 - [ApiPagoFacil.InlineObject1](docs/InlineObject1.md)
 - [ApiPagoFacil.InlineObject2](docs/InlineObject2.md)
 - [ApiPagoFacil.InlineObject3](docs/InlineObject3.md)
 - [ApiPagoFacil.InlineResponse200](docs/InlineResponse200.md)
 - [ApiPagoFacil.InlineResponse2001](docs/InlineResponse2001.md)
 - [ApiPagoFacil.InlineResponse2001Data](docs/InlineResponse2001Data.md)
 - [ApiPagoFacil.InlineResponse2001DataDocument](docs/InlineResponse2001DataDocument.md)
 - [ApiPagoFacil.InlineResponse2001DataItems](docs/InlineResponse2001DataItems.md)
 - [ApiPagoFacil.InlineResponse2001DataNullifications](docs/InlineResponse2001DataNullifications.md)
 - [ApiPagoFacil.InlineResponse2002](docs/InlineResponse2002.md)
 - [ApiPagoFacil.InlineResponse2002Body](docs/InlineResponse2002Body.md)
 - [ApiPagoFacil.InlineResponse2002BodyData](docs/InlineResponse2002BodyData.md)
 - [ApiPagoFacil.InlineResponse2003](docs/InlineResponse2003.md)
 - [ApiPagoFacil.InlineResponse2003Data](docs/InlineResponse2003Data.md)
 - [ApiPagoFacil.InlineResponse2004](docs/InlineResponse2004.md)
 - [ApiPagoFacil.InlineResponse2004Data](docs/InlineResponse2004Data.md)
 - [ApiPagoFacil.InlineResponse2005](docs/InlineResponse2005.md)
 - [ApiPagoFacil.InlineResponse2005Data](docs/InlineResponse2005Data.md)
 - [ApiPagoFacil.InlineResponse2006](docs/InlineResponse2006.md)
 - [ApiPagoFacil.InlineResponse2006Data](docs/InlineResponse2006Data.md)
 - [ApiPagoFacil.InlineResponse2007](docs/InlineResponse2007.md)
 - [ApiPagoFacil.InlineResponse2008](docs/InlineResponse2008.md)
 - [ApiPagoFacil.InlineResponse2008Types](docs/InlineResponse2008Types.md)
 - [ApiPagoFacil.InlineResponse2009](docs/InlineResponse2009.md)
 - [ApiPagoFacil.InlineResponse200Data](docs/InlineResponse200Data.md)
 - [ApiPagoFacil.InlineResponse201](docs/InlineResponse201.md)
 - [ApiPagoFacil.InlineResponse400](docs/InlineResponse400.md)
 - [ApiPagoFacil.InlineResponse401](docs/InlineResponse401.md)
 - [ApiPagoFacil.InlineResponse4011](docs/InlineResponse4011.md)
 - [ApiPagoFacil.InlineResponse4012](docs/InlineResponse4012.md)
 - [ApiPagoFacil.InlineResponse403](docs/InlineResponse403.md)
 - [ApiPagoFacil.InlineResponse404](docs/InlineResponse404.md)
 - [ApiPagoFacil.InlineResponse409](docs/InlineResponse409.md)
 - [ApiPagoFacil.InlineResponse500](docs/InlineResponse500.md)
 - [ApiPagoFacil.LoginBody](docs/LoginBody.md)
 - [ApiPagoFacil.LoginResponse](docs/LoginResponse.md)
 - [ApiPagoFacil.NullificationStatus](docs/NullificationStatus.md)
 - [ApiPagoFacil.NullificationType](docs/NullificationType.md)
 - [ApiPagoFacil.RemittanceByDate](docs/RemittanceByDate.md)
 - [ApiPagoFacil.Shippment](docs/Shippment.md)
 - [ApiPagoFacil.Status](docs/Status.md)
 - [ApiPagoFacil.XCustomerEmail](docs/XCustomerEmail.md)
 - [ApiPagoFacil.XShopCountry](docs/XShopCountry.md)
 - [ApiPagoFacil.XUrlCallback](docs/XUrlCallback.md)
 - [ApiPagoFacil.XUrlCancel](docs/XUrlCancel.md)
 - [ApiPagoFacil.XUrlComplete](docs/XUrlComplete.md)


## Documentation for Authorization



### JWTToken

- **Type**: Bearer authentication (JWT)



### Token


- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header