Problem/Motivation
Currently, the CheckoutSdkFactory uses the @http_handler_stack service and therefore adds middlewares to the global Handler Stack service.
This is problematic and should be changed to instantiate the new one, like so:
use GuzzleHttp\HandlerStack;
$stack = HandlerStack::create();
This could potentially cause issues with Commerce USPS or Commerce UPS: See #3571397: Incompatible with commerce_ups 4.x, #3571295: Multiple shipping method with different credentials or even #3571396: Incompatible with commerce_usps 2.x.
In order to avoid conflicts, instantiating a dedicated handler stack seems to make more sense. The only drawback is by not using the service, anyone decorating it or swapping it won't see its overrides taken into account. But I believe this is relatively edge case we can safely ignore.
Issue fork commerce_paypal-3571669
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
tbkot commentedComment #6
jsacksick commentedMerged, thanks!