Skip to content
LogoLogo

Transport.http

HTTP server-side transport

HTTP transport for server-side payment handling.

Usage

import { , ,  } from 'mppx/server'
 
const  = .({
  : [.()],
  : .({
    : true,
  }),
})

Behavior

  • Reads Credentials from Authorization by default
  • Reads Credentials from Payment-Authorization when requiresAuth is true
  • Issues Challenges in the WWW-Authenticate header with 402 status
  • Attaches Receipts in the Payment-Receipt header

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.