简体   繁体   English

使用 SetupIntent 和 PaymentIntent 时,是否有与默认源等效的源?

[英]Is there an equivalent to the default source, when using SetupIntent & PaymentIntent?

With the Sources API, every customer had a default_source , but when using SetupIntent (in order to be compliant with the PSD2/SCA directive), there doesn't seem to be any direct equivalent.对于 Sources API,每个客户都有一个default_source ,但是在使用SetupIntent (为了符合 PSD2/SCA 指令),似乎没有任何直接的等价物。

So my question is, how this can be properly represented API-side (without using metadata )?所以我的问题是,如何正确表示 API 端(不使用metadata )?

The payment_methods listing seems to have a property called preferred for the card (which seems to be what I am looking for), but so far I have not found out, how to get/set this property. Payment_methods列表中似乎有一个名为“ preferred card的属性(这似乎是我正在寻找的),但到目前为止我还没有发现如何获取/设置此属性。

There is no direct equivalent to the default_source for Payment Methods and the newer APIs like Setup Intents and Payment Intents.对于 Payment Methods 和较新的 API(如 Setup Intents 和 Payment Intents),没有与default_source直接等效项。 The closest thing is invoice_settings.default_payment_method , but it only applies to Invoices.最接近的是invoice_settings.default_payment_method ,但它只适用于发票。

To answer your question directly, you have three choices:要直接回答您的问题,您有三个选择:

  1. Set and use the value of invoice_settings.default_payment_method , specifying the Payment Method stored there explicitly for each Setup and Payment Intent设置并使用invoice_settings.default_payment_method的值,为每个 Setup 和 Payment Intent 明确指定存储在那里的 Payment Method
  2. Specify the default Payment Method in metadata as you suggested按照您的建议在metadata指定默认付款方式
  3. Stored the default on your end in your own database将默认值存储在您自己的数据库中

Regarding the preferred property, if you're referring to card.networks.preferred that is the preferred card network of the card in question and is not relevant to your question.关于preferred属性,如果您指的是card.networks.preferred ,它是相关卡的首选卡网络,与您的问题无关。

If you use Webhooks, you can listen for payment_method.attached or setup_intent.succeeded events and set it as default when they are fired.如果您使用 Webhooks,您可以监听payment_method.attachedsetup_intent.succeeded事件,并在它们被触发时将其设置为默认值。

For more info: https://stripe.com/docs/api/events/types更多信息: https : //stripe.com/docs/api/events/types

Payment method object can be set to update Customer invoice_settings property with a default payment method.可以设置付款方式对象以使用默认付款方式更新 Customer invoice_settings 属性。

https://stripe.com/docs/api/customers/update#update_customer-invoice_settings https://stripe.com/docs/api/customers/update#update_customer-invoice_settings

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当 SetupIntent 成功时,PaymentIntent 需要身份验证 - Stripe - PaymentIntent requires authentication when SetupIntent was successfully - Stripe 是否可以在没有 SetupIntent 的情况下以编程方式/非会话向用户收费,而只有从他们的第一个 PaymentIntent 获得的详细信息? - Is it possible to programmatically/off-session charge users without SetupIntent, with only the details got from their first PaymentIntent? 如何使用 paymentIntent 和 confirmCardPayment 集成条带 - How to integrate stripe using paymentIntent and confirmCardPayment Stripe 3d 使用 PaymentIntent 安全支付 - Stripe 3d secure payment using PaymentIntent Stripe - 创建或更新订阅时 PaymentIntent 为空 - Stripe - PaymentIntent is null when I create or update a subscription 使用条带,是否可以使用“result.setupIntent.payment_method”从付款方式 object 中获取所有数据? - Using stripe, is it possible to get all of the data from the Payment Method object using “result.setupIntent.payment_method”? 创建新的Stripe订阅时,如何为SetupIntent提供return_url? - How to provide return_url to SetupIntent when creating a new Stripe subscription? Stripe - 当我用零计划更新订阅时,PaymentIntent 是 null - Stripe - PaymentIntent is null when I updated subscription with plan zero 仅在提交信用卡表单时创建 Stripe PaymentIntent - Create Stripe PaymentIntent only when credit card form is submitted StripeInvalidRequestError:没有这样的 setupintent:'seti_...' - StripeInvalidRequestError: No such setupintent: 'seti_...'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM