Liking cljdoc? Tell your friends :D

monero-store.payments.provider

Payment rails as data plus a protocol for their effects. The DIP seam.

A ProviderProfile carries the measured behaviour of a rail — its currency, how many confirmations it needs, how much underpayment it tolerates, whether it can be polled, how its notices can be authenticated. settle reads that profile and never branches on which rail it is, so a new rail is a new entry in a registry and no edit anywhere below.

The registry is a VALUE, built at boot and carried in deps. Nothing here is global: two stores in one process, or a test and the system it tests, hold their own.

Payment rails as data plus a protocol for their effects. The DIP seam.

A ProviderProfile carries the measured behaviour of a rail — its currency,
how many confirmations it needs, how much underpayment it tolerates, whether
it can be polled, how its notices can be authenticated. `settle` reads that
profile and never branches on which rail it is, so a new rail is a new entry
in a registry and no edit anywhere below.

The registry is a VALUE, built at boot and carried in deps. Nothing here is
global: two stores in one process, or a test and the system it tests, hold
their own.
raw docstring

claimed-invoice-idclj

(claimed-invoice-id rails provider-id notice)

The invoice id notice claims, as the rail named by provider-id reads it.

Reading a claim out of a body is not authentication and grants nothing: the invoice this yields is what then selects the rail that must verify the notice.

The invoice id `notice` claims, as the rail named by `provider-id` reads it.

Reading a claim out of a body is not authentication and grants nothing: the
invoice this yields is what then selects the rail that must verify the
notice.
sourceraw docstring

currenciesclj

(currencies rails)

Every currency some registered rail settles in.

Every currency some registered rail settles in.
sourceraw docstring

currency-ofclj

(currency-of rails provider-id)

The currency provider-id settles in, or nil.

The currency `provider-id` settles in, or nil.
sourceraw docstring

idsclj

(ids rails)

Ids of every registered rail.

Ids of every registered rail.
sourceraw docstring

IPaymentRailcljprotocol

charge!clj

(charge! this request)

Open a payment for a ChargeRequest. Returns a ChargeHandle.

Open a payment for a ChargeRequest. Returns a ChargeHandle.

interpretclj

(interpret this payload invoice)

Normalize a rail's own report into a Settlement for invoice.

Trusts payload outright. Not an authentication boundary.

Normalize a rail's own report into a Settlement for `invoice`.

Trusts `payload` outright. Not an authentication boundary.

notice-subjectclj

(notice-subject this notice)

The id of the invoice notice claims to be about, or nil.

A CLAIM, not proof: a processor that posts every event of an account to one endpoint cannot put the invoice in the path, so the notice has to name it. The invoice it names then selects the rail that must authenticate the notice. Nil for a rail whose notices name no invoice.

The id of the invoice `notice` claims to be about, or nil.

A CLAIM, not proof: a processor that posts every event of an account to one
endpoint cannot put the invoice in the path, so the notice has to name it.
The invoice it names then selects the rail that must authenticate the
notice. Nil for a rail whose notices name no invoice.

pollclj

(poll this invoice)

Settlement for invoice as this rail's own system reports it now.

Nothing prompts this read, so nothing about it can be forged. Nil when the rail cannot be asked, or has nothing to report.

Settlement for `invoice` as this rail's own system reports it now.

Nothing prompts this read, so nothing about it can be forged. Nil when the
rail cannot be asked, or has nothing to report.

resumeclj

(resume this invoice)

The ChargeHandle an already-open invoice still implies.

Nil when this rail cannot resume one — a hosted checkout that is no longer open cannot be handed back, and minting a new one would leave two live ways to pay a single invoice.

The ChargeHandle an already-open `invoice` still implies.

Nil when this rail cannot resume one — a hosted checkout that is no longer
open cannot be handed back, and minting a new one would leave two live ways
to pay a single invoice.

verify-noticeclj

(verify-notice this notice invoice)

Authenticate a settlement notice against invoice.

Returns a Settlement, or nil when the notice is not authentic for this invoice.

Authenticate a settlement notice against `invoice`.

Returns a Settlement, or nil when the notice is not authentic for this
invoice.
source

pollable?clj

(pollable? rails provider-id)

True when provider-id's profile admits being asked what it has seen.

True when `provider-id`'s profile admits being asked what it has seen.
sourceraw docstring

polled-settlementclj

(polled-settlement rails invoice)

Settlement for invoice as its own rail reports it now, or nil.

A rail whose profile does not admit polling is never asked.

Settlement for `invoice` as its own rail reports it now, or nil.

A rail whose profile does not admit polling is never asked.
sourceraw docstring

profileclj

(profile rails provider-id)

Registered ProviderProfile for provider-id, or nil.

Registered ProviderProfile for `provider-id`, or nil.
sourceraw docstring

railclj

(rail rails provider-id)

Registered IPaymentRail for provider-id, or nil.

Registered IPaymentRail for `provider-id`, or nil.
sourceraw docstring

registryclj

(registry entries)

A rail registry from entries, each {:profile .. :rail ..}.

The profile is validated here: a rail whose declared behaviour is malformed must fail at boot, where an operator is watching, and not at the first customer.

A rail registry from `entries`, each {:profile .. :rail ..}.

The profile is validated here: a rail whose declared behaviour is malformed
must fail at boot, where an operator is watching, and not at the first
customer.
sourceraw docstring

resumed-handleclj

(resumed-handle rails invoice)

The handle invoice's own rail still implies for it, or nil.

The handle `invoice`'s own rail still implies for it, or nil.
sourceraw docstring

settleclj

(settle rails
        {:settlement/keys [status paid-amount expected-amount confirmations
                           suspect?]
         :as settlement})

Decide what a Settlement means under its provider's profile.

Pure, and open for extension: every threshold comes from the profile, so a new rail needs no change here. The order of the clauses is the policy.

Decide what a Settlement means under its provider's profile.

Pure, and open for extension: every threshold comes from the profile, so a
new rail needs no change here. The order of the clauses is the policy.
sourceraw docstring

settlement-forclj

(settlement-for rails invoice notice)

Settlement authenticated for invoice out of notice, or nil.

Nil unless the invoice's own provider is registered, its profile admits webhook settlement, and its rail authenticates the notice.

Settlement authenticated for `invoice` out of `notice`, or nil.

Nil unless the invoice's own provider is registered, its profile admits
webhook settlement, and its rail authenticates the notice.
sourceraw docstring

webhook-railsclj

(webhook-rails rails)

Ids of registered rails that accept settlement notices over HTTP.

Ids of registered rails that accept settlement notices over HTTP.
sourceraw docstring

webhook-settleable?clj

(webhook-settleable? rails provider-id)

True when provider-id's profile admits settlement notices over HTTP.

True when `provider-id`'s profile admits settlement notices over HTTP.
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