Skip to content

basalt / subscriptions/src / MemoryPaymentStore

Class: MemoryPaymentStore ​

Defined in: subscriptions/src/payment.ts:145

In-memory PaymentStore — per-process; swap for a durable one in production.

Implements ​

Constructors ​

Constructor ​

> new MemoryPaymentStore(): MemoryPaymentStore

Returns ​

MemoryPaymentStore

Methods ​

create() ​

> create(payment): Promise<void>

Defined in: subscriptions/src/payment.ts:148

Insert a pending payment. Idempotent: a no-op if the id already exists.

Parameters ​

payment ​

NewPayment

Returns ​

Promise<void>

Implementation of ​

PaymentStore.create


get() ​

> get(id): Promise<PaymentRecord | undefined>

Defined in: subscriptions/src/payment.ts:183

Parameters ​

id ​

string

Returns ​

Promise<PaymentRecord | undefined>

Implementation of ​

PaymentStore.get


setStatus() ​

> setStatus(id, status, patch?): Promise<void>

Defined in: subscriptions/src/payment.ts:163

Apply a terminal status; upserts if the payment wasn't recorded first.

Parameters ​

id ​

string

status ​

PaymentRecordStatus

patch? ​
amount? ​

number

raw? ​

unknown

Returns ​

Promise<void>

Implementation of ​

PaymentStore.setStatus

Released under the MIT License.