#roman_api

1 messages · Page 1 of 1 (latest)

cosmic hillBOT
#

👋 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.

gaunt panther
#

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'])

sly echo
#

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?

gaunt panther
#

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?

sly echo
#

Do give me some time to explain the behaviour

#
  1. Invoice (in_1SSfQhHV8mBGeyFetA0gt7fz) was first created with this request
  2. The first Payment Intent (pi_3SSfQjHV8mBGeyFe0jR73qAD) was then created by the subsequent Invoice finalisation request
  3. 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
  4. 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
sly echo
# gaunt panther

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

gaunt panther
#

Is there any way to create and send an invoice to a user without adding extra lines to transactions?

sly echo
#

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

sly echo
#

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

gaunt panther
#

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.

gaunt panther
sly echo
#

I think to achieve that, you can take a look at this documentation

cosmic hillBOT
deep stream
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

gaunt panther
gaunt panther
#

In my case, it works differently.

#

Maybe I'm misunderstanding something or doing it incorrectly.

deep stream
gaunt panther
#

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.

deep stream
#

pr_test_65Tc3O7LlyzfN3F38ai41HV8mBGeyFeT9E
This is not a PaymentIntent actually

#

Can you share the invoice Id that was marked out of band?

gaunt panther
#

in_1SSfQhHV8mBGeyFetA0gt7fz

deep stream
#

Thanks for sharing.

deep stream
#

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

gaunt panther
#

Or am I doing something wrong?

deep stream
#

No that's the only opiton if you want to use Checkout Session.

gaunt panther
#

Thank you!