Hi everyone ! Anyone has already set up a subscription with stripe and bubble ? So, this is what I did :
1 Created a subscription product in my stripe account
2 Entered my test api key into bubble (so I can see my product into bubble)
3 Created a button on the home page and creating a workflow for subscribe the current user. Until there, no problem
My question is: How can I check if the user subscription is still available ? I think I have to subscribe the user with the button below, and create a variable “payment statut” and set it to “payment statut = valid”, so for 3à days, the user will have access to the platform, but if he doesn’t pay anymore, I want to change the variable payment statut, so in the dashbord of the user, I want to have a cancel button and change the variable only at the end of the subscription and the other way it’s if I cannot charge the credit card of the user (for the next 30 days). So, is my approach correct or I’m missing something? Thank you guys
Hi @J805, thank for your answer ! Yes I think your solution works ! And I would like to automatically change this status if the payment doesnt work or if the user cancel the subscription. I heard about webhooks but never used it.
It actually does that automatically. You can test it out by canceling the subscription in stripe and then returning to your app. On page load you can have a workflow, when it is not “active” then send them to your index page. Or something like that.
I’m using BDK’s native wrapper. But honestly, I’ve asked this same question everywhere I can think of, including Apple Dev Support. They had no straight answer. With Stripe you can see that status is an available option, but I don’t see it in either iOS or Android connections.
He’s working on some other issues I’m having (getting a purchase_fail message from google when online it shows payment accepted). I have asked him about how to confirm the ongoing status on iOS and Android, but got no reply from him about it. Not sure if it’s because there isn’t an answer.
Place the ‘BN - In app (Android)’ element on the page
You can place any number of these elements. Try a 1x1 size so that it doesn’t mess with your design.
The element needs to be visible to work as per bubble’s requirements. If the element is within groups, make sure the groups are not hidden either.
When the native process is complete, the element fields such as Purchase information, Error information and Purchase receipts will be populated
The relevant element actions ‘In-app purchase successful’, ‘In-app purchase failed’ and ‘In-app receipts received’ also get triggered when the native process is complete
Set up your bubble app to keep track of users’ purchases using
We strongly recommend that you also store the output information (especially the receipts) in your database for each purchase
Right. That tells you the initial payment was successful, but there doesn’t seem to be a field on their end that you can interrogate to know on an ongoing basis that the member didn’t cancel or that their payment didn’t fail.
With Stripe, I don’t even worry about the date the monthly payment end. They’re active until they’re not, so I base my ‘Premium’ status field on their status field.
IAP: After purchasing a subscription you will have to ask the system for a receipt. This receipt is encrypted binary data. You can send this data to your server which should store it and associate it with the user (it will essentially act as a token). This receipt can be sent to Apple’s servers at any time and Apple will return the most up-to-date decrypted JSON about the state of the user’s subscription. You can update your users subscription related state based on this returned JSON. Apple also recently started offering webhooks (called status update notifications) so you could be notified about certain events (not as robust as Stripe’s webhooks).