woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

PayPal Credit card area: button issue and country list issue #812

Open melindahelt opened 3 years ago

melindahelt commented 3 years ago

Describe the bug

Issues with missing text on the Blue PayPal Button within the credit card option Issue with the flag dropdown menu dropping countries

To reproduce

Activate PayPal Express Checkout Add Items to the cart Go to checkout using credit card button

Notice that button text appears for US Switch to UK and text does not appear Select other countries (previously a few more were missing, unable to tell which ones now) Also notice that after selecting a few other countries, that the UK and US are no longer in the list

Screenshots Animation of issue: https://d.pr/i/wGJoTk

Expected behavior

I expect to see button text on all buttons and for all countries to remain in list

Environment (please complete the following information):

Additional details

System status ``` ` ### WordPress Environment ### WordPress address (URL): https://thewoostore.mystagingwebsite.com Site address (URL): https://thewoostore.mystagingwebsite.com WC Version: 4.5.2 REST API Version: ✔ 4.5.2 WC Blocks Version: ✔ 3.1.0 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.5.0 Log Directory Writable: ✔ WP Version: 5.5.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.4.10 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.72.0 OpenSSL/1.1.0l SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.21-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 4.5.2 WC Database Prefix: wp_ Total Database Size: 20.79MB Database Data Size: 13.65MB Database Index Size: 7.14MB wp_woocommerce_sessions: Data: 0.03MB + 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.08MB + Index: 0.06MB + 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: 0.14MB + Index: 0.11MB + 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: 0.08MB + Index: 0.03MB + Engine InnoDB wp_ariadminer_connections: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.06MB + Index: 0.09MB + Engine InnoDB wp_followup_coupons: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_coupon_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_customers: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_followup_customer_carts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_followup_email_excludes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_orders: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_followup_email_tracking: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_followup_followup_history: Data: 0.08MB + Index: 0.05MB + Engine InnoDB wp_followup_order_categories: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_order_items: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_subscribers: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscribers_to_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscriber_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form_view: Data: 0.02MB + Index: 0.03MB + 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: 1.13MB + Index: 0.14MB + Engine InnoDB wp_postmeta: Data: 4.39MB + Index: 3.81MB + Engine InnoDB wp_posts: Data: 2.14MB + Index: 0.36MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.09MB + Index: 0.06MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcpv_commissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + 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_deposits_payment_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_deposits_payment_plans_schedule: Data: 0.02MB + Index: 0.02MB + 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_points_rewards_user_points: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points_log: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.14MB + Index: 0.31MB + Engine InnoDB wp_wc_reserved_stock: 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_woocommerce_bundled_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_exported_csv_items: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_exported_xml_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_gpf_google_taxonomy: Data: 2.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_table_rates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpf_filters: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpf_modules: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpf_modules_type: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpf_usage_stat: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpml_mails: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_wtbp_columns: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wtbp_modules: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wtbp_modules_type: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wtbp_tables: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wtbp_usage_stat: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### acf-field: 1 acf-field-group: 1 addify_quote: 1 addify_rfq: 2 afreg_fields: 1 attachment: 414 bookable_person: 7 bookable_resource: 16 custom_css: 1 customize_changeset: 1 def_reg_fields: 10 event_ticket: 7 follow_up_email: 2 jetpack_migration: 2 jp_img_sitemap: 1 jp_sitemap: 1 jp_sitemap_master: 1 order_shipment: 6 page: 27 post: 9 product: 223 product_variation: 690 revision: 72 shop_coupon: 6 shop_order: 43 shop_order_refund: 1 slide: 1 wc_booking: 9 wc_product_table: 1 wcpf_item: 6 wcpf_project: 3 wishlist: 2 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (2) ### WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.0.3 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce: by Automattic – 4.5.2 ### Inactive Plugins (51) ### Akismet Anti-Spam: by Automattic – 4.1.6 ARI Adminer: by ARI Soft – 1.2.3 Bookings Helper: by WooCommerce – 1.0.2 – Installed version not tested with active version of WooCommerce 4.5.2 Bulk Table Editor for WooCommerce: by Consortia – 2.1.7 Classic Editor: by WordPress Contributors – 1.6 Code Snippets: by Code Snippets Pro – 2.14.0 Gravity Forms: by Gravity Forms – 2.4.20 Gutenberg: by Gutenberg Team – 9.0.0 Health Check & Troubleshooting: by The WordPress.org community – 1.4.4 Homepage Control: by WooThemes – 2.0.3 Jetpack by WordPress.com: by Automattic – 8.9.1 Loco Translate: by Tim Whitlock – 2.4.3 Product Filters for WooCommerce: by WooCommerce – 1.2.2 – Installed version not tested with active version of WooCommerce 4.5.2 Request a Quote for WooCommerce: by Addify – 1.5.3 – Installed version not tested with active version of WooCommerce 4.5.2 Storefront Parallax Hero: by WooCommerce – 1.5.7 Storefront Powerpack: by WooCommerce – 1.5.0 Storefront Product Sharing: by WooCommerce – 1.0.6 String Locator: by Clorith – 2.4.1 User Switching: by John Blackbourn & contributors – 1.5.5 WDV Storefront Homepage Control: by Lakhya Phukan – 0.1.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Bookings: by WooCommerce – 1.15.25 (update to version 1.15.27 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Bookings Availability: by WooCommerce – 1.1.15 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Composite Products: by SomewhereWarm – 7.0.6 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Customer/Order/Coupon Export: by SkyVerge – 5.1.1 WooCommerce Distance Rate Shipping: by Automattic – 1.0.26 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Dropshipping: by WooCommerce – 2.6 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce EU VAT Number: by WooCommerce – 2.3.23 (update to version 2.3.24 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce FedEx Shipping: by WooCommerce – 3.4.32 (update to version 3.4.33 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Force Sells: by WooCommerce – 1.1.25 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Google Product Feed: by Ademti Software Ltd. – 9.0.4 (update to version 9.1.0 is available) WooCommerce Gravity Forms Product Add-Ons: by Lucas Stark – 3.3.15 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Min/Max Quantities: by WooCommerce – 2.4.19 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce One Page Checkout: by Automattic – 1.7.8 (update to version 1.7.9 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Order Barcodes: by WooCommerce – 1.3.22 (update to version 1.3.23 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Payment Gateway Based Fees: by InoPlugs – 3.1.12 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Pre-Orders: by WooCommerce – 1.5.28 (update to version 1.5.29 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Add-ons: by WooCommerce – 3.0.38 (update to version 3.1.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Bundles: by SomewhereWarm – 6.3.5 (update to version 6.4.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product CSV Import Suite: by WooCommerce – 1.10.36 (update to version 1.10.37 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Vendors: by WooCommerce – 2.1.42 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Quick View: by WooCommerce – 1.2.11 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Services: by Automattic – 1.24.3 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Shipping Per Product v2: by WooCommerce – 2.3.11 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Ship to Multiple Addresses: by WooCommerce – 3.6.22 (update to version 3.6.23 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Stamps.com API integration: by WooCommerce – 1.3.20 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions: by WooCommerce – 3.0.7 (update to version 3.0.9 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooSlider: by WooThemes – 2.4.2 WordPress Beta Tester: by Peter Westwood Andy Fragen – 2.2.13 WP Downgrade | Specific Core Version: by Reisetiger – 1.2.2 WP Healthcheck: by Tiago Hillebrandt – 1.3.2 WP Rollback: by Impress.org – 1.7.1 ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Must Use Plugins (1) ### Health Check Troubleshooting Mode: by – 1.7.1 ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: accommodation-booking (accommodation-booking) booking (booking) bundle (bundle) composite (composite) external (external) grouped (grouped) paywall (paywall) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) 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: #4 - /shop/ Cart: #5 - /cart/ Checkout: #6 - /checkout/ My account: #7 - /my-account/ Terms and conditions: #3910 - /test-terms-page/ ### Theme ### Name: Storefront Version: 2.7.0 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: 206 Oldest: 2020-08-30 23:25:07 -0400 Newest: 2020-09-30 17:19:51 -0400 Failed: 5 Oldest: 2019-07-01 15:12:41 -0400 Newest: 2020-03-31 09:32:58 -0400 Pending: 4 Oldest: 2020-10-01 05:10:40 -0400 Newest: 2020-10-03 00:51:28 -0400 ` ```
anant1811 commented 3 years ago

Also reported in 3365455-zen

fylgjur commented 3 years ago

Also reported in #24676710-hc, moved to #3383328-zen.

Workaround:

PayPal have advised the user to remove the "locale" parameter as a temporary fix

Re. conversation in A8C Slack #lambda this could be done via adding filter: add_filter('woocommerce_paypal_express_checkout_paypal_locale', '__return_empty_string');

Users could add this using Code Snippets plugin: https://wordpress.org/plugins/code-snippets/

Davidfranom commented 3 years ago

In different languages ​​the name of certain countries changes and it affects to the order of the list, for example: In spanish "United States" is called "Estados Unidos" and "United Kingdom" is called "Reino Unido".

RiaanKnoetze commented 3 years ago

One more: 24699976-hc

rpravisani commented 3 years ago

Also reported in #24676710-hc, moved to #3383328-zen.

Workaround:

PayPal have advised the user to remove the "locale" parameter as a temporary fix

Re. conversation in A8C Slack #lambda this could be done via adding filter: add_filter('woocommerce_paypal_express_checkout_paypal_locale', '__return_empty_string');

Users could add this using Code Snippets plugin: https://wordpress.org/plugins/code-snippets/

Hi,

I tried the workaround and copied&pasted the code in my functions.php file, but doing so the Paypal module doesn't get loaded at all. Browser console reports this error:

