diff options
author | Joel Jackson <jackson.joel@gmail.com> | 2017-06-08 23:39:56 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2017-07-24 10:36:08 -0700 |
commit | 814a1bed9496ac05f6eb280843b530b1e15e3b91 (patch) | |
tree | 7053e42467e1189d15b7f3931dae0a56e8b6f732 /app/models/solidus_subscriptions | |
parent | b1903f746e6879acb804dece1dfe729f0aa4042d (diff) |
Allows for subscription chekout to accommodate a more flexible checkout flow.
Diffstat (limited to 'app/models/solidus_subscriptions')
-rw-r--r-- | app/models/solidus_subscriptions/checkout.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/app/models/solidus_subscriptions/checkout.rb b/app/models/solidus_subscriptions/checkout.rb index 22882b7..e5f634c 100644 --- a/app/models/solidus_subscriptions/checkout.rb +++ b/app/models/solidus_subscriptions/checkout.rb @@ -68,14 +68,11 @@ module SolidusSubscriptions order.update! apply_promotions - order.next! # cart => address - - order.ship_address = ship_address - order.next! # address => delivery - order.next! # delivery => payment - - create_payment - order.next! # payment => confirm + order.checkout_steps[0...-1].each do |step| + order.ship_address = ship_address if order.state == :address + create_payment if order.state == :payment + order.next! + end # Do this as a separate "quiet" transition so that it returns true or # false rather than raising a failed transition error |