#shubhamjha

1 messages · Page 1 of 1 (latest)

hasty zodiacBOT
viral salmon
#

Hi! Let me help you with this.

#

Could you please share a Checkout Session ID?

mystic thunder
#

oh wait

#

evt_1Mr19ISBeubK048wPrHlzA2r

#

sorry i cant see session id here

#

?

viral salmon
#

Looking

#

But how is your customer selecting the currency?

mystic thunder
#

i am moking a ui for them

viral salmon
#

What do you mean?

mystic thunder
#

they have option to select which currency they want to pay in through webpage

#

?

#

are you their

viral salmon
#

Okay.
How do you pass the currency to the Checkout Session?

mystic thunder
#

i am making difrrent prices for them

#

and pass that accordingly

viral salmon
#

If they return to the payment later, do you create a new Checkout Session?

mystic thunder
#

no

#

ones they cancel the chkout session they need to create again by selecting the currency

#

like this way

viral salmon
#

So do you Update the existing Checkout Session object?

mystic thunder
#

no

viral salmon
mystic thunder
#

i just want if payment is incomplete then not to locked the currency

viral salmon
#

Okay, so what's the issue?

mystic thunder
#

How to unlock the currency if stripe loked it if payment is incomplete using node js

viral salmon
#

Could you give me an example please? Where you observe this locking behaviour?

mystic thunder
#

look in this payment is incomlete in that case currency is loked to usd

#

i want to unlock it

#

when this issue occur

viral salmon
#

Could you please copy the PaymentIntent ID? pi_xxx

#

But if you create a new Checkout Session, you don't need to care about this PaymentIntent.

mystic thunder
#

pi_3MrczESBeubK048w0LglQ5yI

mystic thunder
#

why

#

i know if payment is success then customer cannot change their currency but here payment is not completed

viral salmon
#

I see. It's because you used a Price with a specific currency for the Checkout Session, and for that a PaymentIntent was created automatically. You can't update a PaymentIntent created from a Checkout Session.

mystic thunder
#

is their any event in webhook to look into this isssue ?

viral salmon
#

So the behaviour is expected.

mystic thunder
#

may be i dont know the mood of customer

#

how can i do this?

mystic thunder
viral salmon
#

Sorry, I don't understand what's the issue.
You are creating a new Checkout Session object every time the customer selects a currency on your website and you redirect them to the Payment Page, that displays the amount in the currency of the Price that you provided, according to the currency the customer selected, correct?
What's the expected behaviour?

viral salmon
mystic thunder
#

if a payment is incomplete where i get it in webhook

viral salmon
#

Okay, I understand. I don't think we have a webhook event for that.

mystic thunder
#

oh

viral salmon
#

But at what moment do you want to receive the event?
As soon as the Checkout Session is created, an incomplete PaymentIntent is created automatically.

hasty zodiacBOT
austere token
#

I guess you'd listen for payment_intent.created events. But note there's no 'incomplete' status in the API. That Dashboard status maps to a a handful of different API statuses

mystic thunder
austere token
#

Yep, that's expected for pi_3MrczESBeubK048w0LglQ5yI. Your customer attempted to pay, we created the Payment Intent but 3DS was requested and not completed

#

It's in a requires_action state

#

What is it you're trying to do exactly?

mystic thunder
#

ok but payment is not completed or success but stripe lockedk the customer currency

#

I don't need to locked it before any success payment how can i do it?

austere token
#

Yep, as explained you can't update/mutate any Payment Intent generated by Checkout

#

So you'd just discard that Payment Intent, and create a new Checkout Session to reflect the currency change

mystic thunder
#

how can i discard it ?

austere token
#

You can't, I just meant forget about it

mystic thunder
#

but can he pay & select new currency after this in new checkout session?

austere token
#

Correct

mystic thunder
#

no that is the issue, now when user enter again, stripe do not allow to open different currency page, its in currency locked status

austere token
#

I don't know what a 'currency page' is?

#

Can you share a code example of what it is you're trying to do?

mystic thunder
#

i mean to say, when we redirect user on checkout page again with new currency price ID.. it throws error

mystic thunder
austere token
#

That's not an API error: that's an error from your webhook handler responding to those events

#

I'm confused by what error(s) you're referring to

austere token
mystic thunder
austere token
#

You'll need a new Customer object

mystic thunder
#

but customer payment is in completete

austere token
#

They must already have another active Subscription

#

If you share the cus_xxx ID I can confirm

mystic thunder
#

cus_Ncu73OdjhPGyv1

austere token