woocommerce / woocommerce-gateway-stripe

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

Required fields breaking Apple Pay #2169

Closed colmtroy closed 6 months ago

colmtroy commented 2 years ago

Describe the bug Setting some fields to be required in WooCommerce (e.g. Company name field) triggers a js error in the console and prevents a transaction from being completed.

To Reproduce Steps to reproduce the behavior:

  1. Go to Appearance -> Customize -> WooCommerce -> Checkout and make Company name field required
  2. Go to WooCommerce -> Settings -> Payments -> Stripe -> Payment Request Button locations: Checkout (also Enable Payment Request buttons obviously)
  3. Go through a checkout process on any Apple device supporting Apple Pay (my test case was run on macOS 11.2.2 / Safari 14.0.3 )
  4. At the checkout, click the "Buy with Apple Pay" button WITHOUT entering a company name
  5. Attempt to complete the Apple Pay transaction via Touch ID (running on a M1 Macbook Air)
  6. Apple Pay shows a "Payment not completed" notice in the Apple Pay modal.
  7. Observe the following js error in the console

Expected behavior From the nature of the error message: jQuery.Deferred exception: undefined is not an object (evaluating 'e.prev(".woocommerce-error").offset().top')

It would appear WooCommerce knows there's a checkout error, but there's a bug displaying it.

I would expect the payment to fail and for any checkout validation messages to appear on the checkout page, just like with any regular payment gateway integration.

I'm also experiencing this problem with a custom required field I've added for requiring customers to confirm acceptance of privacy policy (the code of which is almost identical to the regular core Terms and Conditions code).

I also note that even going back in and adding a company name doesn't allow the transaction to complete (even after a full page refresh etc. to clear the existing js console errors). The same error re-occurs even with a company name present).

I also have terms and conditions as a required field.

If I remove the required condition on the company name, the Apple Pay transaction works correctly, even if I don't tick the terms and conditions checkbox.

I found this old issue where terms were auto accepted when payment requests were used https://github.com/woocommerce/woocommerce/issues/15040

But that $_POST['terms'] = 1 code from https://github.com/woocommerce/woocommerce-gateway-stripe/commit/7eee7c5cd6f744600f43166db6ea81604ae1910a

seems to have been subsequently removed.

So I'm unsure how you the extension currently auto-approves terms if they've not been selected?

Finally, in addition to resolving this for core fields like Company Name etc. is it possible to filter in additional custom fields?

Thanks.

System Report ` ### WordPress Environment ### WordPress address (URL): https://snip Site address (URL): https://snip WC Version: 5.9.0 REST API Version: ✔ 5.9.0 WC Blocks Version: ✔ 6.1.0 Action Scheduler Version: ✔ 3.3.0 WC Admin Version: ✔ 2.8.0 Log Directory Writable: ✔ WP Version: 5.8.2 WP Multisite: – WP Memory Limit: 8 GB WP Debug Mode: ✔ WP Cron: – Language: en_US External object cache: – ### Server Environment ### Server Info: nginx/1.16.1 PHP Version: 7.4.16 PHP Post Max Size: 512 MB PHP Time Limit: 900 PHP Max Input Vars: 5000 cURL Version: 7.58.0 OpenSSL/1.1.1 SUHOSIN Installed: – MySQL Version: 8.0.22-13 Max Upload Size: 512 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 5.9.0 WC Database Prefix: wp_ Total Database Size: 652.85MB Database Data Size: 393.37MB Database Index Size: 259.48MB wp_woocommerce_sessions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.14MB + Index: 0.17MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 184.70MB + Index: 147.45MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 134.67MB + Index: 73.14MB + Engine InnoDB wp_aelia_dismissed_messages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cmplz_cookiebanners: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cmplz_cookies: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cmplz_services: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_cmplz_statistics: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.09MB + Index: 0.09MB + Engine InnoDB wp_commercekit_waitlist: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commercekit_wishlist: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commercekit_wishlist_items: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_e_submissions: Data: 0.02MB + Index: 0.23MB + Engine InnoDB wp_e_submissions_actions_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_e_submissions_values: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ff_scheduled_actions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_entry_details: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_form_analytics: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_forms: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_submission_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fluentform_submissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_frmt_form_entry: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_frmt_form_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_frmt_form_views: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 5.05MB + Index: 0.14MB + Engine InnoDB wp_postmeta: Data: 32.39MB + Index: 10.81MB + Engine InnoDB wp_posts: Data: 7.08MB + Index: 0.78MB + Engine InnoDB wp_redirection_404: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_skladon_log: Data: 8.52MB + Index: 0.00MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_term_relationships: Data: 0.25MB + Index: 0.14MB + Engine InnoDB wp_term_taxonomy: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.33MB + Index: 0.09MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_gpf_render_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.34MB + Index: 0.55MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_se_queue: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_se_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_gpf_google_taxonomy: Data: 2.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_table_rates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmelon_advbedit_temp: Data: 0.14MB + Index: 0.00MB + Engine InnoDB wp_wpsl_stats_searches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpsl_stats_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpsl_stats_terms: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wsal_metadata: Data: 11.52MB + Index: 21.09MB + Engine InnoDB wp_wsal_occurrences: Data: 1.52MB + Index: 1.83MB + Engine InnoDB wp_yoast_indexable: Data: 2.45MB + Index: 1.08MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.22MB + Index: 0.31MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.25MB + Index: 0.20MB + Engine InnoDB ### Post Type Counts ### acf-field: 18 acf-field-group: 6 attachment: 1540 custom_css: 4 customize_changeset: 9 elementor_library: 49 forminator_forms: 1 nav_menu_item: 19 page: 57 post: 9 product: 62 product_variation: 2155 revision: 142 seedprod: 1 shop_coupon: 5 shop_order: 98 shop_order_refund: 2 sizeguide: 1 ufaq: 273 wc_product_tab: 79 wp_block: 1 wpsl_stores: 315 xs_elementor_pdps: 29 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (5) ### Meks Quick Plugin Disabler: by Meks – 1.0 Aelia - Skip login at checkout: by Aelia – 1.0.2.190225 WooCommerce Stripe Gateway: by WooCommerce – 5.7.0 WooCommerce Table Rate Shipping: by WooCommerce – 3.0.34 WooCommerce: by Automattic – 5.9.0 ### Inactive Plugins (88) ### Advanced Custom Fields: by Delicious Brains – 5.10.2 Advanced Custom Fields PRO: by Delicious Brains – 5.10.2 Aelia Foundation Classes for WooCommerce: by Aelia – 2.1.17.211005 Akismet Anti-Spam: by Automattic – 4.2.1 Angell EYE Updater: by Angell EYE – 2.0.17 Asset CleanUp: Page Speed Booster: by Gabe Livan – 1.3.8.4 Autoptimize: by Frank Goossens (futtta) – 2.9.2 Better Search Replace: by Delicious Brains – 1.3.4 Classic Editor: by WordPress Contributors – 1.6.2 Classic Widgets: by WordPress Contributors – 0.2 Cloudflare: by Cloudflare Inc. – 4.5.1 Code Snippets: by Code Snippets Pro – 2.14.2 Coming Soon Page, Maintenance Mode & Landing Pages by SeedProd: by SeedProd – 6.6.0 CommerceGurus - Convert Guests to Customers for Xero Shoeas: by CommerceGurus – 1.0.0 CommerceGurus Commercekit: by CommerceGurus – 1.2.4 Complianz Privacy Suite (GDPR/CCPA) premium: by Really Simple Plugins – 5.5.2 Complianz | GDPR/CCPA Cookie Consent: by Really Simple Plugins – 5.5.1 Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control: by Cybot A/S – 3.11.1 Criteo OneTag for WooCommerce: by Criteo – 1.3.2 Custom Post Type UI: by WebDevStudios – 1.10.0 Display Posts: by Bill Erickson – 3.0.2 Disqus Conditional Load: by Joel James – 11.0.6 Elementor: by Elementor.com – 3.4.4 Elementor Pro: by Elementor.com – 3.2.1 EWD Premium Helper: by Etoile Web Design – 0.0.12 Forminator: by WPMU DEV – 1.15.2 GLS for WooCommerce: by TIG – 1.4.1 Google Tag Manager for Wordpress: by Thomas Geiger – 1.13.1 GridPane Redis Object Cache: by Version Forked by GridPane | Till Krüss – 1.5.6 Hello Dolly: by Matt Mullenweg – 1.7.2 Kirki Customizer Framework: by David Vongries – 3.1.9 Klaviyo: by Klaviyo Inc. – 2.5.2 Maintenance Mode: by Lukas Juhas – 2.4.4 Members: by MemberPress – 3.1.5 Metorik Helper: by Metorik – 1.5.1 New Relic Reporting for WordPress: by 10up – 1.3.1 Nginx Helper: by rtCamp – 2.2.2 One Click Demo Import: by OCDI – 3.0.2 PayPal for WooCommerce: by Angell EYE – 3.0.2 Preview E-mails for WooCommerce: by Digamber Pradhan – 1.6.8 Query Monitor: by John Blackbourn – 3.7.1 Redirection: by John Godley – 5.1.3 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.5 Skladon: by Skladon – 2.0.15 Smart Variations Images & Swatches for WooCommerce (Premium): by David Rosendo – 5.1.1 Smart WooCommerce Search by Searchanise: by Searchanise – 1.0.8 Stamped.io Reviews & UGC for WooCommerce: by Stamped.io – 2.2.3 TinyPNG - JPEG, PNG & WebP image compression: by TinyPNG – 3.3 Transients Manager: by Pippin Williamson – 1.8.1 Ultimate FAQ - WordPress FAQ and Accordion Plugin: by – 2.0.23 UpdraftPlus - Backup/Restore: by UpdraftPlus.Com DavidAnderson – 2.16.63.25 Weglot Translate: by Weglot Translate team – 3.4 Widget CSS Classes: by Jory Hogeveen – 1.5.4.1 WooCommerce Advanced Bulk Edit: by George Iron – 5.0.1 WooCommerce Create Customer on Order: by cxThemes – 1.36 WooCommerce EU/UK VAT Compliance (Premium): by David Anderson – 1.25.10 WooCommerce Google Product Feed: by Ademti Software Ltd. – 10.2.1 WooCommerce Grid / List toggle: by jameskoster – 1.2.1 WooCommerce Name Your Price: by Kathy Darling – 3.3.2 WooCommerce Order Search Admin powered by Algolia: by Raymond Rutjes – 1.13.2 WooCommerce PayPal Payments: by WooCommerce – 1.6.2 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.10.1 WooCommerce Product CSV Import Suite: by WooCommerce – 1.10.46 WooCommerce Quantity Increment: by Automattic WooThemes – 1.1.0 WooCommerce Smart Coupons: by StoreApps – 4.28.0 WooCommerce Tab Manager: by SkyVerge – 1.14.1 WooCommerce URL Coupons: by SkyVerge – 2.13.0 WooCommerce Variation Swatches and Photos: by Element Stark – 3.1.4 WordPress Importer: by wordpressdotorg – 0.7 WP-ServerInfo: by Lester 'GaMerZ' Chan – 1.66 WP 2FA - Two-factor authentication for WordPress: by WP White Security – 1.7.1 WP Activity Log: by WP White Security – 4.3.2 WP Activity Log for WooCommerce: by WP White Security – 1.3.1 WP Activity Log for Yoast SEO: by WP White Security – 1.2.0 WP Crontrol: by John Blackbourn & crontributors – 1.10.0 WPForms Lite: by WPForms – 1.6.9 WP Mail SMTP: by WPForms – 3.1.0 WP Revisions Control: by Erick Hitter – 1.3 WP Search with Algolia: by WebDevStudios – 2.1.0 WP Store Locator: by Tijmen Smit – 2.2.234 WP Store Locator - CSV Manager: by Tijmen Smit – 1.0.2 WP Store Locator - Statistics: by Tijmen Smit – 1.1.1 XeroShoes GeoFence: by Xero Shoes – 0.9.8 XeroShoes GeoFence: by Xero Shoes – 1.0.4 XeroShoes Toolkit - EU Edition: by CommerceGurus – 1.0.0 XeroShoes Toolkit - EU Edition: by CommerceGurus – 1.0.0 Yoast SEO: by Team Yoast – 17.3 Yoast SEO: WooCommerce: by Team Yoast – 13.9 ### Must Use Plugins (1) ### WP CLI Login Command Server: by Evan Mattson – 1.2 ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude_from_catalog (exclude_from_catalog) exclude_from_search (exclude_from_search) exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #7 - /shop/ Cart: #8 - /cart/ Checkout: #9 - /checkout/ My account: #10 - /my-account/ Terms and conditions: #795 - /terms/ ### Theme ### Name: Storefront Version: 3.9.1 Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### Complete: 535,114 Oldest: 2021-11-16 11:57:27 +0100 Newest: 2021-11-18 13:31:09 +0100 Failed: 2 Oldest: 2021-09-25 20:41:37 +0200 Newest: 2021-09-25 20:41:37 +0200 Pending: 2 Oldest: 2021-11-19 12:07:47 +0100 Newest: 2021-11-19 13:48:31 +0100 ### Status report information ### Generated at: 2021-11-18 13:31:12 +01:00 `
colmtroy commented 2 years ago

Gentle bump on this one - any thoughts on it?

aheckler commented 2 years ago

4802352-zen

therealgilles commented 2 years ago

Same problem here. Also this bug should be fixed:

jQuery.Deferred exception: undefined is not an object (evaluating 'e.prev(".woocommerce-error").offset().top') (2)
displayErrorMessage — stripe-payment-request.min.js:1:2792
abortPayment — stripe-payment-request.min.js:1:2872
(anonymous function) — stripe-payment-request.min.js:1:6680
e — jquery.min.js:2:30044
(anonymous function) — jquery.min.js:2:30342
therealgilles commented 2 years ago

This code in assets/js/stripe-payment-request.js

                /**
                 * Display error messages.
                 *
                 * @since 4.8.0
                 * @param {Object} message DOM object with error message to display.
                 */
                displayErrorMessage: function( message ) {
                        $( '.woocommerce-error' ).remove();

                        if ( wc_stripe_payment_request_params.is_product_page ) {
                                var element = $( '.product' ).first();
                                element.before( message );

                                $( 'html, body' ).animate({
                                        scrollTop: element.prev( '.woocommerce-error' ).offset().top
                                }, 600 );
                        } else {
                                var $form = $( '.shop_table.cart' ).closest( 'form' );
                                $form.before( message );
                                $( 'html, body' ).animate({
                                        scrollTop: $form.prev( '.woocommerce-error' ).offset().top
                                }, 600 );
                        }
                },

