#style_best-practices

1 messages ยท Page 1 of 1 (latest)

tribal ospreyBOT
#

๐Ÿ‘‹ 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/1318669920183128155

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

robust stag
#

Hi, can you clarify what place_id represents here? What does your exact flow look like? Can you add a bit more context here?

subtle moss
#

Sure! So we've got places saved on our backend, place_id is just an identifier on our side. User can find their favourite place on map and then click a button to tip it. My idea was to redirect them to stripe's page (payment links), with some parameter, so then we can identify what place they wanted to tip. (Hopefully we can then see that place_id in stripe's dashboard next to user's payment)

robust stag
subtle moss
#

Oh i must have missed it thank you, i think it will work

#

Not really, we've wanted to use one payment link for all of these places

#

and just change place_id in meta, but i guess it is possible with metadata field?

robust stag
#

You should try it in test mode first and ensure that is what you want

subtle moss
#

yes, that's what im going to do. Thank you

robust stag
#

PaymentLinks is designed to be used a bit differently.. As you scale, updating the PaymentLink each time might not be reasonable.

#

You create one PaymentLink that you can share with many customers. It has a more one to many relation.

tribal ospreyBOT
subtle moss
robust stag
subtle moss
#

I mean if there is any way to prefill this input then it's alright

#

But i couldn't find any as well

#

The last idea i had was to just use place_id as client_reference_id (we don't really need to track customers, and they are tracked by email anyway)

tiny socket
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away.

#

Ha, you beat me to it, I was just about to suggest trying to leverage client_reference_id

subtle moss
#

Hey Toby, thank you pgskc for your time

tiny socket
subtle moss
#

yeah, i think it will do the job. What a shame that Stripe does not support any additional metadata for payment in payment links

#

Well thank you, that's what i'll do

tiny socket
#

It is a bit tricky because Payment Links are more of a one-size-fits-all-customers solution like my teammate mentioned. Checkout Sessions would give you similar behavior (they also direct your customers to our hosted checkout experience) but allow you to pass more transaction-specific context along with the Checkout Session object.

subtle moss
#

Oh i need to take a look at it, i decided to use payment link due to their simplicity and all of the "donate" concept builtin

tiny socket
#

This is a good place to start for that:
https://docs.stripe.com/payments/checkout

The UI you see when using Payment Links as a customer, is a Checkout Session. The Payment Link will create Checkout Sessions for you. If you instead create those yourself, you get a bit more control over the per-transaction specifics, but have to do a bit more coding. Checkout Sessions are more of a low-code solution, whereas Payment Links are closer to no-code.