import { PaymentMethod } from '../PaymentMethod.js'; import { PaymentCustomer } from '../PaymentCustomer.js'; import { PaymentMandate } from '../PaymentMandate.js'; import { AutoEncoder } from '@simonbackx/simple-encoding'; /** * We have multiple checkout flows in Stamhoofd. They all share a similar way of selecting a payment method, * and also allowing you to pay for already existing balances. * * This interface, streamlines this to a common interface that we should start using everywhere, so we can * make more general helpers in the backend and frontend for handling the payment flow. */ export declare abstract class Checkoutable extends AutoEncoder { /** * This part is what you are paying for, new stuff. Can be empty if you are only paying * for existing balances. */ abstract purchases: T; balances: Map; /** * If null, mandate should be set instead. */ paymentMethod: PaymentMethod | null; /** * Pay with an existing mandate instead of a payment method */ mandate: PaymentMandate | null; /** * Invoice details. Will get saved into the created payment and/or invoice. * Can only be null if the total price is zero. */ customer: PaymentCustomer | null; /** * Whether to set up a new mandate for this customer. * Only relevant when paymentMethod is not null. * * If this is set and the total price is zero, the total price might be increased to an arbitrary * number in order to link a payment method. * * Note: it might be required for subscription based purchases to set this to true if not paying with an existing mandate. */ createMandate: boolean; /** * The link we'll redirect the user back too after the payment page (either succeeded or failed!) * The id query param will be appended with the payment id */ redirectUrl: URL | null; /** * The link we'll redirect the user back too after the user canceled a payment (not supported for all payment methods) * The id query param will be appended with the payment id */ cancelUrl: URL | null; /** * In case we don't want to initiate a payment yet, * - want to use the backend to know the total expected price. * - want to know if we can generate an automated invoice or not (might not be available) * * When true, this will create an invoice (without number) in the response, * but won't create the payment yet. */ proForma: boolean; /** * The price that the frontend displayed to the user. Can be null to skip verification. */ totalPrice: number | null; } //# sourceMappingURL=Checkoutable.d.ts.map