mollie / OpenCart

iDEAL, Creditcard, Bancontact/Mister Cash, SOFORT, Belfius Direct Net, KBC/CBC Payment Button, Bank transfer, Bitcoin, PayPal & paysafecard for OpenCart 1.5.6+ and OpenCart 2.0+.
http://www.mollie.com
BSD 2-Clause "Simplified" License
72 stars 37 forks source link

Mollie 9.3.1 is breaking plugins due to payment images #224

Closed DomoticX closed 4 years ago

DomoticX commented 4 years ago

We use TCPDF to create invoices, after updating mollie to v9.3.1....TCPDF is not able to get the filesize of the payment images and the PDF plugin breaks, whereas the rest of the shop images work fine....strange... i tried to fix it but no luck atm...

Ps. i also noticed some RELATIVE PATHS! in multiple base.php (and other PHP files) etc, don't know if that is the issue, but it should be adressed with full/absolute paths from the config, e.g. like:

$payment_method['icon'] = "../image/mollie/" . $module_name . "2x.png";

to

$payment_method['icon'] = DIR_IMAGE . "mollie/" . $module_name . "2x.png";

Using mollie 9.3.1 and OC 3.0.3.2

DomoticX commented 4 years ago

tcpdf error

The file exists though...maybe the payment method array has troubles or is using relative paths somewhere for plugins not to detect properly...

DomoticX commented 4 years ago

For what it's worth...i have checked the database:

table: oc_order column: payment_code

when i REVERT this string (wich gives the 'JSON' error): <img src="https://webshop.domoticx.nl/image/mollie/ideal.png" height="20" style="margin:0 5px -5px 0" />iDEAL

back to:

<img src="https://www.mollie.com/external/icons/payment-methods/ideal.png" height="20" style="margin:0 5px -5px 0" />iDEAL

it works then....no clue what is wrong with the code though....or TCPDF...i am really stunned atm what the cause could be...

This JSON ERROR response seems JSON started with a < (hence the “Unexpected token <”). That unexpected token, <, is a strong clue that the response was HTML instead of JSON.

from: https://www.codeproject.com/Tips/1239019/Unexpected-token-in-JSON-at-position The server might return HTML instead of JSON for a bunch of reasons:

The URL doesn’t exist and the server returned an 404 page as HTML. You might have a typo in the client code (/users instead of /user) or in the server code that sets up the route.

beireken commented 4 years ago

Is this still happening when we disable the images in mollie settings? ( as a temporary fix )

DomoticX commented 4 years ago

Is this still happening when we disable the images in mollie settings? ( as a temporary fix )

We have disabled the images as temporally fix, that seems to work for now....

beireken commented 4 years ago

Ok, thank you @DomoticX

DomoticX commented 4 years ago

After some testing it seems the error was a TCPDF temp cache folder setting (K_PATH_CACHE), now placed outside the webspace again (as default)

Not working: define ('K_PATH_CACHE', '/webspace/httpdocs/.../.../.../tcpdf/tmp/');

Working: define ('K_PATH_CACHE', '/tmp/');

Hope it might help someone else facing this problem ;-)