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

different behavior in rails console and server #12

Closed
AlexandreBernard opened this issue Apr 15, 2014 · 6 comments
Closed

different behavior in rails console and server #12

AlexandreBernard opened this issue Apr 15, 2014 · 6 comments

Comments

@AlexandreBernard
Copy link

Investigating an issue this morning. Sorry for still not being able to be precise but what i encounter is really weird.

I have a user model which has a mango_user method which fetches the mango_user with the SDK - version 3.0.9.

calling exactly the same method for exactly the same user raises different things on an http request and with the console.

http request raises a MangoPay::ResponseError with the following properties:

rails console simply works. i'm still investigating but I currently don't understand what's going on

@AlexandreBernard
Copy link
Author

I confirm that I don't understand this bug at all but getting back to 3.0.8 solves it. now i have different issues but with something else that i'm still investigating

@AlexandreBernard
Copy link
Author

actually i'm not so sure. the problem came back on 3.0.8. that seems to be completely random.

@AlexandreBernard
Copy link
Author

now i guess it's a side effect of something in our code as it seems to work. but i don't understand still. consider it's on our side even if reality is: i don't know. closing.

@terry90
Copy link

terry90 commented Oct 5, 2015

I also encounter this issue.
Using Rails 4.2.3, MangoPay gem 3.0.18

I am writing my tests, I stub every request coming from api.sandbox.mangopay.com
I monkey patched MangoPay.request to be sure that my stubbed responses are corrects and there is no difference in the JSON.

When testing legal user creation, MangoPay sdk throw me exactly the same error.

Have you found a solution ?

Edit: your issue being old, I'll open a new one

@itkin
Copy link

itkin commented May 20, 2016

+1 rails vcr, got this exception a bit randomly when fetching data using MangoPay::LegalUser.fetch for example, i guess it has something to do with the oauth access token, but doesn't the ruby sdk gem handle to get a new token seemlessly ?

update : in my case this behavior seems to be caused by an old oauth token stored in the vcr cassette ; when a new query is necessary because the test has changed, this invalid token is used causing an API auth failure. Solution is just to remove the oauth query in the vcr cassette when in order to force getting a new one, when needed.

@iammichiel
Copy link

When using the php-sdk, this is caused by an old file in the "temp" folder of the MangopaySDK. You might want to clear it if you switch environments on the same machine.

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

4 participants