#dorian6730_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/1278119421923295413
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there!
HEY HEY!
PaymentIntents are more of a "low level" object type, so it's only possible to pass an amount, not price or quantity like you would with a Subscription or Invoice
Ah ok
So in the case where it isnt a subscription, and I want items (price and quantity) to appear on the receipt, do I instead need to create an invoice and if so, can the invoice be immediately charged to a payment method that I pass in and will I get an immediate success/failure response (in the case of card)?
You could look into adding a description for your PaymentIntent. The description value should propagate to the receipt you send: https://docs.stripe.com/receipts?payment-ui=direct-api#customizing-receipts
I'd like to display indiovidual line items (I already do this for subscriptions)
Actually, the description value will propagate to the Charge object, and this is what's used for the receipt
Ah, I see
Can I create a one-time invoice that is immediately charged and pass in prices and quantities?
You could if you're creating an Invoice for an existing Customer where that Customer already has a saved PaymentMethod
Yes I will have both customer and payment method already
Got it. For instances where you need to collect PaymentMethod details from your customers, you could look into using Checkout and use invoice_creation: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation
Another option could be to build out these receipts on your end altogether. That would give you more control overall but would require more dev resources