-
Notifications
You must be signed in to change notification settings - Fork 208
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
Concurrency and multi-thread issues #283
Comments
Thanks for posting this. We have multi-tenants and I just found we have that exact code. Thankfully most of our tenants are using other gateways, but this would be a serious problem |
I supposed |
Thank you for this. Major problem for multi-client systems. Not a great look for a leading payment processor 😬 |
You can use controller.Execute(Environment); I.e. pass environment during execution running. |
The MerchantAuthentication approach provided in the documentation is not thread safe and leads to concurrency issues. This has lead to huge consequences and reliability, where we are seeing payments being processed into the wrong merchant account (because the Transaction ID and Key) are being overwritten when multiple threads are accessing this static method at the same time.
I suspect the abstract class with static method approach works for 98% of the public because they are always accessing the same gateway account (Transaction ID and Key). But we have 100's of customers each with their own Transaction ID and Key, processing hundreds of transactions.
I see there is an overload method for each request object which allows us to push the MerchantAuthentication object in. This solves the concurrency issues.
I opened this issue - so that the documentation can be updated to notate, this is NOT THREAD SAFE,
And that the overload constructor for each request (ie: createTransactionRequest) allows to pass the MerchantAuthentication object in real-time, and fix this issue.
I just didn't see any documentation pointing to this issue and want to save other users the headaches this has caused us and our customers.
https://community.developer.authorize.net/t5/Integration-and-Testing/Multi-Tennant-concurrency-issues/td-p/72341
The text was updated successfully, but these errors were encountered: