diff options
author | Alessandro Desantis <desa.alessandro@gmail.com> | 2020-11-27 17:55:00 +0100 |
---|---|---|
committer | Alessandro Desantis <desa.alessandro@gmail.com> | 2021-01-30 15:23:41 +0100 |
commit | 784c1f07c61964c1a05549bffb0a709763bcf2d6 (patch) | |
tree | b0f8523e29ef717d36c8ec338cfda11dbc091cf8 /app/services/solidus_subscriptions/checkout.rb | |
parent | 2836765c00abc1ba76793ad88c07a3d89a44d672 (diff) |
Pass one installment at a time to dispatcher classes
Diffstat (limited to 'app/services/solidus_subscriptions/checkout.rb')
-rw-r--r-- | app/services/solidus_subscriptions/checkout.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/solidus_subscriptions/checkout.rb b/app/services/solidus_subscriptions/checkout.rb index e348547..83fc35c 100644 --- a/app/services/solidus_subscriptions/checkout.rb +++ b/app/services/solidus_subscriptions/checkout.rb @@ -15,15 +15,15 @@ module SolidusSubscriptions populate_order(order) finalize_order(order) - SolidusSubscriptions.configuration.success_dispatcher_class.new([installment], order).dispatch + SolidusSubscriptions.configuration.success_dispatcher_class.new(installment, order).dispatch rescue StateMachines::InvalidTransition if order.payments.any?(&:failed?) - SolidusSubscriptions.configuration.payment_failed_dispatcher_class.new([installment], order).dispatch + SolidusSubscriptions.configuration.payment_failed_dispatcher_class.new(installment, order).dispatch else - SolidusSubscriptions.configuration.failure_dispatcher_class.new([installment], order).dispatch + SolidusSubscriptions.configuration.failure_dispatcher_class.new(installment, order).dispatch end rescue ::Spree::Order::InsufficientStock - SolidusSubscriptions.configuration.out_of_stock_dispatcher_class.new([installment], order).dispatch + SolidusSubscriptions.configuration.out_of_stock_dispatcher_class.new(installment, order).dispatch end order |