Skip to content

Build a Paid Membership Site

Davor Minchorov•Intermediate•8 to 9 weekends•December 3, 2026

A collective of five podcasters and writers runs its members-only site, and a payment provider timeout left 70 people with bonus episodes they had stopped paying for. You will build the replacement, from tiers and recurring payments to gated posts, search and private podcast feeds, and prove with a simulated month of provider failures that nobody keeps access they stopped paying for.

The brief

The client

I run a members-only site for five podcasters and newsletter writers who share one audience, with about 1,900 paying members. On the first of the month our payment provider's API timed out for two hours and about 120 renewals came back as errors. Our nightly job read an error as a cancellation for some members and skipped the rest, so 70 people kept the bonus episodes for three weeks without paying.

The bonus episodes reach members through a private podcast feed per member, and nothing ever switches a feed off: a link posted in a forum was still being fetched by hundreds of listeners after the member behind it had been refunded. Access is a tier comparison pasted into six places (the post page, the archive list, search, the Friday email, downloads and the feed), and nobody can tell me what a given member could read last Tuesday.

I need the same answer to "may this member read this" on every way of reading, a membership I can trust when the provider's messages arrive twice or late, and an answer for support that comes from a record.

The problem

Every way of reading content carries its own copy of the access check. A new way to read means a new copy, and each copy is a place to forget a condition. The private feed is the worst case, because a podcast app fetches it on a timer with no login and nobody notices when it should have stopped.

Payment status arrives as a message the provider sends to our site when something happens. Messages arrive twice, arrive out of order, and sometimes never arrive. A member whose payment succeeded can be marked failed by a stale message, and a member who stopped paying keeps access because no job looks at them. Refunds and disputes are fixed by hand, in two places that disagree.

With five creators the cost is direct. One leaked bonus episode and the creator who made it asks whether to stay. Support has no record to answer "why could this member read that post", so it answers from memory.

The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.

The spec

Requirements

  • Let a creator define up to three tiers with a price and benefits, and change or retire a tier without changing what current members pay.
  • Let a member join a tier and pay through a payment provider, with access starting when the payment succeeds and not before.
  • Keep every membership correct when the provider sends duplicate, late and out-of-order messages, when two requests arrive at the same moment, and when the process dies at any moment, and settle a membership from the provider's own records when a message never arrives.
  • Follow a retry schedule for declined renewals, keep a grace period before access ends, and let a lapsed member return without a stuck state.
  • Let a member cancel or change tier at the end of the paid period, refund a member, take access away while a dispute is open and when it is lost, and let an operator suspend and reinstate a member.
  • Give the same answer to who may read what on every way of reading: posts, lists, counts, search, previews, files, private feeds and the weekly email.
  • Let a creator publish posts for a tier with a public teaser that reveals nothing gated, and let a member subscribe to a private feed that stops working when access ends.
  • Warn a member once per failed renewal and send a weekly digest that lists only what the member may read.
  • Let support say why a member could read a post at a past moment, from recorded facts.
  • Erase a member's personal data on request and keep the payment records the business has to keep.

Deliverables

  • Your repository starts the product with one command, plus a simulator that plays the members, the clock and a podcast app.
  • A README that takes a reviewer from a fresh clone to a member who joins, reads a gated post, stops paying and loses the post and the private feed, in 15 minutes, and lists the command for each test.
  • The table "Who may read what" and the worked billing month from the first Phase, in the README.
  • Documentation for the people who connect to the product: how a creator publishes a post, how a podcast app uses a private feed link, and what the payment provider sends and how the product checks it came from the provider.
  • A test suite that covers the races, the duplicate, late and out-of-order messages, the process deaths, the leak matrix and the simulated month, with the results of the final run committed.
  • A way to run the client's day faster than real time and to cause the outside failures: a fake payment provider and a fake mail provider that each decline, delay, duplicate, reorder, go quiet or refuse on demand, with a seeded run that repeats.
  • An operations note stating what an operator must be able to do: look up a membership and a payment, refund, suspend and lift, settle a membership against the provider's records, retry a failed warning, erase a member, and ask why a member could read something at a past moment.
  • A short note on what the build leaves open: the refund rule's legal status. The 14-day refund is the site's own guarantee, since the legal EU right of withdrawal lapses once a member asks for immediate access.

