gpt4 book ai didi

stripe-payments - Stripe 支付 : Source vs Token/Card?

转载 作者:行者123 更新时间:2023-12-03 11:29:30 25 4
gpt4 key购买 nike

我正在使用 Stripe 设置定期付款。我正在使用 react-stripe-elements 收集卡片信息,看起来有两种方法可以保存卡片以备后用:

  • this.props.stripe.createToken()
  • this.props.stripe.createSource()

  • 然后在后端创建一个客户:
  • stripe.customers.create({ source: tokenId })
  • stripe.customers.create({ source: sourceId })

  • 条纹仪表板中的结果:
  • token 标识
  • token 身份证
    enter image description here
  • 来源ID
  • sourceId 来源

  • enter image description here
  • 来源身份证

  • enter image description here

    我的问题是这两种模式有什么区别?我应该使用一种而不是另一种吗?我注意到在 tokenId 模式中,卡片说 cvc/zip 检查已通过,而卡片在 sourceId 模式中没有说。但是 sourceId 模式也明确表示该卡是可收费和可重复使用的,这是否意味着使用 tokenId 模式保存的卡不可重复使用? sourceId 卡中的日志/事件是否更有用?两种模式的返回对象结构也不同。

    任何帮助将不胜感激,提前致谢!

    最佳答案

    token 只是用户卡详细信息标记化后的字符串值结果。您可以使用 token 或来源一次性或订阅付款(前提是您在将其附加给客户之前不立即使用它来收费)。

    但是 source 为您提供了更多选择,因为它是您在接受其他付款方式(例如支付宝或微信支付等)时唯一的选择,您不能将 token api 与卡以外的其他付款方式一起使用。正如@Daniel Winterstein 所说, token 是 Stripe 的旧 API,而 Stripe 决定保留它只是为了向后兼容,但您应该使用源作为标准 API 来捕获使用付款详细信息。

    关于stripe-payments - Stripe 支付 : Source vs Token/Card?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50284633/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com