Repository navigation
v1.1.0
Added
actionRoleson thepricingitem'slib/plan-card-config.tsxand the
billing-settingsitem'slib/credit-bundle-config.tsx: the workspace
roles shown a plan's or a bundle's other ways to pay (default
["owner"]). Bind it topaymentPollConfig.payerRolesso the pages
offer the QR payment to the roles its server action accepts.PaymentProvider.callbackResponse({ settled }): the answer a provider
expects to its callback. Thepayment-pollitem's callback route returns
it when the provider has one, and its JSON summary otherwise.
Changed
PricingContent,PlanCardandCreditBundlestake the caller'srole
instead of acanCheckoutflag. Card checkout stays owner-only; an
admin or member sees the bundles on billing settings when
actionRolesincludes their role.- A local invoice is recorded before its provider is asked.
openLocalInvoice
writes thepaymentsrow asopening, hands its id to
createPaymentas the newpaymentIdparameter, and fills in the
provider'sinvoice_idandexpires_atfrom the answer; a provider that
refuses leaves the rowfailed. A provider can usepaymentIdas its
merchant-side invoice number or in its callback URL, and
invoiceIdFromCallbackmay return either id. - An invoice's expiry is kept and acted on.
settleLocalInvoicecancels an
invoice the provider still reports unpaidLOCAL_INVOICE_EXPIRY_GRACE_MS
(15 minutes) after itsexpiresAtand marks it failed, and
settlePendingLocalInvoiceskeeps settling an invoice with a recorded
expiry until then rather than only for a day after it was opened. - A local invoice keeps what it was sold for.
openLocalInvoicetakes the
offer'sgrantand stores it in the newpayments.grant_terms, and
settleLocalInvoiceapplies that grant rather than askingfulfil,
which now decides only for an invoice opened without one. An offer
changed or removed after the invoice was opened no longer changes or
blocks what a paid invoice grants. Thepayment-pollitem's
startLocalPaymentpasses the grant. Payment.invoiceId(thepaymentsrow type) isstring | null: a row
isopening, with no invoice id yet, while its provider is asked. Code
that readspaymentsdirectly checks for it.- Migrations
0005_local_invoice_expiry(payments.invoice_idnullable,
payments.expires_atadded) and0006_local_invoice_grant
(payments.grant_termsadded). Nothing is renamed or removed, so
intelligo migratecan run ahead of the deploy.
Upgrading
Run intelligo migrate, then intelligo sync pricing billing-settings payment-poll to take the new pages and route; bind actionRoles in
lib/plan-card-config.tsx and lib/credit-bundle-config.tsx if a role
other than the owner pays locally.