Stripe webhook setup - Step-by-step

Yes… as long as your API Workflow is in initialization mode and is waiting to detect the data, and the Stripe webhook includes /initialize in the URL then it should work fine…

Possibly I closed the page so it wasn’t ‘waiting to detect the data’. I will create a new webhook to be sure I do this.

I think I have initialized it. I found that after setting up a new backend workflow API you must click Detect data but leave it open and in detention mode (this is where I went wrong). Trying to reopen it later to detect data won’t work. Thanks @adamhholmes for making me think of that!

After creating the new webhook in Stripe, the Bubble detention worked so I know the two apps are talking and Bubble is receiving the payload, in this case just one Event charge.succeeded .

One question I have, if we have multiple Products in Stripe, how does it know which webhooks relate to which Products?

I want to test to see if my Bubble app is receiving the webhook data so I can show some text when a charge has succeeded. I am going to try and set this up now.

I know that if I can get the overall concept for one webhook things will click for me. I have created a field which relates to the event I am listening for “_charge.succeeded”.

Now I want to define what that field is, but what do I choose from the dropdown? Instinctively I want to say “Yes” so that back in my Bubble condition I can say When _charge.succeeded is "Yes" then show some text.

@adamhholmes I have realised I need to do a search for so I’ve set this up, but still not seeing the relevant option in the dropown.

It doesn’t… you need to unpick that yourself in your workflow based on the request data…

Now I want to define what that field is, but what do I choose from the dropdown? Instinctively I want to say “Yes” so that back in my Bubble condition I can say When _charge.succeeded is "Yes" then show some text.

I’m not sure you’re approaching this the right way…

It doesn’t make much sense (to me) to have a field on the User datatype for ‘charge succeeded’… what charge does it relate to? Can a User only ever have a single charge? (in which case it might be reasonable).

A more effective to way to handle this type of thing would be to create a datatype to store payment data (for example a Transaction datatype), then you can use that to store as much data as you need relating to each payment.

I can’t work out what you’re trying to do there at all?..

Ok thank you. I don’t know how I’d do that but I guess that’s for another time, for now I want to just get one webhook working!

I chose something from the dropdown in a hope it would work (would be nice if the dropdown options matched Strips Event names). Anyway, after checking out I am finding that no data is being saved to my DB so, this is where I was before. Effectively Bubble and Stripe are connected but I can’t get the data in my DB?

4

Haha sorry! Please know that I am lost and am never trying to do anything ‘tricky’. I literally want to show some text saying “Congratulations, you just bought something”. That is all I am trying to achieve. The above ‘Search for’ solution was taken from a tutorial which I copied.

I don’t know what to try next … :frowning:

This failed too.

Database is always empty so either my webhook is not setup correctly, or I am not setting up the backend workflow correctly. I just need to see a screenshot of someone’s backend workflow so I can see how it should be formatted. I have copied 7 tutorials now … what is going on?

Which User are you making the changes on (what are your search constraints?)

I am searching for the first:item. I have no idea why but it said to do so in this tutorial.

You can check your server logs… then you’ll know exactly where you’re going wrong

I assume you have the correct Customer IDs stored in the database?..

(but as I said above, check the server logs first to see whether it’s a problem identifying the User, or something else.)

Ah, I just checked and my database has no Customer ID data either. Why is that?

Trouble is, because I am not a coder I look at this and see hieroglyphics! I have no idea what I am looking at.

I meant your server logs in your Bubble app…

It will take some deciphering but it will tell you exactly what’s going on with your workflows…

I wasn’t saving the Customer_ID when the user checks out. I am now trying to do this but I can’t see what to choose from the dropdown?

My Bubble server logs are empty, no data at all. But, it’s clear the issue is that I don’t know how to save a customer_ID or how to display a webhook.

I am going to take a break as I am finding this very difficult. I also don’t want to take advantage of your support. I think I need to go away and redo all the tutorials over and over until something clicks for me. Huge thankyou for your help thus far Adam.

You’ll need to get the customer ID from the webhook