PayPalPlugin icon indicating copy to clipboard operation
PayPalPlugin copied to clipboard

PayPayClient shouldn't be using channelContext under the hood

Open diimpp opened this issue 5 years ago • 1 comments

https://github.com/Sylius/PayPalPlugin/blob/c1c5d4586c3e792d0e062f672b830840583018a1/src/Client/PayPalClient.php#L118

channelContext makes Client stateful and denies ability to select right Partner-Attribution-Id.

Additionally Partner-Attribution-Id seems optional, but asserted as required at Provider/PayPalConfigurationProvider->getPartnerAttributionId image

Logic for getting GatewayConfig at Provider/PayPalConfigurationProvider doesn't look production ready as well.

diimpp avatar Oct 16 '20 23:10 diimpp

Hi Dmitri! Thank you for your issues, they're very helpful :)

Regarding the usage of the channel context - yes, it makes the client stateful, but in the first version of the plugin, we decide to simplify some configuration and support only one PayPal payment method. I agree it's limiting, but thanks to the proper separation of responsibilities (e.g. PayPalConfigurationProvider service) is should be quite easy to customize this behaviour. And definitely, we will want to make it the proper way as fast as possible.

Nonetheless, Partner-Attribution-Id is always provided by our facilitator app, so it will always by the same 🖖

PayPal-Partner-Attribution-Id in theory is not required, but PayPal required it anyway during the acceptation process of the integration 💃

Zales0123 avatar Oct 19 '20 08:10 Zales0123