https://github.com/log-oscon/node-comprafacil
CompraFácil payment gateway wrapper
https://github.com/log-oscon/node-comprafacil
Last synced: over 1 year ago
JSON representation
CompraFácil payment gateway wrapper
- Host: GitHub
- URL: https://github.com/log-oscon/node-comprafacil
- Owner: log-oscon
- Created: 2015-06-30T14:50:55.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-07-20T13:06:08.000Z (about 6 years ago)
- Last Synced: 2025-04-01T16:42:59.701Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 11
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CompraFácil [](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