Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Test 3d secure auth bypassing web-mock - #3

Open
WencesLlobet wants to merge 23 commits into
b-social:masterfrom
mypulse-uk:master
Open

Test 3d secure auth bypassing web-mock #3
WencesLlobet wants to merge 23 commits into
b-social:masterfrom
mypulse-uk:master

Conversation

@WencesLlobet

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread test/zebra/payment_intents_test.clj Outdated
(is (= (:payment_method payment-intent) (:id payment-method)))
(is (= (:type (:next_action payment-intent)) "redirect_to_url")))))
(do
(def driver (create-driver {:driver-type :firefox :driver-args ["--headless"]}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go in the let above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread test/zebra/payment_intents_test.clj Outdated
(is (= (:currency payment-intent) "gbp"))
(is (= (:payment_method payment-intent) (:id payment-method)))
(is (= (:type (:next_action payment-intent)) "redirect_to_url")))))
(do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need for a do here. The body of a let is an implicit do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread test/zebra/payment_intents_test.clj Outdated
Comment on lines +72 to +78
(to driver (:url (:redirect_to_url (:next_action payment-intent))))
(wait-for-element driver :name "__privateStripeFrame4")
(iframe driver "__privateStripeFrame4")
(wait-for-element driver :name "stripe-challenge-frame")
(iframe driver "stripe-challenge-frame")
(send-keys (wait-for-element driver :xpath "//*[@id=\"test-source-authorize-3ds\"]") (. org.openqa.selenium.Keys ENTER)))
(Thread/sleep 500)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strategy of using a firefox webdriver for this is going to make it difficult to run these tests in a deployment pipeline. Maybe look at using htmlunit-driver.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Toby, will take a look.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is not doable because we encountered problems described in here:
https://stackoverflow.com/questions/20315330/how-to-overcome-an-htmlunit-scriptexception

TL;DR: HtmlUnit can break easily with javascript tweaks, even with minimization. Its is happening in the 3DS automating part

We tried:

  • Different browsers versions in the library
  • Deactivate javascript
  • Deactivate image downloading
  • Deactivate error messages

None of them worked for HtmlUnit and t seems to be the most robust "browser as a lib" tool.

We push the changes for error demo purposes

jordanrobinson and others added 23 commits May 25, 2022 11:20
Adds refunds to core and associated functionality
Adds handling for if charges are null on a payment intent
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants