我们正在创建一个网站,允许用户在将来的付款中附加卡。
第一次尝试时,我们使用 PaymentMethod(卡)创建一个 SetupIntent - https://stripe.com/docs/payments/save-and-reuse 。
现在假设用户要删除当前卡并附加一张新卡。 我们无法将指定的付款方式更改为 SetupIntent 或取消 SetupIntent,因为
"You cannot cancel this SetupIntent because it has a status of succeeded."
也许我不明白一些事情,但是在保存并重用示例中,如何允许用户删除卡片并附加新卡片?
或者可能它的设计方式是SetupIntent仅支持PaymentMethod身份验证,对于新卡来说只需断开(分离)当前的>PaymentMethod,保持 SetupIntent 不变并创建一个新的 SetupIntent + PaymentMethod 对?
最佳答案
一旦您通过SetupIntent 设置了PaymentMethod,您就不再通过该SetupIntent 执行任何操作(成功
是最终状态)。你会detach the PaymentMethod from the Customer稍后,和/或如果您想稍后添加不同/新的 PaymentMethod,您将再次遵循 SetupIntent 流程(使用新的 SetupIntent)。
关于stripe-payments - 新 PaymentMethod 的 Stripe SetupIntent 更新流程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66817878/