mollie / PrestaShop

iDEAL, Creditcard, Bancontact, SOFORT, Bank transfer, PayPal & paysafecard for Prestashop
http://www.mollie.com
BSD 2-Clause "Simplified" License
70 stars 43 forks source link

Live mode and test mode mixed up #263

Closed RobMeerwijk closed 3 years ago

RobMeerwijk commented 3 years ago

Expected behavior

Test mode if test mode is switched on Live mode if live mode is switched on

Actual behavior

Test mode if live mode is switched on Live mode if test mode is switched on

Steps to reproduce the behavior

Switch on test mode, start testing: live behaviour Switch back to live, test behaviour...

Environment

Prestashop 1.7.7 Mollie 4.1.2 PHP 7.3.19-1~deb10u1

RobMeerwijk commented 3 years ago

I can see what happened here, after de-install / re-install due to 1.7.7 compatibility issue the api-keys got magically switched without re-entering the keys. I would suggest a check on API-keys. I had even tested the API keys, and the module did not complain over the switched keys.

RobMeerwijk commented 3 years ago

After switching back to the correct config I found the following error regarding a live test payment carried out against the live key in the test-field.

[Tue Dec 15 03:47:17.247748 2020] [proxy_fcgi:error] [pid 13809:tid 140414619215616] [client 87.233.217.242:42748] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught MolliePrefix\\Mollie\\Api\\Exceptions\\ApiException: [2020-12-15T03:47:17+0100] Error executing API call (404: Not Found): Payment tr_9usne3vffa exists, but the wrong mode is used. Try switching live / test API keys.. Documentation: https://docs.mollie.com/guides/handling-errors in /mnt/disks/disk_1/www/sauna-bouwen/shop/modules/mollie/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php:102\nStack trace:\n#0 /mnt/disks/disk_1/www/sauna-bouwen/shop/modules/mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(448): MolliePrefix\\Mollie\\Api\\Exceptions\\ApiException::createFromResponse(Object(MolliePrefix\\GuzzleHttp\\Psr7\\Response), NULL)\n#1 /mnt/disks/disk_1/www/sauna-bouwen/shop/modules/mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(425): MolliePrefix\\Mollie\\Api\\MollieApiClient->parseResponseBody(Object(MolliePrefix\\GuzzleHttp\\Psr7\\Response))\n#2 /mnt/disks/disk_1/www/sauna-bouwen/shop/modules/mollie/vendor/mollie/mollie-api-php/src/MollieAp...'

As far as I am concerned the issue is resolved. I don't know how the keys got switched during un-install / re-install, but I suggest an enhancement warning for switched key's, either as a warning in the config-screen when pressing "test apikeys".

Saimis777 commented 3 years ago

Hello Rob, hope you're having a good day.

Thank you for your insights, really glad that you've managed to resolve the issue, maybe you need assistance with anything else further?

Best regards, Invertus Support team

AmandaMollie commented 3 years ago

@RobMeerwijk - This is a good idea for an enhancement, indeed! We'll take a look at making this happen.

Saimis777 commented 3 years ago

@RobMeerwijk I will close this issue for now, and if you will need any further assistance, let us know, we are here to help!

Also, be sure to download the latest version of Mollie here - https://github.com/mollie/Prestashop/releases

Any feedback regarding the new version is greatly appreciated!

Best regards, Invertus Support team