export interface PaymentHubParams { publishableKey: string; apiHost: string; } export type FormChangeEvent = { isValid: boolean; paymentMethodType: string; }; export interface StripeFormCreateOptions { stripePublishableKey: string; stripePaymentIntentSecret: string; } export interface CreateFormOptions { containerElementId: string; onChange: (event: FormChangeEvent) => void; } export enum GatewayType { STRIPE = "stripe", } export interface StripePaymentIntent { stripePaymentIntentSecret: string; stripePaymentIntentId: string; stripePublishableKey: string; } export interface PaymentForm { confirmPayment: () => Promise; } export type GatewayPaymentIntent = StripePaymentIntent; export interface BasePaymentIntent< T extends GatewayType, G extends GatewayPaymentIntent > { paymentIntentId: string; amount: number; currency: string; paymentMethodType: string; businessEntityId: string; gatewayType: T; gatewayPaymentIntent: G; } export type PaymentIntent = BasePaymentIntent< GatewayType.STRIPE, StripePaymentIntent >;