IntentConfiguration: {
    confirmHandler?: (
        paymentMethod: PaymentMethod.Result,
        shouldSavePaymentMethod: boolean,
        intentCreationCallback: (
            result: PaymentSheet.IntentCreationCallbackParams,
        ) => void,
    ) => void;
    confirmationTokenConfirmHandler?: (
        confirmationToken: ConfirmationToken.Result,
        intentCreationCallback: (
            result: PaymentSheet.IntentCreationCallbackParams,
        ) => void,
    ) => void;
    mode: PaymentSheet.Mode;
    paymentMethodTypes?: string[];
    onBehalfOf?: string;
}

Type declaration

  • OptionalconfirmHandler?: (
        paymentMethod: PaymentMethod.Result,
        shouldSavePaymentMethod: boolean,
        intentCreationCallback: (
            result: PaymentSheet.IntentCreationCallbackParams,
        ) => void,
    ) => void

    Called when the customer confirms payment. Your implementation should create a PaymentIntent or SetupIntent on your server and call the intentCreationCallback with its client secret or an error if one occurred.

    • Note: You must create the PaymentIntent or SetupIntent with the same values used as the IntentConfiguration e.g. the same amount, currency, etc.
    • Note: Either confirmHandler or confirmationTokenConfirmHandler must be provided, but not both.
    • Parameters:
      • paymentMethod: The PaymentMethod representing the customer's payment details.
      • shouldSavePaymentMethod: This is true if the customer selected the "Save this payment method for future use" checkbox. Set setup_future_usage on the PaymentIntent to off_session if this is true.
      • intentCreationCallback: Call this with the client_secret of the PaymentIntent or SetupIntent created by your server or the error that occurred. If you're using customFlow: false (default), the error's localizedMessage will be displayed to the customer in the sheet. If you're using customFlow: true, the confirm method fails with the error.
  • OptionalconfirmationTokenConfirmHandler?: (
        confirmationToken: ConfirmationToken.Result,
        intentCreationCallback: (
            result: PaymentSheet.IntentCreationCallbackParams,
        ) => void,
    ) => void

    Called when the customer confirms payment using confirmation tokens. Your implementation should follow the guide to create (and optionally confirm) a PaymentIntent or SetupIntent on your server and call the intentCreationCallback with its client secret or an error if one occurred.

    • Note: You must create the PaymentIntent or SetupIntent with the same values used as the IntentConfiguration e.g. the same amount, currency, etc.
    • Note: When confirming the PaymentIntent or SetupIntent on your server, use the confirmation token ID (confirmationToken.id) as the confirmation_token parameter.
    • Note: Either confirmHandler or confirmationTokenConfirmHandler must be provided, but not both.
  • mode: PaymentSheet.Mode
  • OptionalpaymentMethodTypes?: string[]
  • OptionalonBehalfOf?: string

    The connected account whose payment method configurations will apply to the PaymentSheet session. Affects the allowed payment methods and whether card brand choice is enabled. If saved, the payment method will be saved to your platform account. See our PaymentIntent docs for more information.