#cludio-figueiral_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253255144011730968
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, there is not. You would need to pass the price id, https://docs.stripe.com/api/payment_links/payment_links/create#create_payment_link-line_items-price
If the price is the same, you would not need to create new ones each time.
ok, but then what do you recommend? do a get on all the products to confirm if there is already one with the same description and then do a get on all the prices of that product to confirm if that price already exists and if there is, use that one If it doesn't exist, create a new one?
Yes, but the way Payment Links works is that you create this once with the Price and you share it with customers so the price would already be defined.
I haven't yet seen how your webhook works, but I was thinking about creating a payment link for each appointment and only allowing it to be paid once so I know that the payment relates to that appointment. Because if I send the same link to several customers and they make several payments, how can I then know which markup it refers to?
Hey! Taking over for my colleague. I think you can use url parameter to reconciliate your PaymentLink:
https://docs.stripe.com/payment-links/url-parameters#streamline-reconciliation-with-a-url-parameter
ok, and how can I pass this parameter when I create the payment link via the API?
If you are using Stripe APIs, then you should use Checkout Sessions and not Payment Link
Is there a particular reason for using PaymentLinks ?
So that you create a unique Checkout Session for each customer/appointment
It may make sense, but the reason for using the payment link is because the person making the appointment will be the professional and then I need to send the link to the client so they can make the payment for that appointment. My use case is not for when the customer makes the appointment online. With checkout, would you also be able to send the link to the customer to pay?
With PaymentLink, you can add custom fields and collect customer details https://docs.stripe.com/payment-links/customize#add-custom-fields or collect their email/phone etc in order to identify it after checkout.
But if you want to have a unique identifier per Checkout Session from your Server/Code then you should create a Checkout Session for each customer
With checkout, would you also be able to send the link to the customer to pay?
And to answer this part, yes you can share the Checkout url with the customer to pay
ok, it seems to me that it really is the checkout that I wanted and not the payment link. I will try to integrate the checkout and if you have any additional questions, I will get back to you. Thanks