【问题标题】:Error in using same card for subscription and one off payment使用同一张卡进行订阅和一次性付款时出错
【发布时间】:2020-08-16 16:38:12
【问题描述】:

场景: 我想创建一个订阅,也想用同一张卡一次性付款。我正在使用 3D 安全卡号 4000002500003155,所以我有一个弹出窗口来转换 3D autentication。确认后,我使用 Ajax 向服务器提交付款方式,并更新默认付款方式,订阅成功创建,但使用相同默认付款方式的一次收费会引发此异常: “付款尝试失败,因为需要执行其他操作才能完成。”

如何使用同一张卡通过 3D 安全卡创建订阅和一次性付款:4000002500003155

这是我的前端代码:

stripe.confirmCardSetup(clientSecret, {
payment_method: {
  card: cardElement,
  billing_details:{ name: "{{$data->first_name}} {{$data->last_name}}"}
  },}).then(function(result) {
if(result.error){
}else{
}}

希望在这方面有所帮助。

【问题讨论】:

    标签: laravel stripe-payments laravel-cashier


    【解决方案1】:

    如果您查看description for that test card,您会发现它需要 3DS 一次性付款,除非设置并用作非会话。

    如果您将一次性付款意图设为off-session,在您完成卡设置并附加到客户之后,它应该会成功。

    \Stripe\PaymentIntent::create([
      'amount' => 2000,
      'currency' => 'usd',
      'payment_method_types' => ['card'],
      'customer' => 'cus_123',
      'payment_method' => 'pm_456',
      'off_session' => true,
      'confirm' => true,
    ]);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-24
      • 2015-01-10
      • 2019-10-22
      • 1970-01-01
      • 2013-05-06
      • 1970-01-01
      • 2020-06-02
      • 2011-03-15
      相关资源
      最近更新 更多