-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to checkout with PayPal through Braintree #37242
Comments
Hi @n2diving-dgx. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-November. Thank you for working on this issue.
|
After consultation, I have learned that the Braintree V4.5.0 module in M2.4.6 includes new functionality and is now passing individual cart line items to PayPal. Previously, the Braintree V4.4.0 version in M2.4.5 and earlier did NOT pass cart line items to PayPal just the Grand Total amount on the order. However, there is an issue in that when the cart line items do not add up to the Grand Total, for example if there is a separate sales tax line item, then PayPal through Braintree will fail as a payment method on checkout, the modal box will automatically close and Magento will display an error message to the customer "PayPal Checkout could not be initialized." There is a configuration option found under Advanced Braintree Settings for Send Cart Line Items, which defaults to Yes. Setting "Send Cart Line Items" = NO does allow the PayPal login modal box to zoom out and remain... it is possible to login to PayPal using the modal box, but upon clicking the "Complete Purchase" button, the modal box closes and returns to the Magento checkout flow where a pink box declares "Something went wrong with your request. Please try again later." simultaneously an error for "Call to undefined method..." is logged in exception.log file. ** main.CRITICAL: Error: Call to undefined method Magento\Sales\Api\Data\OrderExtension::getGwBasePrice() in /www/releases/vendor/paypal/module-braintree-core/Gateway/Request/Level23ProcessingDataBuilder.php:188 ** As of now, there is no workaround that allows checkout using PayPal through Braintree on M2.4.6 |
same issue, thought it was just related to the PayPal buttons (was getting error when trying to add to cart) and on the cart page when PayPal through Braintree was enabled and display on shopping cart was enabled. Was able to duplicate error when using paypal as a checkout method. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @engcom-Dash. Thank you for working on this issue.
|
Hi @n2diving-dgx , Verified the issue in 2.4.6- Magento instance and the issue is reproducible,Hence we are confirming the issue.Kindly Refer the Screenshots. Preconditions: Steps to reproduce: Braintree configuration Here attached the video reference placing the order with paypal: paypal.mp4We are getting actual result as per the description ,Hence we are confirming the issue in 2.4.6-develop instance. Regards, |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-8386 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Dash. Thank you for verifying the issue. |
We have the same issue and opened another issue. |
I can confirm on a stock checkout that paypal does NOT work with braintree. beyond frustrating. |
I can also confirm this change does not work either on p3: Line 135 (after $order = $paymentDO->getOrder();) we added: $shouldSubtractTax = $this->scopeConfig->getValue(\Magento\Tax\Model\Config::XML_PATH_DISPLAY_SALES_PRICE, ScopeInterface::SCOPE_STORE, $order->getStoreId()) == \Magento\Tax\Model\Config::DISPLAY_TYPE_INCLUDING_TAX; and line 162 (after $itemQuantity = (float)$item->getQtyOrdered();) we changed the line to: $itemUnitPrice = $shouldSubtractTax ? ((float)$item->getPrice() - (float)$item->getTaxAmount()) : (float)$item->getPrice(); Result: #72 {main} {"exception":"[object] (Error(code: 0): Call to undefined method Magento\Sales\Api\Data\OrderExtension::getGwBasePrice() at vendor/paypal/module-braintree-core/Gateway/Request/Level23ProcessingDataBuilder.php:191)"} [] This still resolves the issue and everything seems to be working. So still some good bugs somewhere with the GW feature. Come on BrainTree/Gene, fix this. It is getting old having to go through these issues every single update. Commenting out lines 186-189 & 198-232 allows PayPal via Braintree to process without errors Have now left lines 192-195 in and payments are processing okay. |
@live4soccer7 we actually had to change a bit the initial solution, because for cart items with quantity greater than 1 it would still fail. not sure if that's what you experience but here's what we changed:
looking forward to an official fix for this |
This comment was marked as outdated.
This comment was marked as outdated.
I also had to disable captcha v2 again. I'm on 2.4.6-p3. CC could not go through. I implemented the resolution I stated above and I had seen that the captcha issue was resolved. It is not, at least with the resolution that was implemented in my post. |
I have upgraded Magento version from 2.4.5-p2 to 2.4.6-p3 and I am also getting the same error: report.CRITICAL: Error: Call to undefined method Magento\Sales\Api\Data\OrderExtension::getGwBasePrice() in vendor/paypal/module-braintree-core/Gateway/Request/Level23ProcessingDataBuilder.php Is there any patch or fixes available? Thanks in advance! |
same issue on 2.4.6-p3, then installed the suggested patch https://support.gene.co.uk/support/solutions/articles/35000227790-patch-for-unable-to-checkout-via-paypal-through-braintree-in-magento-v2-4-6-and-v2-4-6-p1-p2 and setted under Advanced Braintree Settings for "Send Cart Line Items" to NO, now it works. |
When I opened the link it only has patch for v2.4.6 and v2.4.6-p1/p2. Do you have separate patch for 2.4.6-p3 or Can we use the same patch for p3 as well? |
i used it on 2.4.6-p3 and works well. |
I am using M2.4.7 open source and still found the issue as I am unable to checkout using paypal through braintree. |
@neha023 What errors are you seeing? |
@live4soccer7 It show the integration not done yet even if it is done by my side. Below are some screenshots of admin configuration, Braintree & Paypal: Both braintree & Paypal sandbox created with same email Id and sandbox business id have used for india country & braintree sandbox account created for country india. |
This appears to be a different issue than what this thread has been experiencing. |
@neha023 I recently got it working on the shop I am working on. The error was not in the code. I had to get in touch with braintree, because they hadnt connected the braintree account with the paypal account or smth. similar. Took us about 3 weeks through some support tickets at braintree and paypal. So the error was on their end and not on ours. |
same problem with 2.4.6-p6 and patch is not working. |
Had the same problem in 2.4.6-p6 - Strangely our BrainTree Account Manager recommended we try Adobe Payment Services as an alternative. We did but it clashed with another module (yet to be identified) so we switched back to BrainTree and are using PayPal outside of BrainTree for the moment. This works perfectly. The other recommendation from BrainTree is to raise a support ticket and get the patch. That didn't work for us either. Now we're weighing up how much time to spend BrainTree debugging vs Adobe Payments debugging (to track down the conflicting module(s)) |
@link2light Braintree Payments are still very much available in Magento 2.4.7 (including -p2) as per the Gene Commerce docs |
I'm on 2.4.6-p7 and paypal works just fine with the usual fix in this thread. |
@link2light Braintree is completely available on all the current and upcoming Magento versions. If you don't mind then can I ask you to delete your comment as It will mislead merchants & developers. I don't know why they have told you this but I would like to know the name of that Braintree person who has asked you this. are you able to share name of that Braintree guy with me? |
@link2light Please raise a support ticket here (https://support.gene.co.uk/support/home) and share all the details of that Braintree person and conversion if you can, thanks! |
@link2light Thank you for sending the email. |
Hi, As per this comment #37242 (comment) issue has been fixed already we are closing this issue. Thanks. |
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.
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
The text was updated successfully, but these errors were encountered: