Hi Folks. I’m experiencing a weird issue with Bubble’s Stripe plugin. For some reason, it seems that when I try to subscribe a new customer to a plan using the “subscribe user to plan” action, it is not saving the customer id to the database as expected. Has anyone else experienced this?
hi, are you doing this in backend workflow?
note that sometimes you need 3-5 sec delay between "subscribe user to a plan " and that user becomes findable via do a search for users where stripe customer id = X
Thank you for the reply! It’s actually not a backend workflow, and it’s not becoming available at all, even after significant delay.
It’s actually quite odd. It seems that none of the Stripe actions are saving the customer ID to the current user as they should. That said, the same workflows WILL work on a different page in my application.
Is there anyone who understands what might cause this kind of behavior?
sounds like a bug, i would file a report.
it has happened to me that some workflows dont work on some pages.
maybe before redoing everything create a reusable element 1px by 1px and put it on that page. put the workflows in the reusable via custom event that triggers from the pages button
What’s your workflow look like, saving the customer id?
I’m just using the standard Bubble plugin and actions, which are supposed to automatically save the customer id to the user. I’ve used the plugin extensively in the past and not experienced this issue, so a little puzzled. Probably going to file a bug report I guess.
To answer your question more directly, the workflow is nothing fancy. Just a subscribe user step. Please see below:
The bubble plug-in saves the data in places you won’t be able to see. So you’ll just have to refer to the user as current user stripe customer account
Yes, thank you. I’m afraid this is what I’m doing. The problem is that the data is not being saved at all like it should be. When I try to refer to the current user stripe customer id, it returns an empty value.
Are u using version 3 or 2?
I’m using Version 3.
I’m not too sure bubble actually stores a customer id for you. You might need to do a “make changes to current user” and set the customer_id to result of step x subscribe user to a plan (or charge user). I haven’t tested this.
I just hopped on and seen customer id isn’t an option. I encourage you to checkout plugin Stripe.js 2
I really appreciate the help. That said, Bubble definitely stores the customer id for you. One can reference it in the logic editor. Again, the problem is that I am currently being returned an empty value. I should add that I am being returned an empty value for ALL stripe customer fields.
OH I SEE what you’re saying
Can you go ahead and create a new dummy test user and click “run_as” and try your subscribe workflow against it real quick?
I just tested it in a flow and returning customer info works for me. Perhaps you were actually not running as a user?
I’m afraid that’s not the issue. I am encountering the error when running the application as a logged-in user and where I know there is a valid Stripe customer. Again, the problem is that Bubble is not saving the Stripe customer to the user record like it’s supposed to. I could of course build my own API call to retrieve the customer record based on the user’s email. However, this functionality is supposed to be built into Bubble’s out-of-the-box integration. You can see an example of what I’m talking about below. I’m trying to retrieve charges for the current user based on their Stripe customer ID. However, the records are not being fetched, because the ID is not being returned.
Does your workflow actually subscribe someone to a plan? Perhaps the subscription ID you passed is a little counter intuitive since there is no customer data before hand? IDK you’ve got update users existing subscription ticked indicating this isn’t the first workflow the user subscribes to something. I’m as lost as you I suppose. But it does work on my end.
Yes, the workflow does create the subscription, as expected. I can see that it’s been created in my Stripe dashboard. Again, the issue is that the id for the created customer is not being saved Bubble-side. The option to update the existing subscription is ignored if there is no existing subscription (though I also tried unticking that box when troubleshooting, to no avail). I would also reiterate that it doesn’t matter what the first action is that I take as a given user — whether that be to subscribe them to a plan, collect payment info, etc. ALL the actions for the Bubble Stripe plugin are failing to save the Stripe customer id back to Bubble for some reason. Very bizarre.
Well… I guess you should file a bug report. I understand your issue, I was only trying to help trouble shoot. Sorry I wasn’t of any help.