Jump to content

Stripe webhook issues


Recommended Posts

Hello

after updating to version 8 I continue to receive from Stripe email reporting that Webhook is failing.
I checked in my Stripe Payment gateway and all is correct (Stripe API Key e.g.) and I can receive payments from Stripe.
I understood from stripe logs that the problem happens when a customer tries to update credit card .

Stripe log is reporting
HTTP status code 500 (Internal Server Error)

in Apache logs I see this

54.117.205.235 - - [20/Nov/2020:07:35:38 +0100] "POST /whmcs/modules/gateways/callback/stripe.php HTTP/1.1" 500 - "-" "Stripe/1.0 (+https://stripe.com/docs/webhooks)"

and in Stripe admin section I see this

Failed payment_method.updated evt_1HpTDZHdgpOFjtGMaZVln7uq Nov 20, 6:35 AM
Response
No response body

I contacted WHMCS support ( ticket JMX-068891 ) on 19th Nov 2020 (03:21) but they does not seem interested to solve the problem. They replies very slowww and are asking me for errors in log
but I have only the error shown above.

Anyone can help me to solve this issue ?

Thank you

 

 

Edited by graziano_68
Link to comment
Share on other sites

There is likely a php error within the callback.  Turning debug, log errors, show errors under whmcs -> settings -> other tab may help.  Once that is done, check the php error log for the errors after a webhook fails.  The php error log can and usually are separate from the apache /nginx / whatever web server error log. 

Link to comment
Share on other sites

I found this in   /home/myuser/public_html/whmcs/modules/gateways/callback/ (the folder where is located stripe webhook)
 

[19-Nov-2020 11:23:46 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[19-Nov-2020 12:08:59 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[19-Nov-2020 13:53:30 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[19-Nov-2020 13:53:30 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[19-Nov-2020 14:09:12 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[19-Nov-2020 16:11:03 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:26:46 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:26:50 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:26:50 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 06:26:50 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:26:52 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:35:39 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 06:35:39 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 07:35:35 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 07:35:35 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 08:03:28 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 09:34:43 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 09:34:43 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 11:29:36 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 11:34:40 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 11:34:40 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 13:10:14 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:15:50 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:15:54 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:15:54 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 13:15:56 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:15:59 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:22:10 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:22:10 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:22:13 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:22:13 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 13:22:14 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:31:25 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:31:25 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId
[20-Nov-2020 13:34:30 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: id
[20-Nov-2020 13:34:30 UTC] Stripe Notice: Undefined property of Stripe\StripeObject instance: clientId

 

Link to comment
Share on other sites

Notices should not cause a 500 error as that is more of a fatal error.   Though if the error was output or something beyond a json was given, it might have caused an error. 

The error log might be in /home/myuser/public_html/whmcs/error_log or each folder within whmcs or in a central file for php errors.  You need to check a phpinfo() output.  Check WHMCS -> Utilities -> System -> PHP Info and find error_log and the error log should be there.  Check that file and see if there are any fatal errors or more then a notice. 

Link to comment
Share on other sites

I am still fighting with this issue, WHMCS support still useless  ( ticket JMX-068891 ).

In few words everything works in WHMCS but various files in  /public_html/whmcs/modules/gateways/callback returns a 500 internal error

https://mydomain/whmcs/modules/gateways/callback/index.php  works

but various other files in the folder

https://mydomain/whmcs/modules/gateways/callback/stripe.php
https://mydomain/whmcs/modules/gateways/callback/paypal.php

returns a 500 internal error . In the log there is nothing useful,
all error logs sets to show any possible error.
I asked support to debug the file using a decoded version,
but they ignore my request. Damn , what can I do now, since the file are
encrypted and support is useless ?

I tried to reupload all v8 files it didn't help too

 

 

 

 

 

Edited by graziano_68
Link to comment
Share on other sites

  • 1 month later...

I am on v8.0.4 using PHP v7.3 and I am also having this problem when someone tries to update their credit card details.   My system health looks ok.  In my case I get a 400 error, not 500.

Here are a couple relevant things I see in my Apache logs with the same timestamp at the exact time I try re-initiate the callback manually on the Stripe end.

In access log

"POST /clients/modules/gateways/callback/stripe.php HTTP/1.1" 400 - "-" "Stripe/1.0 (+https://stripe.com/docs/webhooks)"

In error log

PHP message: Stripe Notice: Undefined property of Stripe\\StripeObject instance: id
PHP message: Stripe Notice: Undefined property of Stripe\\StripeObject instance: clientId
PHP message: Stripe Notice: Undefined property of Stripe\\StripeObject instance: email

 

Edited by mustardman
Link to comment
Share on other sites

In my case, if I go into Gateway Transaction Log I see a "Client Not Found" error.  The debug data there shows the failing webhook is missing the Client ID and Pay Method ID for some reason.  So that is why Stripe is seeing a 400 error.  If I use my test client account I can add and edit credit cards and get successful "payment_method.updated" webhooks back from Stripe so I can't seem to reproduce the error of missing Client ID and Pay Method ID.  

Edited by mustardman
Link to comment
Share on other sites

I saw a very similar issues with web hooks failing a while back during beta testing.

I found the issue was related to Stripe having the wrong metadata information for some customers. To resolve the issue I logged into Stripe > Customers > Selected the customer > Scrolled down to the Metadata section and checked the information there matched WHMCS. If not update to match WHMCS.

As an example if the Customer ID within WHMCS is 10 and Stipe has the metadata ID as 15 the web hook would fail. Changing the metadata ID to 10 in Stripe would fix the issue.

Link to comment
Share on other sites

On 1/3/2021 at 1:03 AM, mustardman said:

In my case, if I go into Gateway Transaction Log I see a "Client Not Found" error.  The debug data there shows the failing webhook is missing the Client ID and Pay Method ID for some reason.  So that is why Stripe is seeing a 400 error.  If I use my test client account I can add and edit credit cards and get successful "payment_method.updated" webhooks back from Stripe so I can't seem to reproduce the error of missing Client ID and Pay Method ID.  

I'm having the same issue on 8.1.0 .  Did WHMCS support provide any resolutions?

Link to comment
Share on other sites

12 hours ago, RockTBN said:

I'm having the same issue on 8.1.0 .  Did WHMCS support provide any resolutions?

In my case, I think it may have had something to do with my SSL intermediate certificate bundle no longer working after it renewed.  SSL was still working for browser access but I think Stripe webhook uses the intermediate certificate bundle.  I have not been able to reproduce it since I fixed that.

Edited by mustardman
Link to comment
Share on other sites

  • 2 weeks later...
On 1/21/2021 at 10:58 AM, keyboardmls said:

I'm having the same issue after updating to 8.1. This appears to be a widespread issue. Did anyone find a solution?

Nope. We have been receiving the email notifications from Stripe that the issue was resolved then after a few days it appeared again. Cannot find a root cause of this, I will open a ticket with WHMCS soon.

Link to comment
Share on other sites

On 1/4/2021 at 1:58 PM, HostingMe said:

I saw a very similar issues with web hooks failing a while back during beta testing.

I found the issue was related to Stripe having the wrong metadata information for some customers. To resolve the issue I logged into Stripe > Customers > Selected the customer > Scrolled down to the Metadata section and checked the information there matched WHMCS. If not update to match WHMCS.

As an example if the Customer ID within WHMCS is 10 and Stipe has the metadata ID as 15 the web hook would fail. Changing the metadata ID to 10 in Stripe would fix the issue.

Thank you. This fixed the issue for me too. Specifically the email address in Stripe did not match the email address in WHMCS. Changing them to match appears to have fixed the problem.

 

This definitely needs to get fixed in WHMCS though...

Link to comment
Share on other sites

  • 2 weeks later...

I have similiar issue with webhook after updateing to 8.1.0. My SSL page stopped works - we received solution from SUPPORT already. Basically in the database (tblproducts table) SSL id need to match ID from tblproducts roup for SSL.

Now I have issue with STRIPE webhook. When some fields at checkout are not filled up it not showing errors and hangs. Direct Debit method works fine...any ideas? Also STRIPE support contacted me that webhooks has problems with communication.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated