Repository navigation
feat(billing): CoinPay hosted checkout sessions + nested webhook - #194
Merged
Merged
Conversation
…forwarded = paid Credit packs now open a CoinPay checkout session (POST /checkout/sessions) instead of a single-chain payment: property outreachgraph.com, account_id = user id, customer_email = user email, org/workspace/pack/purchase ids in metadata. The buyer picks any coin or PayPal on CoinPay's page, so the chain picker is gone and the API ignores a sent blockchain. Rows are keyed by the session id; the webhook reads data first, matches checkout_session_id then payment_id, and credits on confirmed or forwarded (idempotent on the row key). The client needs only COINPAY_API_KEY + COINPAY_WEBHOOK_SECRET now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Turns checkout on for outreachgraph.com and moves it to CoinPay hosted checkout sessions.
packages/payments/src/coinpay.ts:createCheckoutSession,getCheckoutSession,checkoutSessionBody,readWebhookEvent(nesteddatafirst, flat fallback; confirmed/forwarded = paid).apps/api/src/billing.ts: session with propertyoutreachgraph.com, account_id = user id, customer_email = user email, metadata {purchase_id, organization_id, workspace_id, user_id, pack_id}. Row keyed bycs_...; webhook matchescheckout_session_idthenpayment_id; credits on confirmed or forwarded, once.blockchain.COINPAY_API_KEY+COINPAY_WEBHOOK_SECRET(business id optional).coinpay-onboard site outreachgraph.com --webhook https://outreachgraph.com/api/v1/coinpay/callbackinto vaultoutreachgraph-com--prod; the dev2 deploy now syncs app.env from it.Tests: billing.test.ts 20 pass (session body, no-email refusal, nested confirmed, confirmed+forwarded once, forwarded alone, expired, unsigned). tsc clean.
🤖 Generated with Claude Code