Liking cljdoc? Tell your friends :D

monero-store.collect.store

Persistence as a port, plus the in-memory adapter the template runs on.

Two operations carry the invariants; everything else is storage.

record-payment! is idempotent per (invoice, reference): a rail that reports the same transaction forever must move the books exactly once.

claim-paid! is a compare-and-set on the invoice's status. Only the caller that performs the pending -> paid transition is told it did, and that caller is the one — the only one — that may hand anything over.

Persistence as a port, plus the in-memory adapter the template runs on.

Two operations carry the invariants; everything else is storage.

`record-payment!` is idempotent per (invoice, reference): a rail that reports
the same transaction forever must move the books exactly once.

`claim-paid!` is a compare-and-set on the invoice's status. Only the caller
that performs the pending -> paid transition is told it did, and that caller
is the one — the only one — that may hand anything over.
raw docstring

IOrderStorecljprotocol

unapplied-paymentsclj

(unapplied-payments this limit)

Money that was seen but could not be applied, newest first.

Money that was seen but could not be applied, newest first.

open-invoicesclj

(open-invoices this)

Every invoice that can still take money.

Every invoice that can still take money.

payments-forclj

(payments-for this invoice-id)

Payments recorded against invoice-id.

Payments recorded against `invoice-id`.

customer-by-refclj

(customer-by-ref this customer-ref)

Customer the host application knows by customer-ref, or nil.

Customer the host application knows by `customer-ref`, or nil.

invoice-by-idclj

(invoice-by-id this invoice-id)

Invoice, or nil.

Invoice, or nil.

record-payment!clj

(record-payment! this payment)

Record one observed movement of money. Returns the stored Payment, or nil when this exact (invoice, reference) was already recorded.

Record one observed movement of money. Returns the stored Payment, or nil
when this exact (invoice, reference) was already recorded.

release-claim!clj

(release-claim! this invoice-id)

Undo a claim whose fulfilment failed, so a later sweep retries it.

Undo a claim whose fulfilment failed, so a later sweep retries it.

customer-by-idclj

(customer-by-id this customer-id)

Customer, or nil.

Customer, or nil.

set-invoice-status!clj

(set-invoice-status! this invoice-id status)

Move the invoice to status unconditionally. Returns the invoice.

Move the invoice to `status` unconditionally. Returns the invoice.

invoices-for-customerclj

(invoices-for-customer this customer-id)

Every invoice of customer-id, newest first.

Every invoice of `customer-id`, newest first.

record-fulfilment!clj

(record-fulfilment! this fulfilment)

Record that the host application was told to hand something over.

Record that the host application was told to hand something over.

live-invoice-forclj

(live-invoice-for this criteria)

The newest still-open invoice matching {:customer-id :item-id :provider}, or nil.

The newest still-open invoice matching {:customer-id :item-id :provider},
or nil.

upsert-customer!clj

(upsert-customer! this identity)

Customer for identity {:customer/ref :customer/email}, created if new.

Customer for `identity` {:customer/ref :customer/email}, created if new.

attach-external-ref!clj

(attach-external-ref! this invoice-id external-ref)

Record the rail's own identifier on the invoice. Returns the invoice.

Record the rail's own identifier on the invoice. Returns the invoice.

fulfilments-forclj

(fulfilments-for this customer-id)

Everything customer-id has been granted.

Everything `customer-id` has been granted.

insert-invoice!clj

(insert-invoice! this invoice)

Store invoice verbatim. Returns it.

Store `invoice` verbatim. Returns it.

claim-paid!clj

(claim-paid! this invoice-id)

Transition invoice-id from pending/underpaid to paid, once.

Returns the invoice when THIS call performed the transition, nil when it was already paid or does not exist. The gate that makes a redelivered settlement notice harmless.

Transition `invoice-id` from pending/underpaid to paid, once.

Returns the invoice when THIS call performed the transition, nil when it
was already paid or does not exist. The gate that makes a redelivered
settlement notice harmless.
source

memory-storeclj

(memory-store)
(memory-store {:keys [now-fn] :or {now-fn (fn* [] (Date.))}})

IOrderStore over an atom. The template's default, and what the tests run on.

Every write is a swap!, so the compare-and-set claim-paid! depends on is the atom's own, not a lock this namespace has to keep.

IOrderStore over an atom. The template's default, and what the tests run on.

Every write is a `swap!`, so the compare-and-set `claim-paid!` depends on is
the atom's own, not a lock this namespace has to keep.
sourceraw docstring

open-statusesclj

Invoice statuses that can still take money and settle normally.

Invoice statuses that can still take money and settle normally.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close