#zeke_best-practices

1 messages ยท Page 1 of 1 (latest)

tacit adderBOT
rare girderBOT
#

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.

tacit adderBOT
#

๐Ÿ‘‹ 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/1260279032168054824

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

quick mauve
#

Hi Zeke, seeing you have plenty of threads over the last few days

have you read about Application Fees on Direct Charges?

past sapphire
#

Yes Sir!

#

I never got it quite to work! let me show you what I have tried!

#

So when I do This I get a success log:

const stripeSession = await stripe.checkout.sessions.create({
success_url: ${process.env.NEXT_PUBLIC_SERVER_URL}/thank-you?orderId=${order.id},
cancel_url: ${process.env.NEXT_PUBLIC_SERVER_URL}/cart,
payment_method_types: ["card"],
mode: "payment",
metadata: {
userId: user.id,
orderId: order.id,
},
line_items,
});

#

But when I do this I get and ERR 400 log:

const stripeSession = await stripe.checkout.sessions.create({
success_url: ${process.env.NEXT_PUBLIC_SERVER_URL}/thank-you?orderId=${order.id},
cancel_url: ${process.env.NEXT_PUBLIC_SERVER_URL}/cart,
payment_method_types: ["card"],
mode: "payment",
metadata: {
userId: user.id,
orderId: order.id,
},
line_items,
payment_intent_data: {
application_fee_amount: 123,
},
});

#

Ill show you the RQ and the ERR! One Sec

#

req_tWLNrbkpVDcXFJ

#

parameter_missing - application_fee_amount
Looks like you are missing the application_fee_amount field. This field allows the platform to take an application fee on direct charges. It can be any positive number up to the amount of the charge.

quick mauve
#

Zeke, I'm going to have to ask you to take a step back

that request isn't even a Connect request (i.e. made by Platform on a Connect account) which is why https://dashboard.stripe.com/test/logs/req_tWLNrbkpVDcXFJ is 400'ing

and the error msg says so:

message: "Can only apply an application_fee_amount when the PaymentIntent is attempting a direct payment (using an OAuth key or Stripe-Account header) or destination payment (using transfer_data[destination]).",

that also isn't the error msg you're quoting above fyi

I think you're diving into one of the most complex topics at Stripe (Connect) without the right pre reads

#

1/ so let's start here - which guide are you followiung

tacit adderBOT
past sapphire
past sapphire
#

Iโ€™m pretty sure the guide Iโ€™m following is direct payments, which has application_fee_amount

quick mauve
#

pls share the doc link you're following

#

cause the code snippet you're using has a mistake that the docs likely don't

#

also full disclosure, Connect is complex so recommend lots of pre reading and self debugging. We're here to help but you'll run into lots of roadblocks without proper understanding of the content and trying it out on your end in test mode to map it to your mental model

past sapphire
#

Ok! Can you send me were to read about connect!

quick mauve
past sapphire
#

Is this all of them? I want to read all of them if possible. Thanks!

white pawn
#

This is most of them. They all link out to other sources, so make sure you follow links as they show up to fully familiarize yourself with all the relevant material

past sapphire
#

Yes sir! thank you guys If i have any questions Ill reach out.