#style_best-practices
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/1318669920183128155
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, can you clarify what place_id represents here? What does your exact flow look like? Can you add a bit more context here?
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)
Hmm, you could use metadata: https://docs.stripe.com/api/payment-link/create#create_payment_link-payment_intent_data-metadata and store that additional place_id data when creating the PaymentLink. This metadata/ id would show on the PaymentIntent ID in your Dashboard.
This would mean that each place_id would have their own PaymentLink is that what your setup looks like?
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?
You should try it in test mode first and ensure that is what you want
yes, that's what im going to do. Thank you
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.
yes and that's what I'll be doing, as the logic behind is the same for every place - we just need some way to identify which place should get the tip
I think a better approach is to use: https://docs.stripe.com/api/payment-link/create#create_payment_link-custom_fields where your customers wil input the data for the place. However, I know that you do not want them to edit it in any way
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)
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
Hey Toby, thank you pgskc for your time
I'm less familiar with the UTM codes that we discuss in this guide, but maybe they could be of assistance as well:
https://docs.stripe.com/payment-links/url-parameters
though the client_reference_id being in the webhook Events is likely going to work better.
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
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.
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
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.