1
12 Comments

Can someone explain to me How Stripe works?

Can someone walk me through how you create subscription tiers with different features in Stripe.

Also,how does this work between your application and Stripe? How does Stripe know how to unlock certain features based on what a user picks as their subscription level?

Im so confused on this. Does th is have to do with web hooks?

on February 22, 2021
  1. 2

    Stripe API: you ask Stripe for the info about the user every time the user wants to use a protected feature.

    Stripe webhooks: Stripe notifies you when the user subscribed/upgraded/unsubscribed, you store that information in your application and use it when the user wants to use a feature.

    1. 1

      AHha ok. So user chooses a certain subscription level then Stripe knows how to distinguish this and apply the correct pricing based on what my code says is correct for that users subscription level.

      1. 2

        TBH I'm not familiar with Stripe Portal, maybe a user is able to choose their subscription level there. I'm using a single-payment setup, and I'm building up a certain URL in my code, then redirect the user to this URL, and Stripe displays the correct price and description according to my code. But I'm pretty sure this is not the only option. As other commenters suggested, you should try and create a Stripe Portal for users, this would be your best option.

        1. 1

          Oh ok youre using that new feature with the Quick check out portal?

          1. 1

            @HypeCrux no, as I said, I'm not familiar with the Portal, I don't need it in my app (yet)

  2. 2

    I agree, Stripe is confusing.

    • Unlocking features based on subscription-level is your app's job. Once it knows the subscription-level it can lock or unlock features.
    • Your app can interrogate the subscription level via the Stripe API if your app has a Stripe user identifier.

    Have you looked at Stripe Customer Portal where customers self-manage their subscriptions?

    I have not integrated it yet, but it is on my to-do list for this week and could write-up my results.

    Someone else said the portal is an easy way to integrate Stripe. The portal uses webhooks to send changes (e.g. if customer upgrades) so my assumption is you're expected to locally store subscription-level for users but not sure that's mandatory and could instead query Stripe.

    1. 1

      Thanks that def paints a better picture for me as Im not a technical founder and integration is something I need to know in order to understand user flow.

      I would love to see your results and findings.

      1. 2

        @HypeCrux

        I've been writing up at the links below but won't have time to write more until weekend as we're going to the beach for 2 days 😁

        It's all a bit draft but would be useful to know if its the kind of thing that would help and/or what level to pitch.

        I can see API docs are (obviously) written for developers and assume a lot of background knowledge.

        Whether a high-level intro is what you're looking for - to then get into the API docs - I'm not sure. Maybe it's to understand enough to be able to direct a developer.

        1. 1

          All of this is good to know even If I don't truly understand it. Thanks a lot!

          1. 1

            Ha. Ok. No worries. I may try again. But anyway feel free to reach out and ask questions if you think I can help.

  3. 2

    Also,how does this work between your application and Stripe? How does Stripe know how to unlock certain features based on what a user picks as their subscription level?

    High-level: You save Stripe identifier to your internal user account and you use that identifier to check from Stripe's API if the user has an ongoing subscription.

    Does th is have to do with web hooks?

    Webhook means instead of you polling Stripe's API, Stripe calls your API when something changes

    1. 1

      Ah ok. thanks I think I am looking for how one creates different subscription tiers in your application then...

      Basically whats happening and has to happen in order for a user to go from visiting the landing page and choosing the sub and that user having access to certain features based on what tier they chose. Im ef missing a piece of this whole process.