Stripe(publishableKey,options?)
stripe.elements(options?)
stripe.elements(options?)
elements.update(options)
elements.on('update-end',handler)
elements.submit()
elements.create('payment',options?)
with customized fields
Option parameter
fields object
Pass an object to specify payment
fields
you don't want to collect with the Payment Element.Hide fields properties
billingDetails 'never' | 'auto' | object
Specify
never
to avoid collecting all billing details in the Payment Element. If you would like to disable only certain billing details, pass an object specifying which fields you would like to disable collection for. The default setting for each field or object isauto
.Hide billingDetails properties
name 'never' | 'auto'
email 'never' | 'auto'
phone 'never' | 'auto'
address 'never' | 'if_required' | 'auto' | object
Specify
if_required
to collect only billing address fields required to complete the payment. You can omit and hide optional address fields in the card form, such as country and postal code. This differs from thenever
option, where you don't need to include fields omitted in the Payment Element when confirming the payment. Useif_required
to collect only the minimum address information required for the payment method. This can reduce the amount of information required to complete the form.Disabling address collection can negatively impact authorization rates and network fees for users on a network cost plus pricing plan.
Show address properties
// Customize which fields are collected by the Payment Element
var paymentElement = elements.create('payment', {
fields: {
billingDetails: {
name: 'never',
email: 'never',
}
}
});
// If you disable collecting fields in the Payment Element, you
// must pass equivalent data when calling `stripe.confirmPayment`.
form.addEventListener('submit', async (event) => {
stripe.confirmPayment({
elements,
confirmParams: {
return_url: 'https://example.com',
payment_method_data: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny.rosen@example.com',
}
},
},
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
});
elements.getElement('payment')
element.update(options)
elements.fetchUpdates()
element.collapse()
elements.create('expressCheckout',options?)
elements.getElement('expressCheckout')
element.update(options)
expressCheckoutElement.on('click',handler)
expressCheckoutElement.on('confirm',handler)
expressCheckoutElement.on('cancel',handler)
expressCheckoutElement.on('shippingaddresschange',handler)
expressCheckoutElement.on('shippingratechange',handler)
elements.create('linkAuthentication',options?)
elements.getElement('linkAuthentication')
elements.create('address',options)
elements.getElement('address',options?)
element.update(options)
element.getValue()
elements.create('issuingCardNumberDisplay',options)
elements.create('card',options?)
elements.getElement(type)
card.update(options)
element.mount(domElement)
element.blur()
element.clear()
element.destroy()
element.focus()
element.unmount()
paymentElement.on('change',handler)
element.on('ready',handler)
element.on('focus',handler)
element.on('blur',handler)
element.on('escape',handler)
expressCheckoutElement.on('click',handler)
element.on('loaderror',handler)
element.on('loaderstart',handler)
cardElement.on('networkschange',handler)
Deprecated
stripe.initEmbeddedCheckout(options)
checkout.mount(domElement)
checkout.unmount()
checkout.destroy()
stripe.initCheckout(options?)
checkout.session()
checkout.applyPromotionCode(promotionCode)
checkout.removePromotionCode()
checkout.updateShippingAddress(shippingAddress)
checkout.updateBillingAddress(billingAddress)
checkout.updateEmail(email)
checkout.updatePhoneNumber(phoneNumber)
checkout.updateLineItemQuantity(options)
checkout.updateShippingOption(shippingOption?)
checkout.confirm(options?)
checkout.runServerUpdate(userFunction)
checkout.on('change',handler)
checkout.changeAppearance(appearance)
checkout.getElement('payment',...args?)
checkout.createElement('payment',options?)
applyPromotionCode(promotionCode)
removePromotionCode()
updateShippingAddress(shippingAddress)
updateBillingAddress(billingAddress)
updateEmail(email)
updatePhoneNumber(phoneNumber)
updateLineItemQuantity(options)
updateShippingOption(shippingOption?)
confirm(options?)
runServerUpdate(userFunction)
stripe.confirmPayment(options)
stripe.confirmCardPayment(clientSecret,data?,options?)
with payment data from an Element
Use stripe.confirmCardPayment
with payment data from an Element
by passing a card
or cardNumber
Element as payment_method[card]
in the
data argument.
The new PaymentMethod
will be created with data collected by the Element
and will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by a
card
orcardNumber
Element.Hide payment_method properties
card required Element
Uses the provided
card
orcardNumber
Element for confirmation.billing_
details recommended objectThe billing_details associated with the card.
stripe
.confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
card: cardElement,
billing_details: {
name: 'Jenny Rosen',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
Use stripe.confirmCardPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe
.confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing token
For backwards compatibility, you can convert an existing Token
into a PaymentMethod
with stripe.confirmCardPayment
by passing the Token
to payment_method[card][token]
.
The newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using an existing token.
Hide payment_method properties
card required object
billing_
details recommended objectThe billing_details associated with the card.
stripe
.confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
card: {
token: 'tok_visa',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmCardPayment
without passing in any additional data.
stripe
.confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmUsBankAccountPayment(clientSecret,data?)
with an existing PaymentMethod
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmUsBankAccountPayment
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmUsBankAccountPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with an attached PaymentMethod
If you have successfully called stripe.collectBankAccountForPayment
or attached a PaymentMethod
to this PaymentIntent
already, then you can confirm the PaymentIntent
without passing in any additional data.
stripe.confirmUsBankAccountPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with self collected bank account information
If you already know the customer’s bank account information, or want to collect it yourself, you can pass them in directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
is required. Providingemail
allows your customer to receive ACH Direct Debit mandate and microdeposit emails.us_
bank_ required Objectaccount The customer's bank account information.
Hide us_bank_account properties
account_
number required stringThe customer’s bank account number.
routing_
number required stringThe routing number of the customer’s bank.
account_
holder_ required stringtype Account holder type: individual or company.
account_
type stringAccount type: checkings or savings. Defaults to checking if omitted.
stripe.confirmUsBankAccountPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
us_bank_account: {
routing_number: '110000000',
account_number: '000123456789',
account_holder_type: 'individual',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
stripe.confirmAcssDebitPayment(clientSecret,data?,options?)
with a new PaymentMethod
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the PaymentIntent
.
You are required to collect and include the customer’s name and email address. This method loads an on-page modal UI
that handles bank account details collection and verification, presents a hosted mandate agreement and collects authorization for you.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe.confirmAcssDebitPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with an existing PaymentMethod
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmAcssDebitPayment
.
This method loads an on-page modal UI that only presents a hosted mandate agreement and collects authorization for you.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmAcssDebitPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
without passing in any additional data.
This method loads an on-page modal UI that only presents a hosted mandate agreement and collects authorization for you.
stripe.confirmAcssDebitPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with self collected bank account information
If you already know the customer’s bank account information, or want to collect it yourself, you can pass them in directly to create a new PaymentMethod
and confirm the PaymentIntent
.
In this case, this method does not load the on-page modal UI, so you will need to build your own mandate agreement page.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.acss_
debit required ObjectThe customer's bank account information.
stripe.confirmAcssDebitPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
acss_debit: {
institution_number: '000',
transit_number: '11000',
account_number: '000123456789',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
with an existing PaymentMethod but skip mandate display
If you have already created a PaymentMethod
and built your own mandate agreement page,
you can reuse it by passing its id
to payment_method
when calling stripe.confirmAcssDebitPayment
and skip the on-page modal UI at the same time.
Data and options argument paramters
data object
Data to be sent with the request.
Hide data properties
payment_
method required stringThe
id
of an existing PaymentMethod.
options object
stripe.confirmAcssDebitPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
},
{
skipMandate: true,
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on PaymentIntent's status.
console.log("PaymentIntent ID: " + result.paymentIntent.id);
console.log("PaymentIntent status: " + result.paymentIntent.status);
}
});
stripe.confirmAffirmPayment(clientSecret,data?,options?)
without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details recommended objectThe billing_details associated with the payment.
Show billing_details properties
shipping required object
The shipping details for the payment.
Show shipping properties
return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmAffirmPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
}
},
shipping: {
name: 'Jenny Rosen',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existingPaymentMethod
.shipping required object
The shipping details for the payment.
Show shipping properties
return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmAffirmPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
shipping: {
name: 'Jenny Rosen',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmAffirmPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmAfterpayClearpayPayment(clientSecret,data?,options?)
without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment.
Show billing_details properties
shipping recommended object
The shipping details for the payment.
Show shipping properties
return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmAfterpayClearpayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
}
},
shipping: {
name: 'Jenny Rosen',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmAfterpayClearpayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmAfterpayClearpayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmAlipayPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
stripe.confirmAlipayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmAlipayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
With an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmAlipayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmAuBecsDebitPayment(clientSecret,data?)
with payment data from an Element
Create and attach a new PaymentMethod with stripe.confirmAuBecsDebitPayment
by passing an auBankAccount
Element to payment_method[au_becs_debit]
.
The new PaymentMethod
will be created with the data collected by the Element
and will be used to confirm the PaymentIntent
.
Additionally, to create a BECS Direct Debit PaymentMethod
, you are required to collect and include the account holder's name and the customer's email address.
Data argument properties
payment_
method required objectPass an
object
to confirm the payment using data collected by anauBankAccount
Element.Hide payment_method properties
au_
becs_ required Elementdebit An
auBankAccount
Element.billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmAuBecsDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
au_becs_debit: auBankAccountElement,
billing_details: {
name: 'John Smith',
email: 'john.smith@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with self collected data
If you already know the customer’s BSB number and bank account number or want to collect it yourself, then you do not need to use the auBankAccount
Element with stripe.confirmAuBecsDebitPayment
.
You can pass in the customer’s bank account information directly to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a BECS Direct Debit PaymentMethod
, you are required to collect and include the account holder's name and the customer's email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected without an
Element
.Hide payment_method properties
au_
becs_ required objectdebit billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmAuBecsDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
au_becs_debit: {
bsb_number: '000000',
account_number: '000123456'
},
billing_details: {
name: 'John Smith',
email: 'john.smith@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmAuBecsDebitPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe
.confirmAuBecsDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmAuBecsDebitPayment
without passing in any additional data.
stripe
.confirmAuBecsDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmBancontactPayment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmBancontactPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existingPaymentMethod
.return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this Bancontact payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmBancontactPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with collected data
Your customer's name is required for the Bancontact authorization to succeed.
You can pass in the customer’s name directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm with the customer's name.
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this Bancontact payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmBancontactPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
billing_details: {
name: 'Jenny Rosen',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmBancontactPayment
without passing in any additional data.
stripe
.confirmBancontactPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmBlikPayment(clientSecret,data,options?)
stripe.confirmBoletoPayment(clientSecret,data?,options?)
with collected data
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a Boleto PaymentMethod
, you are required to collect and include the customer’s name, email, Brazilian tax id (CPF/CNPJ) and address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
boleto required Object
billing_
details required ObjectThe customer's billing_details.
name
,email
andaddress
.Hide billing_details properties
name required string
The customer's name. The first and last name must be at minimum 2 characters each.
email required string
The customer's email.
address required string
The customer's address: street name, city, state and postal code
Hide address properties
line1 required string
The customer's address line 1 (e.g. street or company name).
line2 string
The customer's address line 2 (e.g. apartment, suite, unit, or building).
city required string
The customer's address city (e.g. Sao Paulo).
state required string
The customer's address state (e.g. SP).
postal_
code required stringThe customer's CEP (i.e. Brazilian postal code). Must be 8 digits long.
country required string
Must be BR.
stripe.confirmBoletoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
boleto: {
tax_id: '000.000.000-00'
},
billing_details: {
name: 'Fulaninho de Silva',
email: 'fulaninho@example.com',
address: {
line1: '1234 Avenida Paulista',
city: 'Sao Paulo',
state: 'SP',
postal_code: '01310100',
country: 'BR',
},
},
},
},
{
handleActions: false,
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmBoletoPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmBoletoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
},
{
handleActions: false,
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmBoletoPayment
without passing in any additional data.
stripe.confirmBoletoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{},
{
handleActions: false,
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmCustomerBalancePayment(clientSecret,data?,options?)
with collected data
You can pass in the customer’s bank transfer funding details to create a new PaymentMethod
and confirm the PaymentIntent
.
If the Customer Balance was not enough to pay the amount, the status
is requires_action
. The paymentIntent.next_action.display_bank_transfer_instructions
hash contains bank transfer details for funding the Customer Balance.
Data argument properties
payment_
method required objectpayment_
method_ objectoptions Additional payment-specific configuration options.
Hide payment_method_options properties
funding_
type stringThe funding method type to be used when there are not enough funds in the Customer Balance. Permitted values include:
bank_transfer
.bank_
transfer objectThe customer's chosen bank transfer method.
Show bank_transfer properties
stripe.confirmCustomerBalancePayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
customer_balance: {
},
},
payment_method_options: {
customer_balance: {
funding_type: 'bank_transfer',
bank_transfer: {
type: 'us_bank_account',
},
},
},
},
{
handleActions: false,
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'requires_payment_method') {
// If `payment_method_options.funding_type` wasn't set this
// is where you would need to handle the insufficient customer
// balance state.
} else if (paymentIntent.status === 'requires_action') {
// If the current customer balance is insufficient to cover
// the amount, and you've passed
// `payment_method_options.funding_type` for funding the
// customer balance, you can display the bank transfer
// instructions to your user.
if (paymentIntent.next_action.type === 'display_bank_transfer_instructions') {
// Bank transfer details can be found under:
// paymentIntent.next_action.display_bank_transfer_instructions
}
}
});
stripe.confirmCashappPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
stripe.confirmCashappPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
type: 'cashapp',
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmCashappPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmCashappPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
stripe.confirmEpsPayment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmEpsPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
stripe
.confirmEpsPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with collected data
Your customer's name is required for the EPS authorization to succeed.
You can pass in the customer’s name directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
stripe
.confirmEpsPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
billing_details: {
name: 'Jenny Rosen',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmEpsPayment
without passing in any additional data.
stripe
.confirmEpsPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmFpxPayment(clientSecret,data?,options?)
with payment data from an Element
Create and attach a new PaymentMethod by passing an fpxBank
Element to payment_method[fpx]
.
The new PaymentMethod
will be created with the bank code collected by the Element
and will be used to confirm the PaymentIntent
.
Data argument properties
stripe.confirmFpxPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
fpx: fpxBankElement
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmFpxPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
with self collected data
If you already know the customer’s bank or want to collect it yourself, then you do not need to use the fpxBank
Element.
You can pass in the customer’s bank code directly.
Data argument properties
stripe
.confirmFpxPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
fpx: {
bank: 'ambank',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmFpxPayment
without passing in any additional data.
stripe.confirmFpxPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmGiropayPayment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmGiropayPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
stripe
.confirmGiropayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with collected data
Your customer's name is required for the giropay authorization to succeed.
You can pass in the customer’s name directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
stripe
.confirmGiropayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
billing_details: {
name: 'Jenny Rosen',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmGiropayPayment
without passing in any additional data.
stripe
.confirmGiropayPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmGrabPayPayment(clientSecret,data?,options?)
with a new PaymentMethod
You can confirm the PaymentIntent
using stripe.confirmGrabPayPayment
without
passing in any additional data. This will automatically create and attach a new
PaymentMethod
.
stripe
.confirmGrabPayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing PaymentMethod
Use stripe.confirmGrabPayPayment
with an existing PaymentMethod
by passing its
id
to payment_method
. The PaymentMethod
will be used to confirm the
PaymentIntent
.
stripe
.confirmGrabPayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, you can then
confirm the PaymentIntent
using stripe.confirmGrabPayPayment
without passing in
any additional data.
stripe
.confirmGrabPayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmIdealPayment(clientSecret,data?,options?)
with payment data from an Element
Create and attach a new PaymentMethod
with stripe.confirmIdealPayment
by passing an idealBank
Element to payment_method[ideal]
.
The new PaymentMethod
will be created with the bank code collected by the Element
and will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by an
idealBank
Element.Hide payment_method properties
ideal recommended Element
An
idealBank
Element.billing_
details objectThe customer's billing_details. Required when
setup_future_usage
is set tooff_session
.Show billing_details properties
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this iDEAL payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmIdealPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
ideal: idealBankElement,
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
Use stripe.confirmIdealPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existingPaymentMethod
.return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this iDEAL payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmIdealPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with self collected data
If you already know the customer’s bank or want to collect it yourself, then you do not need to use the idealBank
Element.
You can pass in the customer’s bank code directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by an
idealBank
Element.Hide payment_method properties
ideal required object
An object detailing the customer's iDEAL bank.
Hide ideal properties
bank required string
The customer's bank.
billing_
details objectThe customer's billing_details. Required when
setup_future_usage
is set tooff_session
.Show billing_details properties
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this iDEAL payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmIdealPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
ideal: {
bank: 'abn_amro',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmIdealPayment
without passing in any additional data.
stripe
.confirmIdealPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmKlarnaPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
stripe.confirmKlarnaPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
address: {
country: 'DE',
},
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmKlarnaPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
With an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmKlarnaPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmKonbiniPayment(clientSecret,data?,options?)
with collected data
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a Konbini PaymentMethod
, you are required to collect and include the customer’s name and email.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
payment_
method_ Objectoptions An object containing payment-method-specific configuration to confirm the PaymentIntent with.
Show payment_method_options properties
stripe.confirmKonbiniPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: '花子山田',
email: 'yamada.hanako@example.com',
},
},
payment_method_options: {
konbini: {
confirmation_number: '08012341234',
},
},
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmKonbiniPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.payment_
method_ Objectoptions An object containing payment-method-specific configuration to confirm the PaymentIntent with.
Show payment_method_options properties
stripe.confirmKonbiniPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
payment_method_options: {
konbini: {
confirmation_number: '08012341234',
},
},
},
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmKonbiniPayment
without passing in any additional data.
Data argument properties
payment_
method_ Objectoptions An object containing payment-method-specific configuration to confirm the PaymentIntent with.
Show payment_method_options properties
stripe.confirmKonbiniPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method_options: {
konbini: {
confirmation_number: '08012341234',
},
},
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmMbWayPayment(clientSecret,data?,options?)
without an existing payment method
If you haven't already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
is used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment. A phone number is required for all MB WAY payments.
Show billing_details properties
stripe.confirmMbWayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
phone: '+351911111111'
}
}
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you've already created a PaymentMethod
, you can pass its id
to payment_method
, which is used to confirm the PaymentIntent
.
stripe.confirmMbWayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}'
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you've already attached a PaymentMethod
to this PaymentIntent
, you can confirm it without passing in any additional data.
stripe
.confirmMbWayPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmMobilepayPayment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmMobilepayPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
stripe
.confirmMobilepayPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmMobilepayPayment
without passing in any additional data.
stripe
.confirmMobilepayPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmMultibancoPayment(clientSecret,data?,options?)
with collected data
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a Multibanco PaymentMethod
, you are required to collect and include the customer’s email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
email
is required.
stripe.confirmMultibancoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
email: 'jenny@example.com',
},
},
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmMultibancoPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmMultibancoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmMultibancoPayment
without passing in any additional data.
stripe.confirmMultibancoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmOxxoPayment(clientSecret,data?,options?)
with collected data
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a OXXO PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe.confirmOxxoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Fulano de Tal',
email: 'fulano@example.com',
},
},
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmOxxoPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmOxxoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmOxxoPayment
without passing in any additional data.
stripe.confirmOxxoPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmP24Payment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmP24Payment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
stripe
.confirmP24Payment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with collected data
Your customer's email address is required for the Przelewy24 authorization to succeed.
You can pass in the customer’s email address directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
stripe
.confirmP24Payment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
billing_details: {
email: 'jenny.rosen@example.com',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmP24Payment
without passing in any additional data.
stripe
.confirmP24Payment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmPayNowPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details recommended objectThe billing_details associated with the payment method.
stripe.confirmPayNowPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: '{NAME}',
email: '{EMAIL}'
},
},
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmPayNowPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmPayNowPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
stripe.confirmPayPalPayment(clientSecret,data?)
with a new PaymentMethod
You can confirm the PaymentIntent
using stripe.confirmPayPalPayment
without
passing in any additional data. This will automatically create and attach a new
PaymentMethod
.
stripe
.confirmPayPalPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
Use stripe.confirmPayPalPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
stripe
.confirmPayPalPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmPayPalPayment
without passing in any additional data.
stripe
.confirmPayPalPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/checkout/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmPayToPayment(clientSecret,data?,options?)
without an existing payment method
If you haven't already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
is used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment. The email is required if the customer is paying with PayID.
Show billing_details properties
payto required object
The PayTo payment method details associated with the customer's bank account. Either
pay_id
oraccount_number
andbsb_number
must be provided.Show payto properties
stripe.confirmPayToPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
// Email is only required if `pay_id` is used
email: 'jenny@example.com'
},
payto: {
pay_id: 'jenny@example.com'
// Alternatively, provide bank account details
account_number: '000123456',
bsb_number: '000000'
}
}
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you've already created a PaymentMethod
, you can pass its id
to payment_method
, which is used to confirm the PaymentIntent
.
stripe.confirmPayToPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}'
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you've already attached a PaymentMethod
to this PaymentIntent
, you can confirm it without passing in any additional data.
stripe
.confirmPayToPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmPixPayment(clientSecret,data?,options?)
without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
stripe.confirmPixPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {},
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmPixPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmPixPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmPromptPayPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details recommended objectThe billing_details associated with the payment method.
stripe.confirmPromptPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: '{NAME}',
email: '{EMAIL}'
},
},
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmPromptPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmPromptPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
stripe.confirmSepaDebitPayment(clientSecret,data?)
with payment data from an Element
Create and attach a new PaymentMethod with stripe.confirmSepaDebitPayment
by passing an iban
Element to payment_method[sepa_debit]
.
The new PaymentMethod
will be created with the data collected by the Element
and will be used to confirm the PaymentIntent
.
Additionally, to create a SEPA Direct Debit PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an
object
to confirm the payment using data collected by aniban
Element.Hide payment_method properties
sepa_
debit required ElementAn
iban
Element.billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmSepaDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
sepa_debit: ibanElement,
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with self collected data
If you already know the customer’s IBAN account number or want to collect it yourself, then you do not need to use the iban
Element with stripe.confirmSepaDebitPayment
.
You can pass in the customer’s account number directly to create a new PaymentMethod
and confirm the PaymentIntent
.
To create a SEPA Direct Debit PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected without an
Element
.Hide payment_method properties
sepa_
debit required objectbilling_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmSepaDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
sepa_debit: {
iban: 'DE89370400440532013000',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmSepaDebitPayment
.
It will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe
.confirmSepaDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.paymentIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmSepaDebitPayment
without passing in any additional data.
stripe
.confirmSepaDebitPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmSofortPayment(clientSecret,data?,options?)
with an existing payment method
Use stripe.confirmSofortPayment
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required stringThe
id
of an existingPaymentMethod
.return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this SOFORT payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmSofortPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
// Inform the customer that there was an error.
});
with collected data
The country of your customer's bank is required for the Sofort authorization to succeed.
You can pass in the country of your customer's bank directly to create a new PaymentMethod
and confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass an object to confirm with the customer's name.
Hide payment_method properties
sofort required object
billing_
details objectThe customer's billing_details. Required when
setup_future_usage
is set tooff_session
.Show billing_details properties
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
setup_
future_ stringusage To set up a SEPA Direct Debit payment method using the bank details from this SOFORT payment, set this parameter to
off_session
. When using this parameter, acustomer
will need to be set on the PaymentIntent. The newly created SEPA Direct Debit PaymentMethod will be attached to this customer.
stripe
.confirmSofortPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: {
sofort: {
country: 'DE'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm the PaymentIntent
using stripe.confirmSofortPayment
without passing in any additional data.
stripe
.confirmSofortPayment('{PAYMENT_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.paymentIntent
});
stripe.confirmTwintPayment(clientSecret,data?,options?)
without an existing payment method
If you haven't already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
is used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment.
Show billing_details properties
shipping recommended object
The shipping details for the payment.
Show shipping properties
return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmTwintPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
}
},
shipping: {
name: 'Jenny Rosen',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you've already created a PaymentMethod
, you can pass its id
to payment_method
, which is used to confirm the PaymentIntent
.
stripe.confirmTwintPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you've already attached a return_url
and a PaymentMethod
to this PaymentIntent
, you can confirm it without passing in any additional data.
stripe.confirmTwintPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmWechatPayPayment(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details recommended objectThe billing_details associated with the payment method.
stripe.confirmWechatPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: '{NAME}',
email: '{EMAIL}'
},
wechat_pay: {},
},
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmWechatPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
With an attached PaymentMethod
If you have already attached a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmWechatPayPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{}
).then(function({error, paymentIntent}) {
if (error) {
// Inform the customer that there was an error.
} else if (paymentIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (paymentIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
stripe.confirmZipPayment(clientSecret,data?,options?)
without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the PaymentIntent
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment.
Show billing_details properties
shipping recommended object
The shipping details for the payment.
Show shipping properties
return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmZipPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
}
},
shipping: {
name: 'Jenny Rosen',
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
country: 'US',
postal_code: '94321'
}
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
and it will be used to confirm the PaymentIntent
.
stripe.confirmZipPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(result) {
// Inform the customer that there was an error.
});
with an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this PaymentIntent
, then you can confirm without passing in any additional data.
stripe.confirmZipPayment(
'{PAYMENT_INTENT_CLIENT_SECRET}'
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.retrievePaymentIntent(clientSecret)
stripe.verifyMicrodepositsForPayment(clientSecret,data?)
stripe.createRadarSession()
stripe.handleNextAction(options)
stripe.handleCardAction(clientSecret)
stripe.collectBankAccountForPayment(options)
stripe.confirmSetup(options)
stripe.confirmCardSetup(clientSecret,data?,options?)
with payment data from an Element
Use stripe.confirmCardSetup
with payment data from an Element by passing a card
or cardNumber
Element
to payment_method[card]
.
The new PaymentMethod
will be created with data collected by the Element
and will be used to confirm the SetupIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by a
card
orcardNumber
Element.Hide payment_method properties
card required Element
Uses the provided
card
orcardNumber
Element for confirmation.billing_
details recommended objectThe billing_details associated with the card.
stripe
.confirmCardSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
card: cardElement,
billing_details: {
name: 'Jenny Rosen',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing payment method
Use stripe.confirmCardSetup
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the SetupIntent
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe
.confirmCardSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing token
For backwards compatibility, you can convert an existing Token
into a PaymentMethod
with stripe.confirmCardSetup
by passing the Token
to payment_method[card][token]
.
The newly created PaymentMethod
will be used to confirm the PaymentMethod
.
Data argument properties
payment_
method required objectPass an object to confirm using an existing token.
Hide payment_method properties
card required object
billing_
details recommended objectThe billing_details associated with the card.
stripe
.confirmCardSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
card: {
token: 'tok_visa',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this SetupIntent
, then you can confirm the SetupIntent
using stripe.confirmCardSetup
without passing in any additional data.
stripe
.confirmCardSetup('{SETUP_INTENT_CLIENT_SECRET}')
.then(function(result) {
// Handle result.error or result.setupIntent
});
stripe.confirmUsBankAccountSetup(clientSecret,data?)
with an existing PaymentMethod
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmUsBankAccountSetup
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmUsBankAccountSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with an attached PaymentMethod
If you have successfully called stripe.collectBankAccountForSetup
or attached a PaymentMethod
to this SetupIntent
already, then you can confirm the SetupIntent
without passing in any additional data.
stripe.confirmUsBankAccountSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with self collected bank account information
If you already know the customer’s bank account information, or want to collect it yourself, you can pass them in directly to create a new PaymentMethod
and confirm the SetupIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
is required. Providingemail
allows your customer to receive ACH Direct Debit mandate and microdeposit emails.us_
bank_ required Objectaccount The customer's bank account information.
Hide us_bank_account properties
account_
number required stringThe customer’s bank account number.
routing_
number required stringThe routing number of the customer’s bank.
account_
holder_ required stringtype Account holder type: individual or company.
account_
type stringAccount type: checkings or savings. Defaults to checking if omitted.
stripe.confirmUsBankAccountSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: {
us_bank_account: {
routing_number: '110000000',
account_number: '000123456789',
account_holder_type: 'individual',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
stripe.confirmAcssDebitSetup(clientSecret,data?,options?)
with a new PaymentMethod
You can pass in the customer’s billing details to create a new PaymentMethod
and confirm the SetupIntent
.
You are required to collect and include the customer’s name and email address. This method loads an on-page modal UI
that handles bank account details collection and verification, presents a hosted mandate agreement and collects authorization for you.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe.confirmAcssDebitSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with an existing PaymentMethod
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmAcssDebitSetup
.
This method loads an on-page modal UI that only presents a hosted mandate agreement and collects authorization for you.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.
stripe.confirmAcssDebitSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this SetupIntent
, then you can confirm the SetupIntent
without passing in any additional data.
This method loads an on-page modal UI that only presents a hosted mandate agreement and collects authorization for you.
stripe.confirmAcssDebitSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with self collected bank account information
If you already know the customer’s bank account information, or want to collect it yourself, you can pass them in directly to create a new PaymentMethod
and confirm the SetupIntent
.
In this case, this method does not load the on-page modal UI, so you will need to build your own mandate agreement page.
Data argument properties
payment_
method required objectPass an object to confirm using data collected.
Hide payment_method properties
billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.acss_
debit required ObjectThe customer's bank account information.
stripe.confirmAcssDebitSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: {
acss_debit: {
institution_number: '000',
transit_number: '11000',
account_number: '000123456789',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
with an existing PaymentMethod but skip mandate display
If you have already created a PaymentMethod
and built your own mandate agreement page,
you can reuse it by passing its id
to payment_method
when calling stripe.confirmAcssDebitSetup
and skip the on-page modal UI at the same time.
Data and options argument paramters
data object
Data to be sent with the request.
Hide data properties
payment_
method required stringThe
id
of an existing PaymentMethod.
options object
stripe.confirmAcssDebitSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
},
{
skipMandate: true,
}
).then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else {
// Handle next step based on SetupIntent's status.
console.log("SetupIntent ID: " + result.setupIntent.id);
console.log("SetupIntent status: " + result.setupIntent.status);
}
});
stripe.confirmAuBecsDebitSetup(clientSecret,data?)
with payment data from an Element
Create and attach a new PaymentMethod
with stripe.confirmAuBecsDebitSetup
by passing an auBankAccount
Element to payment_method[au_becs_debit]
.
The new PaymentMethod
will be created with the data collected by the Element
and will be used to confirm the SetupIntent
.
Additionally, to create a BECS Direct Debit PaymentMethod
, you are required to collect and include the account holder's name and the customer’s email address.
Data argument properties
payment_
method required objectPass an
object
to confirm using data collected by anauBankAccount
Element.Hide payment_method properties
au_
becs_ required Elementdebit An
auBankAccount
Element.billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmAuBecsDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
au_becs_debit: auBankAccountElement,
billing_details: {
name: 'John Smith',
email: 'john.smith@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmAuBecsDebitSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmAuBecsDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with self collected data
If you already know the customer’s BSB number and bank account number or want to collect it yourself, then you do not need to use the auBankAccount
Element.
You can pass in the customer’s bank account information directly to create a new PaymentMethod
and confirm the SetupIntent
.
Additionally, to create a BECS Direct Debit PaymentMethod
, you are required to collect and include the account holder's name and the customer's email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected without an
Element
.Hide payment_method properties
au_
becs_ required objectdebit billing_
details required objectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmAuBecsDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
au_becs_debit: {
bsb_number: '000000',
account_number: '000123456'
},
billing_details: {
name: 'John Smith',
email: 'john.smith@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
stripe.confirmBacsDebitSetup(clientSecret,data?)
with self collected data
You can also pass in the customer’s bank account information directly to create a new PaymentMethod
and confirm the SetupIntent
.
Additionally, to create a Bacs Direct Debit PaymentMethod
, you are required to collect and include the account holder's name and the customer's email address.
Data argument properties
payment_
method required objectPass an object to confirm using payment method data.
Hide payment_method properties
bacs_
debit required objectbilling_
details required objectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmBacsDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
bacs_debit: {
sort_code: '108800',
account_number: '000123456'
},
billing_details: {
address: {
line1: addressLine1,
city: addressCity,
country: addressCountry,
postal_code: addressPostalCode,
},
email: customerEmail,
name: customerName,
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmBacsDebitSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmBacsDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
stripe.confirmBancontactSetup(clientSecret,data?,options?)
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmBancontactSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmBancontactSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with self collected data
Your customer's name and email are required for the Bancontact authorization to succeed.
You can pass in these properties directly to create a new PaymentMethod
and confirm the SetupIntent
.
Data argument properties
payment_
method required objectPass an object to confirm with the customer's name and email.
Hide payment_method properties
billing_
details required objectThe customer's billing_details.
name
andemail
are required.
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
stripe
.confirmBancontactSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmCashappSetup(clientSecret,data?,options?)
Without an existing payment method
If you have not already created a PaymentMethod
, you can pass payment method parameters, and the newly created PaymentMethod
will be used to confirm the SetupIntent
.
stripe.confirmCashappSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: {
type: 'cashapp',
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function(error, setupIntent) {
if (error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else if (setupIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (setupIntent.status === 'requires_action'){
// Inform the customer that the payment did not go through
}
});
with an existing PaymentMethod
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmCashappSetup
.
Data argument properties
payment_
method required stringThe
id
of an existing PaymentMethod.return_
url required stringThe url your customer will be directed to after they complete authentication.
stripe.confirmCashappSetup(
'{SETUP_INTENT_CLIENT_SECRET}',
{
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href
}
).then(function({error, setupIntent}) {
if (error) {
// Inform the customer that there was an error.
console.log(result.error.message);
} else if (setupIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (setupIntent.status === 'requires_action'){
// Inform the customer that the payment did not go through
}
});
with an attached PaymentMethod
If you have already attached a return_url
and a PaymentMethod
to this SetupIntent
, then you can confirm without passing in any additional data.
stripe.confirmCashappSetup(
'{SETUP_INTENT_CLIENT_SECRET}'
).then(function({setupIntent, error}) {
if (error) {
// Inform the customer that there was an error.
} else if (setupIntent.status === 'succeeded') {
// Inform the customer that the payment was successful
} else if (setupIntent.status === 'requires_action') {
// Inform the customer that the payment did not go through
}
});
stripe.confirmIdealSetup(clientSecret,data?,options?)
with payment data from an Element
Create and attach a new SEPA Direct Debit PaymentMethod
with stripe.confirmIdealSetup
by passing an idealBank
Element to payment_method[ideal]
.
The new PaymentMethod
will be created with the data collected by the Element
and will be used to confirm the SetupIntent
.
Additionally, to create a SEPA Direct Debit PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by an
idealBank
Element.Hide payment_method properties
ideal required Element
An
idealBank
Element.billing_
details required objectThe customer's billing_details.
name
andemail
are required.
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
stripe
.confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
ideal: idealBankElement,
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmIdealSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with self collected data
If you already know the customer’s bank or want to collect it yourself, then you do not need to use the idealBank
Element.
You can pass in the customer’s bank code directly to create a new PaymentMethod
and confirm the SetupIntent
.
Data argument properties
payment_
method required objectPass an object to confirm using data collected by an
idealBank
Element.Hide payment_method properties
ideal required object
An object detailing the customer's iDEAL bank.
Hide ideal properties
bank required string
The customer's bank.
billing_
details required objectThe customer's billing_details.
name
andemail
are required.
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
stripe
.confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
ideal: {
bank: 'abn_amro',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmPayPalSetup(clientSecret,data?)
with a new PaymentMethod
You can confirm the SetupIntent
using stripe.confirmPayPalSetup
without
passing in any additional data. This will automatically create and attach a new
PaymentMethod
.
stripe
.confirmPayPalSetup('{SETUP_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/setup/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
Use stripe.confirmPayPalSetup
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the SetupIntent
.
stripe
.confirmPayPalPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
// Return URL where the customer should be redirected after the authorization.
return_url: "https://example.com/setup/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this SetupIntent
, then you can confirm the SetupIntent
using stripe.confirmPayPalSetup
without passing in any additional data.
stripe
.confirmPayPalSetup('{SETUP_INTENT_CLIENT_SECRET}', {
// Return URL where the customer should be redirected after
// the authorization.
return_url: "https://example.com/setup/complete",
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmPayToSetup(clientSecret,data?,options?)
with a new PaymentMethod
You can confirm the SetupIntent
using stripe.confirmPayToSetup
without
passing in any additional data. This will automatically create and attach a new
PaymentMethod
.
Data argument properties
payment_
method required objectPass payment method billing details.
Hide payment_method properties
billing_
details required objectThe billing_details associated with the payment. The email is required if the customer is paying with PayID.
Show billing_details properties
payto required object
The PayTo payment method details associated with the customer's bank account. Either
pay_id
oraccount_number
andbsb_number
must be provided.Show payto properties
stripe
.confirmPayToSetup('{SETUP_INTENT_CLIENT_SECRET}', {
{
payment_method: {
billing_details: {
name: 'Jenny Rosen',
// Email is only required if `pay_id` is used
email: 'jenny@example.com'
},
payto: {
pay_id: 'jenny@example.com'
// Alternatively, provide bank account details
account_number: '000123456',
bsb_number: '000000'
}
}
}
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an existing payment method
Use stripe.confirmPayToSetup
with an existing PaymentMethod
by passing its id
to payment_method
.
The PaymentMethod
will be used to confirm the SetupIntent
.
stripe
.confirmPayToPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}'
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
with an attached PaymentMethod
If you have already attached a PaymentMethod
to this SetupIntent
, then you can confirm the SetupIntent
using stripe.confirmPayToSetup
without passing in any additional data.
stripe
.confirmPayToSetup('{SETUP_INTENT_CLIENT_SECRET}')
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
stripe.confirmSepaDebitSetup(clientSecret,data?)
with payment data from an Element
Create and attach a new PaymentMethod
with stripe.confirmSepaDebitSetup
by passing an iban
Element to payment_method[sepa_debit]
.
The new PaymentMethod
will be created with the data collected by the Element
and will be used to confirm the SetupIntent
.
Additionally, to create a SEPA Direct Debit PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an
object
to confirm using data collected by aniban
Element.Hide payment_method properties
sepa_
debit required ElementAn
iban
Element.billing_
details required ObjectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmSepaDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
sepa_debit: ibanElement,
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmSepaDebitSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmSepaDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with self collected data
If you already know the customer’s IBAN account number or want to collect it yourself, then you do not need to use the iban
Element.
You can pass in the customer’s account number directly to create a new PaymentMethod
and confirm the SetupIntent
.
Additionally, to create a SEPA Direct Debit PaymentMethod
, you are required to collect and include the customer’s name and email address.
Data argument properties
payment_
method required objectPass an
object
to confirm using data collected by aniban
Element.Hide payment_method properties
sepa_
debit required objectbilling_
details required objectThe customer's billing_details.
name
andemail
are required.
stripe
.confirmSepaDebitSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
sepa_debit: {
iban: 'DE89370400440532013000',
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
stripe.confirmSofortSetup(clientSecret,data?,options?)
with an existing payment method
If you have already created a PaymentMethod
, you can pass its id
to payment_method
when calling stripe.confirmSofortSetup
and it will be used to confirm the SetupIntent
.
stripe
.confirmSofortSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: '{PAYMENT_METHOD_ID}',
})
.then(function(result) {
// Handle result.error or result.setupIntent
});
with self collected data
Your customer's name, email and the country of their bank are required for the SOFORT authorization to succeed.
You can pass in these properties directly to create a new PaymentMethod
and confirm the SetupIntent
.
Data argument properties
payment_
method required objectPass an object to confirm with the customer's name and email.
Hide payment_method properties
country required string
The country code where customer's bank is located.
billing_
details required objectThe customer's billing_details.
name
andemail
are required.
return_
url recommended stringThe url your customer will be directed to after they complete authentication.
stripe
.confirmSofortSetup('{SETUP_INTENT_CLIENT_SECRET}', {
payment_method: {
sofort: {
country: 'DE'
},
billing_details: {
name: 'Jenny Rosen',
email: 'jenny@example.com',
},
},
// Return URL where the customer should be redirected after the authorization.
return_url: window.location.href,
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});