Skip to content
LogoLogo

mppx.verifyCredential

Legacy Credential verification

Verifies and completes a serialized or parsed Credential on an Mppx.create instance.

Usage

Use broadcastCredential for new integrations. verifyCredential remains as a deprecated alias that validates and completes payment in one call.

import { ,  } from 'mppx/server'
 
const  = .({
  : [.()],
})
 
const  = await .('Payment credential="..."', {
  : {
    : '0.10',
    : '0x20c0000000000000000000000000000000000000',
    : '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  },
  : 'GET /v1/report',
})
 
.(.)
success

Return type

type ReturnType = Promise<Receipt>

Parameters

capturedRequest (optional)

  • Type: Method.CapturedRequest

Authoritative request snapshot used by method verification hooks.

credential

  • Type: string | Credential

Serialized Authorization header value or parsed Credential object.

meta (optional)

  • Type: Record<string, string>

Expected Challenge metadata. mppx compares this with the metadata echoed by the Credential.

realm (optional)

  • Type: string

Expected Challenge realm.

request (optional)

  • Type: Record<string, unknown>

Expected method request parameters. Pass the same route options used to issue the Challenge.

scope (optional)

  • Type: string

Expected route or resource scope. Use this when the original Challenge was issued with scope.