Get data from bubble plugin and save to bubble database

Hi there,

I use Bubble Stripe plugin for subscriptions. Seems that “Subscribe the user to a plan” is working properly but I am not able to save any items from stripe pugin to my database.
ex)the subscripition status, subscription period starting date, subscripition period ending date, customer ID and so on
I need this info to show user subscripition period on custom page.

Does anyone know how to solve this issue?

Much appriciated if you help me out.

Hello!

Since the “subscribe the user to a plan” action using stripe v3 is now a redirect, this has the effect of killing the remainder of any workflow actions that are part of the same workflow event. It functions very much like a “go to page” action now, in that sense.

The solution here is to leverage and make use of stripe webhooks. Stripe can “notify” your app anytime a plan is subscribed to, and you can have it automatically call a backend workflow that saves the data you need to save.

You can check out Stripe’s documentation on webhooks here: Use incoming webhooks to get real-time updates | Stripe Documentation

You’ll need to set up your webhook in your stripe dashboard, and set the URL to the endpoint of a backend workflow in your app. Then, you can use the “detect data” option to initialize the webhook, and once you successfully do that, you’ll have access to the payload of stripe data to use within your workflow.

There is a really great walkthrough of how to set up an example webhook in our manual: Examples and Walkthroughs - Bubble Docs

I hope this helps!

1 Like

Hey @hytsbyhytsby :wave:

@sam.morgan is correct. You can grab all the data you want from Stripe Webhooks.

Did you know, Bubble actually saves this automatically to the user as well?

If you are displaying a text field on the page. Try referencing ‘current user’s stripe subscription status’ from the page. Let me know if that makes sense. You might be already getting all the data you need from Bubble. :blush: No webhook setup required.

3 Likes

Hi @sam.morgan @J805

Sorry for a delayed response.
I struglled with configuaring webhook but currenetly it seems to be working correcly.

I deeply appreciated your help. Thank you!

2 Likes