khipu-got
v1.0.0
Published
Convenience wrapper for `got` to interact with the Khipu API
Downloads
24
Readme
khipu-got
Install
$ npm install --save khipu-got
Usage
const khipuGot = require('khipu-got');
khipuGot('banks', {method: 'GET'}).then(res => {
console.log(res.body.banks);
});
Or:
const khipuGot = require('khipu-got');
khipuGot('https://khipu.com/api/2.0/banks', {method: 'GET'}).then(res => {
console.log(res.body.banks);
});
Khipu Credentials
Must be set as environment variables
KHIPU_RECEIVER_ID
Type: number
KHIPU_SECRET
Type: string
API
Same as got
, but with some additional options:
endpoint
Type: string
Default: https://khipu.com/api/2.0/
To support and reference Khipu developers.
Can be set globally with the KHIPU_ENDPOINT
environment variable.
method
Type: string
Must be specified in a mandatorily. Required to generate the signature submitted to the Khipu API.
body
Type: Object
Should be specified as a plain object.
License
MIT © Hugo Sáez