Description
Preconditions and environment
Upon upgrading our production site from M2.4.5-p2 to M2.4.6 we discovered customers were unable to checkout via PayPal through Braintree.
We were unable to find any workaround.
Building Magento 2.4.6
+ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
+ /usr/local/apache/bin/httpd -v
Server version: Apache/2.4.46 (Unix)
Server built: Jun 16 2021 21:29:21
+ mysql -V
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
+ php -v
PHP 8.1.17 (cli) (built: Mar 17 2023 09:39:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies
with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies
+ php /usr/local/bin/composer -V
Composer version 2.3.5 2022-04-13 16:43:00
Steps to reproduce
Fresh Install of M2.4.6 in environment as above
Open browser "incognito" window using Windows 11 and Google Chrome
Login to Magento admin backend
Nav to Admin>Stores>Configure>General>Web>Default Cookie Settings
If necessary, set the Cookie Domain to the appropriate domain value (so Demo Customer will be able to login on front end)
Save Config
Nav to Admin>Stores>Configure>Sales>Payment Methods
Select Merchant Country as United States and Save Config
Configure Braintree Payments (by GENE Commerce v4.5.0)
Enter known valid sandbox credentials for Merchant ID, Public Key, Private Key and Validate Credentials
In the Enable PayPal through Braintree section...
Set Enable PayPal through Braintree = Yes
Set Display on Shopping Cart = Yes
Save Config
Flush Magento Cache
Open separate tab on incognito browser and navigate to frontend
Successfully Sign In using Demo Customer Access credentials
Click Add-to-Cart for Affirm Water Bottle (or anyother product)
Observe "spinner" remains over count box in upper right hand corner of page and does not clear
NO message "You added the Affirm Water Bottle to your shopping cart." appears
Clicking cart icon displays "You have no items in your shopping cart"
Add-to-Cart two or three more times for the Affirm Water Bottle
Click the Luma Store icon to return to home page
[ Although the website is not hung, it's useless because nothing can successfully added to cart,
this behavior appears to be related to the PayPal button appearing in the mini-cart ]
Return to backend
Nav to Admin>Stores>Configure>Sales>Payment Methods
Configure Braintree Payments (by GENE Commerce v4.5.0)
In the Enable PayPal through Braintree section
Set Display on Shopping Cart = No
Save Config
Flush Magento Cache
Return to frontend
You should still be on the Luma store home page
Use your web browser "refresh" function to reload the page
The green circle with the check mark and the message "You added the Affirm Water Bottle to your shopping cart." appears several times.
The count box in the upper right corner will now equal the number of times add-to-cart was previously clicked.
Click the cart icon and Proceed to Checkout
Shipping Method select Fixed Flat Rate
Payment Method select PayPal
Click the large yellow PayPal button
Rarely, the PayPal "modal box" zooms out surrounded by dark background, and remains open as normal,
If the PayPal modal box remains open, close it and add another item to cart then Proceed to Checkout again
In most tests the modal box zooms out for a moment and closes, then
Message "PayPal Checkout could not be initialized. Please contact store owner." appears.
and you are unable to proceed to place an order.
Expected result
During checkout upon selecting PayPal as the Payment Method then clicking the large yellow PayPal button the PayPal modal box appears and the customer is able to successfully make payment and checkout.
Actual result
During checkout upon selecting PayPal as the Payment Method then clicking the large yellow PayPal button the PayPal modal box appears for a moment before automatically closing and the customer is unable to make payment or complete the order.
Additional information
Tested with both our sandbox and production Braintree creditials, in both production and development environments, PayPal as payment method is essentially not functional although for some reason under certain unknown circumstances it will work as expected for a specific customer checkout. It did work as expected on M2.4.5-p2
I was unable to find any workaround and the PayPal payment method is currently disabled on our M2.4.6 production website.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.