#ELAZHARI-laravel-transfer

1 messages ยท Page 1 of 1 (latest)

slender glen
#

Hi there! To clarify you are looking to use Laravel to create a transfer to a Connected Account?

split idol
#

yes to connected accouns

#

t

slender glen
#

And are you using Cashier?

split idol
#

//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

slender glen
#

What is the error?

split idol
#

wait let me check it and i 'm going to tell you

slender glen
#

๐Ÿ‘

split idol
#

"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

slender glen
#

Which stated it could be null?

split idol
#

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

half rain
#

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.

split idol
#

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

half rain
#

is there a guide you're following for this?

split idol
#

no

#

now i'm discovering that

half rain
#

Are you using destination charges or separate charges and transfers?

split idol
#

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

half rain
split idol
#

yes right

#

i need now the correct value for source_transacrion

#

but i don't know how i can get it

half rain
split idol
#

yes

#

but as i said this is seperated than the payment intent

#

can i make any transfer but with whole the balance

wild spade
#

@split idol Do you still need help?

#

Are you just trying to make a transfer while setting source_transaction?

split idol
#

yes

#

@wild spade

wild spade
#

What are you having issues with?

#

Are you getting errors?

wild spade
#

@split idol Are you seeing my questions?

split idol
#

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

wild spade
#

Gotcha - and what specific part of that are you having trouble with?