wirecardBrasil/moip-sdk-node

Get Balance doesnt work.

Closed this issue · 1 comments

The SDK is broken for moip.balance.getOne() method.

The error is:

 name: 'StatusCodeError',
  statusCode: 401,
  message: '401 - {"ERROR":"Token or Key are invalids"}',
  error: { ERROR: 'Token or Key are invalids' },
  options:
   { url: 'https://api.moip.com.br/v2/balances',
     headers:
      { Authorization: 'OAuth ---_v2',
        'User-Agent': 'MoipNodeSDK/1.2.3 (+https://github.com/moip/moip-sdk-nod
e/)' },
     method: 'GET',
     json: true,

This is the Header on the request:

_header: 'GET /v2/balances HTTP/1.1\r\nAuthorization: OAuth 15d1aadcec0
64b95bb744082a74ed204_v2\r\nUser-Agent: MoipNodeSDK/1.2.3 (+https://github.com/
moip/moip-sdk-node/)\r\nhost: api.moip.com.br\r\naccept: application/json\r\nCo
nnection: close\r\n\r\n',

This is the API Reference for the Balance endpoint (currently on version 2.1):
https://dev.wirecard.com.br/v2.0/reference#saldo-moip-1

Accept
string
REQUIRED
application/json;version=2.1

Delete this please.