Testing Stripe Subscription payment failures

Here’s the background for what I’ve done in my app, and what I think I know to be true:

  • Within my app, the subscribing a user to a plan works.
  • There is some form of built in webhook from Stripe to Bubble such that I am able to easily obtain the Stripe Customer Subscription Status value.

Now I want to simulate subscription charge failures, so I can take appropriate actions to them within my app.

And I’m not figuring out how to do this.

I know that:

  • Within my Stripe dashboard I can switch to test data, and look at subscriptions.
  • Within my Stripe dashboard I can define endpoints, in which I provide a URL of the webhook, which per Stripe I have to do in order to send fake/test signals back to the webhook
  • But Bubble has a good integration with Stripe already and to get the Subscription Status I need only grab the value of Current User Stripe Customer Subscription Status

So, considering all of the above, how do I send fake/test Stripe Subscription Status codes from Stripe to Bubble so that in Bubble I can implement workflows to take the appropriate actions for the various returned Subscription Status codes?

2 Likes

@J805 @johnny @Christophe_HK

I’m tagging you guys as you were very helpful in a prior thread on a different Bubble/Stripe issue and I’m hoping you have some insight here. In fact you guys helped me understand the very concept of being able to just “grab” the value of Stripe Customer Subscription Status, which last week I didn’t even know was a thing.

3 Likes

Good question, I have to say I’ve never tested such use case yet. I think it could be possible to simulate a failed subscription payment by using one of the “test” card number provided by Stripe for testing purpose. The 4242 4242 4242 4242 card always works, but there are others for testing failing scénario

Let me 5 minutes to find them!

3 Likes

Here!
https://stripe.com/docs/billing/testing#:~:text=Testing%20payment%20failures&text=Some%20subscription%20updates%20cause%20Stripe,created%20in%20an%20incomplete%20status.

2 Likes

I’ve used the test card numbers extensively in setting up the initial Subscript user to a plan. However, once the user is subscribed to a plan, how do I test that their initial subscription was valid, but on their next payment date the monthly subscription charge fails?

It’s the subsequent charge failing I want to test now.

1 Like

I’ve been to that Stripe document already. It helped drop me into my current rabbit hole. Per that document, I use use the Bubble webhook endpoint I’ve created then defined in Stripe to send fake/test signals back.

The problem here is I didn’t create a Bubble webhook for Stripe. It’s somehow built into Bubble already.

Either I don’t know what the URL of this Bubble provided Stripe webhook is, or there isn’t one as Bubble does something different.

You have to simulate a failing scenario, have a look at the page provided before. The test plan’ setting could be different that your live plan, but that would bring a good overview of how that works and what kind of webhooks/statuses you’ll get from Stripe

Thank you for the highlight on that paragraph. I missed that important section somehow. I’ll give that a try and report back.

1 Like

I hit another weird obstacle.

While the idea of creating a subscription trial with a trial_end a few minutes in the future sounds good, the Bubble Stripe plugin won’t let me. The minimum trial_end must be 2 days in the future.

There has to be an easier way to have Stripe send fake/test Subscription Status values.

Anyone?

For the record, I finally gave up on using the “built in” Stripe webhook, and it doesn’t quite do what I want.

I broken down, wrote a webhook within our app (which right now doesn’t do much), and to develop and test it, I’ll use the standard Stripe webhook mechanism top send test events from Stripe to my appl

2 Likes

It’s easy enough to setup the webhooks with Stripe. :blush: So either way works really. Whichever is easier for you. Glad you got it working! :clap:

@j805 www.NoCodeMinute.com

For All Your No-Code Education Needs:

  • One-on-One Tutoring
  • eLearning Hub
  • Video Tutorials
  • No-Code Classes

This is true. After I bailed on not using webhooks, I watched a 40 minute tutorial video I found on YouTube and the total time needed to set it up, including watching the video was about an hour and a quarter.

In case anyone finds this thread and is interested, this is a good video tutorial:

The only lingering question I had is why do we not enable webhook authentication?

In this Bubble Forum thread, @emmanuel explains why it isn’t needed:

2 Likes