Skip to content

Commit

Permalink
get rid of CVN number when register a credit card
Browse files Browse the repository at this point in the history
  • Loading branch information
BenZhang committed Jul 25, 2012
1 parent c7d70a6 commit 7a15f2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/active_merchant/billing/gateways/payway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def store(credit_card, options={})
requires!(options, :billing_id)

post = {}
add_payment_method(post, credit_card)
add_payment_method(post, credit_card, true)
add_payment_method(post, options[:billing_id])
commit(:store, post)
end
Expand All @@ -148,11 +148,11 @@ def status(options={})

private

def add_payment_method(post, payment_method)
def add_payment_method(post, payment_method, hide_cvn = false)
if payment_method.respond_to?(:number)
post['card.cardHolderName'] = "#{payment_method.first_name} #{payment_method.last_name}"
post['card.PAN'] = payment_method.number
post['card.CVN'] = payment_method.verification_value
post['card.CVN'] = payment_method.verification_value unless hide_cvn
post['card.expiryYear'] = payment_method.year.to_s[-2,2]
post['card.expiryMonth'] = sprintf('%02d', payment_method.month)
else
Expand Down

0 comments on commit 7a15f2f

Please sign in to comment.