solidus_paypal_commerce_platform icon indicating copy to clipboard operation
solidus_paypal_commerce_platform copied to clipboard

javascript_sdk_url shipping_preference parameter breaks the PayPal integration

Open RyanofWoods opened this issue 3 years ago • 1 comments

When any of the 3 pages (cart, product and payment) pages go to create the PayPal SDK URL, it will attempt to add the shipping_preference param if the delivery step is not present. However, it seems that PayPal does not accept this parameter, as the request returns a 400 (bad request) and then the integration breaks. (when the param is removed it works as normal.)

https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/blob/19c00c68220fa9b7490dcc6497030809cbbfda03/app/models/solidus_paypal_commerce_platform/payment_method.rb#L77 Screenshot 2021-12-16 at 19 49 31

This parameter is not listed in their current documentation: https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#query-parameters

The only reference I see to it, is here: https://developer.paypal.com/docs/api/payments/v1/?mark=shipping_preference%20

RyanofWoods avatar Dec 16 '21 19:12 RyanofWoods