magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.45k stars 9.29k forks source link

Checkout with PayPal - Buttons not being rendered anymore #32548

Closed stephansteiner closed 3 years ago

stephansteiner commented 3 years ago

Since March 16th, "Checkout with PayPal" Buttons are not being rendered anymore. The URL for dynamic images from paypal doesn't seem to work anymore.

Preconditions (*)

  1. Install a Magento 2.4.2 Shop with sample sample products
  2. Have a PayPal Account to set the shop up with

Steps to reproduce (*)

  1. in Sales > Payment Method go to PayPal and set "Enable this Solution" to "Yes"
  2. Configure PayPal using API Signature (set API Username, Password and Signature)
  3. Leave "Enable in-Context Checkout Experience" set to "No"
  4. Under "Basic Settings", set "Display on Product Details page" to "Yes"
  5. Under "Advanced Settings", be sure to set "Shortcut Buttons Flavor" to "Dynamic"

Expected result (*)

On Product detail page or on cart/minicart, it should show a button with "Checkout with Paypal"

Actual result (*)

  1. "Checkout with PayPal"-Buttons shows a broken image link. The URL of the image is https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=en_GB which doesn't seem to work anymore.

The generated code for the image button is: <input type="image" data-action="checkout-form-submit" data-checkout-url="http://bbq.testwebshop.eu/paypal/express/start/button/1/" src="https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&amp;buttontype=ecshortcut&amp;locale=en_GB" alt="Checkout with PayPal" title="Checkout with PayPal">

Only workaround is to set Advanced Settings > Shortcut Buttons Flavor to "static".


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 3 years ago

Hi @stephansteiner. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

stephansteiner commented 3 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 years ago

Hi @stephansteiner. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 years ago

Hi @stephansteiner, here is your Magento Instance: https://05a5d3499b4d527537d8f55e02bd75aa-2-4-develop.instances.magento-community.engineering Admin access: https://05a5d3499b4d527537d8f55e02bd75aa-2-4-develop.instances.magento-community.engineering/admin_53b4 Login: eae235fd Password: 78f0a8ff219a

stephansteiner commented 3 years ago

Ok, I could reproduce the issue, but is dependent of the locale setting of the webshop. With locale set to en_US the buttons where displayed correctly with a different locale (example de_DE) the image links are broken. See here for broken Image of checkout with paypal button: https://05a5d3499b4d527537d8f55e02bd75aa-2-4-develop.instances.magento-community.engineering/argus-all-weather-tank.html

Bildschirmfoto 2021-03-18 um 16 08 50

The issue seems to be is in the function _getDynamicImageUrl in class \Magento\Paypal\Model\Config: for locales different from en_US the image url is build using

return sprintf(
            'https://fpdbs%s.paypal.com/dynamicimageweb?%s',
            $this->getValue('sandboxFlag') ? '.sandbox' : '',
            http_build_query($params)
        );

Apparently https://fpdbs.paypal.com/dynamicimageweb and https://fpdbs.sandbox.paypal.com/dynamicimageweb are both defunct, resulting in the broken image url.

m2-assistant[bot] commented 3 years ago

Hi @ajijshekh123. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ajijshekh123 commented 3 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 years ago

Hi @ajijshekh123. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 years ago

Hi @ajijshekh123, here is your Magento Instance: https://05a5d3499b4d527537d8f55e02bd75aa-2-4-develop.instances.magento-community.engineering Admin access: https://05a5d3499b4d527537d8f55e02bd75aa-2-4-develop.instances.magento-community.engineering/admin_4e36 Login: 8690ef06 Password: ca31f30c86ca

stephansteiner commented 3 years ago

@ajijshekh123 Hi, I noticed that you're verifying this - please remember to change the shops locale, as the default "en_US" won't display broken image buttons. You may also enter fake data for PayPal credentials as these come only into use when actually clicking the button.

ajijshekh123 commented 3 years ago

Hi @stephansteiner, I have verified this issue as per your steps and configuration. All configuration I have set up properly but I didn't know which change required on shops local as the default "en_US". Please update the screenshot here. The rest of the configuration I have set up properly and the "Checkout with PayPal" button is showing properly as Expected.

Product Details Page: image

Mini Cart: image

Thanks.

stephansteiner commented 3 years ago

If PayPal is set to Sandbox Mode, the icons are working, if you disable Sandbox Mode the icon logo is broken again. Sandbox Payment Icon URL: https://fpdbs.sandbox.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=de_DE Non-Sandbox Version (Broken): https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=de_DE

Remember that this affects shops where the locale is set to anythine else but en_US. Please check by changing store locale in Store > Configuration > Locale Options Bildschirmfoto 2021-03-19 um 12 58 21

ajijshekh123 commented 3 years ago

Hello @stephansteiner, As per defined your configuration, I have reviewed the "Checkout with PayPal" button on the product details page. It is broken and not showing properly.

image

image

image

Thanks.

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @ajijshekh123 Thank you for verifying the issue. Based on the provided information internal tickets MC-41454 were created

Issue Available: @ajijshekh123, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!