Repository navigation
Invoices: payer/payee/property to CoinPay, read the nested webhook - #322
Merged
Merged
Conversation
…ested webhook
requestPayment now passes customer_email (payer email), account_id
(payer id) and property agenticjobs.work top-level on
/api/payments/create, and the same plus payee_id in metadata. The
peer-invoice model is unchanged: the payer still pays the payee's own
wallet via merchant_wallet_address.
applyWebhook read event/payment_id flat, so a real nested CoinPay
webhook ({id: evt_..., type, data: {payment_id, status}}) was always
ignored and invoices only settled on the next page load. It now reads
data first with the flat shape as a fallback.
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.
Keeps the peer-invoice model (OAuth + payment to the payee's own wallet via
merchant_wallet_address). Only adds who pays and who is paid:src/core/coinpay.tscreatePaymentsendscustomer_email(payer email),account_id(payer id) andproperty: agenticjobs.worktop-level on/api/payments/create(CoinPay takes them optionally), and the same pluspayee_idinmetadata.src/core/invoices.tsrequestPaymentlooks up the payer's email and passes payer id + payee id.applyWebhookreadevent/payment_idflat, so a real CoinPay webhook (nested:{id: evt_..., type, data: {payment_id, status}}) was alwaysignored; invoices only settled when someone reloaded the page. NewreadWebhookreadsdatafirst, flat as fallback;confirmed/forwardedsettle,detecteddoes not.pnpm test: 886 pass; prettier clean.🤖 Generated with Claude Code