#guillaumemnt_best-practices

1 messages ยท Page 1 of 1 (latest)

wintry roverBOT
#

๐Ÿ‘‹ 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/1399330392418422785

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

crystal narwhal
#

hi there!

delicate sapphire
#

Hello Soma !
With our previous payment implementation, we were relying only on payment intent from invoice. When the payment was succeeded, emails were well sent to customers but we switched this logic to be compliant with EU invoicing (only create invoice on succeeded payment).

Our new flow first create the payment intent. On payment intent succeeded webhook, we create the invoice, finalizing it and attach the payment.

What's wrong with that is that emails are not sent automatically, in order to force the email, we're now using the send method from invoice but with this, emails sent contains the paid button despite the invoice being totally paid + changed the collection method & due date on invoice creation. (other behavior detailed in the thread)

Is there a better approach that I'm not thinking of ? Thank you

#

There's also this unwanted behavior, since creating and finalizing an invoice create a payment intent, we have a second payment created and directly turned cancelled Causing to have 1 additional payment in the dashboard (cf screen attached)

#

About the initial question with the emails not being send. I suspect the stripe invoice still considered as unpaid, and it might result of the non email send

If you need request ids

  • pi_3Roo8ZFkXepB3Hjw1S7Sv3C4
    payment intent created req_E2yTDnvpfmmu9Z
    payment intent confirmed req_MVLPolZ50MUgdj
  • in_1Roo9nFkXepB3HjwmQgHrcko
    invoice created on succeeded payment req_Wb3TqR96lZtZ4b
    Invoice attach payment req_bbgFgXOLtj4hpY
    invoice send req_b2rMEQJrxDj5lG
crystal narwhal
#

thanks, will look into this.

#

There's also this unwanted behavior, since creating and finalizing an invoice create a payment intent, we have a second payment created and directly turned cancelled Causing to have 1 additional payment in the dashboard (cf screen attached)
looks like you can only attach an existing PaymentIntent to an Invoice when the Invoice has an open status. Which means it would already have a PaymentIntent created for it. So looks like you can't avoid seeing two PaymentIntent on the Invoice itself.

#

now looking at your other questoin.

delicate sapphire
crystal narwhal
#

what is the issue with seeing two PaymentIntent in the Dashboard, with one being cancelled?

delicate sapphire
#

I don't see issue, we might get question from our connected account asking why there are two payment ahah, but it's a detail. Thanks for answering this one

crystal narwhal
#

yes I agree it's not ideal, but I don't see a way to avoid this.

#

What's wrong with that is that emails are not sent automatically
can you calrify which email exactly? a payment receipt for the successful payment? the Invoice itself? something else?

delicate sapphire
#

These kind of emails I think.
When you enable this on the dashboard

crystal narwhal
#

got it. and if I understand correctly:

  • if you don't call /send, the email is not send
  • and if you do call /send, then users do receive the email
delicate sapphire
#

Correct, but the email with the send method will have the paid button (with 0 as amount due) and the invoice with the amount not reflected with what was paid. I think it's because the attach was done after finalizing the invoice. But we cannot attach the payment before because you can only attach the payment after finalizing the invoice

crystal narwhal
#

oh I see.

#

you don't want the users to be able to pay that invoice (since it was already paid). instead you just want to send them the pdf invoice?

delicate sapphire
#

Correct !

#

Just like the automated invoice sent on succesfull payment

crystal narwhal
#

one option would be for you to manually send the email with the PDF included. but let me think if there's a better way.

delicate sapphire
#

to manually send the email with the PDF included
Without the stripe methods you mean ? ๐Ÿค”

crystal narwhal
#

yes, this way you have more control on the content of the email.

delicate sapphire
#

Is there another way ? We'd like to use your methods if possible. Can we do something to raise this issue ? (if it's an issue)

crystal narwhal
#

the ability to pay an invoice with an existing PaymentIntent is quite new, so there are some rough edges. I recommend sharing your feedback about the double PaymentIntent and the emails to Stripe support directly. https://support.stripe.com/contact