Sha256: 0b3426c7e3dca9548a3121497bcedc893baf73aca24d53270baed49fb917cd1c

Contents?: true

Size: 611 Bytes

Versions: 15

Compression:

Stored size: 611 Bytes

Contents

module Spree
  module ApplePayOrderDecorator
    def confirmation_required?
      return false if paid_with_apple_pay?

      # Little hacky fix for #4117
      # If this wasn't here, order would transition to address state on confirm failure
      # because there would be no valid payments any more.
      Spree::Config[:always_include_confirm_step] ||
        payments.valid.map(&:payment_method).compact.any?(&:payment_profiles_supported?) ||
        confirm?
    end

    def paid_with_apple_pay?
      payments.valid.any?(&:apple_pay?)
    end
  end
end

Spree::Order.prepend Spree::ApplePayOrderDecorator

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spree_gateway-3.9.3 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.9.2 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.9.0 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.8.0 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.5 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.4 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.3 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.2 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.1 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.7.0 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.6.7 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.6.5 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.6.4 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.6.1 app/models/spree/apple_pay_order_decorator.rb
spree_gateway-3.6.0 app/models/spree/apple_pay_order_decorator.rb