makeCreateCheckoutSession<Result>(provider: PaymentProviderType,create: (intent: CheckoutIntent,baseUrl: string,) => Promise<Result | null>,readResult: (result: Result) => { id: string | undefined; url: string
| undefined
| null; },): ((intent: CheckoutIntent,baseUrl: string,) => Promise<CheckoutSessionResult>)
Build a provider's createCheckoutSession: call the provider's own create
function, read the session id and URL off whatever shape it returns, and map
that to a shared CheckoutSessionResult — all inside the standard checkout
error guard. Each provider only supplies its create call and how to read the
id/url. A null create answer means the provider is not configured; a non-null
answer must contain both documented fields.
provider: PaymentProviderType
create: (intent: CheckoutIntent,baseUrl: string,) => Promise<Result | null>
readResult: (result: Result) => { id: string | undefined; url: string
| undefined
| null; }
((intent: CheckoutIntent,baseUrl: string,) => Promise<CheckoutSessionResult>)