doutu9810 2016-12-12 15:54 采纳率: 0%
浏览 31
已采纳

如何连接到条带管理帐户并进行付款?

First of all, I'm Sorry for my english.

I want to create a charge in Stripe from account A to account B. The account A is a mananaged account. The account B can be any of multiple accounts. But when I try to create the charge with the destination parameter the API resturn an error. Says:

"error": {
    "type": "invalid_request_error",
    "message": "The destination param must be a connected account.",
    "param": "destination"
  }

How I could connect the destination account (Account B) to get this??. I'm using the php api stripe to this. Next this is the example code that I using. Thanks in advance:

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

// Charge the order:
$charge = \Stripe\Charge::create(array(
    // 'source'    => $token,
    'customer'  => 'cus_ID_CUSTOMER_TO_GET_PAYMENT',
    "amount" => 100000,
    "currency" => "usd",
    "description" => "from account A to account B",
    'destination' => 'acct_ID_DESTINATION_ACCOUNT'
    )
);

echo "<pre>";
print_r($charge);
echo "</pre>";
  • 写回答

1条回答 默认 最新

  • doubaisui2526 2017-07-18 06:23
    关注

    If you have gone through stripe documentations you clearly will have seen there are three types of charges in Stripe connect.

    • Direct Charges
    • Destination Charges
    • Seperate Charges

    In your case, you will have to use destination charges. You could use

    $charge = \Stripe\Charge::create(array(
                      "amount" => 1000,
                      "currency" => "usd",
                      "source" => "cus_ID_CUSTOMER_TO_GET_PAYMENT",
                      "destination" => array(
                        "account" => "{CONNECTED_STRIPE_ACCOUNT_ID}",
                      ),
                ));
    

    to charge a customer on behalf of your connected account.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记