opencart / opencart

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.

Home Page:https://www.opencart.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PayPal Checkout Integration breaks choose payment method in checkout

stuartmckim opened this issue · comments

What version of OpenCart are you reporting this for?
OpenCart: 4.0.2.3
PayPal Checkout Integration: downloaded today

Describe the bug
When PayPal Checkout Integration is enabled, the "Choose" button for choose payment method does not do anything. The error log states:

2024-03-09 14:25:08 - PHP Warning:  Undefined array key "status" in /var/www/footandfield/extension/paypal/catalog/model/payment/paypal.php on line 78
2024-03-09 14:25:08 - PHP Warning:  Undefined array key "status" in /var/www/footandfield/extension/paypal/catalog/model/payment/paypal.php on line 85

This problem occurs for both sandbox and production PayPal modes.

To Reproduce
Steps to reproduce the behavior:
As admin:

  1. Upload, install, and enable PayPal Checkout Integration
  2. Connect to PayPal account

As customer:

  1. Add an item to cart, then go to checkout.
  2. Click "Choose" next to Choose payment method...

As admin:

  1. See error in error log

Expected behavior
The choose payment popup should open. In my case, Cash on Delivery and Free Checkout are also enabled. This problem only occurs when the PayPal extension is enabled.

Server / Test environment (please complete the following information):

  • Deployed to a web server
  • Debian Bookworm
  • PHP 8.2.7
  • Apache version 2.4.57
  • Browser(s) tested with: Firefox
    • Version 115.8.0esr

Describe the bug When PayPal Checkout Integration is enabled, the "Choose" button for choose payment method does not do anything. The error log states:

Exactly the same issue faced yesterday while trying to set up new store.

  • Fresh new install.
  • OpenCart 4.0.2.3
  • PHP 8.1
  • Google Chrome 122.0

An extra piece of information: browser's console logs:

SyntaxError: Unexpected token '<', "<b>Warning"... is not valid JSON
parsererror
<b>Warning</b>: Undefined array key "status" in <b>/.../extension/paypal/catalog/model/payment/paypal.php</b> on line <b>78</b><b>Warning</b>: Undefined array key "status" in <b>/.../extension/paypal/catalog/model/payment/paypal.php</b> on line <b>85</b>{"payment_methods":{"paypal":{"code":"paypal","name":"PayPal","option":{"paypal":{"code":"paypal.paypal","name":"PayPal (Pay with PayPal, Card)"}},"sort_order":"2"},"cod":{"code":"cod","name":"Cash On Delivery","option":{"cod":{"code":"cod.cod","name":"Cash On Delivery"}},"sort_order":"5"}}}

Exactly the same issue faced :(

Try this one: https://github.com/Dreamvention/paypal/tree/master
It might have some further fixes not yet available on the OpenCart marketplace!

@danielkerr, can you please remove PayPal Checkout Integration's compatibility with 4.0.2.3 from the marketplace until the investigation is done? As of now, this extension does not support 4.0.2.3 (it cracks OC). Thanks.

@stuartmckim or @ii-st : Can someone please report this as a new issue on the repository https://github.com/Dreamvention/paypal please?

@stuartmckim or @ii-st : Can someone please report this as a new issue on the repository https://github.com/Dreamvention/paypal please?

done.
Dreamvention/paypal#23

should marketplace maintainers remove the compatibility of this extension with 4.0.2.3?

The issue has been solved. Please install the latest version of the module
https://github.com/Dreamvention/paypal/releases

The issue has been solved. Please install the latest version of the module https://github.com/Dreamvention/paypal/releases

Thanks for the quick fix. Can you also please fix the other reported issues (see https://github.com/Dreamvention/paypal/pulls?q=is%3Aopen+is%3Apr), and to avoid any confusions, you should then call it V3.0.1 in e.g. system/config/paypal.php, we don't want to end with multiple flavors of V3.0.0.

I confirm the one at Github (with this commit posted an hour ago): Dreamvention/paypal@34b610a solves the issue.
As mentioned by @mhcwebdesign , versioning causes confusion. As 3.0.0 is available on the market or was downloaded by users before, and now we have v3.0.0 again with some updates.

@rsenmakh, thank you for the quick fix. As @mhcwebdesign and @ii-st also requested, can the version number be bumped to indicate that a fix has been made? There are comments on the opencart.com extension page with the same problem, but they won't know that this fix is available.

Hi @stuartmckim ,
Thank you for your comment. Your note is entirely reasonable.
We plan to make further adjustments in the upcoming days and will then update the version number.

@mhcwebdesign

Can you also please fix the other reported issues (see https://github.com/Dreamvention/paypal/pulls?q=is%3Aopen+is%3Apr)

Sure, all these edits will be added in the upcoming release.

@rsenmakh : For the time being, I am using your latest V3.0.0 , along with further fixes as the pull requests on your github repository, and then I re-labeled it as V3.0.0.1, all in OC 3.0.x.x (the upcoming OC 3.0.4.0). It works fine, but I am happy to hold back the planned OC 3.0.4.0 for a couple of days if you plan further fixes beyond V3.0.0.

How soon will you have a stable PayPal in your planned upcoming release?