diff --git a/core/app/models/spree/gateway/bogus_simple.rb b/core/app/models/spree/gateway/bogus_simple.rb index 8b0757b220a..8a32bf384e8 100644 --- a/core/app/models/spree/gateway/bogus_simple.rb +++ b/core/app/models/spree/gateway/bogus_simple.rb @@ -6,6 +6,14 @@ def payment_profiles_supported? false end + def capture(money, response_code, options = {}) + if response_code == '12345' + ActiveMerchant::Billing::Response.new(true, 'Bogus Gateway: Forced success', {}, :test => true, :authorization => '67890') + else + ActiveMerchant::Billing::Response.new(false, 'Bogus Gateway: Forced failure', :error => 'Bogus Gateway: Forced failure', :test => true) + end + 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' })