#jc-ashley_api
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/1251197278635430091
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there ๐ sorry, but I don't understand the scenario you're trying to describe.
Are you using Checkout Sessions in your flow, and want to enable Invoice creation for that flow? Or are you wanting to manually create an Invoice and then process a payment for it?
@torpid forge are you still around to provide more clarity on what you're trying to accomplish?
yes sory
I saw your first message and though it was automated lol
basically we have created a checkout page where we are charging the customer using their stripeId the transaction goes through but no invoice is created. I want an invoice like a recept to be generated for the customer.
Do you want an actual Invoice, or a receipt?
well when my manager and I were talking about setting this up we said inoices.
they just want when someone subscribes an inoice is recorded and on every payment after that one is made.
we have a profile page where the invoices will be displayed and they can view them from there.
basically I am using a payment method here that charges the customer:
const { error } = await stripe.confirmPayment({
customer: paymentInfo.customerId,
clientSecret,
elements,
invoice: true,
invoice_items: [
{
amount: paymentInfo.amount,
currency: 'usd',
// description: description,
},
],
one_time: true,
subscription: {
plan: 'price_123',
},
confirmParams: {
return_url: `${window.location.origin}/completion`,
},
});
the inoice keys here are just my attempts to activate the invoice part.
It sounds like this whole flow may be easier if you use Subscriptions instead:
https://docs.stripe.com/subscriptions
But if you want to manually handle processing your recurring payment and want an Invoice for those payments, you need to build your flow the other way around. Instead of processing a transaction and then trying to get an Invoice, you need to first create the Invoice and then process the payment for it.
https://docs.stripe.com/invoicing/integration
ok that makes since. so I need to create the invoice then charge the invoice to the customer is what you are saying?
Yup
ok for how the workflow goes:
- The customer selects the product they want
- the checkout page loads with the paymentIntent
- the customer is charged for the product they want.
I think where the invoice creation is needed is between step 2 and 3. am I right?
Between 1 and 2, you need to generate the Invoice so you can use the Payment Intent it creates for rendering your payment form.