#CheckMate-elements-session

1 messages · Page 1 of 1 (latest)

torpid iris
#

Hey, can you elaborate on what you mean by 'session'?

flat valley
#

Hi, can we connect over google meet so I can explain what I am doing. It hard to explain everything over here. I've tried previously but it didn't work out.

torpid iris
#

Unfortunately not!

flat valley
#

we can connect over a call on discord then ?

#

I just want to share my screen and explain

torpid iris
#

I'm afraid not. Feel free to record a video and share if that helps explain the issue!

flat valley
#

cool

flat valley
torpid iris
#

Ok, cool. So can you elaborate on what you mean by 'expiring'? That's not something Elements natively supports

flat valley
torpid iris
#

That's for Checkout, which is a different product

flat valley
#

You are saying "That's not something Elements natively supports" But if you run the app and see the sessions api is being called by the elements. There is no stripe.sessions.create() function called in scope

torpid iris
#

That's a different, private sessions API

#

Completely unrelated to Checkout

flat valley
#

curl 'https://api.stripe.com/v1/elements/sessions?key=pk_test_51KP0OALGEyT9T908Fv0PuwhRMQ2N9sWsrwZQS5hvTan6m6e73Bsv42DyTQwiw63jlluM1tvzeemOrXlE1AvmKY3D00R0yeN1my&type=payment_intent&locale=en-GB&client_secret=pi_3LfguVLGEyT9T9080JZ9Ltpx_secret_KcgAdFB0WfGtKsjLXr2weLXSJ&expand\[0\]=payment_method_preference.payment_intent.payment_method'
-H 'authority: api.stripe.com'
-H 'accept: application/json'
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'origin: https://js.stripe.com'
-H 'pragma: no-cache'
-H 'referer: https://js.stripe.com/'
-H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="104", "Opera";v="90"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
-H 'sec-fetch-dest: empty'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-site: same-site'
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 OPR/90.0.4480.54'
--compressed

torpid iris
#

You can't expire an Elements session. You'd need to implement that yourself

flat valley
#

No wait. Can you elaborate private sessions API ?

#

I have pasted the above cURL that i have found in the network tab

torpid iris
#

It's an internal API that Stripe.js calls when you're using Elements

flat valley
#

So what does it do. Does it means the elements expire after a while ? If yes then how much time ? does the payment_intent expire too

#

Can you please explain me more or provide any documentation ?

torpid iris
#

What is it you're trying to do?

flat valley
#

I want to know if payment_intent has expiry

torpid iris
#

Generally, no

flat valley
#

generally ???

torpid iris
#

It would depend on what the status value is. Some of them are time constrained (requires_action) and may transition to a different state after a certain period of time

flat valley
#

What I am concerned about is ... Suppose a payment_intent is created , I send to the client both publishable key (which stripe sdk has) and client_secret. Now I see that a sessions API is called on elements . Does that mean after a certain amount of time no one can do payment using the client secret and publishable key .

torpid iris
#

No, the Elements 'session' is completely detached from the PI/client_secret

#

The PI itself will also be in a state where it can be confirmed/paid up until its explicitly canceled

#

The Elements session is just retrieving data from your account, the PI provided so it knows which payment methods to offer, etc

flat valley
#

So are the elements expired , can no one use the elements to make payment after some time? If yes , after how much time ?

torpid iris
#

It doesn't expire AFAIK

flat valley
#

So you are saying that the PI doesn't expire and the Elements too don't expire. Then why is a sessions API being called can you please explain ?

torpid iris
#

As I explained, it's an internal API that Stripe.js uses to setup the Payment Element according to the account settings and parameters on the Payment Intent

#

The fact its named a 'session' does not indicate it expires

#

You're confusing Checkout Sessions, which do expire

flat valley
#

Account settings ? Can you please explain what account settings and where I can change that ?

torpid iris
#

i.e. which payment methods are enabled on your account, so which should be shown in the Payment Element

flat valley
#

Ohhh Okay.

#

So to conclude there is no expiry I can confirm payment_intent even after 1 year of creating payment_intent ?

torpid iris
#

Should be fine, yep

flat valley
#

okay cool

#

Just curious to know. If someone simply spam stripe by creating unnecessary payment_intents then do you guys store it in your DB. Won't it take unnecessary space, if you don't have expiry ?

torpid iris
#

I don't know the technical details of how that works, but even if they were to 'expire' they'd still be retrievable (and therefore stored somewhere)

flat valley
#

okay cool

flat valley
torpid iris
#

It updates the Payment Element instance to reflect changes on the underlying Payment Intent

flat valley
#

Cooool

#

where do I get all such glitch demos of stripe

torpid iris
flat valley
#

Thank you very much

violet lance
#

Hi! I'm taking over this thread.