MPP.Methods.USDC.Replay (mpp v0.19.0)

Copy Markdown View Source

Atomic single-use keys for USDC credentials and merchant orders.

A failed settlement releases the keys this attempt claimed. A successful settlement keeps them, so a second presentation cannot receive another receipt.

Summary

Functions

Merchant-order key when the charge carries externalId.

Claim every {key, failure_detail} pair, run fun, and release the claims when fun returns an error.

Functions

order_key(charge)

@spec order_key(MPP.Intents.Charge.t()) :: {:ok, String.t()} | :none

Merchant-order key when the charge carries externalId.

with_claims(store, keys, fun)

@spec with_claims(term(), [{String.t(), String.t()}], (-> result)) :: result
when result: {:ok, term()} | {:error, MPP.Errors.t()}

Claim every {key, failure_detail} pair, run fun, and release the claims when fun returns an error.

store is a MPP.Tempo.Store reference. nil skips persistence.