Uncaught TypeError: Cannot read property 'FUNDING' of undefined
    at String.<anonymous> (wc-gateway-ppec-smart-payment-buttons.js?ver=2.1.0:50)
    at Function.each (jquery.js?ver=1.12.4-wp:2)
    at getFundingMethods (wc-gateway-ppec-smart-payment-buttons.js?ver=2.1.0:49)
    at render (wc-gateway-ppec-smart-payment-buttons.js?ver=2.1.0:102)
    at HTMLBodyElement.dispatch (jquery.js?ver=1.12.4-wp:3)
    at HTMLBodyElement.r.handle (jquery.js?ver=1.12.4-wp:3)
    at Object.trigger (jquery.js?ver=1.12.4-wp:3)
    at Object.a.event.trigger (jquery-migrate.min.js?ver=1.4.1:2)
    at HTMLBodyElement.<anonymous> (jquery.js?ver=1.12.4-wp:3)
    at Function.each (jquery.js?ver=1.12.4-wp:2)

I tried to replace '__return_empty_string' with literally an empty string (''). That made the module appear again, albeit with the text still missing from the blue button. Is there any other workaround I can try?

Regards Roberto

fylgjur commented 3 years ago

My user in #3383328-zen has the same experience as @rpravisani with trying to apply the fix.

jorgeatorres commented 3 years ago

After some quick debugging, turns out PayPal's JS SDK doesn't take an empty locale parameter: if locale is not set, it is detected automatically, but if the argument appears it must have a proper value. Otherwise, you get the following error from PayPal and the SDK isn't loaded:

Please pass a value for query param: locale


@fylgjur @rpravisani: The following code snippet should work and not result in an error:

add_filter( 'woocommerce_paypal_express_checkout_sdk_script_args', function( $settings ) {
    unset( $settings['locale'] );
    return $settings;
} );

This is, of course, provisional. We'll be properly addressing this in a next version. Let me know if it works for you!

amandasjackson commented 3 years ago

I updated to the most recent version of the plugin v 2.1.0 and I am no longer to reproduce this issue, I can see text showing on the blue button for the UK:

Screenshot Screenshot direct link: https://d.pr/i/nLtt3e

Replied to customer in 3383328-zen to ask them to update the plugin and test

fylgjur commented 3 years ago

Customer in #3383328-zen saw no improvement when trying the code snippet, but says problem is solved as of this morning, although they had updated to 2.1.0 previously and still saw the error until today. Asked customer in #3365455-zen to update to 2.1.0 if not tried already. NB I note that the user in 24699976-hc definitely had version 2.1.0 already when they were seeing the issue on 8th Oct so it may be a change on PayPal's side?

MuunWeb commented 3 years ago

Update WP Version 5.5.1 is a solution for me.

jrick1229 commented 3 years ago

Just noting here that this issue is still occurring with 'Mexico' - https://wordpress.org/support/topic/credit-cards-pay-now-button-text-missing/#post-13644434