\n'}},description:"In order to provide a great user experience for 3D Secure on all devices,\nyou should set your page's viewport `width` to `device-width` with the\n[viewport meta tag](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).\n\nThere are several other viewport settings, and you can configure those\nbased on your needs. Just make sure you include `width=device-width`\nsomewhere in your configuration.\n",section_tag:"viewport_meta_requirements"},display_on_load:!0},stripe_checkout_redirect_to_checkout:{title:"Redirect to Checkout",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_checkout_redirect_to_checkout",section_anchor:"stripe_checkout_redirect_to_checkout",subsection_anchors:null,path:"/deprecated/redirect_to_checkout",gate:!1,data:{deprecated:!0,section_type:"method",title:"Redirect to Checkout",description:"Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](/payments/checkout), a Stripe-hosted page to securely collect payment information.\nWhen the customer completes their purchase, they are redirected back to your website.\n",callout:"If you are currently on a beta of the new version of Checkout, read the [Beta Migration Guide](/payments/checkout/migration-from-beta) to upgrade to the latest version.\n",signature:{object_name:"stripe",method_name:"redirectToCheckout",args:[{name:"options",documentation:"",validation:"object",required:!1,expanded:!0,subspec:[{name:"sessionId",documentation:"The ID of the [Checkout Session](/api/checkout/sessions) that is used in [Checkout's client and server integration](/payments/accept-a-payment?integration=checkout).\n",validation:"string",required:!1},{name:"lineItems",documentation:"An array of objects representing the items that your customer would like to purchase.\nThese items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.\nUsed with the [client-only](/payments/checkout/client) integration.\n",validation:"array",required:!1,subspec:[{name:"price",documentation:"The ID of the price that the customer would like to purchase or subscribe to. May also be a SKU or plan.\n",validation:"string",required:!0},{name:"quantity",validation:"integer",documentation:"The quantity of units for the item.\n",required:!0}]},{name:"mode",documentation:"The mode of the Checkout Session, one of `payment` or `subscription`. Required if\nusing `lineItems` with the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"successUrl",documentation:"The URL to which Stripe should send customers when payment is complete.\nIf you’d like access to the Checkout Session for the successful payment, read more about it in the guide on [fulfilling orders](/payments/checkout/fulfill-orders).\nRequired if using the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"cancelUrl",documentation:"The URL to which Stripe should send customers when payment is canceled.\nRequired if using the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"clientReferenceId",documentation:"A unique string to reference the Checkout session.\nThis can be a customer ID, a cart ID, or similar.\nIt is included in the `checkout.session.completed` webhook and can be used to fulfill the purchase.\n",validation:"string",required:!1},{name:"customerEmail",documentation:"The email address used to create the customer object.\nIf you already know your customer's email address, use this attribute to prefill it on Checkout.\n",validation:"string",required:!1},{name:"billingAddressCollection",documentation:"Specify whether Checkout should collect the customer’s billing address.\nIf set to `required`, Checkout will attempt to collect the customer’s billing address.\nIf not set or set to `auto` Checkout will only attempt to collect the billing address when necessary.\n",validation:"string",required:!1},{name:"shippingAddressCollection",documentation:"When set, provides configuration for Checkout to collect a shipping address from a customer.\n",validation:"object",required:!1,subspec:[{name:"allowedCountries",documentation:"An array of [two-letter ISO country codes](https://www.iban.com/country-codes) representing\nwhich countries Checkout should provide as options for shipping locations.\nUnsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.\n",validation:"array",required:!0}]},{name:"locale",documentation:"A [locale](#supported_locales) that will be used to localize the display of Checkout.\nDefault is `auto` (Stripe detects the locale of the browser).\n",validation:"string",required:!1},{name:"submitType",documentation:"Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the **Submit** button.\n`submitType` can only be specified when using using line items or SKUs, and not subscriptions.\nThe default is `auto`. Supported values are: `auto`, `book`, `donate`, `pay`.\n",validation:"string",required:!1},{name:"items",documentation:"An array of objects representing the items that your customer would like to purchase.\nThese items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.\nUsing `lineItems` is preferred.\n",validation:"array",required:!1,subspec:[{name:"sku, plan",documentation:"The ID of the SKU that the customer would like to purchase, or the ID of the plan or recurring price that the customer would like to subscribe to.\n",validation:"string",required:!1},{name:"quantity",validation:"integer",documentation:"The quantity of units for the item.\n",required:!1}]}]}]},table_content:{items:[{name:"options",documentation:"",validation:"object",required:!1,expanded:!0,subspec:[{name:"sessionId",documentation:"The ID of the [Checkout Session](/api/checkout/sessions) that is used in [Checkout's client and server integration](/payments/accept-a-payment?integration=checkout).\n",validation:"string",required:!1},{name:"lineItems",documentation:"An array of objects representing the items that your customer would like to purchase.\nThese items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.\nUsed with the [client-only](/payments/checkout/client) integration.\n",validation:"array",required:!1,subspec:[{name:"price",documentation:"The ID of the price that the customer would like to purchase or subscribe to. May also be a SKU or plan.\n",validation:"string",required:!0},{name:"quantity",validation:"integer",documentation:"The quantity of units for the item.\n",required:!0}]},{name:"mode",documentation:"The mode of the Checkout Session, one of `payment` or `subscription`. Required if\nusing `lineItems` with the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"successUrl",documentation:"The URL to which Stripe should send customers when payment is complete.\nIf you’d like access to the Checkout Session for the successful payment, read more about it in the guide on [fulfilling orders](/payments/checkout/fulfill-orders).\nRequired if using the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"cancelUrl",documentation:"The URL to which Stripe should send customers when payment is canceled.\nRequired if using the [client-only](/payments/checkout/client) integration.\n",validation:"string",required:!1},{name:"clientReferenceId",documentation:"A unique string to reference the Checkout session.\nThis can be a customer ID, a cart ID, or similar.\nIt is included in the `checkout.session.completed` webhook and can be used to fulfill the purchase.\n",validation:"string",required:!1},{name:"customerEmail",documentation:"The email address used to create the customer object.\nIf you already know your customer's email address, use this attribute to prefill it on Checkout.\n",validation:"string",required:!1},{name:"billingAddressCollection",documentation:"Specify whether Checkout should collect the customer’s billing address.\nIf set to `required`, Checkout will attempt to collect the customer’s billing address.\nIf not set or set to `auto` Checkout will only attempt to collect the billing address when necessary.\n",validation:"string",required:!1},{name:"shippingAddressCollection",documentation:"When set, provides configuration for Checkout to collect a shipping address from a customer.\n",validation:"object",required:!1,subspec:[{name:"allowedCountries",documentation:"An array of [two-letter ISO country codes](https://www.iban.com/country-codes) representing\nwhich countries Checkout should provide as options for shipping locations.\nUnsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.\n",validation:"array",required:!0}]},{name:"locale",documentation:"A [locale](#supported_locales) that will be used to localize the display of Checkout.\nDefault is `auto` (Stripe detects the locale of the browser).\n",validation:"string",required:!1},{name:"submitType",documentation:"Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the **Submit** button.\n`submitType` can only be specified when using using line items or SKUs, and not subscriptions.\nThe default is `auto`. Supported values are: `auto`, `book`, `donate`, `pay`.\n",validation:"string",required:!1},{name:"items",documentation:"An array of objects representing the items that your customer would like to purchase.\nThese items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.\nUsing `lineItems` is preferred.\n",validation:"array",required:!1,subspec:[{name:"sku, plan",documentation:"The ID of the SKU that the customer would like to purchase, or the ID of the plan or recurring price that the customer would like to subscribe to.\n",validation:"string",required:!1},{name:"quantity",validation:"integer",documentation:"The quantity of units for the item.\n",required:!1}]}]}]},request:{title:"Redirect to Checkout",snippets:{js:"// Call your backend to create the Checkout Session\nfetch('/create-checkout-session', {\n method: 'POST',\n})\n.then(function(response) {\n return response.json();\n})\n.then(function(session) {\n return stripe.redirectToCheckout({ sessionId: session.id });\n})\n.then(function(result) {\n // If `redirectToCheckout` fails due to a browser or network\n // error, you should display the localized error message to your\n // customer using `error.message`.\n if (result.error) {\n alert(result.error.message);\n }\n});\n",es_next:"// Call your backend to create the Checkout Session\nconst response = await fetch('/create-checkout-session', { method: 'POST' });\nconst session = await response.json();\n\n// When the customer clicks on the button, redirect them to Checkout.\nconst result = await stripe.redirectToCheckout({\n sessionId: session.id,\n});\n\nif (result.error) {\n // If `redirectToCheckout` fails due to a browser or network\n // error, display the localized error message to your customer\n // using `result.error.message`.\n}\n"}},returns:"This method returns a `Promise` which resolves with a result object.\nIf this method fails, the result object will contain a localized error message in the `error.message` field.\n",section_tag:"stripe_checkout_redirect_to_checkout"},display_on_load:!0},stripe_handle_card_payment_element:{title:"Handle a card payment with an Element",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_handle_card_payment_element",section_anchor:"stripe_handle_card_payment_element",subsection_anchors:null,path:"/deprecated/handle_card_payment_element",gate:!1,data:{deprecated:!0,section_type:"method",title:"Handle card payment with an Element",description:"*`handleCardPayment` has been renamed to [confirmCardPayment](#stripe_confirm_card_payment).\nIn addition to the rename, we have slightly modified the arguments.\nThese changes do not affect the behavior of the method.\nWhile we have no plans to ever remove support for `handleCardPayment`, we think the new name and arguments are easier to understand and better convey what the method is doing.*\n\nUse `stripe.handleCardPayment(clientSecret, element, data?)` when the customer submits your payment form.\nIt will gather payment information from the element, which can be a `card` or `cardNumber` element, along with any other data you provide.\nIt will then confirm the `PaymentIntent` and carry out 3DS or other `next_action`s if they are required.\n\nIf you are using [Dynamic 3D Secure](/payments/3d-secure#three-ds-radar), `handleCardPayment` will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment.\n",callout:"Note that `stripe.handleCardPayment` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n\nAdditionally, `stripe.handleCardPayment` may trigger a [3D Secure](/payments/3d-secure) authentication challenge.\nThis will be shown in a modal dialog and may be confusing for customers using assistive technologies like screen readers.\nYou should make your form accessible by ensuring that success or error messages are clearly read out after this method completes.\n",signature:{object_name:"stripe",method_name:"handleCardPayment",args:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"A `card` or `cardNumber` [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details during payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"A `card` or `cardNumber` [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details during payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},request:{title:"Handle a card payment",snippets:{js:"stripe\n .handleCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', element, {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen',\n },\n },\n })\n .then(function(result) {\n // Handle result.error or result.paymentIntent\n });\n",es_next:"const {paymentIntent, error} = await stripe.handleCardPayment(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen',\n },\n },\n },\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.paymentIntent`: the successful [PaymentIntent](/api/payment_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_handle_card_payment_element"},display_on_load:!0},stripe_handle_card_payment:{title:"Handle a card payment",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_handle_card_payment",section_anchor:"stripe_handle_card_payment",subsection_anchors:null,path:"/deprecated/handle_card_payment",gate:!1,data:{deprecated:!0,section_type:"method",title:"Handle card payment",description:"*`handleCardPayment` has been renamed to [confirmCardPayment](#stripe_confirm_card_payment). In addition to the rename, we have slightly modified the arguments. These changes do not affect the behavior of the method. While we have no plans to ever remove support for `handleCardPayment`, we think the new name and arguments are easier to understand and better convey what the method is doing.*\n\nUse `stripe.handleCardPayment(clientSecret, data?)` to advance the [PaymentIntent](/api/payment_intents) towards completion when you are not gathering payment method information from an [Element](/js/elements_object/create_element).\n\nCall this variation when you have already attached a card to this `PaymentIntent` or if you want to attach an existing card to it.\n",callout:"Note that `stripe.handleCardPayment` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n\nAdditionally, `stripe.handleCardPayment` may trigger a [3D Secure](/payments/3d-secure) authentication challenge.\nThis will be shown in a modal dialog and may be confusing for customers using assistive technologies like screen readers.\nYou should make your form accessible by ensuring that success or error messages are clearly read out after this method completes.\n",signature:{object_name:"stripe",method_name:"handleCardPayment",args:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},request:{title:"Handle a card payment",snippets:{js:"stripe\n .handleCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {\n payment_method: '{PAYMENT_METHOD_ID}',\n })\n .then(function(result) {\n // Handle result.error or result.paymentIntent\n });\n",es_next:"const {paymentIntent, error} = await stripe.handleCardPayment(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n {\n payment_method: '{PAYMENT_METHOD_ID}',\n },\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.paymentIntent`: the successful [PaymentIntent](/api/payment_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_handle_card_payment"},display_on_load:!0},stripe_confirm_payment_intent_element:{title:"Confirm a PaymentIntent with an Element",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_confirm_payment_intent_element",section_anchor:"stripe_confirm_payment_intent_element",subsection_anchors:null,path:"/deprecated/confirm_payment_intent_element",gate:!1,data:{deprecated:!0,section_type:"method",title:"Confirm a Payment Intent with an Element",description:"*`confirmPaymentIntent` has been deprecated. Going forward, if you wish to confirm on the client without handling next actions, simply pass `{handleActions: false}` as a third argument to [confirmCardPayment](#stripe_confirm_card_payment). While we have no plans to ever remove support for `confirmPaymentIntent`, we think that explicitly opting out of next action handling is easier to understand and will better convey what the method is doing.*\n\nUse `stripe.confirmPaymentIntent(clientSecret, element, data)` when the customer submits your payment form. It will gather payment information from element, along with any other data you provide, and confirm the `PaymentIntent`.\n\nOnly use this method if you want to [handle next actions yourself](/payments/payment-intents/verifying-status#next-actions). Otherwise, use [stripe.handleCardPayment](#stripe_handle_card_payment).\n",callout:"Note that `stripe.confirmPaymentIntent` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n",signature:{object_name:"stripe",method_name:"confirmPaymentIntent",args:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent` to confirm.\n",validation:"string",required:!0},{name:"element",documentation:"An [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent` to confirm.\n",validation:"string",required:!0},{name:"element",documentation:"An [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},request:{title:"Confirm a PaymentIntent",snippets:{js:"stripe.confirmPaymentIntent(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen'\n }\n },\n return_url: 'https://example.com/return_url'\n }\n).then(function(result) {\n // Handle result.error or result.paymentIntent\n});\n",es_next:"const {paymentIntent, error} = await stripe.confirmPaymentIntent(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: \"Jenny Rosen\"\n }\n },\n return_url: 'https://example.com/return_url'\n }\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.paymentIntent`: the successful [PaymentIntent](/api/payment_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_confirm_payment_intent_element"},display_on_load:!0},stripe_confirm_payment_intent:{title:"Confirm a PaymentIntent",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_confirm_payment_intent",section_anchor:"stripe_confirm_payment_intent",subsection_anchors:null,path:"/deprecated/confirm_payment_intent",gate:!1,data:{deprecated:!0,section_type:"method",title:"Confirm a Payment Intent",description:"*`confirmPaymentIntent` has been deprecated.\nGoing forward, if you wish to confirm on the client without handling next actions, simply pass `{handleActions: false}` as a third argument to [confirmCardPayment](#stripe_confirm_card_payment).\nWhile we have no plans to ever remove support for `confirmPaymentIntent`, we think that explicitly opting out of next action handling is easier to understand and will better convey what the method is doing.*\n\nUse `stripe.confirmPaymentIntent(clientSecret, data)` to confirm the `PaymentIntent` when you are not gathering payment information from an `Element`.\nCall this variation when you have already attached a payment method to this `PaymentIntent`, or if you want to attach an existing card, token, or `PaymentMethod` to it.\n\nOnly use this method if you want to handle next actions yourself.\nOtherwise, use `stripe.handleCardPayment`.\n\n",callout:"Note that `stripe.confirmPaymentIntent` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n",signature:{object_name:"stripe",method_name:"confirmPaymentIntent",args:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent` to confirm.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent` to confirm.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]},{name:"shipping",documentation:"The [shipping details](/api/payment_intents/confirm#confirm_payment_intent-shipping) for the payment, if collected.\n",validation:"object",badge_text:"recommended"},{name:"receipt_email",documentation:"Email address that the receipt for the resulting payment will be sent to.\n",validation:"string"},{name:"setup_future_usage",documentation:"Indicates that you intend to make future payments with this [PaymentIntent](/api/payment_intents)'s payment method.\n\nIf present, the `PaymentMethod` used with this PaymentIntent can be [attached to a Customer](/api/payment_methods/attach), even after the transaction completes.\n\nUse `on_session` if you intend to only reuse the `PaymentMethod` when your customer is present in your checkout flow.\nUse `off_session` if your customer may or may not be in your checkout flow.\nSee [saving card details after a payment](/payments/cards/saving-cards-after-payment) to learn more.\n\nStripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules.\nFor example, if your customer is impacted by SCA, using `off_session` will ensure that they are authenticated while processing this PaymentIntent.\nYou will then be able to collect [off-session payments](/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.\n",validation:"string"}]}]},request:{title:"Confirm a PaymentIntent",snippets:{js:"stripe\n .confirmPaymentIntent('{PAYMENT_INTENT_CLIENT_SECRET}', {\n payment_method: '{PAYMENT_METHOD_ID}',\n return_url: 'https://example.com/return_url',\n })\n .then(function(result) {\n // Handle result.error or result.paymentIntent\n });\n",es_next:"const {paymentIntent, error} = await stripe.confirmPaymentIntent(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n {\n payment_method: '{PAYMENT_METHOD_ID}',\n return_url: 'https://example.com/return_url'\n }\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.paymentIntent`: the successful [PaymentIntent](/api/payment_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_confirm_payment_intent"},display_on_load:!0},stripe_handle_card_setup_element:{title:"Handle card setup with an Element",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_handle_card_setup_element",section_anchor:"stripe_handle_card_setup_element",subsection_anchors:null,path:"/deprecated/handle_card_setup_element",gate:!1,data:{deprecated:!0,section_type:"method",title:"Handle card setup with an Element",description:"*`handleCardSetup` has been renamed to [confirmCardSetup](#stripe_confirm_card_setup). In addition to the rename, we have slightly modified the arguments. These changes do not affect the behavior of the method. While we have no plans to ever remove support for `handleCardSetup`, we think the new name and arguments are easier to understand and better convey what the method is doing.*\n\nUse `stripe.handleCardSetup(clientSecret, element, data?)` in the [Setup Intents API flow](/payments/save-and-reuse) when the customer submits your payment form.\nIt will gather payment information from the `element`, which can be a `card` or `cardNumber` element, along with any other data you provide.\nIt will then confirm the `SetupIntent` and carry out 3DS or other `next_action`s if they are required.\n",signature:{object_name:"stripe",method_name:"handleCardSetup",args:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"A `card` or `cardNumber` Element that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"A `card` or `cardNumber` Element that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]}]}]},request:{title:"Handle card setup",snippets:{js:"stripe.handleCardSetup(\n '{SETUP_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen'\n }\n }\n }\n).then(function(result) {\n // Handle result.error or result.setupIntent\n});\n",es_next:"const {setupIntent, error} = await stripe.handleCardSetup(\n '{SETUP_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen'\n }\n }\n }\n);\n"}},callout:"Note that `stripe.handleCardSetup` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n\nAdditionally, `stripe.handleCardSetup` may trigger a [3D Secure](/payments/3d-secure) authentication challenge.\nThis will be shown in a modal dialog and may be confusing for customers using assistive technologies like screen readers.\nYou should make your form accessible by ensuring that success or error messages are clearly read out after this method completes.\n",returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.setupIntent`: the successful [SetupIntent](/api/setup_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_handle_card_setup_element"},display_on_load:!0},stripe_handle_card_setup:{title:"Handle card setup",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_handle_card_setup",section_anchor:"stripe_handle_card_setup",subsection_anchors:null,path:"/deprecated/handle_card_setup",gate:!1,data:{deprecated:!0,section_type:"method",title:"Handle card setup",description:"*`handleCardSetup` has been renamed to [confirmCardSetup](#stripe_confirm_card_setup). In addition to the rename, we have slightly modified the arguments. These changes do not affect the behavior of the method. While we have no plans to ever remove support for `handleCardSetup`, we think the new name and arguments are easier to understand and better convey what the method is doing.*\n\nUse `stripe.handleCardSetup(clientSecret, data)` to advance the `SetupIntent` towards completion when you are not gathering payment method information from an `Element`.\n\nCall this variation when you have already attached a card to this `SetupIntent` or if you want to attach an existing card to it.\n",signature:{object_name:"stripe",method_name:"handleCardSetup",args:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent`.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent`.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]}]}]},request:{title:"Handle card setup",snippets:{js:"stripe\n .handleCardSetup('{SETUP_INTENT_CLIENT_SECRET}', {\n payment_method: '{PAYMENT_METHOD_ID}',\n })\n .then(function(result) {\n // Handle result.error or result.setupIntent\n });\n",es_next:"const {setupIntent, error} = await stripe.handleCardSetup(\n '{SETUP_INTENT_CLIENT_SECRET}',\n {\n payment_method: '{PAYMENT_METHOD_ID}',\n },\n);\n"}},callout:"Note that `stripe.handleCardSetup` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n\nAdditionally, `stripe.handleCardSetup` may trigger a [3D Secure](/payments/3d-secure) authentication challenge.\nThis will be shown in a modal dialog and may be confusing for customers using assistive technologies like screen readers.\nYou should make your form accessible by ensuring that success or error messages are clearly read out after this method completes.\n",returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.setupIntent`: the successful [SetupIntent](/api/setup_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_handle_card_setup"},display_on_load:!0},stripe_confirm_setup_intent_element:{title:"Confirm a SetupIntent with an Element",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_confirm_setup_intent_element",section_anchor:"stripe_confirm_setup_intent_element",subsection_anchors:null,path:"/deprecated/confirm_setup_intent_element",gate:!1,data:{deprecated:!0,section_type:"method",title:"Confirm a Setup Intent with an Element",description:"*`confirmSetupIntent` has been deprecated. Going forward, if you wish to confirm on the client without handling next actions, simply pass `{handleActions: false}` as a third argument to [confirmCardSetup](#stripe_confirm_card_setup). While we have no plans to ever remove support for `confirmSetupIntent`, we think that explicitly opting out of next action handling is easier to understand and will better convey what the method is doing.*\n\nUse `stripe.confirmSetupIntent(clientSecret, element, data)` when the customer submits your save payment method form. It will gather payment information from `element`, along with any other `data` you provide, and confirm the `SetupIntent`.\n\nOnly use this method if you want to [handle next actions yourself](/payments/payment-intents/verifying-status#next-actions). Otherwise, use [stripe.handleCardSetup](#stripe_handle_card_payment).\n",callout:"Note that `stripe.confirmSetupIntent` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n",signature:{object_name:"stripe",method_name:"confirmSetupIntent",args:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent` to confirm.\n",validation:"string",required:!0},{name:"element",documentation:"An [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent` to confirm.\n",validation:"string",required:!0},{name:"element",documentation:"An [Element](/js/element) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"}]}]}]},request:{title:"Confirm a SetupIntent",snippets:{js:"stripe.confirmSetupIntent(\n '{SETUP_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: 'Jenny Rosen'\n }\n },\n return_url: 'https://example.com/return_url'\n }\n).then(function(result) {\n // Handle result.error or result.setupIntent\n});\n",es_next:"const {setupIntent, error} = await stripe.confirmSetupIntent(\n '{SETUP_INTENT_CLIENT_SECRET}',\n element,\n {\n payment_method_data: {\n billing_details: {\n name: \"Jenny Rosen\"\n }\n },\n return_url: 'https://example.com/return_url'\n }\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.setupIntent`: the successful [SetupIntent](/api/setup_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_confirm_setup_intent_element"},display_on_load:!0},stripe_confirm_setup_intent:{title:"Confirm a SetupIntent",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_confirm_setup_intent",section_anchor:"stripe_confirm_setup_intent",subsection_anchors:null,path:"/deprecated/confirm_setup_intent",gate:!1,data:{deprecated:!0,section_type:"method",title:"Confirm a Setup Intent",description:"*`confirmSetupIntent` has been deprecated.\nGoing forward, if you wish to confirm on the client without handling next actions, simply pass `{handleActions: false}` as a third argument to [confirmCardSetup](#stripe_confirm_card_setup).\nWhile we have no plans to ever remove support for `confirmSetupIntent`, we think that explicitly opting out of next action handling is easier to understand and will better convey what the method is doing.*\n\nUse `stripe.confirmSetupIntent(clientSecret, data)` to confirm the `SetupIntent` when you are not gathering payment information from an `Element`.\nCall this variation when you have already attached a payment method to this `SetupIntent`, or if you want to attach an existing card, token, or `PaymentMethod` to it.\n\nOnly use this method if you want to handle next actions yourself.\nOtherwise, use `stripe.handleCardSetup`.\n",callout:"Note that `stripe.confirmSetupIntent` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n",signature:{object_name:"stripe",method_name:"confirmSetupIntent",args:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent` to confirm.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/setup_intents/object#setup_intent_object-client_secret) of the `SetupIntent` to confirm.\n",validation:"string",required:!0},{name:"data",documentation:"Data to be sent with the request. It can contain the following parameters\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"If you are [handling next actions yourself](/payments/payment-intents/verifying-status#next-actions), pass in a `return_url`.\nIf the subsequent action is `redirect_to_url`, this URL will be used on the return path for the redirect.\n",validation:"string"},{name:"payment_method",documentation:"Use `payment_method` to specify an existing [PaymentMethod](/api/payment_methods) to use for this payment.\n\nOnly one of `payment_method_data` and `payment_method` is required.\n",validation:"string"},{name:"payment_method_data",documentation:"Use this parameter to supply additional data relevant to the payment method, such as billing details.\n",validation:"object",expanded:!0,subspec:[{name:"billing_details",documentation:"The [billing details](/api/payment_methods/create#create_payment_method-billing_details) associated with the card.",validation:"object",badge_text:"recommended"},{name:"card[token]",validation:"string",documentation:"Converts the provided token into a `PaymentMethod` to use for the payment.\n"}]}]}]},request:{title:"Confirm a SetupIntent",snippets:{js:"stripe\n .confirmSetupIntent('{SETUP_INTENT_CLIENT_SECRET}', {\n payment_method: '{PAYMENT_METHOD_ID}',\n return_url: 'https://example.com/return_url',\n })\n .then(function(result) {\n // Handle result.error or result.setupIntent\n });\n",es_next:"const {setupIntent, error} = await stripe.confirmSetupIntent(\n '{SETUP_INTENT_CLIENT_SECRET}',\n {\n payment_method: '{PAYMENT_METHOD_ID}',\n return_url: 'https://example.com/return_url'\n }\n);\n"}},returns:"A Promise which resolves with a `result` object.\n\nThe object will have either:\n\n* `result.setupIntent`: the successful [SetupIntent](/api/setup_intents).\n* `result.error`: An error. Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_confirm_setup_intent"},display_on_load:!0},stripe_handle_fpx_payment:{title:"Handle an FPX payment",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_handle_fpx_payment",section_anchor:"stripe_handle_fpx_payment",subsection_anchors:null,path:"/deprecated/handle_fpx_payment",gate:!1,data:{deprecated:!0,section_type:"method",title:"Handle an FPX payment",description:"*`handleFpxPayment` has been renamed to [confirmFpxPayment](#stripe_confirm_fpx_payment). In addition to the rename, we have slightly modified the arguments. These changes do not affect the behavior of the method. While we will continue to support `handleFpxPayment` for the duration of the beta, we think the new name and arguments are easier to understand and better convey what the method is doing.*\n\nUse `stripe.handleFpxPayment` in the [FPX payment method creation](/stripe-js/elements/fpx-bank) flow when the customer selects a bank from the dropdown. It will gather the [bank code](/payments/fpx/accept-a-payment#bank-reference) from the element, along with any other `PaymentIntent` `data` you provide. It will then create an FPX payment method and confirm the `PaymentIntent`.\n",callout:"Note that `stripe.handleFpxPayment` may take several seconds to complete.\nDuring that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.\nIf you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.\n",signature:{object_name:"stripe",method_name:"handleFpxPayment",args:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"An `fpxBank` [Element](/payments/elements) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"A data object to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"The url your customer will be directed to after they complete authentication. Be sure to review the [payment confirmation page requirements](/payments/fpx/accept-a-payment#payment-confirmation-page).\n",validation:"string"}]}]},table_content:{items:[{name:"clientSecret",documentation:"The [client secret](/api/payment_intents/object#payment_intent_object-client_secret) of the `PaymentIntent`.\n",validation:"string",required:!0},{name:"element",documentation:"An `fpxBank` [Element](/payments/elements) that will be used to create a payment method.\n",validation:"Element",required:!0},{name:"data",documentation:"A data object to be sent with the request.\n",validation:"object",expanded:!0,subspec:[{name:"return_url",documentation:"The url your customer will be directed to after they complete authentication. Be sure to review the [payment confirmation page requirements](/payments/fpx/accept-a-payment#payment-confirmation-page).\n",validation:"string"}]}]},request:{title:"Handle a FPX payment",snippets:{js:"stripe.handleFpxPayment(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n element,\n {\n return_url: 'https://example.com/return_url',\n }\n).then(function(result) {\n // Handle result.error or result.paymentIntent\n});\n",es_next:"const {paymentIntent, error} = await stripe.handleFpxPayment(\n '{PAYMENT_INTENT_CLIENT_SECRET}',\n element,\n {\n return_url: 'https://example.com/return_url',\n }\n);\n"}},returns:"This method returns a `Promise` which resolves with a `result` object.\nThis object has either:\n\n* `result.paymentIntent`: a [PaymentIntent](/api/payment_intents) with the `requires_confirmation` status to confirm server-side.\n* `result.error`: an error.\n Refer to the [API reference](/api#errors) for all possible errors and the [FPX guide](/payments/fpx/accept-a-payment#error-codes) for FPX specific errors.\n",section_tag:"stripe_handle_fpx_payment"},display_on_load:!0},sources:{title:"Sources",group_title:"Deprecated",group_anchor:"deprecated",anchor:"sources",section_anchor:"sources",subsection_anchors:["stripe_create_source","stripe_create_source_data","stripe_retrieve_source"],path:"/deprecated/sources",gate:!1,data:{section_type:"generic",title:"Sources",deprecated:!0,description:"The Sources API has been deprecated and replaced by the [Payment Intents API](/js/payment_intents).\n\nStripe.js provides the following methods to create and retrieve [Sources](/api/sources), which are part of the Charges API.\n",section_tag:"sources"},display_on_load:!0},stripe_create_source:{title:"Create a Source",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_create_source",section_anchor:"sources",subsection_anchors:null,path:"/deprecated/sources/create_source",gate:!1,data:{section_type:"method",title:"Create a Source",deprecated:!0,description:"Use `stripe.createSource` to convert payment information collected by elements into a [Source](/api#sources) object that you safely pass to your server to use in an API call.\nSee the [Sources documentation](/sources) for more information about sources.\n",signature:{object_name:"stripe",method_name:"createSource",args:[{name:"element",documentation:"The [Element](/js/element) containing payment information.\nIf applicable, the `Element` pulls data from other elements you’ve created on the same [Elements](#elements_create) instance.\n",validation:"object",required:!0},{name:"sourceData",documentation:"A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.\nSee the [Sources API](/api#create_source) reference for details.\n",validation:"object",required:!0}]},table_content:{items:[{name:"element",documentation:"The [Element](/js/element) containing payment information.\nIf applicable, the `Element` pulls data from other elements you’ve created on the same [Elements](#elements_create) instance.\n",validation:"object",required:!0},{name:"sourceData",documentation:"A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.\nSee the [Sources API](/api#create_source) reference for details.\n",validation:"object",required:!0}]},request:{title:"Create a Source",snippets:{js:"stripe\n .createSource(ibanElement, {\n type: 'sepa_debit',\n currency: 'eur',\n owner: {\n name: 'Jenny Rosen',\n },\n })\n .then(function(result) {\n // Handle result.error or result.source\n });\n",es_next:"const {source, error} = await stripe.createSource(\n ibanElement,\n {\n type: 'sepa_debit',\n currency: 'eur',\n owner: {\n name: 'Jenny Rosen',\n },\n },\n);\n"}},returns:"This method returns a `Promise` which resolves with a result object.\nThis object has either:\n\n* `result.source`: a [Source](/api#sources) was created successfully.\n* `result.error`: there was an error.\n This includes client-side validation errors.\n Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_create_source"},display_on_load:!0},stripe_create_source_data:{title:"Create a Source from data",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_create_source_data",section_anchor:"sources",subsection_anchors:null,path:"/deprecated/sources/create_source_data",gate:!1,data:{section_type:"method",title:"Create source",deprecated:!0,description:"Use `stripe.createSource` to convert raw payment information into a [Source](/api#sources) object that you can safely pass to your server for use in an API call.\nSee the [Sources documentation](/sources) for more information about sources.\n",callout:"You cannot pass raw card information to `stripe.createSource(sourceData)`.\nInstead, you must gather card information in an Element and use [`stripe.createSource(element, sourceData)`](#stripe_create_source).\nYou can also pass an existing card token to convert it into a `Source` object.\n",signature:{object_name:"stripe",method_name:"createSource",args:[{name:"sourceData",documentation:"A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.\nSee the [Sources API](/api#create_source) reference for details.\n",validation:"object",required:!0}]},table_content:{items:[{name:"sourceData",documentation:"A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.\nSee the [Sources API](/api#create_source) reference for details.\n",validation:"object",required:!0}]},request:{title:"Create a Source",snippets:{js:"stripe\n .createSource({\n type: 'ideal',\n amount: 1099,\n currency: 'eur',\n owner: {\n name: 'Jenny Rosen',\n },\n redirect: {\n return_url: 'https://shop.example.com/crtA6B28E1',\n },\n })\n .then(function(result) {\n // Handle result.error or result.source\n });\n",es_next:"const {source, error} = await stripe.createSource({\n type: 'ideal',\n amount: 1099,\n currency: 'eur',\n owner: {\n name: 'Jenny Rosen',\n },\n redirect: {\n return_url: 'https://shop.example.com/crtA6B28E1',\n },\n});\n"}},returns:"This method returns a `Promise` which resolves with a result object.\nThis object has either:\n\n* `result.source`: a [Source](/api#sources) was created successfully.\n* `result.error`: there was an error.\n This includes client-side validation errors.\n Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_create_source_data"},display_on_load:!0},stripe_retrieve_source:{title:"Retrieve a Source",group_title:"Deprecated",group_anchor:"deprecated",anchor:"stripe_retrieve_source",section_anchor:"sources",subsection_anchors:null,path:"/deprecated/sources/retrieve_source",gate:!1,data:{section_type:"method",title:"Retrieve a Source",deprecated:!0,description:"Retrieve a [Source](/api#sources) using its unique ID and client secret.\n",signature:{object_name:"stripe",method_name:"retrieveSource",args:[{name:"source",required:!0,validation:"object",documentation:"An object containing the unique ID and client secret for a `Source`.\n\nYou can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys.\n",expanded:!0,subspec:[{name:"id",required:!0,validation:"string",documentation:"Unique identifier of the `Source`.\n"},{name:"client_secret",required:!0,validation:"string",documentation:"A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client.\n"}]}]},table_content:{items:[{name:"source",required:!0,validation:"object",documentation:"An object containing the unique ID and client secret for a `Source`.\n\nYou can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys.\n",expanded:!0,subspec:[{name:"id",required:!0,validation:"string",documentation:"Unique identifier of the `Source`.\n"},{name:"client_secret",required:!0,validation:"string",documentation:"A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client.\n"}]}]},request:{title:"Retrieve a Source",snippets:{js:"stripe\n .retrieveSource({\n id: '{SOURCE_ID}',\n client_secret: '{SOURCE_CLIENT_SECRET}',\n })\n .then(function(result) {\n // Handle result.error or result.source\n });\n",es_next:"const {source, error} = await stripe.retrieveSource({\n id: '{{SOURCE_ID}}',\n client_secret: '{{SOURCE_CLIENT_SECRET}}',\n});\n"}},returns:"This method returns a `Promise` which resolves with a result object.\nThis object has either:\n\n* `result.source`: a [Source](/api#sources) was retrieved successfully.\n* `result.error`: there was an error.\n This includes client-side validation errors.\n Refer to the [API reference](/api#errors) for all possible errors.\n",section_tag:"stripe_retrieve_source"},display_on_load:!0}},fuseWebWorkerPath:"/apiRefFuseWebWorker.js",accountSwitcherData:{user:null,login_url:"https://dasard.stripe.com/login?redirect=https%3A%2F%2Fdocs.stripe.com%2Fjs",dasard_host:"https://dasard.stripe.com"},cookieEnforcementMode:"restricted",hiddenRefs:[],locale:"en-US"},APIDocs.load(window.INITIAL_STATE)