Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erro ao incluir cliente #19

Open
nelsonec87 opened this issue Apr 14, 2017 · 1 comment
Open

erro ao incluir cliente #19

nelsonec87 opened this issue Apr 14, 2017 · 1 comment

Comments

@nelsonec87
Copy link

Se eu fizer o POST manualmente ele grava normalmente (com o mesmo JSON), mas pela lib, se eu fizer:

iugu.customers.create({
     "name": "nome teste",
     "email": "[email protected]",
     "custom_variables": [{ "name": "meu_param", "value": "teste" }]
}, function (err, cli) {
     console.log(err, cli);
});

recebo "Invalid JSON" como erro, e uma pagina html..

{ message: 'Invalid JSON received from the Iugu API',
     response: '<!doctype html>\n<html>\n  <head>\n    <meta charset="utf-8">\n    <title>algo
está errado...</title>\n\n    <meta name="viewport" content="width=device-width, initial-scale=
1, maximum-scale=1" />\n    <meta name="apple-mobile-web-app-capable" content="yes" />\n    <me
ta name="apple-mobile-web-status-bar-style" content="yes" />\n    <meta http-equiv="cleartype"
content="on" />\n    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />\n    <met
a name="MobileOptmized" content="320" />\n    \n    <link rel...............

(Só testei no ambiente de teste)

@phrsouza
Copy link

phrsouza commented May 11, 2017

@nelsonec87 Acredito que seja um erro relacionado ao relatado no #8.
O jeito é realizar a chamada do iugu sem utilizar a biblioteca do iugu-node.
Para facilitar eu recomendo o uso do request ou request-promise para realizar as chamadas no iugu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants