Workflow not continuing after a successful Stripe payment

Hi all,

I am trying to get Stripe working. I have done a workflow, starting with ‘Charge the Current User’. It takes me to the checkout, and using the test card 4242xxx it gives a green tick and takes me back to my site.

However, when running the Debugger I see it is simply running the ‘When page loads’ workflow instead of the rest of the Payment workflow. What am I missing?

Can you check the url you’re returned to to see if anything is appended to it, like a checkout session Id?

Nope - just the standard version-test url. Nothing else.

Then you will want to setup webhooks. Webhooks will notify your app of events like successful payment, bad payments, etc.

Your workflow could never continue as the page is refreshed as if it was just visited and no parameters appended.

Search YouTube to learn how to use Webhooks with stripe. It’s very easy.

Will do. Thanks v. much.

Not sure that will work. I have ‘Credits’ that people purchase. I wouldn’t know how Stripe would recognise how many credits they are purchasing… rather only the amount they are paying. Does that make sense?

My workflow (after successful payment) created a Transaction thing with the relevant details, and then makes changes to the current user, adding the Transaction thing, and also increasing their number of Credits by the number purchased.

I’m sure I used Stripe in the past and had a workflow continue successfully. Is there not a way to do that?

Ok I see. You can, in the same workflow as your charge a user, create your transaction thing Only when result of step 1’s charge Id is not empty.

But a Webhooks would still work here. Bc it will send you the successful charge notification with all the details back to which you can create your transaction thing with the request datas unit_amount or credits

Ok - so I’ve changed the Plugin to v2 (legacy) and it’s working fine. Obviously not ideal, and I’ll have to figure out the webhooks, but it works for the time being. Thanks for your help.

When you initialise a stripe checkout it essentially takes you to another browser window - there should be somewhere in the plugin workflow to create cancel and success URLs? this is so that when you are redirected back from stripe (i.e loading up your app again) you have URL parameters there to tell you what to do. You can use things like the unique ID of the order, parameters like success=yes, or status=success (or cancel for cancel) etc. And then on your page load workflow you create ones with conditionals based on parameters and continue on your flow from there.

I use webhooks quite often though, instead of using URL params in the redirect URL’s to rely on knowing how to proceed because I find that at times users will pay in stripe and then close the browser thinking the transaction is complete (i.e not waiting to be redirected back to an app). So I’d suggest thinking about learning and setting up Stripe webhooks as a ‘safer’ way to manager checkout flows :slight_smile:

I had the same issue happen when trying to subscribe a user to a plan through a popup & repeating group.

Stripe would process the payment, but no confirmation or updates to the user would happen once they were sent back to my site. I think it might have something to do with the workflow being trigger from a button that was in a popup, and maybe the workflow couldn’t continue when it tried to resume as it hadn’t loaded yet :man_shrugging:

I ended up setting a pending_stripe field against the user before starting the workflow.

Then when the page loaded and pending_stripe was yes, I just showed the popup again and it continued like expected. Also note the last action here sets the pending_stripe back to no.

2 Likes

Appreciate this detailed solution! It worked for me after hours of frustration.

One note - I tried implementing this last night, and it didn’t work at first.

I had thought of a more “hacky” solution to implement today, but I gave the pending_stripe solution one last try, and it worked! I’m guessing the browser cache refreshed overnight or something like that.