API Reference mpp v#0.6.1

Copy Markdown View Source

Modules

MPP

Elixir implementation of the Machine Payments Protocol (MPP).

Amount and decimal helpers for converting human-readable amounts to base units.

SHA-256 body digest computation and verification.

Payment challenge — the 402 response that tells a client what to pay.

Wraps multiple payment providers and dispatches to the first match.

Behaviour for client-side payment providers.

Behaviour for client-side transports that bridge a protocol response/request pair and the MPP payment flow.

HTTP implementation of MPP.Client.Transport over Req.

Payment credential — the client's response to a 402 challenge.

Demo payment method — accepts a magic token for local testing.

Demo router for mix mpp.demo — serves a protected endpoint behind MPP.

RFC 9457 Problem Details for MPP payment errors.

Parse and format the three MPP protocol headers.

Charge intent request schema — the "Intent = Schema" half of MPP.

RFC 8785 JSON Canonicalization Scheme (JCS) — MPP subset.

MCP (Model Context Protocol) payment transport helpers.

Behaviour for pluggable payment method verification.

Generic EVM payment method — verifies on-chain ERC-20 or native ETH transfers.

Stripe payment method — verifies payment via Stripe PaymentIntent with SPT.

Tempo payment method — verifies payment via on-chain TIP-20 token transfer.

Sponsor (fee-payer) gas-economics policy for Tempo transactions.

Session-intent receipt for Tempo — returned in the Payment-Receipt header for session/pay-as-you-go payments.

Plug middleware implementing the MPP 402 payment handshake.

Validated configuration for MPP.Plug.

Per-method configuration within a multi-method endpoint.

Payment receipt — proof-of-payment returned in the Payment-Receipt header.

Built-in ETS-based dedup store using ConCache (TTL-enabled ETS wrapper by Saša Jurić).

Behaviour for transaction dedup stores used by MPP.Methods.Tempo.

Transport-neutral payment credential verification.

Mix Tasks

Starts a local HTTP server demonstrating the full MPP 402 payment flow.

Generates a static api_manifest.json from the library's descripex annotations.