function buildProviderLineItems
buildProviderLineItems<Item>(
order: PricedOrder,
currency: string,
render: { line: (
line: PricedLine,
currency: string,
) => Item
; extra: (
extra: ExtraLine,
currency: string,
) => Item
; }
,
): Item[]

Render a priced order into a provider's line-item array: each ticket line via line, each extra (booking fee, …) via extra. Providers supply the two shape callbacks; the ordering (tickets, then extras) matches what Stripe and Square built by hand before.

Type Parameters

Item

Parameters

order: PricedOrder
currency: string
render: { line: (
line: PricedLine,
currency: string,
) => Item
; extra: (
extra: ExtraLine,
currency: string,
) => Item
; }

Return Type

Usage

import { buildProviderLineItems } from "doc.ts";