#bajay_api
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.
- bajay_code, 1 hour ago, 35 messages
- bajay_code, 3 hours ago, 43 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/1254762556472430683
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Can you share the URL please
You're not using the correct URL for the session. It's actually: https://checkout.stripe.com/c/pay/cs_live_a10TovhMDQBNedlvlUETQO6lcZ22uZMn6zpufObIuyczFcOvtPy05Wrz4I#fid2cXdsdWBEZmZqcGtxJz8nZGZmcVo0VVR0fV9HYElRcz1oakhdJyknZHVsTmB8Jz8ndW5aaWxzYFowNEs1V3BRQnBKV09QZmZEUEwyfG5sfXJ8UG1cVGNNUzdPMFQ9PVNcNlRKM0NiY0lXdURJM2lcfFZOXzVMZ2JoNUtTM2wzUXNRZHU2Nk9SfFdJbWF0fEJfbDU1aEhRTVMybzcnKSdjd2poVmB3c2B3Jz9xd3BgKSdpZHxqcHFRfHVgJz8ndmxrYmlgWmxxYGgnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl
Sure!
How are you redirecting to the payment page?
this function sends the session id here to my endpoint and i send the id to frontend
if (sessionId != null)
{
return Ok(new { sessionId });
}
if (response.status === 200) {
const session = response.data;
const result = await stripe.redirectToCheckout({
sessionId: session.sessionId,
});
if (result.error) {
toast.error(result.error.message);
}
} else {
toast.error(`Error: ${response.status} - ${response.statusText}`);
}
this is how i receive it on frontend
this was working fine before when i was dealing with destination charges. did multiple payments too
FWIW, redirectToCheckout is deprecated now. You can just redirect server-side using the url field returned
Can you share the code you use to initialise Stripe.js?
yes wait
I suspect you're missing the stripeAccount parameter which is needed for direct charges
var requestOptions = new RequestOptions
{
StripeAccount = receiverAccount.StripeId,
};
this one i am missing?
You have it in your server-side code yes
But you also need to initialise Stripe.js the same way
Can you share the code you use to initialise Stripe.js?
if stripe account was missing then it would have given an exception and it wouldn't have sent a url
on client side?
Yes, client-side
Not the server-side code, I can see you have it there and the session is created as a direct charge
import { loadStripe } from "@stripe/stripe-js";
const stripePromise = loadStripe(
"pk_live_xyz"
);
So, yes, it's missing
this is in my layout
const stripePromise = loadStripe(
"pk_live_xyz", {
stripeAccount: "acct_connctedAccount"
}
);
redirectToCheckout needs that to correctly construct the URL for direct charges as the session is created on the connected account
let me explain you about my platform so you can tell me which stripe account should i use here. my platform is named sponsa and on my platform there are creators and supporters. creators are connect account and supporters pay through checkout session. now on client side which stripe account should i use? platform stripe account?
No, the acct_xxx ID of the connected account you're creating the session for (acct_1PQqxZBeLTv8moMX in this example)
But, as I said, redirectToCheckout is deprecated now. The recommendation is to instead jsut redirect server-side using the url field: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=stripe-hosted#redirect-customers
you mean of the creator in my case?
Yes, the acct_xxx ID of you creators Stripe account
The same ID using in your backend code, here
so i have to pass the stripe account to frontend everytime i create a checkout session? i have many creators
If you want to use redirectToCheckout, yes. Otherwise if you adopt our recommended integration and redirect server-side, no. See: https://docs.stripe.com/connect/direct-charges?platform=web&ui=stripe-hosted#create-checkout-session
can you tell me how to do the recommended integration and redirect server-side?
is it in the link?
thank you so much for your help