Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Restart checkout when cart Paypal button is used #144

Merged
merged 2 commits into from
Jun 8, 2018

Conversation

alepore
Copy link
Contributor

@alepore alepore commented Dec 6, 2017

The problem:
We have two different Paypal flows here: the express checkout from the cart (address comes from Paypal) and the normal Solidus checkout (address comes from Solidus).

If an user starts the express checkout, and then comes back to the cart (from the confirm page) and restarts it with a different address, we currently don't recalculate all the address-dependent order stuff, thus we can end up with wrong taxes and shipping methods.

This is a quick solution for that: the cart button sends a special param to the Solidus controller that restarts the checkout flow.
The normal checkout flow is unaltered.

Comments or better solutions are welcome :)

This allows to pass arbitrary parameters from a Paypal button to the Solidus
controller.
Every time an express Paypal checkout is initiated from the cart we must reset
the checkout flow.
This is needed because the checkout may be in any state and the newly started
Paypal checkout may send us a new, different address, thus we must recalculate
all the things (taxes, shipping methods etc).
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@alepore
Copy link
Contributor Author

alepore commented Dec 18, 2017

@luukveenis @adammathys what do you think about this? :)

@tvdeyen tvdeyen requested a review from adammathys January 2, 2018 10:51
@adammathys adammathys merged commit 03b4fe9 into solidusio:master Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants