#zeke_checkout-question

1 messages Β· Page 1 of 1 (latest)

limpid raftBOT
brisk wagonBOT
#

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.

limpid raftBOT
#

πŸ‘‹ 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/1260735703311056927

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

earnest quartz
#

zeke_checkout-question

#

Hey @slate verge ! I can't really review your code, but I can answer a specific question if you have one

slate verge
#

yeah do you see a application fee within there?

#

Also Hi! sorry to bother you again!

earnest quartz
#

no bother, it's my job πŸ™‚

slate verge
#

I hope you get paid a lot to deal with me!!!

#

πŸ˜‚

earnest quartz
#

Okay so the request you shared is a bit weird it's a Checkout Session confirmation when you tried to pay on the Checkout page.

The real request id that matters is the creation request when you called the Create Checkout Session API. You can see it in the Dashboard here: https://dashboard.stripe.com/test/logs/req_3FDMTxtELRjP8z with all the parameters you passed at the time of creation
Sadly it's the same exact thing as earlier today: this request is not related to Connect at all. It's just a normal Checkout Session on your own Stripe account with no ApplicationFee-related details

slate verge
#

So your saying there is nothing in there that is related to Connect?!

earnest quartz
#

Correct, there is not.
Can you share your exact code so I can show you what's wrong?

slate verge
#

Yes can I share some SS?

#

So its more organized?!

earnest quartz
#

preferably not, we're both developers, pictures of code are a bad idea πŸ™‚

#

All I want is the code that creates a Checkout Session

slate verge
#

True!

#

Ok give me one sec!

#

const line_items: Stripe.Checkout.SessionCreateParams.LineItem[] = [];

    filteredProducts.forEach((product: Product) => {
      line_items.push({
        price: product.priceId!,
        quantity: 1,
      });
    });

    line_items.push({
      price: "price_1PVJAM05fNcBdPQgDEu0sfqT",
      quantity: 1,
      adjustable_quantity: {
        enabled: false,
      },
    });

    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,
    });

    console.log("Stripe session created successfully:", stripeSession);

    return { url: stripeSession.url };
  } catch (err) {
    console.error("Error creating Stripe session:", err);
    throw new TRPCError({
      code: "INTERNAL_SERVER_ERROR",
      message: "Failed to create Stripe session.",
    });
  }
}),
#

Its weird because The session worked but I just cant seem to get connect to work and I swear I have all the APIs right maybe its the way im testing itπŸ€”

earnest quartz
#

okay all I need is this ``` 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,
});

slate verge
#

🫑

earnest quartz
#

nowhere in this did you ever use anything Connect related. There's no payment_intent_data[transfer_data], there's no Stripe-Account header

#

So sadly you still seem completely lost, which is okay

#

Step 1: What type of connected account did you decide to use: Custom, Express or Standard?

slate verge
#

Yeah im learning ill get there

#

Standard

earnest quartz
#

Step 2: What flow of funds are you trying to use? With Standard you should be using Direct Charges, can you confirm that's what you are using?

slate verge
#

Yes i should have that what am I looking for specifically

#

Ive looked at so much code ive forgoteen

earnest quartz
#

all good, so you are using Direct Charges? Sorry your answer wasn't clear so I want to be sure before I move to my next question

slate verge
#

Yes I should be using direct charges what should I look for in my code to confirm that I am

earnest quartz
#

πŸ‘

slate verge
#

Hey leave this thread open for me I have to go eat dinner!! I want to finish our convo!

earnest quartz
#

that's not how it works I'm sorry

#

We help only in real time here