Abstract Class: BillingStore
Defined in: javascript/src/billing/billing-store.ts:43
Abstract billing store — provider-agnostic persistence layer for subscription lifecycle state.
Mirrors Python bursar/billing/store.py.
Extended by
Constructors
Constructor
new BillingStore():
BillingStore
Returns
BillingStore
Properties
providerEnvironment?
readonlyoptionalproviderEnvironment?:"live"|"test"|"sandbox"
Defined in: javascript/src/billing/billing-store.ts:45
Exposed by environment-partitioned stores so composition can reject drift.
Methods
claimAutoRechargeAttempt()
abstractclaimAutoRechargeAttempt(input):Promise<BillingAutoRechargeAttempt|null>
Defined in: javascript/src/billing/billing-store.ts:202
Parameters
input
AutoRechargeAttemptClaim
Returns
Promise<BillingAutoRechargeAttempt | null>
claimBillingEvent()
abstractclaimBillingEvent(provider,eventId,eventType,envelope?):Promise<BillingEventClaim>
Defined in: javascript/src/billing/billing-store.ts:59
Parameters
provider
string
eventId
string
eventType
string
envelope?
JsonObject
Returns
Promise<BillingEventClaim>
completeBillingEvent()
abstractcompleteBillingEvent(provider,eventId,claimToken):Promise<boolean>
Defined in: javascript/src/billing/billing-store.ts:66
Parameters
provider
string
eventId
string
claimToken
string
Returns
Promise<boolean>
computeTopupCredits()
abstractcomputeTopupCredits(amountMinor,topupConfig):Promise<Decimal>
Defined in: javascript/src/billing/billing-store.ts:154
Parameters
amountMinor
number
topupConfig
BillingTopupResult
Returns
Promise<Decimal>
countAutoRechargeAttempts()
abstractcountAutoRechargeAttempts(userId,since):Promise<number>
Defined in: javascript/src/billing/billing-store.ts:209
Parameters
userId
string
since
string | Date
Returns
Promise<number>
createBillingCreditGrant()
abstractcreateBillingCreditGrant(input):Promise<string>
Defined in: javascript/src/billing/billing-store.ts:160
Parameters
input
BillingCreditGrantCreate
Returns
Promise<string>
createBillingSubscriptionChange()
abstractcreateBillingSubscriptionChange(input):Promise<BillingSubscriptionChange>
Defined in: javascript/src/billing/billing-store.ts:95
Parameters
input
BillingSubscriptionChangeInput
Returns
Promise<BillingSubscriptionChange>
createOrGetCheckoutIntent()
abstractcreateOrGetCheckoutIntent(input):Promise<CheckoutIntent>
Defined in: javascript/src/billing/billing-store.ts:47
Parameters
input
CheckoutIntentCreate
Returns
Promise<CheckoutIntent>
expireSubscriptionGracePeriod()
abstractexpireSubscriptionGracePeriod(subjectId,subscriptionId,expectedGraceEndsAt,expiredAt,terminalPlanKey):Promise<boolean>
Defined in: javascript/src/billing/billing-store.ts:121
Parameters
subjectId
string
subscriptionId
string
expectedGraceEndsAt
string
expiredAt
string
terminalPlanKey
string | null
Returns
Promise<boolean>
failBillingEvent()
abstractfailBillingEvent(provider,eventId,claimToken,error?):Promise<boolean>
Defined in: javascript/src/billing/billing-store.ts:72
Parameters
provider
string
eventId
string
claimToken
string
error?
string
Returns
Promise<boolean>
getActiveCatalogDocument()
abstractgetActiveCatalogDocument():Promise<JsonObject|null>
Defined in: javascript/src/billing/billing-store.ts:186
Returns
Promise<JsonObject | null>
getAutoRechargeProfile()
abstractgetAutoRechargeProfile(userId):Promise<BillingAutoRechargeProfile|null>
Defined in: javascript/src/billing/billing-store.ts:197
Parameters
userId
string
Returns
Promise<BillingAutoRechargeProfile | null>
getBillingCreditGrantByPayment()
abstractgetBillingCreditGrantByPayment(paymentId):Promise<string|null>
Defined in: javascript/src/billing/billing-store.ts:165
Parameters
paymentId
string
Returns
Promise<string | null>
getBillingCustomer()
abstractgetBillingCustomer(provider,providerCustomerId):Promise<string|null>
Defined in: javascript/src/billing/billing-store.ts:88
Parameters
provider
string
providerCustomerId
string
Returns
Promise<string | null>
getBillingCustomerByUserId()
abstractgetBillingCustomerByUserId(userId,provider?):Promise<BillingCustomerRecord|null>
Defined in: javascript/src/billing/billing-store.ts:211
Parameters
userId
string
provider?
string | null
Returns
Promise<BillingCustomerRecord | null>
getBillingPayment()
abstractgetBillingPayment(provider,providerPaymentId):Promise<BillingPaymentRecord|null>
Defined in: javascript/src/billing/billing-store.ts:181
Parameters
provider
string
providerPaymentId
string
Returns
Promise<BillingPaymentRecord | null>
getBillingPreferences()
abstractgetBillingPreferences(userId):Promise<BillingPreferences|null>
Defined in: javascript/src/billing/billing-store.ts:194
Parameters
userId
string
Returns
Promise<BillingPreferences | null>
getBillingSubscription()
abstractgetBillingSubscription(provider,providerSubscriptionId):Promise<BillingSubscriptionState|null>
Defined in: javascript/src/billing/billing-store.ts:90
Parameters
provider
string
providerSubscriptionId
string
Returns
Promise<BillingSubscriptionState | null>
getCheckoutIntent()
abstractgetCheckoutIntent(id,subjectId):Promise<CheckoutIntent|null>
Defined in: javascript/src/billing/billing-store.ts:51
Parameters
id
string
subjectId
string
Returns
Promise<CheckoutIntent | null>
getOpenBillingSubscriptionChange()
abstractgetOpenBillingSubscriptionChange(provider,providerSubscriptionId):Promise<BillingSubscriptionChange|null>
Defined in: javascript/src/billing/billing-store.ts:99
Parameters
provider
string
providerSubscriptionId
string
Returns
Promise<BillingSubscriptionChange | null>
getUserSubscription()
abstractgetUserSubscription(userId,statuses?):Promise<BillingSubscriptionState|null>
Defined in: javascript/src/billing/billing-store.ts:134
Parameters
userId
string
statuses?
string[]
Returns
Promise<BillingSubscriptionState | null>
getUserSubscriptions()
abstractgetUserSubscriptions(userId):Promise<BillingSubscriptionState[]>
Defined in: javascript/src/billing/billing-store.ts:190
Parameters
userId
string
Returns
Promise<BillingSubscriptionState[]>
grantBillingCredit()
abstractgrantBillingCredit(grantId,idempotencyKey):Promise<BillingCreditPostingResult>
Defined in: javascript/src/billing/billing-store.ts:161
Parameters
grantId
string
idempotencyKey
string
Returns
Promise<BillingCreditPostingResult>
listBillingInvoices()
abstractlistBillingInvoices(userId):Promise<BillingInvoiceRecord[]>
Defined in: javascript/src/billing/billing-store.ts:173
Parameters
userId
string
Returns
Promise<BillingInvoiceRecord[]>
listExpiredGraceSubscriptions()
abstractlistExpiredGraceSubscriptions(now,limit?):Promise<BillingSubscriptionState[]>
Defined in: javascript/src/billing/billing-store.ts:104
Parameters
now
string
limit?
number
Returns
Promise<BillingSubscriptionState[]>
postBillingRefund()
abstractpostBillingRefund(refundId,grantId,amountMinor,idempotencyKey):Promise<BillingCreditPostingResult>
Defined in: javascript/src/billing/billing-store.ts:166
Parameters
refundId
string
grantId
string
amountMinor
number
idempotencyKey
string
Returns
Promise<BillingCreditPostingResult>
pseudonymizeFinancialSubject()
abstractpseudonymizeFinancialSubject(userId):Promise<boolean>
Defined in: javascript/src/billing/billing-store.ts:188
Parameters
userId
string
Returns
Promise<boolean>
reconcileSubscriptionEntitlement()
abstractreconcileSubscriptionEntitlement(subjectId,subscriptionId,billingEventId,expectedStatus,expectedProviderUpdatedAt,planAssignedAt,applyEntitlement,terminalPlanKey,reason):Promise<SubscriptionEntitlementOutcome>
Defined in: javascript/src/billing/billing-store.ts:109
Parameters
subjectId
string
subscriptionId
string
billingEventId
string
expectedStatus
expectedProviderUpdatedAt
string
planAssignedAt
string | Date | null
applyEntitlement
boolean
terminalPlanKey
string | null
reason
string
Returns
Promise<SubscriptionEntitlementOutcome>
recordSubscriptionConflict()
abstractrecordSubscriptionConflict(input):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:192
Parameters
input
BillingSubscriptionConflictCreate
Returns
Promise<void>
resolveBillingOffer()
abstractresolveBillingOffer(provider,productId?,priceId?):Promise<BillingOfferResult|null>
Defined in: javascript/src/billing/billing-store.ts:53
Parameters
provider
string
productId?
string | null
priceId?
string | null
Returns
Promise<BillingOfferResult | null>
resolveBillingOfferByLookup()
abstractresolveBillingOfferByLookup(provider,lookupKey):Promise<BillingOfferResult|null>
Defined in: javascript/src/billing/billing-store.ts:149
Parameters
provider
string
lookupKey
string
Returns
Promise<BillingOfferResult | null>
resolveCreditTopup()
abstractresolveCreditTopup(provider,productId?,priceId?):Promise<BillingTopupResult|null>
Defined in: javascript/src/billing/billing-store.ts:139
Parameters
provider
string
productId?
string | null
priceId?
string | null
Returns
Promise<BillingTopupResult | null>
resolveCreditTopupByLookup()
abstractresolveCreditTopupByLookup(provider,lookupKey):Promise<BillingTopupResult|null>
Defined in: javascript/src/billing/billing-store.ts:144
Parameters
provider
string
lookupKey
string
Returns
Promise<BillingTopupResult | null>
updateAutoRechargeAttempt()
abstractupdateAutoRechargeAttempt(input):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:205
Parameters
input
AutoRechargeAttemptUpdate
Returns
Promise<void>
updateAutoRechargeAttemptByProviderPayment()
abstractupdateAutoRechargeAttemptByProviderPayment(input):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:206
Parameters
input
AutoRechargeProviderPaymentUpdate
Returns
Promise<void>
updateBillingSubscriptionChange()
abstractupdateBillingSubscriptionChange(id,update):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:129
Parameters
id
string
update
BillingSubscriptionChangeUpdate
Returns
Promise<void>
updateCheckoutIntent()
abstractupdateCheckoutIntent(id,update):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:49
Parameters
id
string
update
CheckoutIntentUpdate
Returns
Promise<void>
upsertAutoRechargeProfile()
abstractupsertAutoRechargeProfile(profile,options?):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:198
Parameters
profile
options?
resetCooldown?
boolean
Returns
Promise<void>
upsertBillingCustomer()
abstractupsertBillingCustomer(provider,providerCustomerId,userId,email?):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:79
Parameters
provider
string
providerCustomerId
string
userId
string
email?
string | null
Returns
Promise<void>
upsertBillingDispute()
abstractupsertBillingDispute(options):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:179
Parameters
options
BillingDisputeUpsert
Returns
Promise<void>
upsertBillingInvoice()
abstractupsertBillingInvoice(options):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:177
Parameters
options
BillingInvoiceUpsert
Returns
Promise<void>
upsertBillingPayment()
abstractupsertBillingPayment(options):Promise<string>
Defined in: javascript/src/billing/billing-store.ts:159
Parameters
options
BillingPaymentUpsert
Returns
Promise<string>
upsertBillingPreferences()
abstractupsertBillingPreferences(prefs):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:196
Parameters
prefs
Returns
Promise<void>
upsertBillingRefund()
abstractupsertBillingRefund(options):Promise<string>
Defined in: javascript/src/billing/billing-store.ts:175
Parameters
options
BillingRefundUpsert
Returns
Promise<string>
upsertBillingSubscription()
abstractupsertBillingSubscription(state):Promise<void>
Defined in: javascript/src/billing/billing-store.ts:86
Parameters
state
Returns
Promise<void>