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

Moneris: Update crypt_type for 3DS #5162

Merged
merged 1 commit into from
Jul 17, 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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Add Maestro card bins [yunnydang] #5172
* Braintree: Remove stored credential v1 [almalee24] #5175
* Braintree Blue: Pass overridden mid into client token for GS 3DS [sinourain] #5166
* Moneris: Update crypt_type for 3DS [almalee24] #5162

== Version 1.136.0 (June 3, 2024)
* Shift4V2: Add new gateway based on SecurionPay adapter [heavyblade] #4860
Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/moneris.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def add_external_mpi_fields(post, options)
three_d_secure_options = options[:three_d_secure]

post[:threeds_version] = three_d_secure_options[:version]
post[:crypt_type] = three_d_secure_options[:eci]
post[:crypt_type] = three_d_secure_options.dig(:eci)&.to_s&.sub!(/^0/, '')
post[:cavv] = three_d_secure_options[:cavv]
post[:threeds_server_trans_id] = three_d_secure_options[:three_ds_server_trans_id]
post[:ds_trans_id] = three_d_secure_options[:ds_transaction_id]
Expand Down
3 changes: 2 additions & 1 deletion test/unit/gateways/moneris_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setup
@credit_card = credit_card('4242424242424242')

# https://developer.moneris.com/livedemo/3ds2/reference/guide/php
@fully_authenticated_eci = 5
@fully_authenticated_eci = '02'
@no_liability_shift_eci = 7

@options = { order_id: '1', customer: '1', billing_address: address }
Expand Down Expand Up @@ -86,6 +86,7 @@ def test_failed_mpi_cavv_purchase
assert_match(/<ds_trans_id>12345<\/ds_trans_id>/, data)
assert_match(/<threeds_server_trans_id>d0f461f8-960f-40c9-a323-4e43a4e16aaa<\/threeds_server_trans_id>/, data)
assert_match(/<threeds_version>2<\/threeds_version>/, data)
assert_match(/<crypt_type>2<\/crypt_type>/, data)
end.respond_with(failed_cavv_purchase_response)

assert_failure response
Expand Down
Loading