Sha256: a7ab17f48a7a47c64858dda1e3cc360110027dc3636c4782eb6884571b783447

Contents?: true

Size: 487 Bytes

Versions: 100

Compression:

Stored size: 487 Bytes

Contents

module Spree
  module Checkout
    class Complete
      prepend Spree::ServiceModule::Base

      def call(order:)
        Spree::Dependencies.checkout_next_service.constantize.call(order: order) until cannot_make_transition?(order)

        if order.reload.complete?
          success(order)
        else
          failure(order)
        end
      end

      private

      def cannot_make_transition?(order)
        order.complete? || order.errors.present?
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
spree_core-4.10.1 app/services/spree/checkout/complete.rb
spree_core-4.10.0 app/services/spree/checkout/complete.rb
spree_core-4.9.0 app/services/spree/checkout/complete.rb
spree_core-4.8.3 app/services/spree/checkout/complete.rb
spree_core-4.8.2 app/services/spree/checkout/complete.rb
spree_core-4.7.3 app/services/spree/checkout/complete.rb
spree_core-4.6.6 app/services/spree/checkout/complete.rb
spree_core-4.5.5 app/services/spree/checkout/complete.rb
spree_core-4.0.9 app/services/spree/checkout/complete.rb
spree_core-4.1.15 app/services/spree/checkout/complete.rb
spree_core-4.2.7 app/services/spree/checkout/complete.rb
spree_core-4.3.3 app/services/spree/checkout/complete.rb
spree_core-4.4.1 app/services/spree/checkout/complete.rb
spree_core-4.5.4 app/services/spree/checkout/complete.rb
spree_core-4.6.5 app/services/spree/checkout/complete.rb
spree_core-4.7.2 app/services/spree/checkout/complete.rb
spree_core-4.7.1 app/services/spree/checkout/complete.rb
spree_core-4.6.4 app/services/spree/checkout/complete.rb
spree_core-4.7.0 app/services/spree/checkout/complete.rb
spree_core-4.6.3 app/services/spree/checkout/complete.rb