Skip to main content

#154 Webhook failing

Posted in ‘Stripe Checkout for Phoca Cart’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information (available for public)

PHP version
8.4.4
Phoca Cart version
5.0.0beta99
Stripe Checkout for Phoca Cart version
2.1.3

Latest post by b2z on Monday, 24 March 2025 13:26 EET

iceferret

Hi all, Our webhook has been failing a a lot for a while now, been trying to trace the issue presuming something wasn't entered correctly on our site www.rsf.org.uk. Been inspecting the rsponse body and noticed line 15 which says

    <title>0 PlgPcpStripeco::getOrderAmount(): Argument #1 ($orderId) must be of type int, string given, called in /home/rsf96104/public_html/plugins/pcp/stripeco/stripeco.php on line 927</title>

Is this causing the issue?

Cheers

Mike Pringle

iceferret

Just a heads up, changed line 927 to read, so the value is cast to an integer, this seems to solve the problem but is then marked as cancelled in Phoca cart.

$amount = $this->getOrderAmount((int) $order['common']->id);

b2z

Hi Mike,

Thanks for a report and feedback. I wonder what version of the plugin are your using? Can't find the piece of code you mentioned on line 927.

Kind regards,

Dmitrijs

b2z

I see now - you are using 2.1.3 and the code on line 927 is:

$amount = $this->getOrderAmount($orderId);

Interesting. Have you changed PHP version recently? Because on 8.2.20 I do not have such warning message.

Kind regards,

Dmitrijs

b2z

Nevermind :) I was checking on version 2.1.2 that does not have this issue.

Thank you for your report one more time, will fix it in the next version.

Kind regards,

Dmitrijs

iceferret

Thanks, we have been on Php3 for quite a long time and just changed to Php4 in the last two weeks. I looked back and found a version of the plugin I downloaded at end 2023 beginning 2024 and installed that. Set Phoca and Stripe in test mode and succesfully carried out a transaction. Back in live mode now, lets see what happens. ๐Ÿ˜Ž๐Ÿ‘

iceferret

Looking back I have several versions of the app in my downloads folder so i'm now using 2.1.2 and can confirm succesful transaction in sandbox mode

b2z

Yeah, 2.1.3 has a bug indeed, and 2.1.2 has not. I need to be more cautious introducing type-hinting.

Kind regards,

Dmitrijs

b2z

Hi Mike,

Has been fixed in version 2.1.4 and released.

Kind regards,

Dmitrijs

iceferret

Thanks for the quick work Dimtrijs,ย  ๐Ÿ˜Ž๐Ÿ‘

b2z

Hi Mike,

Can you confirm that it is working as expected now? Just to be sure that no fixes are needed :)

Kind regards,

Dmitrijs

iceferret

Absolutely, put everything in sandbox and made a test purchase. Went though and no errors with the webhook reported, think you cracked it ๐Ÿ˜Š

Many thanks

Mike

b2z

Thank you!

Kind regards,

Dmitrijs

Support information

Support hours: You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+3), but not limited. Our staff is pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days.


Our time: / Your time:

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. We also ask you to remove temporary credentials at your site after the problem is resolved. Thank you.

Support of free extensions is not provided on this forum. Please submit your questions or report issues via Github tracker. See link on the product page.