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

Changing order to "Complete" from admin dashboard does not trigger Order#enable_subscription #48

Open
femmestem opened this issue Jan 2, 2017 · 4 comments

Comments

@femmestem
Copy link

If subscription order is initiated by customer on the front-end using manual payment or Spree::BogusGateway, and admin approves payment from the admin dashboard then the Order state is changed to "Complete" but subscription is not updated.

If Admin panel is changing order to "Complete" through ActiveRecord callbacks then State Machine is not invoked, so below is never triggered:

self.state_machine.after_transition to: :complete, do: :enable_subscriptions, if: :any_disabled_subscription?

See similar issue: https://stackoverflow.com/questions/22622254/spreeshipment-state-machine

@nishant-cyro
Copy link

@femmestem - Able to replicate the issue. Will fix them and let you know.

@AhmedAliIbrahim
Copy link

i think it doesn't trigger Order#enable_subscription on both admin and normal user !!
@nishant-cyro is there an estimate for the time you expect to solve it ?!

@femmestem
Copy link
Author

@AhmedAliIbrahim When I place an order that is processed successfully, then it creates a subscription for me. However, if there's ANY error in the order process -- even if the error is in the subscription mail notification -- then subscription is not created. The issue is that Order#enable_subscription is only triggered by state_machine. Any operation for creating an order that doesn't invoke state_machine won't trigger Order#enable_subscription.

@nishant-cyro
Copy link

@AhmedAliIbrahim - Will fix it by EOW.

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

3 participants