-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description ------------------------- This commit enable 3ds Global for Nuvei Unit test ------------------------- Finished in 1.229216 seconds. 19 tests, 98 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed 15.46 tests/s, 79.73 assertions/s Remote test ------------------------- Finished in 106.016738 seconds. 30 tests, 99 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed 0.28 tests/s, 0.93 assertions/s Rubocop ------------------------- 801 files inspected, no offenses detected
- Loading branch information
Javier Pedroza
committed
Oct 15, 2024
1 parent
d579b24
commit 5f83d5d
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ def setup | |
@challenge_credit_card = credit_card('2221008123677736', first_name: 'CL-BRW2', last_name: '') | ||
@three_ds_amount = 151 # for challenge = 151, for frictionless >= 150 | ||
@frictionless_credit_card = credit_card('4000020951595032', first_name: 'FL-BRW2', last_name: '') | ||
@credit_card_3ds = credit_card('4000020951595032') | ||
|
||
@options = { | ||
email: '[email protected]', | ||
|
@@ -38,6 +39,14 @@ def setup | |
} | ||
} | ||
} | ||
|
||
@three_d_secure_options = @options.merge({ | ||
three_d_secure: { | ||
cavv: 'jJ81HADVRtXfCBATEp01CJUAAAA=', | ||
ds_transaction_id: '97267598-FAE6-48F2-8083-C23433990FBC', | ||
eci: '05' | ||
} | ||
}) | ||
end | ||
|
||
def test_transcript_scrubbing | ||
|
@@ -269,4 +278,28 @@ def test_purchase_using_stored_credentials_merchant_installments_cit | |
assert_success recurring_response | ||
assert_match 'SUCCESS', recurring_response.params['status'] | ||
end | ||
|
||
def test_failing_purchase_three_d_secure | ||
@three_d_secure_options[:three_d_secure][:cavv] = 'wrong_cavv_value' | ||
assert response = @gateway.purchase(@amount, @credit_card_3ds, @three_d_secure_options) | ||
assert_failure response | ||
assert_equal 'UNEXPECTED SYSTEM ERROR - PLEASE RETRY LATER', response.message | ||
assert_match 'ERROR', response.params['transactionStatus'] | ||
end | ||
|
||
def test_successful_purchase_with_three_d_secure | ||
assert response = @gateway.purchase(@amount, @credit_card_3ds, @three_d_secure_options) | ||
assert_success response | ||
assert response.authorization | ||
assert_equal 'APPROVED', response.message | ||
assert_match 'SUCCESS', response.params['status'] | ||
end | ||
|
||
def test_successful_purchase_three_d_secure_challenge_preference | ||
assert response = @gateway.purchase(@amount, @credit_card_3ds, @three_d_secure_options.merge(challenge_preference: 'ExemptionRequest', exemption_request_reason: 'AccountVerification')) | ||
assert_success response | ||
assert_equal 'APPROVED', response.message | ||
assert_match 'SUCCESS', response.params['status'] | ||
assert response.authorization | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters