#tohidi_code

1 messages · Page 1 of 1 (latest)

distant sierraBOT
#

👋 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/1335962848270090362

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

polar sand
#

Can you share the checkout session id ?

deep sparrow
#

yes '/payment/request_embed_payment/verify/Stripe/?session_id=cs_test_a1LOxCWdzq2XuCrckBR28sy48CGTuruj9bqUj5xW35XTjHl5Htqrc97rr9'

polar sand
#

I see a Subscription created for that Session, here it's Id: sub_1QoNNoFQGJKajUQvExor1qIi

deep sparrow
#

yes becuse i submit it again
but at first time when comes to return_url, it didnt make any subscription
let me crate new one transaction

polar sand
#

Yes please and share it back with us...

deep sparrow
#

{'session_id': 'cs_test_a12u8bLHxBYJ9mJmkOWy7RDidtCJF4ZAqpc5lPCT4CY48gRojPmoXJR9ie'}

#

it returns in return_url

#

but when i retrive that here, session = stripe.checkout.Session.retrieve(params["session_id"]), it sayes this session not paid and without eny subscription

#

but when i refresh the url again manualy, it will become paid and create subscription

polar sand
#

Ah it seems like this is a concurrency issue, in your return_url you should simply show a successful message

#

and fetch the Subscription in a couple of seconds (or you can keep retrying (for example every 5sec) untill you got the Susbcription created)

deep sparrow
#

Thanks! I actually considered this approach but was unsure if it was safe or if the issue was coming from somewhere else.

Is this the best practice for Django and embedded JavaScript? ‌Becuse thats a new one

#

I am looking for good one for front config with javaScript

polar sand
#

This is not related to Django, but it may take some times to create the Subscription in the background.

#

The return url should display only a success page.

distant sierraBOT
deep sparrow
#

I am looking for good one for front config with javaScript in html page for embed checkout

fast venture
#

Hi, I'm taking over as my teammate needs to step away. Let me catch up

deep sparrow
#

Thank you

fast venture
#

Sure