简体   繁体   English

如何从一个关联的Stripe帐户向另一个关联的Stripe帐户转移收费金额

[英]How to transfer Charged Amount from one connected Stripe Account to Another Connected Stripe Account

Is it possible to transfer an amount from one Connected-Account to another Connected-Account? 是否可以将金额从一个关联帐户转移到另一个关联帐户? both are connected under one Stripe account. 两者都通过一个Stripe帐户关联。 I know i can split the transfer between both accounts like 我知道我可以在两个帐户之间分配转帐

$transfer = \Stripe\Transfer::create(array(
 "amount" => 7000,
 "currency" => "usd",
 "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID1}",
));


$transfer = \Stripe\Transfer::create(array(
 "amount" => 2000,
 "currency" => "usd",
 "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID2}",
));

But i want to transfer 9000 in 1st account and then from 1st Account to another. 但是我想在第一个帐户中转移9000,然后从第一个帐户转移到另一个帐户。 i had try to transfer using CONNECTED_STRIPE_ACCOUNT_ID1 secret key to transfer in CONNECTED_STRIPE_ACCOUNT_ID2 but got error like no such account available. 我曾尝试使用CONNECTED_STRIPE_ACCOUNT_ID1秘密密钥进行转移,以在CONNECTED_STRIPE_ACCOUNT_ID2中进行转移,但出现错误,例如没有可用的此类帐户。

individual transfer are working perfect but want it from one account to another. 个人转帐运作完美,但希望将其从一个帐户转移到另一个帐户。

please Help. 请帮忙。

No, you cannot transfer funds from one connected account to another. 不可以,您不能将资金从一个关联帐户转移到另一个帐户。

What you could do, if you are eligible for it, is to use the separate charges & transfers flow , in which case you would create the charge on your own account (the platform's), then create as many transfers as needed to move funds from your account's balance to each connected account. 如果有资格,您可以做的是使用单独的费用和转帐流程 ,在这种情况下,您可以在自己的帐户(平台的帐户)上创建费用,然后根据需要创建任意数量的转帐,以从中转移资金您帐户的每个关联帐户的余额。

You can't transfer from connected accounts - 您无法从关联的帐户转移-

Better way is to take all amount in your main stripe account and then you can transfer from your main account to CONNECTED_STRIPE_ACCOUNT_ID1 and CONNECTED_STRIPE_ACCOUNT_ID2 etc 更好的方法是将所有金额放入您的主条带化帐户中,然后您可以从主帐户转移到CONNECTED_STRIPE_ACCOUNT_ID1和CONNECTED_STRIPE_ACCOUNT_ID2等

When you redirect to stripe to connect account - stripe redirect back to your page with "code" value - 当您重定向到条带连接帐户时-条带重定向回到具有“代码”值的页面-

App::import('Vendor', 'StripeOAuth/StripeOAuth');
$oauth = new StripeOAuth(YOUR_CLIENT_ID, YOUR_SECRET_KEY);
$access_token = $oauth->getAccessToken($_GET['code']);
$publishable_key = $oauth->getPublishableKey($_GET['code']);
$refresh_token = $oauth->getRefreshToken($_GET['code']); 
$stripe_account_id = $oauth->getUserId($_GET['code']);

This $stripe_account_id is CONNECTED_STRIPE_ACCOUNT_ID1 (Your were using secret key of connected account but instead of that $stripe_account_id will work) $stripe_account_id为CONNECTED_STRIPE_ACCOUNT_ID1(您使用的是已关联帐户的密钥,但可以使用$stripe_account_id代替)

Now you can take all charge on main stripe account and transfer to connected account as you wish - 现在,您可以对主要条带帐户收取全部费用,然后根据需要转移到关联的帐户-

\Stripe\Stripe::setApiKey(YOUR_SECRET_KEY[![enter image description here][1]][1]);

// Create a Charge:
$charge = \Stripe\Charge::create(array(
  "amount" => 10000,
  "currency" => "usd",
  "source" => "tok_visa",
  "transfer_group" => "{ORDER10}",
));

// Create a Transfer to a connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 7000,
  "currency" => "usd",
  "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));

// Create a second Transfer to another connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 2000,
  "currency" => "usd",
  "destination" => "{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));

金额流的工作方式如下图所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM