Interface UseEmbeddedPaymentElementResult

interface UseEmbeddedPaymentElementResult {
    embeddedPaymentElementView:
        | null
        | ReactElement<unknown, string | JSXElementConstructor<any>>;
    paymentOption: null | PaymentOptionDisplayData;
    confirm: () => Promise<EmbeddedPaymentElementResult>;
    update: (intentConfig: PaymentSheet.IntentConfiguration) => void;
    clearPaymentOption: () => void;
    loadingError: null | Error;
}

Properties

embeddedPaymentElementView:
    | null
    | ReactElement<unknown, string | JSXElementConstructor<any>>
paymentOption: null | PaymentOptionDisplayData

Contains information about the customer's selected payment option. Use this to display the payment option in your own UI

confirm: () => Promise<EmbeddedPaymentElementResult>

Completes the payment or setup.

Type declaration

This method requires that the last call to update succeeded. If the last update call failed, this call will fail. If this method is called while a call to update is in progress, it waits until the update call completes.

update: (intentConfig: PaymentSheet.IntentConfiguration) => void

Call this method when the IntentConfiguration values you used to initialize EmbeddedPaymentElement (amount, currency, etc.) change. This ensures the appropriate payment methods are displayed, collect the right fields, etc.

Sets loadingError if the update fails.

Upon completion, paymentOption may become null if it's no longer available.

If you call update while a previous call to update is still in progress, the previous call is canceled.

clearPaymentOption: () => void
loadingError: null | Error
MMNEPVFCICPMFPCPTTAAATR