# Stripe subscription

**URL:** <https://forum.bubble.io/t/stripe-subscription/95862>\
**Category:** Need help\
**Created:** [June 7, 2020, 1:35pm UTC](https://forum.bubble.io/t/stripe-subscription/95862 "2020-06-07T13:35:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayjay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jayjay/32/80242_2.png) [@jayjay](https://forum.bubble.io/u/jayjay)\
**Post date:** [June 7, 2020, 1:35pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/1 "2020-06-07T13:35:52Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/4/d/4dcda7a05af66dab4bca5f2e1f6f0b2f24859c35.png)

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 7, 2020, 2:17pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/2 "2020-06-07T14:17:04Z")

</div>

There is an easier way.

Do conditionals and check:

Current Users \> Stripe Subscription \> Status \> is \> “active”

I believe that should do what you want. There are other ways to do the same thing. This is just one suggestion.

> **Want to learn more?**
>
> [www.nocodeminute.com](http://www.nocodeminute.com)
> 
> ![Presenting](https://us1.discourse-cdn.com/bubble/original/3X/6/5/65f6fab3efed1c82ed9ceb6b067f755e0766996c.gif)

Hope that helps! 😊

---

<div class="post-metadata">

**Author:** ![jayjay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jayjay/32/80242_2.png) [@jayjay](https://forum.bubble.io/u/jayjay)\
**Post date:** [June 7, 2020, 2:51pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/3 "2020-06-07T14:51:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 7, 2020, 3:12pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/4 "2020-06-07T15:12:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jayjay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jayjay/32/80242_2.png) [@jayjay](https://forum.bubble.io/u/jayjay)\
**Post date:** [June 7, 2020, 3:28pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/5 "2020-06-07T15:28:12Z")

</div>

Okay. I will try it! Thank you

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 7, 2020, 3:30pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/6 "2020-06-07T15:30:51Z")

</div>

No problem! 😊

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:04pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/7 "2020-06-19T20:04:44Z")

</div>

Hi J805,  
Is there an equivalent for checking for ‘active’ on iTunes iOS subscriptions or GooglePlay?

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:06pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/8 "2020-06-19T20:06:47Z")

</div>

Hey @c.knight55 That is a good question. How are you subscribing the user to iTunes or Google Play?

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:10pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/9 "2020-06-19T20:10:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:13pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/10 "2020-06-19T20:13:11Z")

</div>

Have you asked @gaurav yet?

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:17pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/11 "2020-06-19T20:17:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:18pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/12 "2020-06-19T20:18:55Z")

</div>

Yeah, I am looking at his documentation, there should be a way to confirm that:

Documentation: [https://www.notion.so/BDK-Native-Plugin-Documentation-f39872f62d84489594aea28e46185947#f7d97bfca3a0419ab4b4f40c036539ac](https://www.notion.so/BDK-Native-Plugin-Documentation-f39872f62d84489594aea28e46185947#f7d97bfca3a0419ab4b4f40c036539ac)

_Receiving purchase related information_

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

1. When the native process is complete, the element fields such as Purchase information, Error information and Purchase receipts will be populated
2. 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
3. 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

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:19pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/13 "2020-06-19T20:19:19Z")

</div>

When I asked Apple Dev Support, they referred me to monthly reports, but I didn’t understand enough of it to sort it.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:20pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/14 "2020-06-19T20:20:15Z")

</div>

I think @gaurav will be your best resource here. His wrapper should allow you to have access to that information somehow.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:22pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/15 "2020-06-19T20:22:14Z")

</div>

> [@J805](#):
>
> Place the ‘BN - In app (Android)’ element on the page

I think this is the key. Then you can access the data.

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:22pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/16 "2020-06-19T20:22:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:39pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/17 "2020-06-19T20:39:43Z")

</div>

Yeah, that makes sense. Maybe this would be a better resource?

Resource: [https://medium.com/@jessesahli3/ios-renewable-subscriptions-overview-stripe-vs-in-app-purchases-4fdb02bec0da](https://medium.com/@jessesahli3/ios-renewable-subscriptions-overview-stripe-vs-in-app-purchases-4fdb02bec0da)

**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](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW13)) so you could be notified about certain events (not as robust as Stripe’s webhooks).

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:53pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/18 "2020-06-19T20:53:55Z")

</div>

That’s really interesting. And is simple in theory. Just send the receipt back.

I wonder how to implement it within BDK’s and Bubble’s environments?

Oh! so you just trigger the Verify Receipt workflow again and it verifies again.

---

<div class="post-metadata">

**Author:** ![J805](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/j805/32/41267_2.png) [@J805](https://forum.bubble.io/u/J805)\
**Post date:** [June 19, 2020, 8:55pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/19 "2020-06-19T20:55:10Z")

</div>

That makes sense to me. 👍

---

<div class="post-metadata">

**Author:** ![c.knight55](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@c.knight55](https://forum.bubble.io/u/c.knight55)\
**Post date:** [June 19, 2020, 8:56pm UTC](https://forum.bubble.io/t/stripe-subscription/95862/20 "2020-06-19T20:56:04Z")

</div>

Today’s a good day. Thx J

[Next page](https://forum.bubble.io/t/stripe-subscription/95862.md?page=2)
