#will_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/1403041309362491503
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Clarification about my current payment flow:
- create payment intent
- confirm through payment sheet
- do some work -- upload user data
- when work completes, capture payment
Hey there
Hello
Unfortunately no, Invoices do not support manual capture.
So you would not be able to use Invoices if you want to use manual capture.
🙁
What if I create the invoice in the part of my code where I capture the PI? That is, I attach the payment intent and then immediately capture it?
You could capture the PaymentIntent and then create an Invoice and mark it as paid separately.
Okay, thank you for that suggestion. However, I'm struggling to understand why attaching a PI to an invoice would not work.
From the attachPayment documentation: "For the PaymentIntent, when the PaymentIntent’s status changes to succeeded, the payment is credited to the invoice, increasing its amount_paid. When the invoice is fully paid, the invoice’s status becomes paid."
Could you briefly explain why attachment wouldn't work here? It seems to me that, upon successful PI capture, the associated invoice would change to paid; or, on failure, it would send an email notification and attempt to retry.
Ah sorry I see what you are saying. Attaching payments to Invoices is part of the new API version so this was a recently added feature. So yeah this should work fine -- it is similar to what I was describing above but you would have actual reconciliation.
I'd do a quick test in test mode here but yeah you are correct that this should work.
That's great! I understand that invoice items are also part of the equation. If I moved forward with the payment-intent-attachment solution, do you know if it would also be necessary to create an invoice item, or would the payment intent be sufficient?
Yeah you would still need Invoice items in order to have a finalized Invoie that you can then attach the PaymentIntent to.
Okay, thanks. I have another question. Say my product costs $20, so I'll have a payment intent for $20. Like you said, I'll also need to create an invoice item. I'm curious about the amount and pricing fields for the invoice item: should I make the amount $0 since I'll be attaching a $20 payment intent? Can I leave the amount and pricing fields blank? My worry is double-charging the user