#ELAZHARI-laravel-transfer
1 messages ยท Page 1 of 1 (latest)
Hi there! To clarify you are looking to use Laravel to create a transfer to a Connected Account?
And are you using Cashier?
//successfuly received payment
if ($request['method'] == 'STRIPE') {
$restaurant = Restaurant::where('id', $newOrder->restaurant_id)->first();
if ( $restaurant->stripeId != null) {
\Stripe\Stripe::setApiKey(config('setting.stripeSecretKey'));
$percentage = 95;
$transfer = \Stripe\Transfer::create([
"amount" => round(($percentage / 100) * $orderTotal),
"currency" => 'brl',
"source_transaction" => null,
"destination" => $restaurant->stripeId,
]);
}
here the payment intent already go to the stripe account i want just to transfer it in another function
and i used Transfer class for it
and i'm just getting error i don't know why
What is the error?
Do you have a request ID for the error? (https://support.stripe.com/questions/finding-the-id-for-an-api-request)
wait let me check it and i 'm going to tell you
๐
"message": "You passed an empty string for 'source_transaction'. We assume empty values are an attempt to unset a parameter; however 'source_transaction' cannot be unset. You should remove 'source_transaction' from your request or supply a non-empty value.",
in the stripe doc
they said we can make it have null
value
Which stated it could be null?
source_transaction
i wqnt to get the money from the account balance
and as you know brasil accounts need to use this ' source_transaction ' to make the transfer
Hello ๐
Stepping in here
Seems like the issue is that you're passing source_transaction as null
You need to specify the source_transaction value.
oww
yes that's what i see also
but
it 's need the charge id
but i want firstly to retrieve the last payment
the specific payment that customer pay for it
payment intent
and put it there
to cut a percentage for it
is there a guide you're following for this?
Are you using destination charges or separate charges and transfers?
i have used just
pqy,ent intent
qnd stripe js
payment intent
and stripe js
now i want to do a transfer with a specific charge id
of the payment intent
Have you setup stripe connect already?
Does this look like something you're doing currently? https://stripe.com/docs/connect/charges-transfers
yes right
i need now the correct value for source_transacrion
but i don't know how i can get it
So the PaymentIntent using which you collected the payment, should have a charge ID listed on it
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges
yes
but as i said this is seperated than the payment intent
can i make any transfer but with whole the balance
@split idol Do you still need help?
Are you just trying to make a transfer while setting source_transaction?
@split idol Are you seeing my questions?
hii i'm back sorry
look
@wild spade
i want to transfer money but in another function
i want for example
retrieve the payment intent charge id
when the customer pay
and retreive it in the function when i want to transfer money
to the restaurant
or delivery man
Gotcha - and what specific part of that are you having trouble with?