#harshil-ahir_code

1 messages ยท Page 1 of 1 (latest)

spice iceBOT
#

๐Ÿ‘‹ 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/1341708598384001104

๐Ÿ“ 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.

magic saddle
#

๐Ÿ‘‹ happy to help

#

sorry I'm not I understood the issue

#

would you mind elaborating more?

muted spire
#

NP its solved

#

Thanks for your help

#

No such checkout.session: {CHECKOUT_SESSION_ID}; code: resource_missing; request-id: req_jfX4HgFsWxAxsb

wait can you please check that these paymentIntent have seesionID or not

magic saddle
#

what's the PaymetnIntent ID?

muted spire
#

pi_3QuAE5EO9jafft5P0UoU6VPj

#

you there ??

magic saddle
#

sorry for my late reply

#

yes the PI in question was created from a Checkout Sesion

#

the session ID is not in the metadata of the PaymentIntent

muted spire
#

so as a metadata does the paymentIntent have session_id as checkout session id

magic saddle
#

what you're storing is this

    session_id: "{CHECKOUT_SESSION_ID}"
  },```
muted spire
magic saddle
#

yes I know but you're storing that String

#

which is wrong

muted spire
#

okay

muted spire
#

its listing all checkout sessions but how can i get the specific failed checkout session for payment failed event i am trying to get my sessionID

spice iceBOT
frosty steeple
#

Are you sure you're passing the payment_intent parameter?

muted spire
#

sorry i dont understand
i amhandling payment failure for which i need to get session Id which i am not getting

frosty steeple
#

What is the code you're using to make the API request?

#

You have a pi_xxx ID right, and you want the cs_xxx ID of the session associated to the Payment Intent?

muted spire
#

yes how can i do that i have try somethings

frosty steeple
#

You'd use this API and pass the pi_xxx ID to the payment_intent param. It'll return one session in the list

muted spire
#

SessionCreateParams.Builder paramsBuilder = SessionCreateParams.builder()
.setMode(SessionCreateParams.Mode.PAYMENT)
.setUiMode(SessionCreateParams.UiMode.EMBEDDED)
.setCustomer(stripeCustomerId)
.setReturnUrl(frontendDomainURL + ApplicationURLConstants.PAYMENT_REDIRECT+"?session_id={CHECKOUT_SESSION_ID}")
.putMetadata("customer_id", customerId)
.putMetadata("buildcard_id", id.toString())
.setPaymentIntentData(
SessionCreateParams.PaymentIntentData.builder()
.setSetupFutureUsage(SessionCreateParams.PaymentIntentData.SetupFutureUsage.OFF_SESSION)
.putMetadata("session_id",CHECKOUT_SESSION_ID)
.build()
);

#

these fails then i have try another thing

frosty steeple
#

No, that's your code to create the session

#
SessionListParams params = SessionListParams.builder()
  .setPaymentIntent('pi_xxx')

SessionCollection sessions = Session.list(params)
muted spire
#

also my requirement is after payment failed i want to get sessionId from paymentIntent which these also work in the above code which you have provide

frosty steeple
#

also one more dount these SessionCollection will only return one session id right as per name it wont give collections
That endpoint will always return a list yes, but there'll only ever be one result if you pass the payment_intent param (as a Payment Intent can only belong to one session)

frosty steeple
muted spire
frosty steeple
#

Alright, let us know if that doesn't do what you need!

muted spire
#

yeah let me just see it

#

it worked brother thanks for the help