#OneShot - payment intent + product
1 messages ยท Page 1 of 1 (latest)
You can create one off invoices using the products and prices that you have made https://stripe.com/docs/billing/invoices/subscription#manage-invoices
The PaymentIntent objects themselves don't have a concept of our price/product objects, so you can still use the prices that you created if you would like. You just have to add them up yourself
Hi, thanks for replying
I actually don't want to use subscriptions for now
But just charge for regular product
Is it possible to create the customer, attach the product and then start the payment flow?
Is there any example for this?
I was talking about a standard payment intent creation and supplying whatever amount you have calculated https://stripe.com/docs/api/payment_intents/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you tell me a bit more about what you mean by attaching the product to a customer and starting the payment flow?
What i would like to avoid is having to setup the price by myself, as the price is already created on the stripe product
In the subscription flow, you first create a customer, then you create the subscription products, and when the customer picks one, you create a subscription invoice with that product id that have the price information, and then the payment.
While making a single charge, do i have to set the price by myself or can i somehow get the price automatically from the product coming from Stripe?
Any help or suggestion please?
Hi ๐ jumping in as my teammate needs to step away. Bear with me a moment while I get caught up.
Thanks
There are a couple options:
As my teammate mentioned, you could create one-off invoices. This will be the approach that most closely matches the subscription flow that you were looking at.
https://stripe.com/docs/api/invoices/create
https://stripe.com/docs/invoicing
You can also create Payment Intents directly. When doing this you can retrieve the Product/Price from Stripe to determine the amount so you can still reference your existing objects.
You could also use Checkout Sessions if a hosted checkout experience fits your flow.
https://stripe.com/docs/checkout/quickstart
Creating the invoice, would i be able to go to my custom payment flow and have the user pay for it?
I'm currently using the react stripe library, using the payment element
Yeah, the invoice would still generate a Payment Intent the way an invoice for a subscription would. Then you pass that intent through your flow.
Oh i think that should work
Thanks for that
I have another quick question
Regarding to taxes, is there a way to get the tax amount from stripe on my custom checkout?
We have a couple tax options:
Stripe Tax is a solution that automatically determines tax amounts based on customer info and product codes:https://stripe.com/docs/tax
Or the more manual (and more free) version of that is to use Tax Rates to define the tax amounts you want to collect:
https://stripe.com/docs/billing/taxes/tax-rates
Thanks, i think the second one is the one i'm looking for