Closed masterofdaemon closed 8 years ago
Don't think that error comes from this module, but rather from Mangopay API. Did you try to reach out to Mangopay?
yes, they tell me, we not support nodejs,i can try do the other way, get transcription of this error from them
here full output(earlier it was from meteor wrapper now more info):
err { [MangoPayError: [object Object]]
name: 'MangoPayError',
message:
{ Message: 'One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.',
Type: 'param_error',
Id: '99b35040-1362-4f36-a3a8-5608264be095#1460123359',
Date: 1460123360,
errors: { Address: 'Error reading string. Unexpected token: StartObject. Path \'Address\', line 1, position 226.' } } }
user { Message: 'One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.',
Type: 'param_error',
Id: '99b35040-1362-4f36-a3a8-5608264be095#1460123359',
Date: 1460123360,
errors: { Address: 'Error reading string. Unexpected token: StartObject. Path \'Address\', line 1, position 226.' } }
res 400
Hi there, I think the error is shown because by default versión 2 of Mangopay API is used, and so Address should be a String and not a JSON object. If you use the 2.01 version, the Address is indeed and object and you can use what you've coded.
You can set what api version to use when declaring your mango object, in my case I've used the following:
var mango = require('mangopay')({ username: 'youruser', password: 'yourpassphrase', version: 'v2.01', production: false });
And it works fine. By the way, you can add users to mangopay but you can't delete them, so use fake info :-D
So I think it's not a bug and maybe the default API version shoud be changed to v2.01
Thanks a lot to this project's developers for this great API for NodeJS.
Hi @n40lab thanks for pitching in! @masterofdaemon does this fix your issue? If so, do you want to write a regression unit test for it for this module (so that it never breaks again)? That'd be great! If you need any directions, let me know.
@n40lab By default, it's indeed set to v2
, but v2.01
has been available for a while the docs. see #69
yes, thanks.
When i creating natural user without address all is fine but if i add it, i get error, here is data:
error: