-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Conversation
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"]})) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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 |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
test/zebra/payment_intents_test.clj
Outdated
(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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
& amount-received Authors: @callwait @ShanaSkydancer
Adds basic invoice functionality
Adds invoices to core
Adds refunds to core and associated functionality
Adds handling for if charges are null on a payment intent
Adds more fields to refunds
Add field total to invoices
No description provided.