Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

🐛 Stripe Payments not showing in platform

Open officialJCReyes opened this issue 7 months ago • 6 comments

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:

  1. 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

Image

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.

officialJCReyes avatar Apr 30 '25 12:04 officialJCReyes

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?

officialJCReyes avatar Apr 30 '25 14:04 officialJCReyes

Thanks for the report @officialJCReyes! Is there anything in the Docker container logs?

daveearley avatar May 01 '25 00:05 daveearley

@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.

513-docker-logs.txt

[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.

officialJCReyes avatar May 01 '25 03:05 officialJCReyes

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?

daveearley avatar May 01 '25 04:05 daveearley

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.

officialJCReyes avatar May 01 '25 10:05 officialJCReyes

@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".

officialJCReyes avatar May 15 '25 01:05 officialJCReyes

@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?

officialJCReyes avatar Aug 07 '25 14:08 officialJCReyes

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 avatar Aug 07 '25 21:08 daveearley

@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

officialJCReyes avatar Aug 17 '25 16:08 officialJCReyes

@daveearley

Just wanted to give you a heads up. I did 3 things that might have ended up resolving this issue

  1. I had a Wireguard VPN still on that I had thought I turned off on the host machine
  2. I removed the time zone variable in the .env file
  3. 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

officialJCReyes avatar Aug 17 '25 22:08 officialJCReyes

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.

daveearley avatar Aug 27 '25 08:08 daveearley