Skip to content
LogoLogo

Credential.fromRequest

Extract a Credential from a Request

Extracts the Credential from a Request's configured payment field.

Usage

import {  } from 'mppx'
 
export async function (: Request) {
  const  = .(, {
    : 'Payment-Authorization',
  })
  // ...
}

Return type

type ReturnType = Credential<payload>

The deserialized Credential object.

Parameters

options (optional)

  • Type: { header?: string }
  • Default: { header: 'Authorization' }

Configures the HTTP field containing the Payment Credential.

request

  • Type: Request

The HTTP request.