Mangopay / mangopay2-net-sdk

.Net SDK for MANGOPAY
https://www.nuget.org/packages/mangopay2-sdk/
20 stars 22 forks source link

Conflict between prod and sandbox api #229

Open lukaszbajorski-filmbooking opened 3 weeks ago

lukaszbajorski-filmbooking commented 3 weeks ago

Hello folks,

In our use case we need to be able to switch between prod and sandbox mangopay endpoints dynamically, depending on the data in the running system. Unfortunately, it seems there's an underlying conflict making it impossible. Perhaps a state that the SDK keeps that prevents changing Client+ClientPassword+BaseUrl combo on the fly?

Any help or direction will be appreciated.

Cheers, Łukasz

lukaszbajorski-filmbooking commented 3 weeks ago

Hello again,

We've downloaded the source code of the SDK, did some searching and found the issue.

The cause of the problem is usage of singleton RestSharpDto instead of map-per-url.

I can push the code or you can make the changes yourselves, it's not a biggie:

image

Cheers, Ł.

PS - as a side issue, the HTTP response code returned with the erroneous behaviour was 0 and the message null which caused a NPE in the SDK:

image

lukaszbajorski-filmbooking commented 3 weeks ago

PR with the changes: https://github.com/Mangopay/mangopay2-net-sdk/pull/230

lukaszbajorski-filmbooking commented 1 day ago

Hello @iulian03, I've just noticed there's a new 3.19.3 version of the SDK but the error above stops us from migrating to it. Could you include the fix we provided?

iulian03 commented 1 day ago

Hi @lukaszbajorski-filmbooking , We will take a look at this. Thank you for the PR!

lukaszbajorski-filmbooking commented 1 day ago

Thanks @iulian03!