Out of scope

  • Conversations, replies and reactions. Members read here and do not write.
  • Live events, RSVPs and capacity. Seat limits are a different problem from access.
  • A moderation queue, moderation decisions and statements of reasons. One operator suspension stands in for a takedown that is not about money.
  • Creator payouts, balances, fee splits and tax reports. They are a second domain.
  • Tax of any kind. Prices are whole euro cents with no VAT line.
  • A login system. Treat the person behind each request as already identified.
  • A real payment provider account, and card numbers. You build a fake provider that copies documented behaviour, so card data never touches the product.
  • App store billing. A second money path adds a channel and teaches nothing new here.
  • A web front end for members. The simulator plays the browsers and podcast apps.
  • Direct messages, recommendations and ranking beyond newest first.
  • Legal advice. The README names the legal questions the build leaves open and says it is not legal advice.

Architectural constraints

  • Amounts are whole euro cents and exact to the cent.
  • No card number is ever stored or seen by the product.
  • The price a member pays is fixed when they join, and a later price change never reprices them.
  • Access starts only from a successful payment, and it ends no later than 7 days after the paid period when no payment arrives.
  • The answer to who may read what is the same on every way of reading, and when the product cannot work out the answer, it shows public content only.
  • A gated post shown to someone who may not read it reveals none of its title, body or file names.
  • When the product and the provider disagree about a payment, the provider's record wins.
  • A payment is counted once however many times its message arrives, and payments are ordered by when they happened and not by when they arrived.
  • Nothing is lost and nothing is done twice when the process dies at any moment.
  • Charge dates follow the join date in Europe/Amsterdam time.
  • A member's name and email are erased on request, while payment, tax and traceability records stay, identified by member ID.

Prerequisites

You have built one application with a database, in any language and framework. You do not need experience with payments or distributed systems, and you do not need to know how a members-only site sells access to its creators' work; the first Phase explains the business and the words the brief uses. The brief explains each outside behaviour at the Checkpoint that first needs it. Your tests must be able to send requests at the same moment, because a test that sends them one after another never shows a race and passes on code that is wrong. Having once been paid late, or twice, by a system that trusted the order messages arrived in will make most of this brief feel familiar.

Create a free accountSign in

Free to start. An account is what keeps track of the checkpoints you finish.

Phase 1

Work out the access and billing rules by hand

Produces a worked billing month and a table that says who may read what in every case, which later Checkpoints are checked against. Builds nothing yet.

Research

Research

Architectural walkthrough

How a members-only site sells access to its creators' work

The client runs one members-only site for five podcasters and newsletter writers who share an audience of about 1,900 paying members. A creator defines up to three tiers, each with a price and benefits. A member joins a tier and pays through a payment provider, and each month the provider tries to take the renewal.

Members read posts on the site, search the archive, download files, get a weekly email, and listen to bonus episodes through a private podcast feed of their own. A podcast app fetches that feed on a timer with no login. A post has a public teaser that reveals nothing from behind the gate.

The provider tells the site what happened by sending messages. A message can arrive twice, late, out of order or never. When a renewal is declined, the site retries it on a schedule and gives the member a grace period of 7 days before access ends. A member can cancel or change tier at the end of the paid period, ask for a refund, or dispute a charge with their bank. The client keeps payment records for 7 years, which is the Dutch rule for business records.

The words this brief uses:

  • Tier: a level of membership with its own price and benefits.

  • Membership state: where a membership stands: waiting for first payment, active, in grace, on hold, lapsed or ended. The client's meanings are set out under the next heading.

  • Renewal: the charge that continues a membership into the next paid period.

  • Grace period: the days after a failed renewal when access continues. Here it is 7.

  • Dispute: a member asking the bank to reverse a charge. Access is taken away while it is open and when it is lost.

  • Private feed: a podcast feed with one link per member.

  • Teaser: the public part of a gated post.

  • Provider message: the payment provider's report that something happened to a payment.

