#dbugger_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/1250536793019777106
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello
Hello @winter sparrow , nice to meet you
If you want to send a link out (like over email) then you want to work with Payment Links
Checkout Sessions and PaymentIntents are for when a customer would be on your website and in your checkout flow
Nice to meet you too ๐
Yeah, well. I was looking at the example on how to use Payment Links
const paymentLink = await stripe.paymentLinks.create({
line_items: [
{
price: 'price_1MoC3TLkdIwHu7ixcIbKelAC',
quantity: 1,
},
],
});
It seems like a Price ID is needed, but the users of my platform do not necessarily have their products/services listed in Stripe. It could be something as simple as an artist that made a particular painting, and wants to send the invoice to the buyer.
Yeah you'll have to define a Price to represent the amount to charger. You can create that Price just before creating the Payment Link but it is required.
Mmm... isn't there a simpler way to do that? Something like (pseudo-code)
const {url} = stripe.easyPayment.create({
amount: 123,
description: "foo",
currency: "usd"
})
Sure you can do that if they are on your site in your checkout flow
But no, not to return a URL that you then send out
Yes you would use PaymentIntents if you build a custom flow (where you collect payment methods using Elements)
Or Checkout Sessions if you want to use our hosted checkout page
But with Checkout Session I also have to create a Price ID, no?
Yes but you can create it inline at the time of Checkout Session creation using price_data: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
I see. In any case, the Price ID is created. And I assume that this information is tracked by my account, no?
Because I wanted to stay completely out of the payment between my users and their clients
I'm not sure exactly what you mean by that, but overall it sounds like you want to use Stripe Connect here with Standard Accounts and you would create the Prices and Checkout Sessions direclty on the Connected Accounts -- nothing exists on your platform in this case.
Yes, in my site I have a "Connect with Stripe" button, that gives me an Account ID, that is saved in the DB
stripe.accounts.create({ type: "standard" })
So basically, I was hoping that I could just create a payment link, assign it to the invoice, and just display it when the user sees the invoice
And storing as little data as possible of this transaction
since i want to stay out of it as much as possible
You can create Invoices directly, which do come with a Hosted Payment Page as well
That would be another alternative here
Make it as direct as possible, between the user and his client
But wasn't aware initially you wanted to use Invoices
Ah, no. Invoicing is the service I offer ๐
Ah
My Saas is an invoicing system for small businesses and freelancers
LIke this (fake data)
So basically, I wanted to offer the possibility to create payment links, that the user could send to their clients via email
But the whole payment thing should happen directly between the user and his client
How will they see that screenshot? Is that hosted on your site?
My site is https://invoicemaster.org if you want to check it out
Effortless invoicing, client management, and financial tracking for freelancers and small businesses. Create professional invoices, manage clients, and streamline your billing process with Invoice Master.
It is basically a website kinda like Xero
Okay well yeah the best thing to do here is still use Payment Links. There are no limits on the amount of Prices nor Payment Links, so you basically are going to want to just create a Price with the corresponding value of the Invoice and then create a Payment Link for that Price.
That is really the only way to send out a URL like you are trying to do
All the other flows we provide (other than our own Invoicing product), expect the customer to be on your website in order to pay at that time.
Actually, I suppose the workaround would be for you to send out your own link in the email which then directs them to a payment page on your own site
That works too
And would not require a Payment Link
I would rather that the payment would be a Stripe checkout, since it inspires more trust to the buyer, than anything that I can design
I guess I will have to create Price IDs for them. Shame.
I wanted to avoid creating as many "db entries" as possible, to make my code as simple as possible ๐
But if it cant be helped, then it cant be helped
Yeah as I said above there is no limit on Prices
So you don't really have to store them in your database if you don't want to
Can I create inline prices also with Payment Links? Or only with Checkout sessions?
No, only Checkout Sessions. Payment Links are designed for a one-to-many use-case.
Yeah, I know, but the least IDs there are to track, always the better ๐
Anyway, I guess that answers my question!
๐
Sure thing
Take care ๐