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 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大