@classapp-tech/iugu-node-integration
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@classapp-tech/iugu-node-integration

Installation

Use the package manager node to install.

npm install @classapp-tech/iugu-node-integration

Usage

Initialize the sdk using you API key, previously generated:

import Iugu, { IuguCustomer } from 'iugu-node-sdk'

Iugu.setApiKey('<YOUR API KEY>')

All methods follow the pattern Iugu.{resource}.{method}(model,urlParams)

const client: IuguCustomer = {
    name: 'John Doe',
    email: 'mail@domain.com'
}

const urlParams: Map<string, string> = new Map()
urlParams.set('id', '558958DB714B389EA6B1FF0A33D75505')

// You can use await
const resultClient : IuguCustomer = await Iugu.customers.update(client, urlParams)

// Or you can use .then
Iugu.customers.create(client, urlParams).then((cli: IuguCustomer) => {
    // On success
}).catch((error: Error) => {
    // On error
})

Tests

To run the tests you need to create the file iugu_services.json inside tests folder with the data below:

{
    "accountId": "<SUA ACCOUNT ID>",
    "apiKey": "<API KEY PREFERENCIALMENTE DE TESTES>",
    "clientId": "<UM CLIENT ID VÁLIDO>",
    "paymentMethodToken": "<<UM TOKEN DE FORMA DE PAGAMENTO VÁLIDO>>"
}

To run the tests execute:

npm run test

More info

To find more information about requests and his parameters, access the documentation dev.iugu.com/reference for reference.

Credits

Keywords

iugu

Readme

Keywords

Package Sidebar

Install

npm i @classapp-tech/iugu-node-integration

Weekly Downloads

111

Version

1.0.1

License

BSD-3-Clause

Unpacked Size

76.2 kB

Total Files

54

Last publish

Collaborators

  • jaovito
  • mrspaiva
  • gbferreira
  • sergiodeveloper
  • arturcrs
  • benicio.samuel
  • silvasmvs
  • classapp_edna