Accept a Sofort payment
Learn how to accept Sofort, a common payment method in Europe.
Warning
New businesses can’t accept SOFORT payments and our financial partners are in the process of discontinuing SOFORT. For more information, read our support page.
Sofort is a single use, delayed notification payment method that requires customers to authenticate their payment. Customers pay with Sofort by redirecting from your website to their bank’s portal to authenticate the payment. It typically takes 2 to 14 days to receive notification of success or failure.
Note
To accept Sofort, you must comply with the Sofort Terms of Service.
Set up StripeServer-side![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
First, you need a Stripe account. Register now.
Use our official libraries for access to the Stripe API from your application:
Create a PaymentIntentServer-side![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
A PaymentIntent represents your intent to collect payment from a customer and tracks the lifecycle of the payment process. Create a PaymentIntent
on your server and specify the amount
to collect and the eur
currency (Sofort doesn’t support other currencies). If you have an existing Payment Intents integration, add sofort
to the list of payment method types.
Changing the preferred language![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
By default, Stripe presents the Sofort authorization page in a language based on the specified country code. You can customize this to the language preferred by your customer by specifying it as part of the request and changing the value of the preferred_
property. The supported values are de
, en
, es
, it
, fr
, nl
, and pl
.
Instead of passing the entire PaymentIntent object to your app, return its client secret. The PaymentIntent’s client secret is a unique key that lets you confirm the payment and update payment details on the client, without allowing manipulation of sensitive information, like payment amount.
Submit the payment to StripeClient-side![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
To complete the payment on the client side, provide your client application with the client secret of the PaymentIntent.
Handling the redirect![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
The following URL query parameters are provided when Stripe redirects the customer to the return_
.
Parameter | Description |
---|---|
payment_ | The unique identifier for the PaymentIntent . |
payment_ | The client secret of the PaymentIntent object. |
You may also append your own query parameters when providing the return_
. They persist throughout the redirect process. The return_
should correspond to a page on your website that provides the status of the payment. You should verify the status of the PaymentIntent
when rendering the return page. You can do so by using the retrievePaymentIntent
function from Stripe.js and passing in the payment_
.
(async () => { const url = new URL(window.location); const clientSecret = url.searchParams.get('payment_intent_client_secret'); const {paymentIntent, error} = await stripe.retrievePaymentIntent(clientSecret); if (error) { // Handle error } else if (paymentIntent && paymentIntent.status === 'succeeded') { // Handle successful payment } })();
You can find details about the bank account the customer used to complete the payment under payment_method_details.
"payment_method_details": { "sofort": { "bank_code": "VAPE", "bank_name": "VAN DE PUT & CO", "bics": "VAPEBE22", "country": "DE", "iban_last4": "7061", "preferred_language": "en", "verified_name": "Jenny Rosen", }, "type": "sofort" }
Testing the redirect process![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
When creating a PaymentIntent object using your test API keys, you’ll be redirected to a Stripe page that displays information about the API request and you can either authorize or cancel the payment. Authorizing the payment redirects you to the URL specified in return_
.
Handle post-payment events ![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
As Sofort is a delayed notification payment method, the PaymentIntent’s status remains in a payment_intent.processing state for up to 14 days from its creation (also known as the cutoff date). In test mode, the PaymentIntent’s status remains in the processing state for three minutes to simulate this.
- Stripe recommends fulfilling purchases during the processing state. On average, you can expect approximately 0.2% of Sofort payment attempts to fail after entering the processing state. This only applies to Sofort payments due to its low payment failure rate and doesn’t apply to other delayed notification payment methods.
- You may prefer to fulfill orders only after receiving the payment_intent.succeeded event. Stripe sends this event after the payment attempt is confirmed and the funds are guaranteed.
- If a customer doesn’t pay, Stripe sends the payment_intent.failed event and the PaymentIntent returns to a status of
requires_
.payment_ method
Use the Dashboard, a custom webhook, or a partner solution to receive these events and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.
Manually![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Use the Stripe Dashboard to view all your Stripe payments, send email receipts, handle payouts, or retry failed payments.
Custom code![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Build a webhook handler to listen for events and build custom asynchronous payment flows. Test and debug your webhook integration locally with the Stripe CLI.
Prebuilt apps![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Handle common business events, like automation or marketing and sales, by integrating a partner application.
Disputed payments![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
The risk of fraud or unrecognized payments is low because the customer must authenticate the payment with their bank. As a result, you won’t have disputes that turn into chargebacks, with funds withdrawn from your Stripe account.
Failed attempts![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
If a payment attempt hasn’t been confirmed within the cutoff time, the PaymentIntent object’s status automatically transitions from processing
to requires_
. Additionally, if the funds are received after the cutoff date, the customer is automatically refunded.
On average, you can expect approximately 0.2% of Sofort payment attempts to fail. This may vary based on your industry or customer base. Depending on your average payment amount, the type of products or service you provide, and the risk associated with your business, you may prefer to fulfill orders only after receiving the payment_
event.
Refunds![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Sofort only accepts refund requests within 180 days from the date of the original payment. After 180 days, it’s no longer possible to refund the payment.
You can submit a refund against pending charges that haven’t been confirmed yet. If you create a full or partial refund when a PaymentIntent’s status is processing
, the refund occurs only after the PaymentIntent’s status is succeeded
. If the PaymentIntent’s status is requires_
after a payment attempt fails, full and partial refunds are marked as canceled as the money never left the customer’s bank account.