create ghost lib with example and one click installation#88
create ghost lib with example and one click installation#88martinsaposnic wants to merge 3 commits intomainfrom
Conversation
simple lib that inherits everything from nextjs, BUT rewrites api/mdk POST to add some logic that talks to ghost
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.