Fatal error due to null create_time in PayPalOrderResponse (PS Checkout v5.0.2) #1355
Replies: 7 comments
-
|
Hello! Thanks for reporting the bug, we expect That is very weird. When we try to reproduce on our side, we have I suggest reaching out to the Support team using this link https://help-center.prestashop.com/contact?psx=ps_checkout |
Beta Was this translation helpful? Give feedback.
-
|
Hello! Thanks for your quick reply. To reproduce the issue on my side:
Everything worked fine before the latest update. I can still access the order details of all orders placed before the update without any issue. I have also reproduced this bug on another shop, so it does not seem to be isolated to my installation. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! I applied a temporary fix to avoid the fatal error on one specific order where create_time was null. In PayPalOrderProvider.php, inside buildPayPalOrderResponse(), I added the following: And then passed $createTime to the PayPalOrderResponse constructor. This allowed me to access the order details without crashing. Could you advise the proper way to add or set create_time for this order only? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Hello @matks, I’m wondering why the module does not include a fallback or safety check for In some rare cases, This seems like something that could affect more than one user. Have nice day. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @StephaneFerre good news we found the problem! It should be fixed by PR #1381 and delivered with incoming patch release v5.0.4 |
Beta Was this translation helpful? Give feedback.
-
|
Hello @matks 🙂 |
Beta Was this translation helpful? Give feedback.
-
|
Fixed in release 5.0.4 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I’m encountering a fatal error in ps_checkout v5.0.2:
Warning: Undefined array key "create_time" in PayPalOrderProvider.php on line 167
Fatal error: Uncaught TypeError: PsCheckout\Api\ValueObject\PayPalOrderResponse::__construct(): Argument #8 ($createTime) must be of type string, null given
The error occurs in
PayPalOrderProvider.phpwhen callingbuildPayPalOrderResponse():The error occurs in
PayPalOrderProvider.phpwhen callingbuildPayPalOrderResponse():Could you advise whether the PayPalOrderResponse class should allow null for $createTime, or if the provider should always ensure it is set?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions