Skip to content

ConfirmPaymentData

What confirmPayment() takes. An element typed as a union, such as CardElement | MobileElement, takes only the options every member can use. An option the element’s payment cannot use is refused rather than dropped: redirect with a card or scan element, and anything but signal with a hostedCard or payment element.

export type ConfirmPaymentData<E extends ConfirmableElement = ConfirmableElement> = {
element: E;
} & ((E extends ConfirmableElement ? (options: ConfirmPaymentOptionsMap[E["elementType"]]) => void : never) extends (options: infer O) => void ? O : never);