Sha256: 150620f5f6be7d3d3442a811f40457be87542a783c0e926e165a4acd35bc4707

Contents?: true

Size: 1 KB

Versions: 122

Compression:

Stored size: 1 KB

Contents

# Bogus Gateway that doesn't support payment profiles
module Spree
  class Gateway::BogusSimple < Gateway::Bogus
    def payment_profiles_supported?
      false
    end

    def authorize(_money, credit_card, _options = {})
      if VALID_CCS.include? credit_card.number
        ActiveMerchant::Billing::Response.new(true, 'Bogus Gateway: Forced success', {}, test: true, authorization: '12345', avs_result: { code: 'A' })
      else
        ActiveMerchant::Billing::Response.new(false, 'Bogus Gateway: Forced failure', { message: 'Bogus Gateway: Forced failure' }, test: true)
      end
    end

    def purchase(_money, credit_card, _options = {})
      if VALID_CCS.include? credit_card.number
        ActiveMerchant::Billing::Response.new(true, 'Bogus Gateway: Forced success', {}, test: true, authorization: '12345', avs_result: { code: 'A' })
      else
        ActiveMerchant::Billing::Response.new(false, 'Bogus Gateway: Forced failure', message: 'Bogus Gateway: Forced failure', test: true)
      end
    end
  end
end

Version data entries

122 entries across 122 versions & 1 rubygems

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