Skip to content

create ghost lib with example and one click installation#88

Open
martinsaposnic wants to merge 3 commits intomainfrom
mdk-216
Open

create ghost lib with example and one click installation#88
martinsaposnic wants to merge 3 commits intomainfrom
mdk-216

Conversation

@martinsaposnic
Copy link
Copy Markdown
Contributor

No description provided.

simple lib that inherits everything from nextjs, BUT
rewrites api/mdk POST to add some logic that talks to ghost
Copy link
Copy Markdown

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

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: 30c2e2d073

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +125 to +129
if (isPaymentReceived(result?.data) && process.env.GHOST_URL) {
console.log('[ghost-route] Payment received, syncing to Ghost...')
const checkout = result.data

// Get product info for tier name, price, and interval
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 Make Ghost sync idempotent per checkout

The Ghost sync runs on every POST response whose data status is PAYMENT_RECEIVED (lines 125–159), but the client repeatedly calls get_checkout after payment: the checkout UI polls clientGetCheckout every second until status changes (packages/core/src/components/Checkout.tsx lines 164–184), and the success page calls it again (packages/core/src/hooks/useCheckoutSuccess.ts lines 7–59). That means the same paid checkout will trigger syncToGhost multiple times, and because syncToGhost extends tier expiry for existing members, the member can be granted extra months for a single payment. Consider de‑duping by checkout id (e.g., persist “processed” state), or only syncing on a single, server-side confirmation route so repeated status fetches don’t extend membership again.

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