Closed (fixed)
Project:
Commerce Datatrans
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
28 Sep 2020 at 08:21 UTC
Updated:
18 Dec 2020 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirComment #3
berdirHere's a patch, seems to be working for me.
I did add a setting for the password, that is mandatory for this, the URL for now I just adapt from the default URL. That is a bit ugly, but should work for now. Also corrected the default configuration to the use the format.
This is the new API while the rest of the module still works with the old API. I think in light of the issues with session cookies and so on, it would be better to rewrite the module to use the new API only. That will likely require a completely new approach to settings anyway, most won't be needed anymore and I think I will then just use the test/live setting and hardcode the actual URL's, they are unlikely to change I assume.
But for now, it should work, I verified with the Datatrans team that it is OK to use to mix the two API's, but of course they recommend to only use the new API.
Comment #4
tcrawford commented@Berdir Thanks. This looks good to me. What was the reason for not allowing redirects by the guzzle client? In testing I found that some of the older Datatrans urls redirect to newer urls.
Comment #5
berdirWe're doing POST requests, redirects on POST result in losing the body which can be very confusing and hard to debug. I usually add the no redirect argument whenever I'm doing POST requests on an API.
Comment #6
berdirCommitted.