Why the client's words are fixed first

The client's trouble starts with words that mean different things to different people. Support says a member is "active" when the member has paid, and the nightly job says it when the member has not been marked cancelled. A rule that two people read two ways gets built twice, and the version nobody wrote down ends up in the product. This Phase fixes the client's rules in writing, with dates and numbers, so that every later Checkpoint can be checked against them and not against what the builder remembers.

These are the client's words, and every Checkpoint uses them. A membership is waiting for first payment when a member asked to join and the first payment has not succeeded. It is active inside a paid period. It is in grace when a renewal failed and the member is still inside the 7 days before access ends. It is on hold while a dispute is open or an operator has suspended the member. It is lapsed when grace ran out without a payment. It is ended when it was cancelled, refunded or lost in a dispute. A member whose first payment failed never started. Every membership has an access-until time, the moment it stops giving access unless a payment pushes it out: the end of the paid period plus 7 days, or 7 days after the first failure of a renewal.

Two things go wrong when the rules stay in people's heads. A creator's bonus episode reaches a member who stopped paying, because one of six places that check access forgot the grace rule. A member who joined on 31 Jan is charged on the 28th every month for years, because the first person to add a month to a date never met February. Both cost the client money and trust, and neither shows up until a member writes in.

Phase 2

Sell tiers and start memberships from payments

Produces tiers with dated prices, a fake payment provider that misbehaves on demand, and memberships that start only from a successful payment, even when the provider's messages arrive twice or late and the process dies mid-payment. No renewals yet.

Implementation

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

A payment provider tells the product what happened by sending it a message, and the arrival of a message is not the same as the truth. Messages arrive twice, arrive in the wrong order, and sometimes never arrive. A product that writes whatever came in last marks a member who paid as failed because a delayed message finally turned up. A product that starts a membership when the member presses join gives access to someone whose card was declined.

The provider also gets slow. A call that times out gives the product no answer, and the card may already have been charged. A product that reads the timeout as a decline charges the member a second time on the next try. A provider also sends a message again whenever the product answers slowly, so a product that does its work before it answers turns every slow moment into a second copy of the same message.

Two decisions about money run through the Phase. An amount is a whole number of euro cents, because 7 euros held as a decimal can become 6.999999 and nobody sees it. The price a member pays is fixed when they join, so a creator who raises a tier's price never reprices existing members.

The last failure is a process that dies. If it dies after taking a payment and before giving the member what it paid for, the member has paid and has nothing, and nobody finds out until they write in. If it dies after charging a card and before anything remembers it did, the next try charges again. Tests that send requests one after another cannot show either, and cannot show two requests that overlap: they never do, and the test passes on code that is wrong.

Phase 3

Charge, retry and end access on schedule

Produces renewals on the anniversary, retries, a grace period, lapse and return, cancels and tier changes at the end of the paid period, holds for refunds, disputes and suspensions, and settlement when a message never arrives. Nothing is gated yet.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

What a failure means for access, and for how long, is the question this Phase answers. A declined card, an error from the provider and a call that never gets an answer look alike in a log and are three different facts. A decline is an answer: the provider looked and said no. An error or a timeout is no answer, and the charge may have gone through. The client's nightly job read errors as cancellations for some members and skipped the rest, and 70 people read bonus episodes for three weeks on the strength of that confusion. A timeout must change nothing about a membership. The attempt stays unresolved until the provider's message or a lookup brings the real answer.

The end of a paid period is a moment on a clock and no message announces it. Nothing arrives to say that 15 Apr 2026 has come, so the product has to notice. A month of renewals also has to run in seconds in the tests, which means the date the product believes must be one you can set.

