-
Notifications
You must be signed in to change notification settings - Fork 207
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
tweak: 'add payment method page' to honor WC rate limiter #3810
Conversation
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.
@frosso Thanks for working on this!
A few requests:
-
Could you also add your logic to the main path
create_and_confirm_setup_intent()
?create_setup_intent()
only gets hit by stores on legacy checkout mode.
public function create_and_confirm_setup_intent( $payment_information ) { public function create_setup_intent() { - To disable legacy checkout, make sure this checkbox in Stripe settings is unchecked:
-
It would be great if we could still display an error explaining why the payment method failed to save -- in my testing I did not see one.
Thank you for pointing that out - I updated it in 7318eac
From what I see, any failure on the "My account > Add payment method" page is not displayed with WC Stripe. This seems to be happening because The check If, instead, your merchant's site is using a non-block-based theme (e.g.: Storefront), the error is correctly displayed when the second attempt is made. It seems that this error message issue could be a bigger scope than this ticket and could necessitate a wider scope/fix - what do you think? |
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.
It seems that this error message issue could be a bigger scope than this ticket and could necessitate a wider scope/fix - what do you think?
Good point, it does sound like a separate, bigger issue. I will create a Github ticket for it, so someone can take a look.
Thanks for working on this again! I tested both legacy and new checkout, and rate limiting is working as expected.
#3818 to document the error message and block-based theme issue. |
Fixes #3794
Changes proposed in this Pull Request:
Adding a similar check to the one made in WC Core, here: woocommerce/woocommerce@d252c8a/plugins/woocommerce/includes/class-wc-form-handler.php#L506-L510
Testing instructions
5555555555554444
card5200828282828210
card5200828282828210
card, after the 20 seconds limit (you don't need to refresh the page)changelog.txt
andreadme.txt
(or does not apply)Post merge