Skip to content

Commit

Permalink
Add process method to BogusSimple gateway to be able to process payme…
Browse files Browse the repository at this point in the history
…nts.

Fixes issue where hitting "process" on payments screen breaks with
BogusSimple gateway.
  • Loading branch information
heisenbugged authored and radar committed Oct 8, 2013
1 parent d119d73 commit 7dc9164
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/app/models/spree/gateway/bogus_simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down

0 comments on commit 7dc9164

Please sign in to comment.