#zeke_best-practices
1 messages ยท Page 1 of 1 (latest)
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.
- zeke_best-practices, 11 hours ago, 16 messages
- zeke_best-practices, 18 hours ago, 30 messages
- zeke_api, 20 hours ago, 97 messages
- zeke_webhooks, 1 day ago, 16 messages
๐ 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.
Hi Zeke, seeing you have plenty of threads over the last few days
have you read about Application Fees on Direct Charges?
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.
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
Well this makes me feel better ๐ I was wondering why it was so hard ๐ญ
What do you mean?!
Iโm pretty sure the guide Iโm following is direct payments, which has application_fee_amount
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
Ok! Can you send me were to read about connect!
please read through both end to end, then try out any code snippets you need to
then specifically zero in on https://docs.stripe.com/connect/enable-payment-acceptance-guide?platform=web#create-checkout-session which is where you were stuck at
Is this all of them? I want to read all of them if possible. Thanks!
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
Yes sir! thank you guys If i have any questions Ill reach out.