@happyvertical/smrt-commerce 0.51.34 → 0.51.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +15 -6
- package/README.md +50 -14
- package/dist/__tests__/helpers/fake-stripe.d.ts +11 -0
- package/dist/__tests__/helpers/fake-stripe.d.ts.map +1 -1
- package/dist/billing/cards.d.ts +17 -2
- package/dist/billing/cards.d.ts.map +1 -1
- package/dist/billing/credits.d.ts.map +1 -1
- package/dist/billing/crypto.d.ts.map +1 -1
- package/dist/billing/events.d.ts.map +1 -1
- package/dist/billing/index.d.ts +4 -4
- package/dist/billing/index.d.ts.map +1 -1
- package/dist/billing/invoice-payments.d.ts.map +1 -1
- package/dist/billing/payment-attempts.d.ts.map +1 -1
- package/dist/billing/provider.d.ts +58 -2
- package/dist/billing/provider.d.ts.map +1 -1
- package/dist/billing/runtime.d.ts +37 -2
- package/dist/billing/runtime.d.ts.map +1 -1
- package/dist/billing/stripe.d.ts.map +1 -1
- package/dist/billing/top-up.d.ts +56 -7
- package/dist/billing/top-up.d.ts.map +1 -1
- package/dist/billing/units.d.ts +2 -0
- package/dist/billing/units.d.ts.map +1 -1
- package/dist/chunks/types-CRnln577.js.map +1 -1
- package/dist/chunks/{units-ROB39hIC.js → units-CpBepqG1.js} +5 -2
- package/dist/chunks/{units-ROB39hIC.js.map → units-CpBepqG1.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +217 -64
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +22 -5
- package/dist/models/Invoice.d.ts +9 -1
- package/dist/models/Invoice.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +12 -5
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -11
package/AGENTS.md
CHANGED
|
@@ -86,18 +86,27 @@ for usage.
|
|
|
86
86
|
transaction and must be idempotent.
|
|
87
87
|
- **Card on file and top-ups (#3139).** A saved card is the payer customer's
|
|
88
88
|
default `PaymentInstrument` (seller tenant, id from the provider method).
|
|
89
|
-
`autoChargeInvoices` bills such payers `charge_automatically`, decided
|
|
90
|
-
|
|
89
|
+
`autoChargeInvoices` bills such payers `charge_automatically`, decided once
|
|
90
|
+
and saved as `Invoice.collectionMethod` before the first push, which every
|
|
91
|
+
retry reuses (never recompute it: a lost push response would record a
|
|
92
|
+
method the provider was not asked for, #3190); activation follows `paid`, never send. An auto top-up attempt
|
|
91
93
|
is a `PENDING` `Payment` (`reference` `auto-top-up:<policyId>`, id from the
|
|
92
94
|
policy and `count()` of its attempts) inserted before the charge, so racing
|
|
93
95
|
evaluations derive one id and one charge; the charge key is derived from
|
|
94
96
|
that id. `applyAutoTopUpOutcome()` must run in a transaction and starts with
|
|
95
97
|
a conditional `UPDATE … WHERE status = 'pending'` row lock, so the hook and
|
|
96
98
|
the `payment` webhook settle once; the grant is keyed by the charge key.
|
|
97
|
-
Never settle an attempt outside that function. Taxed accounts are
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
Never settle an attempt outside that function. Taxed accounts are charged
|
|
100
|
+
with provider tax by default (#3194): the attempt row holds the credit
|
|
101
|
+
(the charge subtotal), the tax is journaled to tax payable at settlement,
|
|
102
|
+
and the attempt's tax decision is recorded in its `notes` so a re-drive
|
|
103
|
+
repeats the same charge request (the provider refuses a key reused with
|
|
104
|
+
different tax). `claimAttempt()` is the only place that decides a
|
|
105
|
+
skip and reports it (`onAutoTopUpSkipped`); `cardOnFile()` and period close
|
|
106
|
+
use `defaultCardInstrument()` — never copy that predicate. A provider write-off moves the local invoice to
|
|
107
|
+
`WRITTEN_OFF` (a later payment, by card or on a rail (#3188), is recorded
|
|
108
|
+
and reinstates the payer; the status stays, so "paid in full" for a
|
|
109
|
+
written-off invoice is read from its allocations).
|
|
101
110
|
- **`Invoice.providerTaxAmount`** is added to line-item tax; it is
|
|
102
111
|
server-managed (not API-writable). `toAccountingInput()` emits major units.
|
|
103
112
|
- **Payment rails (#3138).** A runtime has one issuing `provider` and any
|
package/README.md
CHANGED
|
@@ -234,9 +234,8 @@ const setup = await billing.createCardSetupCheckout({
|
|
|
234
234
|
});
|
|
235
235
|
|
|
236
236
|
// Automatic top-ups: charge the saved card when a balance would run out.
|
|
237
|
-
// Accounts are taxed by default (`automaticTax`)
|
|
238
|
-
//
|
|
239
|
-
// `automaticTax: false` on the account or pass `taxedAccounts: 'charge_untaxed'`.
|
|
237
|
+
// Accounts are taxed by default (`automaticTax`); a taxed account is charged
|
|
238
|
+
// the credit plus provider-calculated tax (#3194).
|
|
240
239
|
const evaluator = await SpendingPolicyEvaluator.create({
|
|
241
240
|
db,
|
|
242
241
|
autoTopUp: billing.autoTopUpHook({ amount: () => 2500 }),
|
|
@@ -345,16 +344,34 @@ const evaluator = await SpendingPolicyEvaluator.create({
|
|
|
345
344
|
completion the card becomes the provider customer's default and the
|
|
346
345
|
payer's default `PaymentInstrument`. When the checkout collected the billing
|
|
347
346
|
address (a taxed payer with no tax location), it becomes the payer's tax
|
|
348
|
-
location.
|
|
347
|
+
location. `cardOnFile(payerTenantId)` returns `{ onFile, savedAt? }` from
|
|
348
|
+
the same check automatic charges use (a default card with the account's
|
|
349
|
+
provider customer), for "card on file" displays and signup activation;
|
|
350
|
+
the payer or a system context may call it (#3187).
|
|
349
351
|
- **Automatically charged invoices.** With `autoChargeInvoices: true` on the
|
|
350
352
|
runtime, a payer with a default card is invoiced `charge_automatically`:
|
|
351
353
|
the provider charges the card after the invoice is sent, on its own
|
|
352
|
-
schedule, and retries failures.
|
|
354
|
+
schedule, and retries failures. Each pushed invoice records the method in
|
|
355
|
+
`Invoice.collectionMethod` (`charge_automatically` or `send_invoice`; empty
|
|
356
|
+
for invoices pushed before #3190). Do not offer another payment rail on a
|
|
357
|
+
`charge_automatically` invoice the provider is still collecting.
|
|
358
|
+
Upgrading adds the `collection_method` column to `invoices` (run
|
|
359
|
+
`smrt db:migrate`). Activate service on the `current` standing
|
|
353
360
|
from the `paid` event, not on send; a failure marks the payer `past_due`.
|
|
354
361
|
- **Automatic top-ups.** Taxed accounts (the default: `automaticTax` on, not
|
|
355
|
-
tax-exempt) are
|
|
356
|
-
|
|
357
|
-
tax
|
|
362
|
+
tax-exempt) are charged the credit plus provider-calculated tax (#3194):
|
|
363
|
+
the balance is credited the credit, the payment records the credit, and
|
|
364
|
+
the tax is booked to the tax account. `taxedAccounts: 'skip'` does not top
|
|
365
|
+
them up, and `'charge_untaxed'` charges them without tax. A taxed payer
|
|
366
|
+
without a tax location is not charged. A location Stripe rejects fails the
|
|
367
|
+
attempt with `failureCode: 'customer_tax_location_invalid'`
|
|
368
|
+
(`onAutoTopUpFailed`), and it is retried only after `retryAfterMs`. Pass
|
|
369
|
+
`onAutoTopUpSkipped` to learn when a needed top-up will not be charged
|
|
370
|
+
because of the payer's account. Its `reason` is `taxed_account`, `no_card`,
|
|
371
|
+
`no_account`, or `tax_location_invalid`, and more may be added. Use it, for
|
|
372
|
+
example, to ask the payer to top up by hand or to add a billing address; it is not called while a charge is processing, while a
|
|
373
|
+
declined card waits out `retryAfterMs`, or when the top-up is no longer
|
|
374
|
+
needed or `amount` declines it (#3189).
|
|
358
375
|
`billing.autoTopUpHook()` is the `autoTopUp` hook for
|
|
359
376
|
`SpendingPolicyEvaluator`: when a balance would run out it charges the
|
|
360
377
|
payer's saved card off-session (the delegating parent's, for a delegated
|
|
@@ -364,10 +381,14 @@ const evaluator = await SpendingPolicyEvaluator.create({
|
|
|
364
381
|
attempt, and calls the runtime's `onAutoTopUpFailed` (ask the payer to
|
|
365
382
|
re-save their card with a setup checkout). One attempt runs per policy at a
|
|
366
383
|
time, retries of a declined card wait `retryAfterMs` (default one hour),
|
|
367
|
-
and the credit is granted exactly once however the outcome arrives.
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
384
|
+
and the credit is granted exactly once however the outcome arrives.
|
|
385
|
+
- **Product tax codes (#3194).** `taxCodes: { credit, invoice }` on the
|
|
386
|
+
runtime classifies prepaid credit (checkout purchases and taxed top-ups)
|
|
387
|
+
and billing-period invoice lines for Stripe Tax (`txcd_...`). Without it,
|
|
388
|
+
the Stripe account's default product tax code applies.
|
|
389
|
+
- **Upgrading to #3194.** Requires `@happyvertical/accounting` 0.96 or later.
|
|
390
|
+
No schema change. Taxed accounts are now topped up with tax. To keep the
|
|
391
|
+
previous behaviour, pass `taxedAccounts: 'skip'`.
|
|
371
392
|
- **Upgrading to #3139.** Requires `@happyvertical/accounting` 0.92 or later.
|
|
372
393
|
No schema change. Credit checkouts are now taxed for taxed accounts (pass
|
|
373
394
|
`automaticTax: false` to keep them untaxed), and Stripe customers are
|
|
@@ -415,6 +436,14 @@ await billing.acceptWebhook(rawBody, '', { provider: 'btcpay', headers: request.
|
|
|
415
436
|
await billing.processEvents();
|
|
416
437
|
```
|
|
417
438
|
|
|
439
|
+
- **Refusals are typed (#3185).** `createInvoicePayment()` and
|
|
440
|
+
`createCreditCheckout()` throw `BillingPaymentRefusedError` for requests the
|
|
441
|
+
payer can correct, with a stable `code`: `not_found`, `not_payable`,
|
|
442
|
+
`payment_in_progress`, `nothing_due`, `invalid_amount`, `below_minimum`
|
|
443
|
+
(under the rail's `minimumAmount`), or `no_account`. Show its message as a
|
|
444
|
+
4xx; any other error is a server failure, and `TenantIsolationError` still
|
|
445
|
+
means the caller is not the payer. Treat an unknown code like
|
|
446
|
+
`not_payable`.
|
|
418
447
|
- **Settlement is the gateway's.** Credit is granted and invoices are paid
|
|
419
448
|
only when the gateway reports `settled` under its own confirmation policy;
|
|
420
449
|
this package never counts confirmations. BTCPay offers 0, 1, 2 or 6
|
|
@@ -423,8 +452,10 @@ await billing.processEvents();
|
|
|
423
452
|
recording the locked fiat price, fiat and native amounts received, rate and
|
|
424
453
|
rate source, each payment's txid, rail and fee, a timeline of status changes,
|
|
425
454
|
and what settlement produced. `listPaymentAttempts()` feeds "payment
|
|
426
|
-
confirming" displays and operator queues;
|
|
427
|
-
|
|
455
|
+
confirming" displays and operator queues; every filter applies before its
|
|
456
|
+
`limit` and `offset`, so paging through `{ unresolved: true }` lists every
|
|
457
|
+
open exception (flagged, not yet resolved) however old. `refreshPaymentAttempts()` is the polling
|
|
458
|
+
fallback for missed webhooks.
|
|
428
459
|
- **Dunning pauses** for an invoice while a payment for it is confirming
|
|
429
460
|
(0-conf seen); if the payment then expires or is invalidated the payer's
|
|
430
461
|
standing is re-applied.
|
|
@@ -432,6 +463,11 @@ await billing.processEvents();
|
|
|
432
463
|
`markInvoicePaidOutOfBand` (Stripe `paid_out_of_band`), so Stripe stops
|
|
433
464
|
collecting; Stripe's own `paid` event then records nothing more.
|
|
434
465
|
`createInvoicePayment` refuses when the issuing provider cannot do that.
|
|
466
|
+
A written-off (uncollectible) invoice with an amount due can be paid on a
|
|
467
|
+
rail too, as it can by card at Stripe (#3188): the payment is recorded,
|
|
468
|
+
Stripe's invoice is closed out of band, and the payer returns to `current`;
|
|
469
|
+
the invoice keeps its `WRITTEN_OFF` status (its `amountPaid` shows the
|
|
470
|
+
recovery).
|
|
435
471
|
- **Exceptions never auto-refund.** Underpaid, overpaid, late, manually marked
|
|
436
472
|
(at the gateway), invalidated-after-settlement, and paid-twice attempts are
|
|
437
473
|
flagged for an operator (`resolvePaymentAttempt`). Per-seller
|
|
@@ -19,6 +19,7 @@ interface FakeInvoiceItem {
|
|
|
19
19
|
description: string;
|
|
20
20
|
invoice: string | null;
|
|
21
21
|
metadata: Record<string, string>;
|
|
22
|
+
tax_code?: string;
|
|
22
23
|
}
|
|
23
24
|
interface FakeInvoice {
|
|
24
25
|
id: string;
|
|
@@ -58,6 +59,15 @@ interface FakeSession {
|
|
|
58
59
|
setup_future_usage: string | null;
|
|
59
60
|
payment_method: string | null;
|
|
60
61
|
metadata: Record<string, string>;
|
|
62
|
+
tax_code: string | null;
|
|
63
|
+
}
|
|
64
|
+
/** A Stripe Tax calculation for an off-session charge (#3194). */
|
|
65
|
+
interface FakeTaxCalculation {
|
|
66
|
+
id: string;
|
|
67
|
+
customer: string;
|
|
68
|
+
amount_total: number;
|
|
69
|
+
tax_amount_exclusive: number;
|
|
70
|
+
tax_code: string | null;
|
|
61
71
|
}
|
|
62
72
|
/** How a saved payment method answers an off-session charge. */
|
|
63
73
|
export type FakeCardBehavior = 'succeed' | 'processing' | 'decline' | 'authentication_required';
|
|
@@ -79,6 +89,7 @@ export declare class FakeStripe {
|
|
|
79
89
|
readonly invoices: Map<string, FakeInvoice>;
|
|
80
90
|
readonly sessions: Map<string, FakeSession>;
|
|
81
91
|
readonly paymentIntents: Map<string, FakePaymentIntent>;
|
|
92
|
+
readonly taxCalculations: Map<string, FakeTaxCalculation>;
|
|
82
93
|
/** False while Stripe's search index lags behind writes. */
|
|
83
94
|
searchable: boolean;
|
|
84
95
|
/** Behavior of each saved payment method (default `succeed`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-stripe.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/fake-stripe.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAG1E,eAAO,MAAM,cAAc,uBAAuB,CAAC;AAEnD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CA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E,MAAM,GAAG,eAAe,EAAE;CAMlD;AAED,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAOA;AAID,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE;IACP,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,EACD,aAAa,SAAS,EACtB,IAAI,SAA+B,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBzB;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB"}
|
package/dist/billing/cards.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';
|
|
12
12
|
import type { BillingAccount } from '../models/billing.js';
|
|
13
|
+
import type { PaymentInstrument } from '../models/PaymentInstrument.js';
|
|
13
14
|
import type { BillingProviderCheckoutSession, BillingProviderCheckoutState } from './provider.js';
|
|
14
15
|
import type { BillingRuntime } from './runtime.js';
|
|
15
16
|
export declare const CARD_SETUP_PURPOSE = "card_setup";
|
|
@@ -67,8 +68,22 @@ export declare function savedCardFromCheckout(runtime: BillingRuntime, metadata:
|
|
|
67
68
|
*/
|
|
68
69
|
export declare function recordSavedCard(runtime: BillingRuntime, db: DatabaseInterface, card: SavedCard): Promise<void>;
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
-
* what `autoChargeInvoices` bills and automatic top-ups charge.
|
|
71
|
+
* The payer's default card when it is with this runtime's provider customer,
|
|
72
|
+
* else null: what `autoChargeInvoices` bills and automatic top-ups charge.
|
|
72
73
|
*/
|
|
74
|
+
export declare function defaultCardInstrument(runtime: BillingRuntime, account: BillingAccount, providerCustomerId: string): Promise<PaymentInstrument | null>;
|
|
75
|
+
/** Whether {@link defaultCardInstrument} finds a card. */
|
|
73
76
|
export declare function defaultCardFor(runtime: BillingRuntime, account: BillingAccount, providerCustomerId: string): Promise<boolean>;
|
|
77
|
+
/** Whether a payer has a card on file, and since when (#3187). */
|
|
78
|
+
export interface BillingCardOnFile {
|
|
79
|
+
/**
|
|
80
|
+
* The payer has a default card with this runtime's provider customer: the
|
|
81
|
+
* card automatically charged invoices bill and automatic top-ups charge.
|
|
82
|
+
*/
|
|
83
|
+
onFile: boolean;
|
|
84
|
+
/** When that card was first recorded. */
|
|
85
|
+
savedAt?: Date;
|
|
86
|
+
}
|
|
87
|
+
/** See {@link BillingRuntime.cardOnFile}. */
|
|
88
|
+
export declare function cardOnFile(runtime: BillingRuntime, payerTenantId: string): Promise<BillingCardOnFile>;
|
|
74
89
|
//# sourceMappingURL=cards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/billing/cards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,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,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;CACjE;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAShE;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,KAAK,EAAE,4BAA4B,EACnC,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA0C3B;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,cAAc,EACvB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,IAAI,CAAC,CAYf;AA0CD;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,EACvB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAUnC;AAED,0DAA0D;AAC1D,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,cAAc,EACvB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED,6CAA6C;AAC7C,wBAAsB,UAAU,CAC9B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAuB5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/billing/credits.ts"],"names":[],"mappings":"AAkBA,OAAO,
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src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billing/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/billing/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,KAAK,eAAe,EAMrB,MAAM,eAAe,CAAC;AASvB,MAAM,WAAW,4BAA4B;IAC3C,uEAAuE;IACvE,OAAO,EAAE,qBAAqB,CAAC;IAC/B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAKD,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,eAAe,CAsHjB;AAkED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/billing/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAqBlC,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,0BAA0B,EAE1B,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,gCAAgC,EACjC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIn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AC9D,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;CACxB,GACD;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1C;IACE,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAIN,6EAA6E;AAC7E,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,cAAc,GACtB,cAAc,CAAC,aAAa,CAAC,CAuG/B"}
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
export { type BtcPayBillingProviderOptions, createBtcPayBillingProvider, } from './btcpay.js';
|
|
7
|
-
export type { CreateCardSetupCheckoutInput } from './cards.js';
|
|
7
|
+
export type { BillingCardOnFile, CreateCardSetupCheckoutInput, } from './cards.js';
|
|
8
8
|
export type { CreateCreditCheckoutInput } from './credits.js';
|
|
9
9
|
export { type CryptoBillingProviderOptions, createCryptoBillingProvider, } from './crypto.js';
|
|
10
10
|
export { addBillingMonths, billingPeriodContaining, lastEndedBillingPeriod, prorateMinorUnits, type ScheduledBillingPeriod, } from './cycles.js';
|
|
@@ -12,9 +12,9 @@ export { type CreateInvoicePaymentInput, INVOICE_PAYMENT_PURPOSE, } from './invo
|
|
|
12
12
|
export { type EnqueueBillingJobOptions, enqueueBillingEvents, enqueueBillingPeriodClose, getBillingRuntime, registerBillingRuntime, unregisterBillingRuntime, } from './jobs.js';
|
|
13
13
|
export { type BillingPaymentPolicy, type CryptoConversionInput, type CryptoSettlement, decideAttempt, type ManualRefundInput, type ManualRefundResult, } from './payment-attempts.js';
|
|
14
14
|
export { type BillingPeriod, BillingPeriodCloseError, type ClosePeriodInput, type PeriodCloseGroupResult, type PeriodCloseOutcome, type PeriodCloseResult, previousCalendarMonth, } from './period-close.js';
|
|
15
|
-
export { type BillingChargeStatus, type BillingCollectionMethod, type BillingInvoiceEventType, type BillingPaymentAttemptException, type BillingPaymentAttemptPayment, type BillingPaymentAttemptState, type BillingPaymentAttemptStatus, type BillingProvider, type BillingProviderCapabilities, type BillingProviderChargeInput, type BillingProviderChargeResult, type BillingProviderCheckoutInput, type BillingProviderCheckoutSession, type BillingProviderCheckoutState, type BillingProviderCustomerInput, type BillingProviderEvent, type BillingProviderInvoiceInput, type BillingProviderInvoiceLine, type BillingProviderInvoiceState, type BillingProviderInvoiceStatus, type BillingProviderSetupCheckoutInput, type BillingProviderSubscriptionState, BillingProviderUnsupportedError, BillingWebhookVerificationError, providerCapabilities, } from './provider.js';
|
|
16
|
-
export { type BillingLedgerAccounts, BillingRuntime, type BillingRuntimeOptions, type EnsureProviderCustomerOptions, type PayerStandingChange, type PayerStandingHook, type SyncedBillingAccount, type UpsertBillingAccountInput, } from './runtime.js';
|
|
15
|
+
export { type BillingChargeStatus, type BillingCollectionMethod, type BillingInvoiceEventType, type BillingPaymentAttemptException, type BillingPaymentAttemptPayment, type BillingPaymentAttemptState, type BillingPaymentAttemptStatus, type BillingPaymentRefusalCode, BillingPaymentRefusedError, type BillingProvider, type BillingProviderCapabilities, type BillingProviderChargeInput, type BillingProviderChargeResult, type BillingProviderCheckoutInput, type BillingProviderCheckoutSession, type BillingProviderCheckoutState, type BillingProviderCustomerInput, type BillingProviderEvent, type BillingProviderInvoiceInput, type BillingProviderInvoiceLine, type BillingProviderInvoiceState, type BillingProviderInvoiceStatus, type BillingProviderSetupCheckoutInput, type BillingProviderSubscriptionState, BillingProviderUnsupportedError, BillingWebhookVerificationError, providerCapabilities, } from './provider.js';
|
|
16
|
+
export { type BillingLedgerAccounts, BillingRuntime, type BillingRuntimeOptions, type BillingTaxCodes, type EnsureProviderCustomerOptions, type PayerStandingChange, type PayerStandingHook, type SyncedBillingAccount, type UpsertBillingAccountInput, } from './runtime.js';
|
|
17
17
|
export { createStripeBillingProvider, type StripeBillingProviderOptions, } from './stripe.js';
|
|
18
|
-
export type { AutoTopUpFailure, AutoTopUpFailureHook, AutoTopUpHookOptions, } from './top-up.js';
|
|
18
|
+
export type { AutoTopUpFailure, AutoTopUpFailureHook, AutoTopUpHookOptions, AutoTopUpSkip, AutoTopUpSkipHook, AutoTopUpSkipReason, } from './top-up.js';
|
|
19
19
|
export { currencyMinorUnitExponent, majorToMinorUnits, minorToMajorUnits, } from './units.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,4BAA4B,EACjC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,4BAA4B,EACjC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,KAAK,4BAA4B,EACjC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,yBAAyB,EAC9B,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,wBAAwB,EAC7B,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB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B,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-payments.d.ts","sourceRoot":"","sources":["../../src/billing/invoice-payments.ts"],"names":[],"mappings":"AAkBA,OAAO,
|
|
1
|
+
{"version":3,"file":"invoice-payments.d.ts","sourceRoot":"","sources":["../../src/billing/invoice-payments.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQnD,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAgBzD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,sBAAsB,GAAG,IAAI,CAuB/B;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,E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"}
|
|
@@ -27,6 +27,11 @@ export interface BillingProviderInvoiceLine {
|
|
|
27
27
|
amount: number;
|
|
28
28
|
periodStart?: Date;
|
|
29
29
|
periodEnd?: Date;
|
|
30
|
+
/**
|
|
31
|
+
* Product tax code for provider-calculated tax (Stripe Tax `txcd_...`,
|
|
32
|
+
* #3194). Omitted: the provider account's default.
|
|
33
|
+
*/
|
|
34
|
+
taxCode?: string;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* How the provider collects an invoice. `charge_automatically` charges the
|
|
@@ -105,6 +110,11 @@ export interface BillingProviderCheckoutInput {
|
|
|
105
110
|
* tax location is collected at checkout when the customer has none.
|
|
106
111
|
*/
|
|
107
112
|
automaticTax?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Product tax code for the checkout line (Stripe Tax `txcd_...`, #3194).
|
|
115
|
+
* Omitted: the provider account's default.
|
|
116
|
+
*/
|
|
117
|
+
taxCode?: string;
|
|
108
118
|
/**
|
|
109
119
|
* Also save the payment method for later off-session charges (for example
|
|
110
120
|
* automatic top-ups). Requires `providerCustomerId`.
|
|
@@ -171,14 +181,29 @@ export interface BillingProviderChargeInput {
|
|
|
171
181
|
idempotencyKey: string;
|
|
172
182
|
description?: string;
|
|
173
183
|
metadata?: Record<string, string>;
|
|
184
|
+
/**
|
|
185
|
+
* Add provider-calculated tax on top of `amount` from the customer's tax
|
|
186
|
+
* location (#3194): `amount` is then the pre-tax subtotal. A customer whose
|
|
187
|
+
* tax location cannot be determined yields a `failed` result with
|
|
188
|
+
* `failureCode: 'customer_tax_location_invalid'`, charging nothing. A
|
|
189
|
+
* provider that cannot calculate tax must throw, never charge untaxed.
|
|
190
|
+
* Every retry of a charge key must pass the same value.
|
|
191
|
+
*/
|
|
192
|
+
automaticTax?: boolean;
|
|
193
|
+
/** Product tax code (requires `automaticTax`). */
|
|
194
|
+
taxCode?: string;
|
|
174
195
|
}
|
|
175
196
|
export interface BillingProviderChargeResult {
|
|
176
197
|
status: BillingChargeStatus;
|
|
177
198
|
/** The provider payment id, when one was created. */
|
|
178
199
|
providerPaymentId?: string;
|
|
179
|
-
/** Minor units. */
|
|
200
|
+
/** Minor units charged, including tax for an `automaticTax` charge. */
|
|
180
201
|
amount: number;
|
|
181
202
|
currency: string;
|
|
203
|
+
/** `automaticTax` charges: the pre-tax amount, minor units. */
|
|
204
|
+
subtotal?: number;
|
|
205
|
+
/** `automaticTax` charges: the provider-calculated tax, minor units. */
|
|
206
|
+
tax?: number;
|
|
182
207
|
failureCode?: string;
|
|
183
208
|
failureMessage?: string;
|
|
184
209
|
}
|
|
@@ -223,9 +248,16 @@ export type BillingProviderEvent = {
|
|
|
223
248
|
status: BillingChargeStatus;
|
|
224
249
|
providerPaymentId: string;
|
|
225
250
|
providerCustomerId?: string;
|
|
226
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Minor units charged (with tax for an `automaticTax` charge), when the
|
|
253
|
+
* provider amount converts exactly.
|
|
254
|
+
*/
|
|
227
255
|
amount?: number;
|
|
228
256
|
currency?: string;
|
|
257
|
+
/** `automaticTax` charges: the pre-tax amount, minor units (#3194). */
|
|
258
|
+
subtotal?: number;
|
|
259
|
+
/** `automaticTax` charges: the provider-calculated tax, minor units. */
|
|
260
|
+
tax?: number;
|
|
229
261
|
failureCode?: string;
|
|
230
262
|
} | {
|
|
231
263
|
/**
|
|
@@ -362,6 +394,30 @@ export declare function providerCapabilities(provider: BillingProvider): Billing
|
|
|
362
394
|
export declare class BillingProviderUnsupportedError extends Error {
|
|
363
395
|
constructor(message: string);
|
|
364
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Why a payer's payment request was refused (#3185). New codes may be added
|
|
399
|
+
* in a minor release; treat an unknown code like `not_payable`.
|
|
400
|
+
*
|
|
401
|
+
* - `not_found`: no such invoice for this payer, or no active balance policy.
|
|
402
|
+
* - `not_payable`: the invoice exists but cannot be paid now (not sent and
|
|
403
|
+
* unpaid, or not issued by this runtime's provider).
|
|
404
|
+
* - `payment_in_progress`: another payment for the invoice is still open.
|
|
405
|
+
* - `nothing_due`: the invoice has no amount left to pay.
|
|
406
|
+
* - `invalid_amount`: the requested amount is not positive minor units.
|
|
407
|
+
* - `below_minimum`: the amount is under the rail's minimum.
|
|
408
|
+
* - `no_account`: the payer has no billing account with this seller.
|
|
409
|
+
*/
|
|
410
|
+
export type BillingPaymentRefusalCode = 'not_found' | 'not_payable' | 'payment_in_progress' | 'nothing_due' | 'invalid_amount' | 'below_minimum' | 'no_account';
|
|
411
|
+
/**
|
|
412
|
+
* A payment request refused for a reason the payer can act on (#3185): show
|
|
413
|
+
* the message as a 4xx. Anything else thrown by the same call (provider,
|
|
414
|
+
* database, or configuration failures) is a server error.
|
|
415
|
+
* `TenantIsolationError` (a caller who is not the payer) stays separate.
|
|
416
|
+
*/
|
|
417
|
+
export declare class BillingPaymentRefusedError extends Error {
|
|
418
|
+
readonly code: BillingPaymentRefusalCode;
|
|
419
|
+
constructor(code: BillingPaymentRefusalCode, message: string);
|
|
420
|
+
}
|
|
365
421
|
export declare class BillingWebhookVerificationError extends Error {
|
|
366
422
|
constructor(message?: string);
|
|
367
423
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/billing/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,4BAA4B;IAC3C,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MA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AC,IAAI,CAAC,CAAC;IACpE;;;OAGG;IACH,iBAAiB,CAAC,CAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,GACxB,2BAA2B,CAI7B;AAED,iEAAiE;AACjE,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,yBAAyB,GACjC,WAAW,GACX,aAAa,GACb,qBAAqB,GACrB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,CAAC;AAEjB;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;gBAE7B,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM;CAK7D;AAED,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,SAAmD;CAIvE"}
|
|
@@ -14,7 +14,7 @@ import { PaymentInstrumentCollection } from '../collections/PaymentInstrumentCol
|
|
|
14
14
|
import { type BillingAccount, BillingAccountCollection, type BillingCloseKind, BillingLineSourceCollection, type BillingPaymentAttempt, BillingPaymentAttemptCollection, type BillingPaymentAttemptPurpose, BillingPeriodCloseCollection, type BillingStanding } from '../models/billing.js';
|
|
15
15
|
import type { Invoice } from '../models/Invoice.js';
|
|
16
16
|
import { type Address } from '../types/index.js';
|
|
17
|
-
import { type CreateCardSetupCheckoutInput } from './cards.js';
|
|
17
|
+
import { type BillingCardOnFile, type CreateCardSetupCheckoutInput } from './cards.js';
|
|
18
18
|
import { type CreateCreditCheckoutInput } from './credits.js';
|
|
19
19
|
import { type ScheduledBillingPeriod } from './cycles.js';
|
|
20
20
|
import { type CreateInvoicePaymentInput } from './invoice-payments.js';
|
|
@@ -98,6 +98,13 @@ export interface BillingRuntimeOptions extends SmrtClassOptions {
|
|
|
98
98
|
* standing), not on send: collection happens on the provider's schedule.
|
|
99
99
|
*/
|
|
100
100
|
autoChargeInvoices?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Product tax codes for provider-calculated tax (Stripe Tax `txcd_...`,
|
|
103
|
+
* #3194): `credit` classifies prepaid credit (checkout purchases and
|
|
104
|
+
* automatic top-ups), `invoice` the lines of billing-period invoices.
|
|
105
|
+
* Omitted: the provider account's default product tax code.
|
|
106
|
+
*/
|
|
107
|
+
taxCodes?: BillingTaxCodes;
|
|
101
108
|
/**
|
|
102
109
|
* Called when an automatic top-up charge ends without collecting (a
|
|
103
110
|
* decline, or the issuer requiring the payer to authenticate), from the
|
|
@@ -105,6 +112,11 @@ export interface BillingRuntimeOptions extends SmrtClassOptions {
|
|
|
105
112
|
*/
|
|
106
113
|
onAutoTopUpFailed?: AutoTopUpFailureHook;
|
|
107
114
|
}
|
|
115
|
+
/** Product tax codes (#3194). */
|
|
116
|
+
export interface BillingTaxCodes {
|
|
117
|
+
credit?: string;
|
|
118
|
+
invoice?: string;
|
|
119
|
+
}
|
|
108
120
|
export interface UpsertBillingAccountInput {
|
|
109
121
|
payerTenantId: string;
|
|
110
122
|
name: string;
|
|
@@ -180,6 +192,7 @@ export declare class BillingRuntime {
|
|
|
180
192
|
readonly leaseMs: number;
|
|
181
193
|
readonly pageSize: number;
|
|
182
194
|
readonly autoChargeInvoices: boolean;
|
|
195
|
+
readonly taxCodes: Readonly<BillingTaxCodes>;
|
|
183
196
|
readonly onAutoTopUpFailed?: AutoTopUpFailureHook;
|
|
184
197
|
/** The inbox provider namespace for the issuing provider's events. */
|
|
185
198
|
readonly eventProvider: string;
|
|
@@ -277,6 +290,13 @@ export declare class BillingRuntime {
|
|
|
277
290
|
* context. Throws when the provider cannot save payment methods.
|
|
278
291
|
*/
|
|
279
292
|
createCardSetupCheckout(input: CreateCardSetupCheckoutInput): Promise<BillingProviderCheckoutSession>;
|
|
293
|
+
/**
|
|
294
|
+
* Whether the payer has a card on file (#3187): the default card that
|
|
295
|
+
* `autoChargeInvoices` bills and automatic top-ups charge, decided by the
|
|
296
|
+
* same check they use. Read-only; callable by the payer or in a system
|
|
297
|
+
* context.
|
|
298
|
+
*/
|
|
299
|
+
cardOnFile(payerTenantId: string): Promise<BillingCardOnFile>;
|
|
280
300
|
/**
|
|
281
301
|
* The `autoTopUp` hook for smrt-subscriptions' `SpendingPolicyEvaluator`:
|
|
282
302
|
* charges the payer's saved card off-session and credits the balance once
|
|
@@ -317,19 +337,34 @@ export declare class BillingRuntime {
|
|
|
317
337
|
paymentAttemptId(provider: string, checkoutId: string): Promise<string>;
|
|
318
338
|
/**
|
|
319
339
|
* This seller's rail payment attempts, newest first — for "payment
|
|
320
|
-
* confirming" displays and operator queues.
|
|
340
|
+
* confirming" displays and operator queues. Every filter is applied in the
|
|
341
|
+
* query, before `limit` (default 100) and `offset`, so paging through
|
|
342
|
+
* `{ unresolved: true }` lists every open exception however old (#3186).
|
|
321
343
|
*/
|
|
322
344
|
listPaymentAttempts(filter?: {
|
|
323
345
|
payerTenantId?: string;
|
|
324
346
|
invoiceId?: string;
|
|
325
347
|
status?: string;
|
|
348
|
+
/** Only attempts with (`true`) or without (`false`) a flag. */
|
|
326
349
|
flagged?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Only open exceptions: flagged attempts no operator has resolved yet.
|
|
352
|
+
* Combine with `flagged: true` or leave `flagged` unset.
|
|
353
|
+
*/
|
|
354
|
+
unresolved?: true;
|
|
327
355
|
limit?: number;
|
|
356
|
+
/** Rows to skip, for paging (default 0). */
|
|
357
|
+
offset?: number;
|
|
328
358
|
}): Promise<BillingPaymentAttempt[]>;
|
|
329
359
|
/**
|
|
330
360
|
* Queue a re-read of open and confirming attempts (the polling fallback
|
|
331
361
|
* for missed webhooks). Returns how many were queued; apply them with
|
|
332
362
|
* `processEvents()`.
|
|
363
|
+
*
|
|
364
|
+
* Confirming attempts (money seen) go first, then open ones, each oldest
|
|
365
|
+
* first, so a burst of newer or abandoned checkouts cannot starve a paid
|
|
366
|
+
* attempt whose settlement webhook was missed (#3183). Rows leave the set
|
|
367
|
+
* once the gateway reports a terminal state.
|
|
333
368
|
*/
|
|
334
369
|
refreshPaymentAttempts(limit?: number): Promise<number>;
|
|
335
370
|
/** Queue a re-read of one rail checkout; false if one is already queued. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/billing/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,aAAa,EAClB,2BAA2B,EAC3B,KAAK,yBAAyB,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EACL,KAAK,cAAc,EACnB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,+BAA+B,EAC/B,KAAK,4BAA4B,EACjC,4BAA4B,EAC5B,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,mBAAmB,CAAC;AAChE,OAAO,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