Session expired when transferred back from Stripe

Hi all

I am using Stripe to handle payments. Approx. 99 out of 100 transactions works like a charm, but the last 1 fails. And it fails big.

When the user pays, the transaction is fulfilled in Stripe. BUT… when the user is redirected back to my Bubble app, the user gets the error “Session has expired”. Which means 1) user is super confuded and 2) the workflow stops and doesn’t create the order.

This often means that the user keeps trying to pay causing frustration and double and triple payments in Stripe.

  1. Anyone knows why the message “session has expired” shows and how to fix it?
  2. Anyone who knows how I can test this?
  3. Anyone experiencing the same?

Fingers crossed anyone knows about this, because it’s super crucial for my app. Unfortunately I haven’t been able to reproduce the error myself.

Hey @maja-overgaard ,

Any update about this strange behavior? I’m facing the same issue in my app and can’t really understand why or how it happens.

Best,

Arthur

Unfortunately not.

I have shared all logs from Bubble and Stripe with the support team, but they cannot find any issues. The logs doesn’t give any errors, everything seems fine.

And neither them or me can reproduce the error. But… it still happens in 99/100 cases for me approx.

Do you have any hunch about when it happens for you?

@maja-overgaard and @arthur.kieffer how are you handling payments, using API setup directly to Stripe or using a plugin?

I am using the Stripe plugin from Bubble.

Okay…I’m not sure exactly how that works as it has been a while since I abandoned it…I’ve started to use stripe api for handling payments…with this I use two different approaches, one is when they are returned to my site I use the values in the URL to update my database (which I think is what you are trying to do with the plugin and seem to have success with so far).

The other thing I do is set up Stripe Webhooks for checkout sessions, which is where I do a series of actions to update the data in my database if the session is successful and payment is made. It is this webhook that I actually rely on for ensuring the user has paid.

You should be able to set up stripe webhooks in your app even if you are using the Stripe Plugin by Bubble. I’m not sure if the plugin may be the cause of the error you have, but you could also consider using the Stripe API instead as it tends to be more reliable.

Thanks a lot for taking the time for this detailed response. Sounds like the way to do it. I have, in my second app, used Stripe.js instead and that seems to allow for this more detailed logic making sure no errors happen.

On another note…
It seems like you know your way around integration with Stripe very well. Would it be possible to book an 1:1 consultation?

I have a fairly good grip on the Stripe calls and docs (from a non-technical founder perspective), but I am lacking a few components to fully understand it. Have set up a few Webhooks as well, but could use some best practice and advice on it.

1 Like