Skip to content

Commit

Permalink
TransFirstTransactionExpress: Take into account blank string CVV
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsantoso committed Oct 11, 2016
1 parent b86ce9a commit a461d17
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* Redsys: Added DOP and CRC currency [davidsantoso]
* TransFirsTransactionExpress: Remove blank cvv element [davidsantoso]
* PayU Latam: Update supported countries list [shasum]
* TransFirsTransactionExpress: Take into account blank string CVV [davidsantoso]

== Version 1.60.0 (July 4, 2016)
* Orbital: Fix CC num leak on profile calls [drewblas]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def add_order_number(doc, options)
def add_payment_method(doc, payment_method)
doc["v1"].card {
doc["v1"].pan payment_method.number
doc["v1"].sec payment_method.verification_value if payment_method.verification_value
doc["v1"].sec payment_method.verification_value if payment_method.verification_value?
doc["v1"].xprDt expiration_date(payment_method)
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ def test_successful_purchase_without_cvv
assert_equal "Succeeded", response.message
end

def test_successful_purchase_with_empty_string_cvv
credit_card_opts = {
:number => 4485896261017708,
:month => Date.new((Time.now.year + 1), 9, 30).month,
:year => Date.new((Time.now.year + 1), 9, 30).year,
:first_name => 'Longbob',
:last_name => 'Longsen',
:verification_value => '',
:brand => 'visa'
}

credit_card = CreditCard.new(credit_card_opts)
response = @gateway.purchase(@amount, credit_card, @options)
assert_success response
assert_equal "Succeeded", response.message
end

def test_partial_purchase
response = @gateway.purchase(@partial_amount, @credit_card, @options)
assert_success response
Expand Down

0 comments on commit a461d17

Please sign in to comment.