【问题标题】:How to connect to managed account in stripe and make a payment?如何连接到条带中的托管帐户并进行付款?
【发布时间】:2016-12-12 15:54:38
【问题描述】:

首先,对不起我的英语。

我想在 Stripe 中创建从账户 A 到账户 B 的费用。账户 A 是托管账户。账户B可以是多个账户中的任意一个。但是,当我尝试使用目标参数创建费用时,API 会返回错误。说:

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

如何连接目标帐户(帐户 B)以获取此信息??我正在为此使用 php api 条带。接下来这是我使用的示例代码。提前致谢:

\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>";

【问题讨论】:

  • 这两个账户需要用 Stripe Connect 连接(可能使用 Standalone 方式)。看看这里的指南--stripe.com/docs/connect/standalone-accounts 连接两个帐户后,您的代码可能会起作用。
  • 嗨@korben,独立帐户允许条带处理一切,连接,创建用户等。我们不能这样做,因为所有这些过程必须对用户透明。它必须在后台进程中(如幕后),我认为这可以通过托管帐户和 api 实现

标签: php stripe-payments stripe-connect


【解决方案1】:

如果您浏览过 Stripe 文档,您会清楚地看到 Stripe connect 中存在三种类型的费用。

  • 直接收费
  • 目的地费用
  • 单独收费

在您的情况下,您将不得不使用目的地费用。你可以使用

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

代表您的关联帐户向客户收费。

【讨论】:

  • 感谢@VishnuR 的帮助。这就是我需要的。谢谢。
猜你喜欢
  • 1970-01-01
  • 2021-07-20
  • 2019-10-10
  • 1970-01-01
  • 2015-11-07
  • 1970-01-01
  • 2015-07-16
  • 1970-01-01
  • 2012-06-18
相关资源
最近更新 更多