我已经集成了条纹连接付款流程。我向管理员帐户收取了罚款,但连接帐户返回的余额不足错误
$payableAmount = $payableAmount * 100;
//Stripe admin account charge process
$charge = \Stripe\Charge::create(array(
"amount" => 100, // $15.00 this time
"currency" => 'GBP',
"customer" => $stripeDetails['stripe_customer_id']
));
//charge working fine (In Dashboard currency converted GBP to UD)
$splitAmount = 100 * 2 / 100;
$splitAmount = 90 - $splitAmount;
$transfer = \Stripe\Transfer::create(array(
'amount' => $splitAmount * 100,
'currency' => 'GBP',
'destination' => $storeData['stripe_account_id']
));
//transfer return Insufficient funds in Stripe account. In test mode, you can add funds to your available balance.
答案 0 :(得分:1)
您已向客户收取了£1英镑的费用,Stripe接受最低货币值的amount
值,在这种情况下为100便士。然后,您尝试将88英镑转入您只有1英镑的可用关联帐户。
您应该重新审视自己的$splitAmount
逻辑,因为不管您向客户收取多少费用,它总是等于88
。
答案 1 :(得分:0)
应付金额始终大于转帐金额Read More 更改的应付金额。因此$ payable的金额始终大于splitAmount。
$payable=100*100;
$charge = \Stripe\Charge::create(array(
"amount" => $payable, // $100.00 this time
"currency" => 'GBP',
"customer" => $stripeDetails['stripe_customer_id']
));
//charge working fine (In Dashboard currency converted GBP to UD)
//Can only transfer up to the platform’s available account balance (with an exception when using source_transaction),before check it
$balance = \Stripe\Balance::retrieve(
["stripe_account" => CONNECTED_STRIPE_ACCOUNT_ID]
);
$splitAmount = 100 * 2 / 100;
$splitAmount = 90 - $splitAmount;
$transfer = \Stripe\Transfer::create(array(
'amount' => $splitAmount * 100,
'currency' => 'GBP',
'destination' => $storeData['stripe_account_id']
));