Download the PHP package michaelhairetis/mpp without Composer
On this page you can find all versions of the php package michaelhairetis/mpp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michaelhairetis/mpp
More information about michaelhairetis/mpp
Files in michaelhairetis/mpp
Package mpp
Short Description PHP SDK for the Machine Payments Protocol (MPP)
License Apache-2.0 MIT
Homepage https://mpp.dev
Informations about the package mpp
mpp-php
PHP SDK for the Machine Payments Protocol. Pay for HTTP resources per request, with no account or API key set up in advance.
MPP is an HTTP authentication scheme (draft-ryan-httpauth-payment),
so this library is built like one: no framework dependency, PSR-7/15/18 throughout.
Install
Requires PHP 8.2+.
Selling
PaymentGate issues challenges and checks credentials. It does not settle. Confirming a payment landed
needs chain access, so that sits behind Verifier, which you implement.
Or drop PaymentMiddleware into a PSR-15 stack and return the price per request:
The verified Credential and Receipt land on the request as mpp.credential and mpp.receipt.
Buying
PaymentClient wraps any PSR-18 client and answers 402s. Signing lives in your Payer.
It re-pays if the server re-challenges (up to maxPayments), skips expired challenges, and picks
between competing offers using the payer's own preference order rather than the server's.
Challenge binding
Challenge ids are an HMAC over the parameters they commit to, so a server can verify an echoed
challenge without storing it. The construction follows the spec's recommended layout and reproduces
its published test vectors.
description is deliberately outside the binding. It is display only.
What's here
| Core | challenge, credential, receipt, RFC 9110 auth-params, RFC 8785 JCS, RFC 9530 digests |
| Methods | tempo / charge |
| Transport | PSR-15 middleware, PSR-18 client decorator |
Sessions, subscriptions, other methods, and the MCP transport are not implemented yet.
Development
Everything runs in a container; nothing is installed on the host.
License
Apache-2.0 or MIT, at your option.
All versions of mpp with dependencies
ext-json Version *
ext-mbstring Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/http-server-middleware Version ^1.0