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

Shipment tax adjustments not created when using Paypal Express #219

Open
mdavo6 opened this issue Sep 4, 2020 · 0 comments
Open

Shipment tax adjustments not created when using Paypal Express #219

mdavo6 opened this issue Sep 4, 2020 · 0 comments

Comments

@mdavo6
Copy link
Contributor

mdavo6 commented Sep 4, 2020

When using Paypal Express our checkout flow skips the payment step. For example our checkout flow is:

  1. Address
  2. Delivery
  3. Confirm
  4. Complete

In Spree's checkout.rb model, "create_tax_charge!" is called when an order progresses through the payment step, however in our case (and I assume most use cases for Paypal Express) this is never called due to the lack of a payment step. This leads to tax adjustments on shipping not being calculated.

To resolve I have added the following line to an order_decorator to ensure create_tax_charge! is called:
state_machine.before_transition to: :confirm, from: :delivery, do: :create_tax_charge!
I have added the call between the delivery and before the confirm to ensure it is only called when a checkout skips the payment step, however perhaps there may be another better time to call it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant