🐛 Stripe Payments not showing in platform
Describe the bug When a payment is successful in Stripe, the webhook notification to Hi.Events fails with a 400 error
To Reproduce Steps to reproduce the behavior:
- After a customer places an order, review the Stripe transaction
Expected behavior After a customer pays, have the order reflect in Hi.Events, show as paid/complete and have Stripe be able to send a successful webhook for payment
Screenshots
Logs
Desktop (please complete the following information): Any device
Hi.Events Version and platform Docker hosted v1.0.0-beta.1
Additional context Add any other context about the problem here.
After upgrading to v1.0.0-beta I noticed that this was an issue. In Stripe, it is showing error 400. When attempting to run the through Postman, it reports
400 Bad Request The server could not understand the request. Maybe a bad syntax?
Thanks for the report @officialJCReyes! Is there anything in the Docker container logs?
@daveearley Here is the main part of the logs. I've attached a text file with the full logs after sending the webhook from Stripe.
[2025-05-01 03:04:33] production.INFO: Refunded expired order {"order_id":1316,"event_id":11,"payment_intent_id":"pi_3RJicUE8iptpoxjJ0r4A7Nws"}
[2025-05-01 03:04:33] production.ERROR: Cannot accept payment: Payment was successful, but order has expired. Order: 1316 {"payload":"{
What I have been doing to manually fix this is running the following in the postgres database
UPDATE orders SET payment_status = 'PAYMENT_RECEIVED', status = 'COMPLETED', deleted_at = NULL WHERE id = ####;
This results in the order showing in the front end and being marked as successful. Once the order is processed, it either stays as Awaiting offline payment even though it was processed through Stripe or it is not visible at all in the frontend until I run the database command from earlier.
Just an FYI, that patch was recommended by ChatGPT and it seems to be working fine so far.
The error occurs because the order has expired by the time Stripe sends the webhook. This should be rare, and is intentional to prevent overselling. In these cases, the order is automatically refunded, so manually updating it to 'COMPLETED' in the database is not recommended.
Is this error happening for every order?
Have you manually changed the order timeout setting?
When I change the order to 'COMPLETED' in the database, I first check Stripe. The transactions have been successfully charged to the customer. There were a few instances were it failed and one where it was refunded. I've only modified ones that showed as payment complete in Stripe.
This is happening on every order, for any event.
I have changed my order timeout settings to 60 minutes.
@daveearley You mentioned that this happens to prevent overselling. Shouldn't that only apply if there are venue and/or ticket quantity/limits in place?
For my event I have it set to "unlimited".
@daveearley Is there a timeline on when this would be fixed? I have an event at the end of next month and I want to know if I should use a temporary alternative until this is resolved?
Hi @officialJCReyes,
This is the only report of this error and I can't reproduce it, so it's hard to know how to fix it.
Did you manually change the timezone of the app?
@daveearley Understood. There was one other person that reported it but if its not a common issue I get it.
Regarding the time zone, I have in my .env file set the following
TZ=America\New_York
@daveearley
Just wanted to give you a heads up. I did 3 things that might have ended up resolving this issue
- I had a Wireguard VPN still on that I had thought I turned off on the host machine
- I removed the time zone variable in the .env file
- I updated/pulled the latest release, v1.0.0-beta.6
After doing this, I was able to perform a test transaction and it was immediately marked as paid
Hi @officialJCReyes,
The likely issue was the timezone. The backend should always be in UTC and never be changed. I'll make a not of this in the docs.