Access depends on one time, the access-until time. It sits 7 days after the end of the paid period, a payment pushes it out, and a hold, an end or a lapse cuts it short. A member whose messages all go missing therefore loses access on a known date and does not keep it forever.

The schedule is the client's. The first attempt is on the charge date. After a soft decline, retries come 24 and 96 hours after the first failure, and grace ends 7 days after the first failure. A hard decline, one that retrying will not fix, gets no retry and the same grace. The last retry sits three days clear of the lapse, so a retry result and the lapse cannot land in the same minute. A payment that happened just before the lapse but reaches the product just after it still counts, because the time that matters is when it happened and not when it arrived.

The charge date comes from the day the member joined, in Europe/Amsterdam, clamped to the length of the month. A member who joined on the 31st is charged on the 28th in a short February and on the 31st again in March. Adding a month to the previous charge date would slide that member to the 28th for good.

Two requests at once and a process that dies are the other failures here. A refund requested twice at once must refund once. A process killed halfway through a renewal must leave a member who is charged once, and not zero times or twice. No Checkpoint in this Phase can show a member a gated post, because none exists yet. The operator's view of the membership is where each result is read.

Phase 4

Decide who may read what

Produces the answer to what a member may read at any moment, and a record that explains it for a past moment. Publishes no posts yet.

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

The client lives with the same question answered in six places: the post page, the archive list, search, the Friday email, downloads and the private feed. Six answers drift, and the one that drifts furthest is the one nobody reviews. This Phase fixes the answer to the question, by member and by moment, before any post exists, so the Phase after it can ask the same question of every way of reading.

A creator's higher tier covers the lower tiers of the same creator, and the order of tiers changes when a creator adds a fourth. Every place that carries its own copy of the order has to be found and fixed on that day, and one is always missed. The answer also has to lean toward less when anything is in doubt. A bug that shows a paying member too little costs an apology. A bug that shows a stranger a gated post costs the creator who made it, and that creator asks whether to stay.

Payment news reaches the product in whatever order the provider sends it. A lapse handled after the renewal that follows it takes away what the member just paid for. The same news handled twice must change nothing the second time. A process that dies after a refund was accepted and before reading was taken away leaves a refunded member reading, which is the client's forum-link incident again.

Support has to say why a member could read a post last Tuesday. A status that shows only what is true now cannot answer, and a record edited after the fact answers with today's facts for a day that is gone.

Phase 5

Publish gated content

Produces posts with a public teaser, lists, counts and search that show only what a member may read, private podcast feeds and downloads that stop when access ends, and a test that finds no leak. The weekly email comes in the next Phase.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

Content leaves the product in seven ways: a single post, a post list, a post count, search results, a file download, a private podcast feed and the weekly email. The post page gets its access check on the first day. The others get theirs when someone remembers, and the one nobody lists in a design review is the one that leaks. The client's incident lives there: a podcast app fetched a private feed on a timer after the member behind it had been refunded, and hundreds of listeners kept getting episodes.

A leak does not need a gated post to appear in full. A list that fetches 50 posts and drops the ones the viewer cannot see returns pages of uneven length. A count taken before the drop tells a stranger how many gated posts exist. A search that shows a snippet of a gated body has published the body. A teaser made by trimming the first paragraph of a gated post is a copy of the gated text. None of these shows up when a test looks at one post at a time.

A request from someone the product cannot identify, or for whom it cannot work out the rights, gets public content only. There is no case in which a missing answer means everything.

A private feed adds a second kind of risk. A feed link works for whoever holds it, so a link posted in a forum is read by strangers. The only moment the product can decide anything is the moment of each fetch, because a podcast app fetches on a timer with no login. A download link that keeps working by itself outlives the membership behind it.

The last Checkpoint proves the checks work: a test that has never failed has not been shown to catch anything, so each way of reading is broken on purpose and the test must go red in that way alone.

Phase 6

Notify members and prove the month

Produces payment warnings, the weekly digest, erasure of a member's personal data and a simulated month of 1,900 members with the provider misbehaving. Payouts, tax and moderation stay out of the project.

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

