#yagnesh_docs
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1497092838591299614
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- yagnesh_api, 2 days ago, 7 messages
- yagnesh_best-practices, 2 days ago, 7 messages
Hi there, can you share with me your checkout session ID?
cs_test_a1sTaQB7SWcSl9NAlx2VfeMqRvY8b4mnbcVTsB6OlgGWsQbtDolNdvfxWw
Thanks, I don't see any request to update customer for this checkout session. Can you share with me your code?
This is in my frontend for updating the session:
try {
await this.checkoutAction.runServerUpdate(() =>
this.invoiceService.updateCheckoutSession(
this.sessionId(),
'acct_123abc',
'cus_123,
invoice.livemode,
),
);
this.buttonRole.set('submitPayment');
} catch (error) {
console.error('Failed to update checkout session with customer details: ', error);
this.handleSecureError(error);
}
}
there is no error in this and working as expected and but as soon as i hit the confirm() i am getting email errror
And what's inside the this.invoiceService.updateCheckoutSession function ?
it is api call to backend:
const updatedSession = await this.stripeService.updateCheckoutSession({
id: checkoutSessionId,
params: {
customer: 'cus_123'
},
requestOptions: { stripeAccount: stripeAccountId },
livemode,
});
req id: req_gEwjwUNRlTAy1w```
I have called the update checkout session with customer id
Can you share with me the backend code?
this is the backend code
That is still a wrapper. Can you show me the code that you call stripe api directly ?
try {
const stripeClient = new Stripe(environment.STRIPE.STRIPE_SECRET_KEY || '', {
apiVersion: '2026-02-25.preview;' as any,
});
return await stripeClient.checkout.sessions.update(id, params, requestOptions);
} catch (error) {
this.handleStripeError(StripeService.name, error);
}
Ok, thanks. And did you get any error from the api call?
no it is getting update successfully and customer is also attached properly no error, the only error is in frontend while confirming the element
OK, did you run https://docs.corp.stripe.com/js/custom_checkout/run_server_update to sync the chekcout session after the update?
yes yes, inside run server update only i have my api call
Ok, I just realized you haven't set an email to the customer, can you set an email to it and try again>
i am creating it before the updating the checkout session:
const newCustomer: any = {
email: customerEmail,
description: customerEmail + ' | ' + customerName,
}
const createdCustomer = await this.stripeService.createCustomer({
params: newCustomer,
requestOptions: { stripeAccount: stripeAccountId },
});
and then i have attached the customer id received from above call to update checkout session,
Can you check the value of customerEmail ? is it emtpy or null?
Ahh, there you go, I just released that, it is empty string. but why i did not get any error in update checkout session call, i am seeing in dashboard the update call is going success.
Checkout will only validate the customer email when you confirm the checkout session.
Okay, maybe i should get better at debugging, thanks a lot.