woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

Incompatibility with WooCommerce Bookings and PayPal Payments on the Product Page (895) #1463

Closed lynnjat7 closed 1 year ago

lynnjat7 commented 1 year ago

Describe the Bug

With Bookings and PayPal Payments installed and configured, you can activate PayPal buttons on the Bookable Product Page.

However, if you click the PayPal button on the Bookable product page directly you see an error, "Something went wrong. Please try again or choose another payment source."

This is confusing to the customer.

If we click the "Book Now" button to add the bookable product to the cart, then proceed forward in the checkout process, then the PayPal buttons on either the cart or checkout page work fine.

To Reproduce

  1. Install PayPal Payments and connect it. I tested this with the latest version, 2.1.0 and also spot-tested with a series of versions all the way back to 1.9.0 which is about a year old - the same error happened with every version so it's likely been an issue for a while.
  2. install WooCommerce Bookings. I tested this with the latest version, 1.16.02 but also spot-tested with downgrades going back to version 1.15.54 which is more than a year old, and again, the same error happened every time. So it's not a recent change to either plugin.
  3. Create a Bookable product. I don't think the settings really matter, as long as it has a price assigned. For duplication, my product has these general settings:

QUAEAQ.png

and this for availability:

Vq3qIA.png

  1. Now go to the product page for that bookable product. You should see the PayPal button load like this:

ugeJMF.png

  1. Choose a bookable time slot like this, which should show a dynamically calculated price:

kIjCdK.png

  1. Click the PayPal button and you'll see an error:

MASFz0.png

  1. The console shows an empty order / create order error like this:

ODDHGA.png

Expected Behavior

Either we should:

Environment

This issue was originally reported by a customer but I duplicated it on my test site, details are from my own site.

