[英]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:要直接回答您的问题,您有三个选择:
invoice_settings.default_payment_method
, specifying the Payment Method stored there explicitly for each Setup and Payment Intentinvoice_settings.default_payment_method
的值,为每个 Setup 和 Payment Intent 明确指定存储在那里的 Payment Methodmetadata
as you suggestedmetadata
指定默认付款方式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.attached或setup_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.