Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Fix 3D Secure specs
Browse files Browse the repository at this point in the history
Cardinal, that handles "3D Secure" for Braintree made some changes to
how the legacy 3Ds test numbers are handled. Because of this, the
numbers were changed to trigger the correct scenarios needed. The
DOM of the Cardinal iFrame also changed and needed tweaking. Cardinal
also likes the expiration date to be January and 3 years ahead of
today's year.

References:
- https://cardinaldocs.atlassian.net/wiki/spaces/CCen/pages/400654355/3DS+1.0+Test+Cases
- https://cardinaldocs.atlassian.net/wiki/spaces/CCen/pages/903577725/EMV+3DS+Test+Cases#Test-Case-12%3A-Error-on-Authentication
  • Loading branch information
RyanofWoods committed Nov 7, 2022
1 parent 6af8c47 commit 7b59e87
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 44 deletions.
13 changes: 6 additions & 7 deletions spec/features/frontend/braintree_credit_card_checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:three_d_secure_enabled) { false }
let(:venmo_enabled) { false }
let(:card_number) { "4111111111111111" }
let(:card_expiration) { "01/#{Time.now.utc.year + 2}" }
let(:card_expiration) { "01/#{Time.now.utc.year + 3}" }

before do
braintree.save!
Expand Down Expand Up @@ -107,7 +107,6 @@

context 'with 3D secure enabled' do
let(:three_d_secure_enabled) { true }
let(:card_number) { "4000000000000002" }

it 'checks out successfully' do
authenticate_3ds
Expand All @@ -121,7 +120,7 @@
end

context 'with 3ds authentication error' do
let(:card_number) { "4000000000000028" }
let(:card_number) { "4000000000001125" }

it 'shows a 3ds authentication error' do
authenticate_3ds
Expand Down Expand Up @@ -183,10 +182,10 @@

def authenticate_3ds
within_frame("Cardinal-CCA-IFrame") do
within_frame("authWindow") do
fill_in("password", with: "1234")
click_button("Submit")
end
fill_in("challengeDataEntry", with: "1234")
continue_button = find_button("SUBMIT")
continue_button.scroll_to(continue_button)
continue_button.click
end
end
end
89 changes: 52 additions & 37 deletions spec/fixtures/cassettes/checkout/valid_credit_card.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b59e87

Please sign in to comment.