Skip to content

A Ko-fi shop item can hand out a code too - #82

Open
McCal-Codes wants to merge 1 commit into
mainfrom
kofi-shop-item
Open

McCal-Codes wants to merge 1 commit into
mainfrom
kofi-shop-item

Conversation

@McCal-Codes

Copy link
Copy Markdown
Owner

A shop item is the least work for the most cover: someone buys it, Ko-fi calls the worker, the worker emails a code. No membership, and nobody has to think about amounts.

  • POOLS in wrangler.toml keeps a shop section, ready for the item's direct_link_code.
  • The README says how: make the item in Ko-fi, price it at $3 to match a month of Coffee so nobody buys access cheaper than a member gets it, paste the last part of its link into POOLS, deploy, then buy it once to see the whole path.
  • Nothing expires on the shelf: a code's month starts when it's redeemed, so the item can sit there for months.

Config and documentation only; the worker's code is unchanged and its tests still pass.

POOLS keeps a shop section for the item's direct_link_code, and the README says
how to make the item, price it against a month of Coffee, and check it once by
buying it. A code starts its month when it's redeemed, so the item never goes
stale in the shop.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18f3176265

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The least work for the most cover: a shop item anyone can buy, with no membership and no thinking about amounts.

1. **Ko-fi › Shop › Add item.** Name it what it is, for example "Folio early access, one month". Price it at $3, the
same as a month of Coffee, so nobody can buy access cheaper than a member gets it. No shipping, no stock limit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Limit orders to one unit or fulfill every purchased unit

When a buyer orders more than one unit, Ko-fi supplies the count as shop_items[].quantity, but poolFor returns only one pool and the webhook calls claimCode only once per message_id. A two-unit order is therefore charged twice while receiving only one one-month code. The listing must prevent multi-unit orders, or the worker must fulfill the requested quantity.

Useful? React with 👍 / 👎.

The least work for the most cover: a shop item anyone can buy, with no membership and no thinking about amounts.

1. **Ko-fi › Shop › Add item.** Name it what it is, for example "Folio early access, one month". Price it at $3, the
same as a month of Coffee, so nobody can buy access cheaper than a member gets it. No shipping, no stock limit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid unlimited sales against the finite code pool

When the m1 pool is exhausted, claimCode returns no code and the webhook records a problem and returns 200, so Ko-fi considers the order handled while this unlimited listing remains available. Subsequent buyers can keep paying without receiving the advertised code; the shop availability needs to be bounded or replenishment/fulfillment must prevent sales from continuing after the pool empties.

Useful? React with 👍 / 👎.

Comment on lines +57 to +58
Say so in the item's description: what it opens (the Market, Keyd, Beta Features), that it lasts a month, that Folio
is free and open source either way, and that the code arrives by email straight after paying.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Condition the immediate-email promise on working mail

In the documented supported configuration where RESEND_KEY is omitted, or whenever Resend returns a non-success response, email() returns false and the webhook still responds successfully; the code then requires manual delivery. Telling sellers to promise that it arrives by email immediately after payment is therefore false for those configurations and should be conditional on verified mail setup and delivery handling.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant