Permalink
Browse files

Force CreditCard#to_vaulted_billing in bogus gateway.

This will allow an object other than VaultedBilling::CreditCard to be
used as the credit_card param, similar to Customer.
  • Loading branch information...
1 parent 4525678 commit 6c4fae88b8f8cfa16d063053ae1d9ec834a23d4a @hoverlover hoverlover committed Mar 22, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/vaulted_billing/gateways/bogus.rb
@@ -105,6 +105,8 @@ def new_identifier
end
def transaction_response(credit_card, amount)
+ credit_card = credit_card.to_vaulted_billing if credit_card
+
attributes = { :id => new_identifier }
attributes[:masked_card_number] = "XXXX%04d" % [credit_card ? credit_card.card_number.to_s[-4..-1].to_i : rand(9999)]
success = true

0 comments on commit 6c4fae8

Please sign in to comment.