#phonicuk - Payment Link Redirects

1 messages ยท Page 1 of 1 (latest)

terse escarp
#

Hi ๐Ÿ‘‹

pastel pond
#

Evening!

terse escarp
#

What are you trying to achieve by adding parameters to the success url?

pastel pond
#

I've got the beta 'URL parameters' feature on my account, what I'd like to be able to do is get back the original client_reference_id that I originally shoved in, or the payment intent id.

Use case is that my checkout-less system could direct the user off to payment for their software licence, and then once checkout is complete I'd have the reference needed to look their transaction up again and present their licence key to them in the browser rather than them having to wait for the email.

terse escarp
#

Okay I just saw something on this. You actually append the client_reference value as a parameter to the Payment Link URL itself.

#

e.g.

https://buy.stripe.com/test_eEOIGJAHODHOHDOFGHHO?client_reference_id=my_customer_123
pastel pond
#

aye, I get that in my webhook just fine so the server has it - but I want the client to be given that value again in the redirect

terse escarp
#

Ah....okay.

pastel pond
#

since I've got no state for my user after that redirect

#

so like https://mydomain.com/success?client_reference_id=my_customer_123 which would let me re-capture my state

#

I am yet again trying to bend payment links further than I suspect they were intended ๐Ÿ˜‰

terse escarp
#

Well Checkout does support dynamic success_urls but mostly to return payment intent ID's to check the status of the payment.

pastel pond
#

the payment intent ID would be absolutely fine

#

so if checkouts already has that function, making it available to payment links would be a nice touch

terse escarp
#

Sorry, checkout session id rather. In my own test integration I have a success url as follows:

"/success?session_id={CHECKOUT_SESSION_ID}",
pastel pond
#

I wonder what happens if I shove {CHECKOUT_SESSION_ID} in that field value same as the checkout API...

#

ooooh that does indeed work!

#

derp it is in fact documented xD

terse escarp
#

Hey, there's a lot of stuff documented. It doesn't mean it's easy to find

pastel pond
#

xD

#

Okay, that's perfect - that suits my needs perfectly. Thanks for pointing me in that direction ๐Ÿ™‚

terse escarp
#

Happy to help ๐Ÿ™‚