# comprafacil

> CompraFácil payment gateway wrapper

Latest version **1.1.1** (published 2015-07-28) · GPL-2.0+ license · 0 weekly downloads

## Install

```sh
npm install comprafacil
pnpm add comprafacil
yarn add comprafacil
bun add comprafacil
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-07-28 |
| First published | 2015-07-14 |
| Weekly downloads | 0 |
| License | GPL-2.0+ |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | log-oscon, s3rgiosan |
| Keywords | comprafacil, hipay, wrapper, api, payment, gateway |

## Links

- npm: https://www.npmjs.com/package/comprafacil
- Repository: https://github.com/log-oscon/node-comprafacil
- Issues: https://github.com/log-oscon/node-comprafacil/issues
- npm.io page: https://npm.io/package/comprafacil

## Dependencies (3)

- [soap](https://npm.io/package/soap.md) ^0.9.1
- [lodash](https://npm.io/package/lodash.md) ^3.9.3
- [compress](https://npm.io/package/compress.md) ^0.99.0

## Recent versions

- 1.1.1 (latest) — 2015-07-28
- 1.1.0 — 2015-07-24
- 1.0.0 — 2015-07-14

## README

# CompraFácil [![Build Status](https://travis-ci.org/log-oscon/node-comprafacil.svg)](https://travis-ci.org/log-oscon/node-comprafacil)

> CompraFácil payment gateway wrapper.

A JavaScript wrapper for interacting with the CompraFácil SOAP webservices.


## Install

```sh
$ npm install --save comprafacil
```


## Usage

### Create SOAP client

```js
var comprafacil = require('comprafacil');

var options = {
    wsdl:   'http://example.com/webservice?WSDL',
    onDone: function() {},
    onFail: function() {}
};

compraFacil.init(options);

```


### Get information about references

```js
var options = {
    username:     'foo',
    password:     'bar',
    dateStartStr: 'dd-MM-yyyy hh:mm:ss',
    dataEndStr:   'dd-MM-yyyy hh:mm:ss',
    type:         'R',
    onDone:       function() {},
    onFail:       function() {}
};

compraFacil.getInfo(client, options);

```


### Get information about a reference

```js
var options = {
    username:     'foo',
    password:     'bar',
    reference:    '000 000 000',
    onDone:       function() {},
    onFail:       function() {}
};

compraFacil.getInfoReference(client, options);

```


### Get a new MULTIBANCO reference

```js
var options = {
    username: 'foo',
    password: 'bar',
    amount:   1,
    email:    'user@example.com',
    onDone:   function() {},
    onFail:   function() {}
};

compraFacil.getReferenceMB(client, options);

```


### Get a new MULTIBANCO reference specifying a product

```js
var options = {
    username:  'foo',
    password:  'bar',
    productID: 0,
    quantity:  1,
    email:     'user@example.com',
    onDone:    function() {},
    onFail:    function() {}
};

compraFacil.getReferenceMB2(client, options);

```


### Get a new PayShop reference

```js
var options = {
    username: 'foo',
    password: 'bar',
    amount:   1,
    email:    'user@example.com',
    onDone:   function() {},
    onFail:   function() {}
};

compraFacil.getReferencePS(client, options);

```


### Get a new PayShop reference specifying a product

```js
var options = {
    username:  'foo',
    password:  'bar',
    productID: 0,
    quantity:  1,
    email:     'user@example.com',
    onDone:    function() {},
    onFail:    function() {}
};

compraFacil.getReferencePS2(client, options);

```


## Tests

```sh
$ npm run test
```


## Changelog

### 1.1.0

* Bug fixing and code review

### 1.0.0

* Stable release


## License

MIT

---
_Source: https://npm.io/package/comprafacil · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
