solidusio / solidusio/solidus_paypal_commerce_platform
Support shipping_preference: GET_FROM_FILE to be able to checkout without address
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 17
- Forks
- 22
- Avg merge
- 57m
- Merged PRs (30d)
- 1
Description
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
- use a user without a former address
- put an item in cart
- go to cart
- click on paypal button
Watch the
- javascript error box "There was a problem connecting with PayPal."
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at app/models/solidus_paypal_commerce_platform/paypal_order.rb around line 108 and reproduce the PayPal flow from the cart with a user who has no address. Review how shipping_preference is selected for existing addresses, missing addresses, and no-shipping orders. Done means checkout can return to the confirm page with PayPal's address, with shipping rates handled or an adapter option available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100