does not seem to support the checkout page or at least not the one-page checkout (provided by the woocommerce-one-page-checkout plugin).

joashrajin commented 2 years ago

+1 at #5613226-zen

The user reports that having a phone number set as a mandatory field is causing Google/Apple Pay not to work

amElnagdy commented 2 years ago

Reported here as well: 5634728-zen

paulostp commented 1 year ago

6004110-zen

diegoversiani commented 1 year ago

We had a customer complain that the our plugin Fluid Checkout was not working with Apple Pay/Google Pay anymore, there was no error message on the checkout page, on the browser console tab or on PHP logs.

After hours, we found out they had a custom required field causing the issue, and that the plugin WooCommerce Stripe Gateway does not show the messages on the checkout page as it only targets the product (single) details page and cart page.

This code in assets/js/stripe-payment-request.js

                /**
                 * Display error messages.
                 *
                 * @since 4.8.0
                 * @param {Object} message DOM object with error message to display.
                 */
                displayErrorMessage: function( message ) {
                        $( '.woocommerce-error' ).remove();

                        if ( wc_stripe_payment_request_params.is_product_page ) {
                                var element = $( '.product' ).first();
                                element.before( message );

                                $( 'html, body' ).animate({
                                        scrollTop: element.prev( '.woocommerce-error' ).offset().top
                                }, 600 );
                        } else {
                                var $form = $( '.shop_table.cart' ).closest( 'form' );
                                $form.before( message );
                                $( 'html, body' ).animate({
                                        scrollTop: $form.prev( '.woocommerce-error' ).offset().top
                                }, 600 );
                        }
                },

does not seem to support the checkout page or at least not the one-page checkout (provided by the woocommerce-one-page-checkout plugin).

The messages are not shown on the checkout page even with only WooCommerce and the Stripe Gateway plugin active.

It would be nice if the plugin at least showed the error messages on the checkout page too.

To fix the error messages issue, simply changing the selector to also target the form element on the checkout page would be enough:

From this:

var $form = $( '.shop_table.cart' ).closest( 'form' );

To this:

var $form = $( '.shop_table.cart, .shop_table.woocommerce-checkout-review-order-table' ).closest( 'form' );

This solution has been tested and works.

Hopefully the WooCommerce Stripe Gateway team can update the plugin with this change soon.

Best, Diego.

elementall2 commented 1 year ago

Hi, I tried this and did not fix it for me... Stripe Version 7.5.0 Wordpress 6.3.1 Woocommerce Version 8.0.3

I got no custom modules for the checkout, no errors in console

Babylon1999 commented 1 year ago

zd-7075528

wpshellbelle commented 11 months ago

7311800-zen

mattallan commented 6 months ago

This issue was fixed by #2886

While looking into this problem I found that this problem isn't unique to our Stripe plugin and there's ongoing discussions happening in the WooPayments and WooCommerce core repos. Here are the relevant issues:

therealgilles commented 6 months ago

Can someone please clarify if we can use Apple/Google Pay with required fields? I am again asking for documentation here. What use cases work, what use cases do not work, for each recent release. Thank you!

mattallan commented 6 months ago

Hey @therealgilles, yes you can use Apple/Google Pay with required fields.

While there are ongoing discussions within WooCommerce core and WooPayments related to how to handle required checkout fields for Apple/Google Pay, here's a breakdown of how we currently handle these cases in our Stripe plugin (shipped in v8.0.0):

Hopefully that answers your question

therealgilles commented 6 months ago

@mattallan I just tried it and not checking a required checkbox did not stop the Google Pay checkout, so it's not working for me at least.

PS: For the checkout flow with custom required fields to make sense to a customer, the required fields need to appear first above any payment button. That's basic UX design.