diff --git a/.travis.yml b/.travis.yml index 4edd5785..b67e22ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,14 @@ language: ruby addons: chrome: stable + postgresql: 9.4 env: - DB=postgres - DB=mysql gemfile: - - gemfiles/spree_3_2.gemfile + # - gemfiles/spree_3_2.gemfile - gemfiles/spree_3_5.gemfile - gemfiles/spree_3_7.gemfile - gemfiles/spree_master.gemfile @@ -27,12 +28,16 @@ rvm: matrix: allow_failures: - - gemfile: gemfiles/spree_master.gemfile + - gemfile: gemfiles/spree_master.gemfile exclude: - - rvm: 2.3.7 - gemfile: gemfiles/spree_master.gemfile - - rvm: 2.4.4 - gemfile: gemfiles/spree_master.gemfile + - rvm: 2.3.7 + gemfile: gemfiles/spree_master.gemfile + - rvm: 2.4.4 + gemfile: gemfiles/spree_master.gemfile + - rvm: 2.5.1 + gemfile: gemfiles/spree_3_2.gemfile + - rvm: 2.4.4 + gemfile: gemfiles/spree_3_2.gemfile before_install: - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';" diff --git a/Appraisals b/Appraisals index 04489688..10dfb36d 100644 --- a/Appraisals +++ b/Appraisals @@ -10,6 +10,7 @@ end appraise 'spree-3-7' do gem 'spree', '~> 3.7.0' + gem 'sass-rails' gem 'rails-controller-testing' end diff --git a/app/models/spree/apple_pay_order_decorator.rb b/app/models/spree/apple_pay_order_decorator.rb new file mode 100644 index 00000000..2e428e27 --- /dev/null +++ b/app/models/spree/apple_pay_order_decorator.rb @@ -0,0 +1,20 @@ +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 \ No newline at end of file diff --git a/app/models/spree/payment_decorator.rb b/app/models/spree/apple_pay_payment_decorator.rb similarity index 62% rename from app/models/spree/payment_decorator.rb rename to app/models/spree/apple_pay_payment_decorator.rb index fa59a381..6eb456ed 100644 --- a/app/models/spree/payment_decorator.rb +++ b/app/models/spree/apple_pay_payment_decorator.rb @@ -1,4 +1,4 @@ -module SpreeGateway +module Spree module ApplePayPaymentDecorator def apple_pay? payment_method.is_a? Spree::Gateway::StripeApplePayGateway @@ -6,4 +6,4 @@ def apple_pay? end end -Spree::Payment.prepend SpreeGateway::ApplePayPaymentDecorator +Spree::Payment.prepend Spree::ApplePayPaymentDecorator diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb deleted file mode 100644 index 9e475211..00000000 --- a/app/models/spree/order_decorator.rb +++ /dev/null @@ -1,16 +0,0 @@ -Spree::Order.class_eval do - def confirmation_required? - return false if paid_with_apple_pay? - - Spree::Config[:always_include_confirm_step] || - payments.valid.map(&:payment_method).compact.any?(&:payment_profiles_supported?) || - # 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. - confirm? - end - - def paid_with_apple_pay? - payments.valid.any?(&:apple_pay?) - end -end diff --git a/gemfiles/spree_3_7.gemfile b/gemfiles/spree_3_7.gemfile index 85581154..d1a87a04 100644 --- a/gemfiles/spree_3_7.gemfile +++ b/gemfiles/spree_3_7.gemfile @@ -4,5 +4,6 @@ source "https://rubygems.org" gem "rails-controller-testing" gem "spree", "~> 3.7.0" +gem "sass-rails" gemspec path: "../"