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

Test 3d secure auth bypassing web-mock #3

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

WencesLlobet
Copy link
Contributor

No description provided.

(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
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
Contributor Author

Choose a reason for hiding this comment

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

👍

(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
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
Contributor Author

Choose a reason for hiding this comment

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

👍

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
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
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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants