【问题标题】:Stripe PHP 3D secure payment without Stripe.JS?没有 Stripe.JS 的 Stripe PHP 3D 安全支付?
【发布时间】:2021-02-20 06:17:04
【问题描述】:

我没有使用 Stripe.JS,因为我需要自定义 UI。 我从我的客户那里收集了卡信息。我正在使用 PHP SDK。 我的工作流程是

  create customer
  add/attach payment method to customer
  create payment intent

  

一切正常。现在的问题是,如果最终用户使用 3D 安全卡,我会在响应中得到 next_action

"next_action": {
    "type": "use_stripe_sdk",
    "use_stripe_sdk": {
      "type": "three_d_secure_redirect",
      "stripe_js": "https://hooks.stripe.com/redirect/authenticate/xxxxxx?client_secret=src_client_secret_xxxxxxx",
      "source": "src_xxxxxx"
    }
  },
  "next_source_action": {
    "type": "use_stripe_sdk",
    "use_stripe_sdk": {
      "type": "three_d_secure_redirect",
      "stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_xxxxxx?client_secret=src_client_secret_xxxxxx",
      "source": "src_xxxxxx"
    }
  },

文档随后依赖 Stripe.JS 来执行此步骤以打开验证弹出窗口。由于自定义 UI,我没有在实现的第一部分使用 Stripe.JS。我可以只在这部分使用 Stripe.JS 吗?或者我如何在不使用 Stripe.JS 的情况下完成这部分?我如何知道下一步是否成功,以便确认付款?我还在我的开发仪表板中看到付款如此成功(令人困惑)。但文件说我还需要确认付款意图?

【问题讨论】:

  • 老实说,Stripe 曾经很了不起,但最近他们发现它的发展非常混乱。但是,我建议您联系 Stripe 支持并问他们这个问题——我有过类似的问题,他们对解决问题很有帮助。

标签: php stripe-payments


【解决方案1】:

Stripe 有 documentation about handling 3D Secure manually without Stripe.js,它将指导您完成需要做的事情。

也就是说,您可以create your own custom payment form with Stripe.js using Stripe Elements,强烈建议您这样做以提高安全性并减轻您的 PCI 合规负担。

【讨论】:

  • 我的回复没有“redirect_to_url”但“use_stripe_sdk”但我不使用Stipe.JS
  • 那是因为您在确认付款意图时没有指定return_url。请参阅此处:stripe.com/docs/payments/3d-secure#confirm-payment-intent 在确认时指定 return_url 是您告诉 Stripe 您不会将 Stripe.js 用于 3D 安全的方式。
猜你喜欢
  • 2021-10-11
  • 2019-12-11
  • 2018-06-19
  • 2013-04-17
  • 2021-01-08
  • 2015-05-19
  • 2016-01-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多