简体   繁体   English

更新使用 SetupIntent 保存的 Stripe 信用卡

[英]Update Stripe credit card that was saved with SetupIntent

I've saved the credit card for later usage with SetupIntent to the customer.我已保存信用卡以供客户以后使用 SetupIntent 使用。 Let's say that the user wants to edit his card (expiration/cvc/billing, etc..) after 5 days.假设用户想要在 5 天后编辑他的卡(到期/cvc/计费等)。

What would be the workflow for it?它的工作流程是什么?

Documentation got me confused because they propose to create a new SetupIntent and attach it to the customer. 文档让我感到困惑,因为他们建议创建一个新的 SetupIntent 并将其附加给客户。 If that's so, what should we do with the previously added card?如果是这样,我们应该如何处理之前添加的卡?

For very good privacy reasons, there's very little you can "edit" on a user's payment methods.出于非常好的隐私原因,您几乎无法“编辑”用户的付款方式。 Stripe allows an almost unlimited number of paymentMethods attached to a customer. Stripe 允许为客户附加几乎无限数量的支付方式。 The recommended flow (as I also answered on Discord) is to attach the new paymentMethod - you can simply delete the previous one(s).推荐的流程(正如我在 Discord 上也回答的那样)是附加新的 paymentMethod - 您可以简单地删除以前的付款方式。 When you query the API for a customer's payment Methods (list), they are returned in reverse chronological order - the first one is the most recent.当您在 API 中查询客户的付款方式(列表)时,它们会按时间倒序返回 - 第一个是最新的。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM