簡體   English   中英

如何連接到條帶管理帳戶並進行付款?

[英]How to connect to managed account in stripe and make a payment?

首先,對不起我的英語。

我想在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文檔,則可以清楚地看到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}",
                  ),
            ));

代表您的關聯帳戶向客戶收費。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM