Stripe Customer Portal Plugin Help

Hi all,

Working on an app that features monthly subscriptions, and to start simple I’d like to just use Stripe’s Customer Portal where members can manage their subscriptions on Stripe’s end.

I found this plugin which looks like it will do the trick, but having some trouble with setup. Specifically, I’m not sure what’s supposed to go here and where/how to retrieve it:

And this is the workflow, which had this default input for customer, do I leave this as is?

They also mention this, what is the Bearer? "Provide your API keys. Be sure to add the ‘Bearer’ before your keys regardless of the testing or production keys."

Thanks!

The Stripe Portal - return_url is the URL of the page on your app where you want users to be redirected to when they click the ‘Return To APPname’ on their customer portal (so probably the same page the came from…)

And this is the workflow, which had this default input for customer, do I leave this as is?

No, you need to dynamically set the Customer ID of the User

They also mention this, what is the Bearer? "Provide your API keys. Be sure to add the ‘Bearer’ before your keys regardless of the testing or production keys."

You need to add your API keys in the following format Bearer sk_live_********************* - be sure to leave a space between the word ‘Bearer’ and the API key.

2 Likes

Thank you @adamhholmes - quick question on the Customer ID of the User, how do I set retrieve their Stripe Customer ID to pass to the Portal?

You’ll need to save it to the database when the customer is created (i.e. when they make their first payment).

Depending on how you’re connecting to stripe, you can retrieve that from a number of places, such as the checkout session, payment intent, charge object, subscription, etc.

Or, you could retrieve a list of all customers, then match the email address, in order to find the customer ID of a specific user if you haven’t already saved it to the database.

1 Like

Hey @adamhholmes, here’s a look at my workflow setup: https://i.gyazo.com/35bb6f975c7832623f8fb46facefb98c.mp4

I think the part I’m missing is how to create the Customer Stripe ID. Is it not created with this step?
image

I have the main Stripe (Bubble made) Plugin and the Stripe Customer Portal plugin, both with my test API keys. Do you know how I’d create the actual Stripe User ID?

Hey @trvshowell, creator of this plugin here.

To get the stripe customer id using this workflow, create a second workflow right after this to make changes to the user, and use the ‘result of step 1’s ID’.

Then whenever you use the portal, you’ll pass this id along.

2 Likes

Hi @lantzgould - thanks, this is an amazing plugin. I am trying to set the ID here but it’s red, what am I doing incorrect you think?

1 Like

Is the Stripe Customer ID in your database a type of ‘text’? If not, it needs to be.

1 Like

Ah yes @lantzgould, thank you. I was able to create a customer ID now and save that to the user database:
image

My hopefully last question is, how do I now get the user to the correct portal? This method opens a new tab but goes to my own URL and passes the customer id like this:
“settings/cus_LLTK10OuJojdbx”
image

What is the correct Stripe Portal URL? Is it supposed to be something like stripe.com/customerportal/[insert customer ID]?

I should have deleted that workflow option, will do soon.

You should be using the bubble built in option, “Open an external website” and pass like this:

As for the url, whichever url you specify in the plugin settings, is what the user will return to after being in the portal. Alternatively, you can use this workflow, too, if you want it to be dynamic every time. If you use the ‘Self Service Portal - Stripe Portal w/dynamic return url’ workflow action, it will over-ride whatever you have in your plugin settings. In other words, it will use this option instead.

Hope this helps.

2 Likes