#nerdslice_api

1 messages ¡ Page 1 of 1 (latest)

west saddleBOT
idle ospreyBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

west saddleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1251224086852538451

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

limpid berry
untold bough
#

I think this is the culprit:
$team['

#

What's that bracket and single quote doing?

limpid berry
#

for 'destination' => $team['connect_id'],?

#

That is from our database we store their connect id and retrieve it

untold bough
#

The code you posted might be truncated. Can you post the full API call function?

limpid berry
#

$paymentIntent = \Stripe\PaymentIntent::create(
[
'amount' => $total,
'currency' => strtolower($lane->country).'d',
'payment_method_types' => ['card_present'],
'capture_method' => 'automatic_async',
'transfer_data' => [
'amount' => (round($total, 2) - (round($total * .00003))) - 5,
'destination' => $team->connect_id,
],
//get package and determine percent to charge for fee.
//'tax' => $totaltax,
//'application_fee_amount' => 5,
//'processing' => 5
]
);

#

All i did was change processing fee to transfer_data

#

I jsut updated team['connect_id'] to team->connect_id

#

Still getting that same error

untold bough
#

Do you need $team->$connect_id instead?

#

It's a syntax error, so something in the formatting is wrong

limpid berry
#

I am trying one thing it might be, using laravel cashier, so it might be the api version so I added , 'stripe_version' => '2024-04-10']

#

And yes I do I need to be able to transfer their funds from my account to theirs

untold bough
#

No, I mean, this is a formatting error. Syntax errors mean that the code is written in a way that the interpreter/compiler cannot understand. So you need to poke around at the formatting of the request to see where you might have missed something.

My first guess is you need to add a $ to connect_id such that it looks like this --> $connect_id

limpid berry
#

That will break within laravel's eloquent

untold bough
#

Huh, okay. So if you run your code, what's the full error message?

#

Are you still just getting syntax error, unexpected single-quoted string "transfer_data", expecting "]" ?

limpid berry
#

Yes I am

untold bough
#

Hold on. Let me load this in my test integration

limpid berry
#

ok

untold bough
#

Wait wait wait... what is that method syntax for the function?

Like, why this --> \Stripe\PaymentIntent::create(
Instead of this --> $stripe->paymentIntents->create(

#

Not sure how I glossed over that so easily

#

Think I got hung up on the transfer_data part of the request

limpid berry
#

OK I got it working

#

I changed to the later and did a couple items.

#

Thank you for at least being a sounding board to help me resolve this

#

But do have one other issue along with this

untold bough
#

Sure thing! Glad we got you unblocked.

What's the next question?

limpid berry
#

Actually it might be that I did not number format my fee

untold bough
#

Happens to the best of us

limpid berry
#

So for req_KmPLeTQCbTDhlg I do not see the instant transfer including the 3% reduction but it might be due to the fact that the fee is too small but unsure? We are wanting to charge the customer the rate and transfer the remaining

#

So like for $1 charge it should be $1.05 charged with tax and transfer $.92 to the customer

untold bough
limpid berry
#

Yeah its supposed to charge a 3% fee and take $.10 off as well

#

OK got it, go ahead and close this please and thank you for your help