【问题标题】:Stripe: How to migrate from Charge API to PaymentIntent API in phpStripe:如何在 php 中从 Charge API 迁移到 PaymentIntent API
【发布时间】:2020-01-13 13:44:24
【问题描述】:

我在其中一个项目中使用了条带。我正在从用户那里获取卡详细信息,以下代码用于付款。

\Stripe\Stripe::setApiKey('KEY');

$token = \Stripe\Token::create([
        "card" => [
        "number"    => $paymentModel['number'],
        "exp_month" => $paymentModel['expire_month'],
        "exp_year"  => $paymentModel['expire_year'],
        "cvc"       => $paymentModel['card_cvc'],
        "name"      => $userName
      ]]);

 $customer   = \Stripe\Customer::create([
    'email'  => $email,
    'source' => $token['id'],
    ]);

$charge   = \Stripe\Charge::create([
   'amount'      => $chargeableAmount,
   'currency'    => 'usd',
   'description' => "Purchase User",
   'customer'    => $customerId,
]);

我收到“立即更新您的 SCA 集成”的通知。所以我发现我应该使用 PaymentIntent 进行卡支付。我真的对这些事情感到困惑。该文档令人困惑,它说了很多东西,所以我不明白我应该做哪些改变来迁移。没有适当的文档描述从 Charge API 迁移到 Payment Intent API 的步骤。

谁能指导我?

【问题讨论】:

    标签: php stripe-payments


    【解决方案1】:

    您可以在“迁移将卡片保存在客户对象上的集成”和“付款后保存卡片”选项卡下关注 Stripe's Migration Guide。那里的文字还包括有关如何在 SCA 下使用前端 handleCardPayment 处理身份验证的说明。

    【讨论】:

      【解决方案2】:

      您可以参考以下文章将 SCA 集成到您的支付解决方案中

      3DS supported Stripe.js Integration with Chargebee APIs

      Chargebee 在github 有 PHP 演示应用程序,可以帮助您更好地理解。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-11-20
        • 1970-01-01
        • 2019-12-07
        • 2015-06-24
        • 2015-06-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多