woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
231 stars 202 forks source link

getting error on checkout for cardInput, scrollIntoView and validateInput #3186

Open nctbrtc opened 3 months ago

nctbrtc commented 3 months ago

Describe the bug My client site was having some checkout issues and I was troubleshooting the checkout. I was getting some JS error on the console and could not locate the source of the error. However, while changing the checkout with some other type, I got the full source code of a JS, at first I taught it was malicious code because it was very obfuscated, but than noticed it's JS from Stripe.

errors I was getting at different times when "Place Order" button is clicked:

1-) checkout/:152 Uncaught TypeError: Cannot read properties of undefined (reading 'validateInput') at HTMLButtonElement._0x115903 (checkout/:152:27382) _0x115903 @ checkout/:152 2-)

checkout/:152 Uncaught TypeError: Cannot read properties of null (reading 'scrollIntoView') at iEvents.<computed> (checkout/:152:26758) at iEvents.<computed> (checkout/:152:25872) at HTMLInputElement.<anonymous> (checkout/:152:27232) 3-) Uncaught TypeError: Cannot read properties of undefined (reading 'cardInput') at checkout/:1217:27429

Here is the link for the full code of the JS I mention earlier: https://gist.github.com/nctbrtc/875a7d102544eeaad109aaaa506efdfe

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Checkout' (scrollIntoView might show up directly)
  2. Fill out all inputs for checkout
  3. click on place order button
  4. check the console for the cardInput or validateInput error

Expected behavior when "Place Order" button clicked, order should go thru

Screenshots

image

Environment (please complete the following information):

WP (6.5.4) WooCommerce (8.9.2) WooCommerce Stripe Gateway ( 8.3.1 ) Chrome (latest version)

Additional context Add any other context about the problem here.

shameemreza commented 2 months ago

Possibly another report: 8492871-zen Thread: https://wordpress.org/support/topic/no-possibility-to-pay-by-card/