#pawan425_api
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/1243147058332962880
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
hello
that if i finalize the invoice then i am not able to change invoice item like amount,
that's correct, once the invoice is finalized it can no longer be edited
so only finalize the Invoice once you know the exact amount the user has to pay
but after choosing a plan type(monthly pay or full pay) customer can go back and change the plan as many times he wants
then you would create a new Invoice every time (and delete the previous one if needed).
as i read the docs i can only get the payment intent when i finalize the invoice
correct
as i want my domain has the payment page on which customer needs to open that link and pay
so can i inject my payment intent into invoice ?
so can i inject my payment intent into invoice ?
no, you create an Invoice and it will contain a PaymentIntent when you finalize it
can i open my payment page by only creating invoice ?
like generate a link which customer opens and pay
just like the i am using payment intent
now
like payment secret for invoice, which oopen stripe payment element on frontend
?
you have two main options to pay an Invoice:
- use the PaymentIntent inside the Invoice with the Payment Element
- or redirect users to the hosted invoice page: https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url
i don't want to use stripe hosted page i want my customer to come on my portal and pay the payment using stripe payment element
then yes you can use the Payment Element
but how can use invoice
i need an invoice as well of my customer payment
when they done a downpayment or choose mothly payment option
- create the Invoice
- finalize the invoice
- retrieve the PaymentIntent created by the Invoice and the client secret
- use the client secret to mount the Payment Element
- user enter their payment details
- confirm the PaymentIntent on the frontend
when they done a downpayment or choose mothly payment option
that's step 0, you ask the user what they want, and then create the Invoice
let me explain my usecase
lets suppose i am creating a product for which i need to generate a payment link which is common if the payment is not done
currently i am getting this link by using payment intent
and i am using stripe payment element on my frontend
to show card form
but in this step i am not getting any invoice
which i want
so during the product creating i need a link
and also one important thing is that, customer can change the plan (full pay or downpayment) any no. of time which change the payment amount
I already explained you how to do this:
- ask the user what they want (full pay or downpayment)
- create the Invoice for the correct amount
- finalize the invoice
- retrieve the PaymentIntent created by the Invoice and the client secret
- use the client secret to mount the Payment Element
- user enter their payment details
- confirm the PaymentIntent on the frontend
customer can change the plan (full pay or downpayment) any no. of time which change the payment amount
before doing final payment
yeah I also already answered this question:
then you would create a new Invoice every time (and delete the previous one if needed).
and does stripe charge every api call ?
like generating multiple invoice and then delete them can cause high amount of bill or charge
no, you will only pay a Stripe fee when a user pays for something
making the API call is free
happy to help ๐