调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员工具
概览
关于 Stripe 支付
升级您的集成
支付分析
线上付款
概览查找您的用例Managed Payments
使用 Payment Link
构建结账页面
构建高级集成
构建应用内集成
支付方式
添加支付方式
    概览
    支付方式集成选项
    在管理平台中管理默认支付方式
    支付方式类型
    银行卡
    使用 Stripe 余额支付
    加密货币
    银行借记
    银行重定向
      Bancontact
      BLIK
      EPS
      FPX
      iDEAL
      Przelewy24
      Sofort
        移除并更换 SOFORT
        收款
        支付过程中保存银行详情
        设置未来付款
      TWINT
    银行转账
    贷记转账(来源)
    先买后付
    实时付款
    付款凭单
    钱包
    按国家启用本地支付方式
    自定义支付方式
管理支付方式
用 Link 更快结账
支付接口
Payment Links
结账
Web Elements
应用内 Element
支付场景
自定义支付流程
灵活收单
编排
线下支付
Terminal
其他 Stripe 产品
Financial Connections
加密货币
Climate
首页付款Add payment methodsBank redirectsSOFORT

Use Sofort to set up future SEPA Direct Debit payments

Learn how to save bank details from a Sofort payment and charge your customers later with SEPA Direct Debit.

复制页面

警告

SOFORT has been discontinued as of March 31, 2025. For more information, read our support page.

注意

We recommend that you follow the Set up future payments guide. If you’ve already integrated with Elements, see the Payment Element migration guide.

Sofort payments

See Save bank details during payment if you need to accept a payment and save IBAN details.

Sofort is a single use payment method where customers are required to authenticate each payment. With this integration, Stripe charges your customer 1 EUR through Sofort to collect their bank details. After your customer authenticates the payment, Stripe refunds the payment and store your customer’s IBAN in a SEPA Direct Debit payment method. You can then use the SEPA Direct Debit PaymentMethod to accept payments or set up a subscription.

注意

To use Sofort to set up SEPA Direct Debit payments, you must SEPA Direct Debit in the Dashboard. You must also comply with our Sofort Terms of Service and SEPA Direct Debit Terms of Service.

You can use Checkout in setup mode to collect payment details and set up future SEPA Direct Debit payments using Sofort.

Create or retrieve a Customer
Server-side

To set up future SEPA Direct Debit payments using Sofort, you must attach the SEPA Direct Debit payment method to a Customer.

Create a Customer object when your customer creates an account with your business. You can retrieve and use a customer’s stored payment method details later, if you associate the ID of the Customer object with your own internal representation of the customer.

Command Line
cURL
curl -X POST https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

Set up future payments

This guide builds on the foundational set up future payments Checkout integration and describes how to enable Sofort—it shows the differences between setting up future payments for cards and using Sofort.

Enable Sofort as a payment method

When creating a new Checkout Session, you need to add sofort to the list of payment_method_types.

Ruby
Stripe::Checkout::Session.create({ mode: 'setup', payment_method_types: ['card'], payment_method_types: ['card', 'sofort'], customer: customer.id, success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', })

Charge the SEPA Direct Debit PaymentMethod later
Server-side

When you need to charge your customer again, create a new PaymentIntent. Find the ID of the SEPA Direct Debit payment method by retrieving the SetupIntent and expanding the latest_attempt field where you will find the generated_sepa_debit ID inside of payment_method_details.

Command Line
cURL
curl -G https://api.stripe.com/v1/setup_intents/{{SETUP_INTENT_ID}} \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "expand[]"=latest_attempt

Create a PaymentIntent with the SEPA Direct Debit and Customer IDs.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "payment_method_types[]"=sepa_debit \ -d amount=1099 \ -d currency=eur \ -d customer=
{{CUSTOMER_ID}}
\ -d payment_method={{SEPA_DEBIT_PAYMENT_METHOD_ID}} \ -d confirm=true

Test your integration

When testing your Checkout integration, select Sofort as the payment method and click the Pay button.

另见

  • Accept a SEPA Direct Debit payment
  • Set up a subscription with SEPA Direct Debit in the EU
此页面的内容有帮助吗?
是否
需要帮助?联系支持。
加入我们的早期使用计划。
查看我们的更改日志。
有问题?联系销售。
LLM? Read llms.txt.
Powered by Markdoc