#marimuthu_code
1 messages · Page 1 of 1 (latest)
👋 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/1283410369011777658
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
when you create the Payment Link you have the option to redirect users to your own website.
are you using the API or the dashboard to create it?
I am using dashbaord
I set redirect users to your own website, but I want to pass custom param in payment link once payment is done it should redirect with custom param and charge id
Like how stripe is working in stripe elements
When I set redirect users to your own website. its just redirecting to my website I dont know the user is subscribed or not
@frigid island
this is explained here: https://docs.stripe.com/payment-links/post-payment#change-confirmation-behavior
you can include {CHECKOUT_SESSION_ID} in the redirect URL to dynamically pass the customer’s current Checkout Session ID.
But session Id is something can be done in API Level right?
what do you mean?
How can I create a CHECKOUT_SESSION_ID, Because my client has given only payment link
you don't create one. the Payment Link automatically creates a Checkout Session for you.
just add the string {CHECKOUT_SESSION_ID} in the return URL, and it will be automatically replaced with the Checkout Sesion ID the Payment Link created
https://dev.go-koala.com/succes?=id{CHECKOUT_SESSION_ID} something like this?
almost: https://dev.go-koala.com/success?id={CHECKOUT_SESSION_ID}
Perfect. it works. I have unique tracking code, When I am giving payment link to user it will be like this
https://buy.stripe.com/test_5kA01m3MM9NHcfKfYY?state=xxxzzzxxx
How can I get back this state param in my return url, so I can track who paid
That's not how this works. CHECKOUT_SESSION_ID is a special parameter Stripe populates automatically. We don't support custom params afaik..
You can set state to Checkout metadata and retrieve that value from checkout object once you have checkout session ID
How can I add state & prefill it from URL.
Sorry If I disturbing you a lot
Currently I am in advanced option's How can I make state as invisible field and pass it as meta data
You can't set/prefill custom fields for checkout sessions created using a PaymentLink.. You can only set that if you're creating checkout sessions directly using the API.
These are all the customizations PaymentLink supports: https://docs.stripe.com/payment-links/customize
and only these fields can be prefilled - https://docs.stripe.com/payment-links/customize#customize-checkout-with-url-parameters
Checking
Only Email, Promo code and Locale is prefilled ? Cannot prefill my custom lable?
@misty herald @frigid island
yeah that's exactly what I said above
Okay. Is they any way to match with my unique state param?. Because I want to store it in my DB like who is paid
~~#1283410369011777658 message
You can set state to Checkout metadata and retrieve that value from checkout object once you have checkout session ID~~
😦
Okay. Any other suggestions?. So it will help me a lot
I want to match in my db like who paid.
If you have your own user/customer ID in your database, you can pass it using client_reference_id query parameter: https://docs.stripe.com/payment-links/url-parameters#streamline-reconciliation-with-a-url-parameter
This parameter will be added to checkout session object. You can retrieve checkout session once you have the CHECKOUT_SESSION_ID and look at it.
Checking
Thats cool
This is enough for me
It helps a lot
Thanks a lot @misty herald
Awesome, happy to help
Sorry to disturb again
I dont see payment_intent id in empty when I retirve data from cs_test_a14VPF3GfAWkCTMImHZg6cqlBUo8f5A2s5A8ja1ojL21OvT4aplXebAOz8
I have invoice id, I to the payment_intent id from invoice API
Thanks It solves my requirment
Yup, payment_intent is only available in payment mode - https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-payment_intent
Thanks once again dude