Sha256: 64b7c1aa03251964a84aa95fc33b549a04f96c38a7f63f1f3584d11721a3bc45

Contents?: true

Size: 1.04 KB

Versions: 104

Compression:

Stored size: 1.04 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

104 entries across 104 versions & 2 rubygems

Version Path
spree_core-3.1.14 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.13 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.12 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.11 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.10 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.9 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.8 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.7 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.6 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.5 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.4 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.3 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.2 app/models/spree/gateway/bogus_simple.rb
spree_core-3.0.10 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.1 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.0 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.0.rc4 app/models/spree/gateway/bogus_simple.rb
spree_core-3.0.9 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.0.rc3 app/models/spree/gateway/bogus_simple.rb
spree_core-3.1.0.rc2 app/models/spree/gateway/bogus_simple.rb