Skip to content
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

Support shipping_preference: GET_FROM_FILE to be able to checkout without address #201

Open
hefan opened this issue Jul 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hefan
Copy link

hefan commented Jul 13, 2023

if a user wants to do a paypal guided checkout from address or cart it is not possible. Paypal returns a 422 Error "The shipping address is required when shipping_preference=SET_PROVIDED_ADDRESS.
It would be only possible if the shop doesn't require any shipping step at all.

Solidus Version:
Solidus 3.4.3

To Reproduce

  • Just install Solidus 3.4.3 with solidus paypal commerce platform.
  • Configure a paypal sandbox account and fill in the sandbox credentials in the payment method.
  • Check "Display on Cart"

it doesnt matter if you use the solidus_starter_frontend or solidus_frontend.

In Solidus Frontend

  1. use a user without a former address
  2. put an item in cart
  3. go to cart
  4. click on paypal button

Watch the

  1. javascript error box "There was a problem connecting with PayPal."
  2. Error from Paypal in Log 'The shipping address is required when `shipping_preference=SET_PROVIDED_ADDRESS'

Current behavior
You are not able to use the paypal Checkout. You need an Adress.
'shipping_preference=SET_PROVIDED_ADDRESS' needs an address.
'shipping_preference=NO_SHIPPING' is no working solution if you have shipment.

These are seemingly the only possibilities given here
https://github.com/solidusio/solidus_paypal_commerce_platform/blob/master/app/models/solidus_paypal_commerce_platform/paypal_order.rb#L108

Expected behavior
You should be able to do the Paypal checkout and return on the confirm page with the provided address from paypal.
If you have to apply shipping rates, they should be added automatically or you should have the possibility to write an adapter which sets the shipping method.

Proposal
You can use the 'shipping_preference=GET_FROM_FILE'
see here
https://www.paypal-community.com/t5/REST-APIs/order-created-with-SET-PROVIDED-ADDRESS-canno-t-patch-without-a/td-p/3034696
which would not need an address.

The Logic for the shipping_preference should be more complex and consider an already entered user address, no address, and also no shipping. it may also alter the setting based on if paypal is used from product screen, cart screen or payment screen.
https://github.com/solidusio/solidus_paypal_commerce_platform/blob/master/app/models/solidus_paypal_commerce_platform/paypal_order.rb#L108

Desktop (please complete the following information):

  • OS: Ubuntu 2204
  • Browser Firefox
  • Version 114.0

Additional context
configured paypal sandbox account

@hefan hefan added the bug Something isn't working label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant