Need help with Stripe backend

Ok, got it.

Try to think logically about what you’re trying to do and it should all make sense…

It’s so intuitive for me I can’t think logically, even with your explanation I don’t know what’s going on. I think I am trying to ask Stripe to find the customer who matches the Bubble’s current user.

It won’t let me select an email address from the dropdown so I am left with this:

No, there’s no such thing as a ‘Current User’ in a workflow triggered via a webhook (current User only exists in Bubble, not in Stripe)… what you’re actually doing is asking Stripe to show you the Customer of the Subscription event that the webhook is using…

It won’t let me select an email address from the dropdown so I am left with this:

Yes, that’s correct for the Get Stripe Customer Call… now click close, then select the email address back in the search constraints…

No, there’s no such thing as a ‘Current User’ in a workflow triggered via a webhook (current User only exists in Bubble, not in Stripe)… what you’re actually doing is asking Stripe to show you the Customer of the Subscription event that the webhook is using…

I get you, thanks that’s made it clearer. Phew, I do find this complicated!

Like this? If so, that didn’t work either.

Like this? If so, that didn’t work either.

No :man_facepalming: that doesn’t make sense either…

A Stripe Customer ID needs to be a Stripe Customer ID…
An Email Address needs to be an Email address…

Now, in your screenshot, you’re searching for a User by their Stripe Customer ID (which they still don’t have anyway), but you’re entering an email address instead of a Stripe Customer ID…

Forget about the Stripe Customer ID (your User doesn’t have one at this point, that’s the whole issue)…

You just need to search for the User by their Email Address…

Lol, I seem to have Stripe Customer ID on my brain!!

Ok, I will try that now … (thanks for your patience)…

@adamhholmes This ‘partially’ worked. The Plan_ID and dummy text were updated but the Status came back as ‘incomplete’, meaning in the database it says ‘incomplete’ in the Status field.

Nothing was updated in step 2 of the work flow?

1 Like

Stripe says;

" Stripe categorizes a transaction as “incomplete” when a “payment intent” was created, but your user never completed the payment . In other words, an incomplete transaction means the user went to the payment page, but never took action. When it comes to an incomplete transaction, the sale was simply not made."

However, the sale was completed and I checked in Stripe to verify that the customer has an active subscription.

The issue may be that I am setting a Customer ID on the ‘Pay now’ button… although maybe that is fine?

I can’t answer that… assuming the status really is ‘active’ in Stripe then it’s possible there is a delay between the Stripe event being fired (which triggers your workflow) and the Status being updated internally in Stripe…

Nothing was updated in step 2 of the work flow?

Again, I can’t see any obvious reason, but I’d guess it’s to do with your Only When Condition (which I don’t really understand…)

The issue may be that I am setting a Customer ID on the ‘Pay now’ button… although maybe that is fine?

I can’t see why that should have any effect on anything here…

In any case, your best bet with anything like this is to check, and decipher, your Server Logs, as all the information you need will be in there to see what’s going wrong…

Otherwise it’s just guesswork (from yourself, or anyone else who’s trying to help)…

Thanks again, I will dig into the server logs and test a few other things. I’ll remove the ‘Only When Condition’ and everything else not essential to isolate the issue.

@adamhholmes I have finally solved this issue and it was a combination of a few things. Thanks again for your input.

For the benefit of all, the main thing was that I needed to “Get stripe customer email” instead of the “customer ID” , as @adamhholmes pointed out, because of the workflow delay when Bubble’s Stripe Plugin searches for the user (because at the point of checkout there is not yet a customer ID).

Then, I make most ‘changes to User’s company’ in my ‘pay now’ workflow. I was anxious that an aborted checkout may cause Bubble to run the workflow anyway but I’ve been reassured that this won’t happen.

If I remove the make ‘changes to User’s company’ workflow and make those changes on the backend webhook workflow instead, it fails. I spent too long trying to get that to work! I am happy now that the setup I have does the job and works well :slight_smile:

Just bear in mind that the opposite is also true…

I.e. if, after a successful payment, the user fails to return to your app (e.g. they lose their internet connection, have a power cut, click the back button, close their browser window etc.) then the on-page workflows will not run…

Meaning you’ll have a situation where a customer has been charged and had a subscription set up, but your app won’t know about it and wont have updated the company datatype accordingly which, depending on how your app works, may mean that a paying customer doesn’t get access to what they’ve paid for.

Which is precisely the reason why webhooks are always recommended over any on-page workflows for dealing with things to do with successful (or failed) payments… it’s the only reliable way to handle it.

1 Like

That is good to know, thank you - it gives me something to be aware of.

I think I will launch the site as is and deal with any issues as they arise. If this becomes an issue I will have to try and get help. I’ve spent so many weeks on this (and approx $250) trying to get the backend workflow to update a new signup that I’m burnt out from it!