#yagnesh_docs

1 messages ¡ Page 1 of 1 (latest)

dense sunBOT
#

👋 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.

woven wigeon
#

Hi there, can you share with me your checkout session ID?

proven pawn
#

cs_test_a1sTaQB7SWcSl9NAlx2VfeMqRvY8b4mnbcVTsB6OlgGWsQbtDolNdvfxWw

woven wigeon
#

Thanks, I don't see any request to update customer for this checkout session. Can you share with me your code?

proven pawn
#

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

woven wigeon
#

And what's inside the this.invoiceService.updateCheckoutSession function ?

proven pawn
#

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

woven wigeon
#

Can you share with me the backend code?

woven wigeon
#

That is still a wrapper. Can you show me the code that you call stripe api directly ?

proven pawn
#
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);
        }

woven wigeon
#

Ok, thanks. And did you get any error from the api call?

proven pawn
#

no it is getting update successfully and customer is also attached properly no error, the only error is in frontend while confirming the element

woven wigeon
proven pawn
woven wigeon
#

Ok, I just realized you haven't set an email to the customer, can you set an email to it and try again>

proven pawn
#

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,

woven wigeon
#

Can you check the value of customerEmail ? is it emtpy or null?

proven pawn
#

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.

woven wigeon
#

Checkout will only validate the customer email when you confirm the checkout session.

proven pawn
#

Okay, maybe i should get better at debugging, thanks a lot.