I have an another thread for setting up Stripe data but I’m posting this here as it’s specific to a single issue.
The Stripe Plugin by Bubble saves the “Stripe Customer ID” to the User Datatype as default, which makes sense.
However, I would like to save the other fields (SubscriptionEnd, SubscriptionStatus etc) in a separate Datatype called Subscriptions, but this is not working.
My “Pay Now” button’s workflow currently subscribes the user to a price plan, then saves the "Stripe Customer ID” to the User Datatype, this works fine.
Then, I try and save the other fields to the new Datatype called ‘Subscription’.
Could someone tell me if I am correctly assigning the subscription to the User (and vice versa) and if this needs to be done with the Stripe Plugin? I am not experienced so may be doing something obviously wrong. I assume that the subscription and User will be ‘linked’ automatically because in step 3 I am referring to the Result of step 1.
If my setup looks correct then perhaps using the Stripe plugin is the reason I haven’t been able to save data to the ‘Subscription’ Datatype.
Any help would be appreciated.
Where are you creating the Subscription in your database?
Nothing will happen automatically… Bubble is a visual programming tool… not a magic mind-reading tool… if you want something to happen you have to programme it to happen… (how would it know what you’re trying to do otherwise?)…
lol, I am looking forward to a time when programs can read my mind!
When I said ‘automatically’ I didn’t mean without coding it, I should have said;
I assume that the subscription and User will be ‘linked’
automatically because when I try and save the fields to Datatype ‘Subscription’ I am referencing the Result of step 1 (which creates the subscription).
I imagined that Bubble would “know” that step 3 and step 1 are related because I have programmed it to refer to one another.
This clearly is incorrect and does not work.
I am admitting that I do not know how to assign the subscription to the User (and vice versa) although not for lack of trying. Any tips or pointers would be appreciated.
I am not. This is what I need to know how to do.
Well that’s the issue (you can’t make changes to something that doesn’t exist)…
It’s simple to create a new thing (and about as basic as it gets in Bubble)…
Your workflow needs to contain the following steps:
- Subscribe the User to a Stripe Plan
- Create a New Thing (Subscription) > Use the data from Step 1, and the Current User for the User field.
- Make changes to Current User > Set the Subscription to be the results of Step 2. Set The User’s Customer Stripe ID Field to the Stripe_Customer_ID from the plugin data…
The only concern with that might be that the Plugin’s Stripe Customer ID might take longer to populate on the User datatype and so it won’t be ready to be saved during the workflow itself… but try it and see.
Thank you, that worked!
Apologies for my incompetence and I’m grateful for your patience.
I have previously created and updated new Thing’s in my database so I am unsure why I struggled with this. I couldn’t see how Bubble would know the Subscription data because Step 1 sends the user off to Stripe before getting to Step 2 or 3. Anyway, it works!
Create a New Thing (Subscription) > Use the data from Step 1, and the Current User for the User field.
This is what I should have known, assigning the subscription to the User (and vice versa). Sad to say I don’t have a firm grasp on the basics, very annoyed with myself.