Transport.http
HTTP server-side transport
HTTP transport for server-side payment handling.
Usage
import { , , } from 'mppx/server'
const = .({
: [.()],
: .({
: true,
}),
})Behavior
- Reads Credentials from
Authorizationby default - Reads Credentials from
Payment-AuthorizationwhenrequiresAuthistrue - Issues Challenges in the
WWW-Authenticateheader with402status - Attaches Receipts in the
Payment-Receiptheader
Return type
type ReturnType = Transport<Request, Response>Parameters
requiresAuth (optional)
- Type:
boolean - Default:
false
Reads Payment Credentials from Payment-Authorization. Prefer setting the same option on Mppx.create, which also advertises the field in generated Challenges.