Raises a typed MppError on malformed input — undecodable base64url
JSON, or JSON that decodes to something that is not a usable
{ method, reference, status, timestamp } object — rather than a raw
SyntaxError or an untyped receipt. This function does not decide whether
that failure is fatal for its caller (the receipt is "unsigned by design,
and carries no balance", so a caller may reasonably treat a decode
failure as non-fatal and simply omit the receipt); it only guarantees the
failure is typed and raised at the boundary, not as a later TypeError
on a field access with nothing pointing back at the header that caused it
— the same asymmetry parseChallengeHeader closes for request=.
Decodes a
Payment-Receiptheader value.Raises a typed MppError on malformed input — undecodable base64url JSON, or JSON that decodes to something that is not a usable
{ method, reference, status, timestamp }object — rather than a rawSyntaxErroror an untyped receipt. This function does not decide whether that failure is fatal for its caller (the receipt is "unsigned by design, and carries no balance", so a caller may reasonably treat a decode failure as non-fatal and simply omit the receipt); it only guarantees the failure is typed and raised at the boundary, not as a laterTypeErroron a field access with nothing pointing back at the header that caused it — the same asymmetry parseChallengeHeader closes forrequest=.