Skip to content

Commit

Permalink
Elavon: Update sending CVV for MIT transactions
Browse files Browse the repository at this point in the history
CVV should be sent for all transactions if present.

Remote
40 tests, 178 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
95% passed
  • Loading branch information
Alma Malambo committed Aug 14, 2024
1 parent 2de6a31 commit 70e9830
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* FlexCharge: add more descriptives error messages [gasb150] #5199
* Braintree: Updates to Paypal Integration [almalee24] #5190
* CommerceHub: Update test url [DustinHaefele] #5211
* Elavon: Update sending CVV for MIT transactions [almalee24] #5210

== Version 1.137.0 (August 2, 2024)
* Unlock dependency on `rexml` to allow fixing a CVE (#5181).
Expand Down
2 changes: 0 additions & 2 deletions lib/active_merchant/billing/gateways/elavon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ def add_currency(xml, money, options)

def add_verification_value(xml, credit_card, options)
return unless credit_card.verification_value?
# Don't add cvv if this is a non-initial stored credential transaction
return if options[:stored_credential] && !options.dig(:stored_credential, :initial_transaction) && options[:stored_cred_v2]

xml.ssl_cvv2cvc2 credit_card.verification_value
xml.ssl_cvv2cvc2_indicator 1
Expand Down
6 changes: 3 additions & 3 deletions test/unit/gateways/elavon_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def test_stored_credential_pass_in_recurring_request
assert_match(/<ssl_approval_code>1234566<\/ssl_approval_code>/, data)
assert_match(/<ssl_recurring_flag>1<\/ssl_recurring_flag>/, data)
refute_match(/<ssl_entry_mode/, data)
refute_match(/<ssl_cvv2cvc2/, data)
assert_match(/<ssl_cvv2cvc2/, data)
end.respond_with(successful_purchase_response)
end

Expand All @@ -475,7 +475,7 @@ def test_stored_credential_pass_in_installment_request
assert_match(/<ssl_payment_number>2<\/ssl_payment_number>/, data)
assert_match(/<ssl_payment_count>4<\/ssl_payment_count>/, data)
refute_match(/<ssl_entry_mode/, data)
refute_match(/<ssl_cvv2cvc2/, data)
assert_match(/<ssl_cvv2cvc2/, data)
end.respond_with(successful_purchase_response)
end

Expand All @@ -502,7 +502,7 @@ def test_stored_credential_pass_in_unscheduled_with_additional_data_request
assert_match(/<ssl_entry_mode>12<\/ssl_entry_mode>/, data)
assert_match(/<ssl_par_value>1234567890<\/ssl_par_value>/, data)
assert_match(/<ssl_association_token_data>1<\/ssl_association_token_data>/, data)
refute_match(/<ssl_cvv2cvc2/, data)
assert_match(/<ssl_cvv2cvc2/, data)
end.respond_with(successful_purchase_response)
end

Expand Down

0 comments on commit 70e9830

Please sign in to comment.