В настоящее время я использую метод передачи из Stripe Connect в Transfer сумма с основного счета на полосовой счет Продавца.
Код: Выделить всё
public function payout(Request $request)
{
try {
$data = $request->all();
$merchant = Merchant::find($data['merchant_id']);
Transfer::create([ //s 2 s
'amount' => 1 * 100,
'currency' => 'eur',
'destination' => $merchant->asStripeAccount()?->id,
'description' => 'Stripe to stripe transfer',
]);
return $this->sendSuccess('success');
} catch (\Exception $e) {
\Log::info($e->getMessage());
return response()->json(['msg' => $e->getMessage()]);
}
}
Код: Выделить всё
Payout::create([
'amount' => 100,
'currency' => 'eur',
'method' => 'standard',
'description' => 'payout to merchant',
],
['stripe_account' => $merchant->asStripeAccount()?->id]
);
С помощью приведенного выше кода я получаю следующее сообщение, поскольку по умолчанию в качестве source_type используется карта. :
Код: Выделить всё
{
"msg": "You have insufficient funds in your Stripe account for this transfer. Your card balance is too low. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance)."
}
Код: Выделить всё
{
"object": "balance",
"available": [
{
"amount": 6974202,
"currency": "eur",
"sourceTypes": {
"card": 6974202
}
}
],
"connectReserved": [
{
"amount": 0,
"currency": "eur"
}
],
"livemode": false,
"pending": [
{
"amount": -2135283,
"currency": "eur",
"sourceTypes": {
"card": -2135283
}
}
]
}
API выплат предназначен только для перемещения средств из подключенного Stripe
баланс счета на внешний счет.
Можно ли перевести средства с основного счета на банковский счет продавца напрямую?
Подробнее здесь: https://stackoverflow.com/questions/779 ... nk-account