Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decidir: Remove pass_cvv_for_nt #5226

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/decidir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def add_network_token(post, payment_method, options)
post[:fraud_detection] ||= {}
post[:fraud_detection][:sent_to_cs] = false
post[:card_data][:last_four_digits] = options[:last_4]
post[:card_data][:security_code] = payment_method.verification_value if payment_method.verification_value? && options[:pass_cvv_for_nt]
post[:card_data][:security_code] = payment_method.verification_value if payment_method.verification_value?

post[:token_card_data] = {
expiration_month: format(payment_method.month, :two_digits),
Expand Down
11 changes: 7 additions & 4 deletions test/remote/gateways/remote_decidir_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ def setup
@network_token = network_tokenization_credit_card(
'4012001037141112',
brand: 'visa',
eci: '05',
payment_cryptogram: '000203016912340000000FA08400317500000000',
name: 'Tesest payway'
eci: '07',
payment_cryptogram: '060103078512340000000FA08400317400000000',
name: 'Tesest payway',
verification_value: '840',
month: '12',
year: '2027'
)

@failed_message = ['PEDIR AUTORIZACION | request_authorization_card', 'COMERCIO INVALIDO | invalid_card']
Expand Down Expand Up @@ -63,7 +66,7 @@ def test_successful_purchase_with_amex
assert response.authorization
end

def test_successful_purchase_with_network_token
def test_successful_purchase_with_network_token_visa
options = {
card_holder_door_number: 1234,
card_holder_birthday: '200988',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/gateways/decidir_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def test_network_token_payment_method
}

response = stub_comms(@gateway_for_auth, :ssl_request) do
@gateway_for_auth.authorize(100, @network_token, options.merge(pass_cvv_for_nt: true))
@gateway_for_auth.authorize(100, @network_token, options)
end.check_request do |_method, _endpoint, data, _headers|
assert_match(/"cryptogram\":\"#{@network_token.payment_cryptogram}\"/, data)
assert_match(/"security_code\":\"#{@network_token.verification_value}\"/, data)
Expand All @@ -432,7 +432,7 @@ def test_network_token_payment_method_without_cvv
card_holder_identification_number: '44444444',
last_4: @credit_card.last_digits
}

@network_token.verification_value = nil
response = stub_comms(@gateway_for_auth, :ssl_request) do
@gateway_for_auth.authorize(100, @network_token, options)
end.check_request do |_method, _endpoint, data, _headers|
Expand Down
Loading