Sha256: 9e13862434b0f74d1f26d33ef0226f78f21bbf1a5d83b992e8441b06a500d4d0

Contents?: true

Size: 631 Bytes

Versions: 5

Compression:

Stored size: 631 Bytes

Contents

module SpreeGateway
  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(::SpreeGateway::ApplePayOrderDecorator)

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
spree_gateway-3.11.0 app/models/spree_gateway/apple_pay_order_decorator.rb
spree_gateway-3.10.0 app/models/spree_gateway/apple_pay_order_decorator.rb
archetype_spree_gateway-3.9.5.1 app/models/spree_gateway/apple_pay_order_decorator.rb
archetype_spree_gateway-3.9.5 app/models/spree_gateway/apple_pay_order_decorator.rb
spree_gateway-3.9.4 app/models/spree_gateway/apple_pay_order_decorator.rb