8
18 Comments

Using Stripe for Payment

I'm ready to incorporate Stipe into my project with monthly and annual subscriptions. I know what to do technically, but I have a few questions:

  1. For the first pass at this, I'm planning to link to Stripe's pages and have Stripe send events to cloud functions. Is this a great way to get started or can you recommend a tutorial describing a better way?

  2. I'm having trouble conceptualizing the workflow, taking a new user through login to selecting a subscription plan and paying for it. Or should I start with payment and then log in? If so how do I collect the email address?

  3. It looks like Stripe allows for a trial period. Any input on offering a 30-day trial period? Does that help avoid people asking for refunds?

  4. When should I check back with Stripe to know if a payment has or hasn't been made or if somebody canceled their payment?

posted to Icon for group Developers
Developers
on November 6, 2022
  1. 3

    Hi! I wrote an extensive guide for implementing Stripe Checkout in your SaaS. Here is the link: https://makerkit.dev/blog/tutorials/guide-nextjs-stripe

    It's for Next.js, but the concepts are easy to apply to any stack you will use.

    Hope it helps!

    1. 1

      i was looking for this for 2 days

    2. 1

      amazing, thanks for writing this up. bookmarking this.

    3. 1

      Thanks, this is an Excellent Guide, I've already shared it with others. Today is implementation day and after reading this, I don't think it is going to be that bad.

      1. 1

        Thank you, glad it helps!

  2. 1

    I found this tutorial very helpful sometime back, covers auth, storing the necessary customer details, capturing payment as well has handling recurring subscription.
    The SDKs are outdated though, but the concepts are pretty solid (it's also easy to relate what's covered with any other updated SDK or back end language eg node/py).

    https://symfonycasts.com/screencast/stripe

    1. 2

      Thanks, I'll take a look, the more info the better :)

      1. 1

        You're most welcome

  3. 1

    Going to through exact situation now.
    Took a lot of reading.

    Anyone here know how to make the stripe UI subscription page allow the free tier to bypass the credit card information?

  4. 1

    On number 2, I'd say just stick all your customers on the best possible plan during their trial. Which sort of answers number 3 - definitely have a free trial period. Some people will caution against this, but honestly your first users as a new business are realistically going to want to 'try before they buy' so you can earn their trust. Once you've found product-market-fit I think you revisit the idea of skipping free trials.

    Unrelated, but if you're selling subscriptions to businesses, make sure you include the business name and Tax ID fields in the checkout flow, otherwise your bookkeeper or accountant will hate you, and you'll hate yourself (I learned the hard way haha)

    1. 1

      Thanks for the feedback and "Pro Tip"

  5. 1

    What I did with Planzer was to let Stripe handle as much as possible. This means I use Stripes checkout pages and their pages to change credit cards.
    This way there is less code for me to maintain, and it works well 🙌

    1. 1

      Exactly, this seems like a good first pass for the MVP. I'm assuming the following steps:

      1. Define subscriptions and prices in Stripe.
      2. Configure a restricted set of Stripe Auth keys.
      3. When a new user logs into the app, create that user in Stripe, and direct them to a pay-to-play page. A 30-day trial period is always available.
      4. Use the Stripe Checkout payment links to power the pay-to-play page.
      5. Implement a set of webhooks to receive notifications for:
        a. When a payment is made.
        b. When payment has failed.
        c. When a subscription is canceled.
      6. It also looks like I can ask Stipe for the current state of a user. This could be a more deterministic workflow to check whenever a user starts a new document.
      7. If a user's account becomes past due, I drop into read-only mode until they get up-to-date.

      Am I missing anything?

      1. 1

        That seems like you got it all covered, awesome!

  6. 1

    Hello, we have done a Stripe integration last week with my friend. You can check the flow at: fdbck.io

    I did the frontend so I can only answer to your 2. question:

    As far as we know, you have to force your customer to register first before he makes a purchase.

    1. 1

      Hey, thanks for the tip, and excellent job on the interface.

  7. 1

    I’ve done Stripe consulting in the past. Happy to give back to an IndieHacker, and hop on a 30 minute Zoom to walk you through the process.

    1. 1

      Wow, much appreciated, thanks, and I would like to take you up on that once I go through the process myself to get a feeling for it. I'll learn better once I've struggled.

Trending on Indie Hackers
I got my first $159 in sales after realizing I was building in silence User Avatar 52 comments I spent more time setting up cold email than actually selling. Here is what fixed it. User Avatar 41 comments Three Days Before Launch, I Let My Own Tool Tear Me Apart User Avatar 35 comments I got tired of rewriting the same content for 9 different platforms. So I built Repostify. User Avatar 29 comments A pattern I keep seeing in EdTech: traffic isn't usually the problem. User Avatar 23 comments I thought I was building a news visualization tool. Users thought it was a catch-up tool. User Avatar 20 comments