Pretty lean test environment, here is my SSR: `

WordPress Environment

WordPress address (URL): https://numberthree.mystagingwebsite.com Site address (URL): https://numberthree.mystagingwebsite.com WC Version: 7.8.0 REST API Version: ✔ 7.8.0 WC Blocks Version: ✔ 10.2.3 Action Scheduler Version: ✔ 3.5.4 Log Directory Writable: ✔ WP Version: 6.2.2 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: ✔

Server Environment

Server Info: nginx PHP Version: 8.0.29 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 8.0.1 OpenSSL/1.1.1n

SUHOSIN Installed: – MySQL Version: 10.4.25-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: 7.8.0 WC Database Prefix: wp_ Total Database Size: 17.26MB Database Data Size: 12.05MB Database Index Size: 5.21MB wp_woocommerce_sessions: Data: 0.02MB + 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.11MB + Index: 0.13MB + 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: 1.02MB + Index: 0.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: 1.31MB + Index: 0.47MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.19MB + Index: 0.16MB + Engine InnoDB wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 3.14MB + Index: 0.16MB + Engine InnoDB wp_postmeta: Data: 2.52MB + Index: 1.88MB + Engine InnoDB wp_posts: Data: 0.30MB + Index: 0.13MB + Engine InnoDB wp_sa_cfw_fbt_temp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.03MB + 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.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.06MB + 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.08MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.06MB + 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_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_od_time_framemeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_od_time_frames: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_order_bundle_lookup: Data: 0.02MB + Index: 0.09MB + 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_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + 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_warranty_products: Data: 0.02MB + Index: 0.05MB + 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_gc_activity: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_gc_cards: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_gc_cardsmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_prl_deploymentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_prl_deployments: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_prl_frequencies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_prl_tracking_conversions: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpml_mails: Data: 2.02MB + Index: 0.00MB + Engine InnoDB wp_wtbp_favorites: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wtbp_tables: Data: 0.02MB + Index: 0.00MB + Engine InnoDB

Post Type Counts

afreg_fields: 1 attachment: 76 bis_stock_alert: 1 def_reg_fields: 10 elementor_library: 1 global_product_addon: 1 gtc_gift_card: 1 jb_store_css: 4 mail-debug: 68 nav_menu_item: 5 order_shipment: 7 page: 27 payment_gateway: 1 prl_engine: 1 product: 44 product_variation: 35 revision: 12 shop_coupon: 5 shop_order: 157 shop_order_refund: 3 shop_subscription: 8 user_request: 1 warranty_request: 1 wc_booking: 3 wishlist: 1 wp_global_styles: 2

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (12)

Code Snippets: by Code Snippets Pro – 3.4.0 Jetpack: by Automattic – 12.3-a.7 WooCommerce Bookings: by WooCommerce – 1.15.54 (update to version 1.16.02 is available) WooCommerce Gift Cards: by WooCommerce – 1.16.2 WooCommerce PayPal Payments: by WooCommerce – 1.9.0 (update to version 2.1.0 is available) WooCommerce Points and Rewards: by WooCommerce – 1.7.35 WooCommerce FedEx Shipping: by WooCommerce – 3.7.3 WooCommerce Smart Coupons: by StoreApps – 8.0.0 WooCommerce Square: by WooCommerce – 3.9.0 WooCommerce Subscriptions: by WooCommerce – 5.1.3 WooCommerce: by Automattic – 7.8.0 WP Mail Logging: by WP Mail Logging Team – 1.12.0

Inactive Plugins (33)

Akismet Anti-Spam: Spam Protection: by Automattic - Anti Spam Team – 5.2 Custom User Registration Fields for WooCommerce: by Addify – 1.7.8 (update to version 2.0.0 is available) Donation For Woocommerce: by wpexpertsio – 3.4.5 Edit Order by Customer: by Addify – 1.0.1 Elementor: by Elementor.com – 3.12.2 Gift Cards Pro for WooCommerce: by FantasticPlugins – 3.7 Invoice Payment Option: by Addify – 1.0.4 Jetpack Boost: by Automattic - Jetpack Site Speed team – 1.8.0 Mail Debug for WooCommerce: by Leanza Francesco – 1.3.0 Meks Quick Plugin Disabler: by Meks – 1.0 Spin Wheel For Woocommerce: by wpexpertsio – 1.7.1 User Registration for WooCommerce: by WPExperts – 1.1.2 WooCommerce - ShipStation Integration: by WooCommerce – 4.3.7 WooCommerce Additional Variation Images: by WooCommerce – 2.3.2 WooCommerce Advanced Shipping Packages: by Jeroen Sormani – 1.1.10 WooCommerce Checkout Field Editor: by WooCommerce – 1.7.7 (update to version 1.7.9 is available) WooCommerce Moneris Gateway: by SkyVerge – 3.2.3 WooCommerce Name Your Price: by Kathy Darling – 3.5.2 (update to version 3.5.3 is available) WooCommerce One Page Checkout: by Automattic – 2.3.0 (update to version 2.5.0 is available) WooCommerce Order Delivery: by Themesquad – 2.3.2 (update to version 2.5.3 is available) WooCommerce Payments: by Automattic – 6.0.0 WooCommerce PDF Invoices: by Andrew Benbow – 4.17.2 (update to version 4.18.2 is available) WooCommerce PDF Watermark: by WooCommerce – 1.5.1 (update to version 1.5.2 is available) WooCommerce Pre-Orders: by WooCommerce – 1.9.0 (update to version 2.0.2 is available) WooCommerce Product Add-ons: by WooCommerce – 6.2.0 (update to version 6.4.2 is available) WooCommerce Product Bundles: by WooCommerce – 6.18.5 (update to version 6.21.0 is available) WooCommerce Product Recommendations: by WooCommerce – 2.3.0 (update to version 2.4.0 is available) WooCommerce Ship to Multiple Addresses: by WooCommerce – 3.8.6 WooCommerce Store Credit: by Themesquad – 4.3.0 (update to version 4.3.1 is available) WooCommerce UPS Shipping: by WooCommerce – 3.4.1 (update to version 3.4.3 is available) WooCommerce Warranty Requests: by WooCommerce – 2.1.7 (update to version 2.2.0 is available) WooCommerce WishLists: by Element Stark – 2.2.8 (update to version 2.2.10 is available) WooCommerce Xero Integration: by WooCommerce – 1.7.52 (update to version 1.7.57 is available)

Dropin Plugins (2)

advanced-cache.php: advanced-cache.php object-cache.php: Memcached

Settings

API Enabled: ✔ Force SSL: – Currency: CAD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: booking (booking) bundle (bundle) external (external) gift_card (gift_card) grouped (grouped) 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) 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: ✔ Enforce Approved Product Download Directories: ✔ HPOS feature screen enabled: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: –

WC Pages

Shop base: #5 - /shop/ Cart: #6 - /cart/ Checkout: #7 - /checkout/ My account: #8 - /my-account/ Terms and conditions: ❌ Page not set

Theme

Name: Storefront Version: 4.2.0 (update to version 4.3.0 is available) 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: storefront/woocommerce/emails/customer-new-account.php

Subscriptions

WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://numberthree.mystagingwebsite.com Subscriptions-core Library Version: 5.7.2 Subscription Statuses: wc-active: 6 wc-expired: 2

WooCommerce Account Connected: ✔ Yes Active Product Key: ❌ No Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure

Store Setup

Country / State: Canada — Ontario

Subscriptions by Payment Gateway

Square: wc-active: 6 wc-expired: 2

Payment Gateway Support

Check payments: products Cash on delivery: products PayPal: refunds products subscriptions subscription_cancellation subscription_suspension subscription_reactivation subscription_amount_changes subscription_date_changes subscription_payment_method_change subscription_payment_method_change_customer subscription_payment_method_change_admin multiple_subscriptions

Square: products card_types customer_decline_messages payment_form authorization charge charge-virtual capture_charge refunds voids customer_id tokenization add_payment_method token_editor subscriptions subscription_suspension subscription_cancellation subscription_reactivation subscription_amount_changes subscription_date_changes multiple_subscriptions subscription_payment_method_change_customer subscription_payment_method_change_admin

Gift Cards

Database Version: 1.16.2 Loopback Test: ✔ Task Queueing Test: ✔

WooCommerce PayPal Payments

Onboarded: ✔ Shop country code: CA WooCommerce currency supported: ✔ PayPal card processing available in country: ✔ Pay Later messaging available in country: – Webhook status: – Vault enabled: ✔ Logging enabled: ✔ Reference Transactions: – Used PayPal Checkout plugin: –

Square

Environment: Production Tokenization Enabled: ✔ Debug Mode: Off

Admin

Enabled Features: activity-panels analytics product-block-editor coupons customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page

Disabled Features: core-profiler minified-js new-product-management-experience product-variation-management settings async-product-editor-category-field

Daily Cron: ✔ Next scheduled: 2023-06-23 14:44:56 +00:00 Options: ✔ Notes: 112 Onboarding: skipped

Action Scheduler

Complete: 1,118 Oldest: 2023-05-22 19:41:57 +0000 Newest: 2023-06-22 18:54:35 +0000

Failed: 13 Oldest: 2022-11-11 17:37:23 +0000 Newest: 2023-06-13 16:07:32 +0000

Pending: 10 Oldest: 2023-06-22 19:54:35 +0000 Newest: 2023-07-22 18:40:02 +0000

Smart Coupons related settings

Number of coupons to show: 5 Number of characters in auto-generated coupon code: Valid order status for auto-generating coupon: processing completed

Include tax in the amount of the generated gift card: Deduct credit/gift before doing tax calculations: no Gift Card discount is inclusive of tax: no Automatic deletion: no Coupon emails: yes Printing coupons: yes Sell gift cards at less price?: no Use gift card applied in first subscription order for subsequent renewals until credit reaches zero: yes Renewal orders should not generate coupons even when they include a product that issues coupons: no Allow sending of coupons to others: yes Allow schedule sending of coupons?: Combine emails: Auto generated coupon email: yes Combined auto generated coupons email: no Acknowledgement email: yes Enable taxes: yes Prices entered with tax: no Rounding: no Display prices in the shop: excl Display prices during cart and checkout: excl Display tax totals: itemized Enable the use of coupon codes: yes Calculate coupon discounts sequentially: no Account endpoints > Coupons: wc-smart-coupons

Status report information

Generated at: 2023-06-22 19:39:47 +00:00 `

Additional Details

6455773-zen

lynnjat7 commented 1 year ago

Workaround: remove the PayPal button from Bookable Product pages with this snippet: https://gist.github.com/InpsydeNiklas/14c1b788301f8ffbaad4e37ca9092ed3

InpsydeNiklas commented 1 year ago

Hi @lynnjat7 Just to let you know, the team is working on adding full compatibility with the Bookings plugin. It needs a bit more testing, so the support for it will probably be included in the update that comes after the upcoming 2.2.0 version, likely sometime in early August.