function extractSessionMetadata
extractSessionMetadata(metadata: SessionMetadata): ValidatedPaymentSession["metadata"]

Normalize validated session metadata into the canonical SessionMetadata shape.

Must only be called after hasRequiredSessionMetadata narrows the type — name is guaranteed non-empty by that guard. Optional fields that were omitted during metadata creation are normalized to "" here.

Parameters

Return Type

Usage

import { extractSessionMetadata } from "docs/payments.ts";