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).