【问题标题】:Stripe charge destination account in latest stripe API最新 Stripe API 中的 Stripe 收费目的地账户
【发布时间】:2021-03-02 17:09:09
【问题描述】:

我正在使用 php stripe API,在我的旧条带版本中,我使用下面的代码向客户收取费用并将金额发送到另一个条带帐户

我的逻辑: 假设我是一个市场,例如,我允许约翰在线销售灯具。然后,爱丽丝来了,想在他的网站上从约翰那里购买一盏灯。我使用下面提到的代码向 Alice 收费并将资金直接发送到 John 的账户。

仅供参考:我有店主约翰的条纹结账卡详细信息,例如卡令牌 ID、卡号

我的旧条带版本代码:

 $charge = \Stripe\Charge::create(array(
            "amount" => 100,
            "currency" => "gbp",
            "source" => $token,
            "destination" => [
                "amount" => 20,
                "account" => 'xxxxx',
            ],
        ));

如何在新的条带版本中实现上述逻辑,因为上面的代码不起作用。

谁能提供等效的php代码示例请让我在这里震惊..

代码更新:

 $account = \Stripe\Account::create(array(
                    "type" => "custom",
                    "country" => "GB",
                    "email" => $email,
                    'capabilities' => [
                        'card_payments' => ['requested' => true],
                        'transfers' => ['requested' => true],
                    ]
                   
        ));

我收到以下错误:

  1. 在添加业务类型之前,此帐户的卡付款、付款和转账功能将被禁用。

  2. 添加银行帐户或借记卡以启用付款。

如何使用 php stripe

解决这些错误

【问题讨论】:

    标签: php stripe-payments


    【解决方案1】:

    Jonh 是否有关联到您的条带帐户?

    似乎在新的 API 中你必须找到他的帐户的 id 并执行此操作:

    $payment_intent = \Stripe\PaymentIntent::create([
      'payment_method_types' => ['card'],
      'amount' => 1000,
      'currency' => 'usd',
      'transfer_data' => [
        'destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
      ],
    ]);
    

    在此处查看完整文档:https://stripe.com/docs/connect/destination-charges

    【讨论】:

    • 我收到错误“您的目标帐户需要至少启用以下功能之一:转帐、legacy_payments”
    • 好吧,您应该启用transfers 功能。在此处查看有关如何检查和更新您的帐户功能的最新文档:stripe.com/docs/api/accounts/object?lang=php
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 2019-08-05
    • 1970-01-01
    • 2017-12-29
    • 1970-01-01
    • 2023-01-27
    • 2015-11-10
    相关资源
    最近更新 更多