An email is a way of reading and a thing that can be sent twice. As a way of reading, it shows content, so what it shows must be decided at the moment of sending. A digest assembled when the digest was prepared mails gated titles to a member who stopped paying in between. As a thing that can be sent twice, it has to survive a mail provider that times out after the mail went out. The product cannot tell whether the mail left, and a retry that guesses wrong sends a second email.

A renewal that fails on attempt 1, 2 and 3 is one failure for the member and three for the provider's messages. The member must still get one warning. Next month's failed renewal is a new failure and gets its own.

Erasure removes a person's name and email and keeps the payment records the business has to keep, including the billing country on each payment. Dutch law requires a business to keep its records for 7 years (Belastingdienst), and that is the client's legal duty here. The README names that duty and says it is not legal advice. Erasure also races with everything else: a warning waiting to go out before the erasure must not mail an address that no longer exists, and a dispute won after the erasure must not bring the member back.

The last Checkpoint runs everything at once. 1,900 members go through a compressed month while the payment provider declines, duplicates, reorders, delays and goes quiet, and the process is killed at random moments. Each defence in the project assumed the others held, and this is the first time none of them can.

Architectural walkthrough

Six answers to one question

The old site compared tiers in six places, so six places could disagree. The post page checked the member, the archive list checked them differently, and the Friday email checked them when the digest was prepared and not when it was sent. A new way to read content meant a new place to forget a condition. The price of that is a creator whose bonus episode reaches someone who stopped paying, and a creator who asks whether to stay.

Check your own build for the same weakness. Pick any way of reading, remove who is asking from it, and see whether a single test goes red. If the answer is no for any of the seven, a stranger can read what a member paid for.

Leaks that no single post shows

A gated post does not have to appear in full to leak. A list that drops the posts a stranger cannot see after fetching them returns short pages, and a count taken before the drop tells the stranger how many gated posts exist. A search that shows a snippet of a gated body has published the body. A teaser made by trimming the first paragraph is a copy of the gated text. The client's private feed is the worst case, because a podcast app fetches it on a timer with no login. A link checked once when it was issued kept serving hundreds of listeners after the member behind it was refunded.

Read the responses of your own build as a stranger would, whole, and search them for words from a gated post.

Messages are not the truth

The provider tells the site what happened by sending messages, and messages arrive twice, arrive out of order, and sometimes never arrive. A site that writes whatever arrived last marks a member who paid as failed because a delayed message finally turned up. A site that waits for a message that never comes leaves a member who paid shown as unpaid until a person notices. A call that times out gives no answer, and the card may already have been charged. The client's nightly job read those timeouts as cancellations, and 70 people read bonus episodes for three weeks.

Check that a payment reported as happening before a lapse still counts when it arrives after, and that a payment is counted once however often its message arrives.

A process that dies at the wrong moment

If the process dies after taking a payment and before giving the member what it paid for, a member has paid and has nothing. If it dies after charging a card or sending an email and before anything remembers it did, the next try does it again, and a card is charged twice or an email goes out twice. A refund that was accepted and never carried out is a refunded member who still reads, and a suspension lost in that moment has no date to end it. These deaths do not show up in tests that never kill anything.

Kill your own build at every step of a join, a refund and a warning, and read what the member and the client see afterwards.

Support needs a record

Support has to answer "why could this member read that post last Tuesday". A status shows only what is true now, and an answer that changes after Thursday's renewal is worth nothing in an argument with a creator. Check that the answer for a past moment is the same before and after a later renewal.

Where it shows if you cut a corner

A product that writes whatever status arrived last passes with a friendly fake provider and fails the day the provider sends a late failure after the success of the retry that followed it. A feed that checks access when the link is created passes until a test ends a membership and fetches the same link again. A weekly email built from the posts a member could read at signup mails gated titles to someone who stopped paying. A test that sends requests one after another never shows two overlapping requests. The simulated month runs all of these together, with the provider misbehaving and the process dying, and counts the leaks.