#roman_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/1438423328699449434
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- roman_api, 17 hours ago, 10 messages
Not all the code was copied.
invoice = stripe.Invoice.create(
customer=object_data['customer'],
collection_method='send_invoice',
days_until_due=0,
auto_advance=False,
metadata = {
'related_payment_intent': object_data['payment_intent']
}
)
stripe.Invoice.finalize_invoice(invoice["id"])
stripe.Invoice.pay(invoice['id'], paid_out_of_band=True)
stripe.Invoice.send_invoice(invoice['id'])
Hey! do give me some time to take a look at this
Could you send me the Invoice that was created? (in_xxxx)
And what do you mean by three rows for the same transaction amount? Do you mean three events were sent?
in_1SSfQhHV8mBGeyFetA0gt7fz
I need to send an invoice to the customer after a successful sale.
Two successful transactions for the same amount are confusing, as there is only one successful sale in reality.
Or am I mistaken, and this is the correct behavior and data display?
Do give me some time to explain the behaviour
- Invoice (in_1SSfQhHV8mBGeyFetA0gt7fz) was first created with this request
- The first Payment Intent (pi_3SSfQjHV8mBGeyFe0jR73qAD) was then created by the subsequent Invoice finalisation request
- An Invoice payment was made with the field, paid_out_of_band: "True” in this request, this led to the previous Payment Intent (pi_3SSfQjHV8mBGeyFe0jR73qAD) to be canceled
- The Invoice was then sent in this request, subsequently the Invoice was paid outside of Stripe. This created a new Payment with ID pr_test_65Tc3O7LlyzfN3F38ai41HV8mBGeyFeT9E
The first two Transactions in the image you sent are related to each other
The first one that says succeeded is the out of band payment (pr_test_65Tc3O7LlyzfN3F38ai41HV8mBGeyFeT9E) and the second one that says canceled is the Payment Intent pi_3SSfQjHV8mBGeyFe0jR73qAD
Is there any way to create and send an invoice to a user without adding extra lines to transactions?
Could i clarify what you are trying to achieve with your current payment flow ?
Understanding it will help me to point you in the right direction
The top two transactions rows in the image that you sent are expected
however, the transaction on the last row, with the payment intent pi_3SSfQ5HV8mBGeyFe1nBo4X8x was generated with a checkout session, and the payment was captured and completed in a separate request
Actually, I have two goals:
To send an invoice to the customer as proof of purchase and for proper documentation.
To build analytics based on transactions and invoices.
It seems to me that it would be more correct to create an invoice for the generated payment intent when using a Checkout session. Is this possible?
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Yes, I know that this feature is available.
The problem is that I create a Checkout session with certain parameters:
mode=payment
payment_intent_data={capture_method=manual}
and with these settings, invoice creation is not available.
Hi!
This is a continuation of yesterday's thread:
#1438136599396356269 message
In my case, it works differently.
Maybe I'm misunderstanding something or doing it incorrectly.
Can you share the invoice and the transaction Id you are referring to?
Created after the Checkout session:
pi_3SSfQ5HV8mBGeyFe1nBo4X8x
Created after sending the invoice:
pr_test_65Tc3O7LlyzfN3F38ai41HV8mBGeyFeT9E
By creating an invoice after the payment is processed, I pursue two goals:
To send an invoice to the customer as proof of purchase and for proper documentation.
To build analytics based on transactions and invoices.
pr_test_65Tc3O7LlyzfN3F38ai41HV8mBGeyFeT9E
This is not a PaymentIntent actually
Can you share the invoice Id that was marked out of band?
in_1SSfQhHV8mBGeyFetA0gt7fz
Thanks for sharing.
The related PaymentIntentpi_3SSfQjHV8mBGeyFe0jR73qAD's status is canceled so there was no transaction created
I think the confusing here is the payment transaction/charge and the PaymentIntent created
I think in your analytics, you should not consider canceled PaymentIntents
Perhaps there is a better flow for my use case?
Or am I doing something wrong?
No that's the only opiton if you want to use Checkout Session.
Thank you!