Repository navigation
CoinPay hosted checkout sessions: any coin or PayPal - #229
Merged
Merged
Conversation
Replaces the older SDK-based payments fork with the shared v2 file: createCheckout opens POST /api/checkout/sessions with customer_email, account_id and property (nichedb.dev). Premium, Pro (web + OpenSaaS) and Data checkouts pass the buyer's email and id, no longer pin BTC, and get success/cancel URLs back to their page. The webhook settles by session or payment id (old in-flight payments still settle), counts forwarded as paid, and a referral is only recorded on a fresh membership grant so a confirmed+forwarded pair cannot count it twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves every NicheDB checkout (Premium terms, Pro on /pro and via OpenSaaS
/api/v1/billing/subscribe, Data dumps) onto CoinPay hosted checkout sessions.packages/payments/src/index.jsis now the shared v2 file (byte-identical with genrewatch/tipoffwatch/bg0ne/typeheard/pwamart/wx93/tleehealth/watchnews), replacing the older 143-line SDK fork.createCheckoutposts/api/checkout/sessionswithcustomer_email,account_id,property(nichedb.dev) and our metadata. The buyer picks any coin the business has a wallet for, or PayPal.cs_session id; settlement matches session id or payment id, so old in-flight payments still settle.forwardednow counts as paid (CoinPay retries a failed forwarded for a day, a failed confirmed only ~12 min). An unknown payment answers 200 instead of throwing.recordReferralonly runs whengrantMembershipactually inserted a term (it is idempotent on payment_id), so confirmed + forwarded cannot count a referral twice.email+accountId, dropblockchain(COINPAY_BLOCKCHAIN is now unused), and get success/cancel URLs (/premium,/pro,/dumps).test/payments-checkout-sessions.test.js; premium/data route tests assert email, account, no chain, success URL. Full suite 2539 pass, 0 fail.CoinPay business 2ccb4a79 has 15 wallets; PayPal connected today (house app, self-serve).
🤖 Generated with Claude Code