#kirito - post payment flow

1 messages ยท Page 1 of 1 (latest)

dim hillBOT
grand raven
#

You would have to poll the status of the subscription/invoice which would not be reccommended

#

Is there a reason you want to avoid using webhooks here?

#

If you are confirming these payments on your own page you can also send a signal about the payment completing from that page, which can sometimes get you the notification faster, but the client connection can cut out so you would still want the webhook for reliability

crystal sparrow
#

How can I send a signal to my page ?

#

I think I could use webhook to update data in my database and signal to informe user when payment is done

grand raven
#

There are a lot of options there. A common one that I have seen is for your page to make a POST request to your server and for your server to verify that the payment is done and send back whatever info you want about the success

crystal sparrow
#

is there no way to receive it directly from stripe?

grand raven
#

Yes, our Stripe.js functions will return the status of the payment

#

You are likely using something like confirmPayment which can return a full payment intent object

#

Though again, keep in mind that you need webhooks in case the client connection goes away before your server hears about the successful payment

crystal sparrow
#

I understand, thank you.

#

my next question is :

#

could I get the receipt instead of the invoice

grand raven
#

Good question, will look to see if you can get a receipt URL

crystal sparrow
#

Thank you

grand raven
crystal sparrow
#

How do I get the charge object using webhooks, wish event and data object should I use?

grand raven
#

kirito - post payment flow

#

PaymentIntent objects have a latest_charge parameter that would be the ID of the relevant Charge, you can retrieve the charge from there.

Otherwise you can listen to the charge.succeeded event

crystal sparrow
#

I understand, thank you so much ๐Ÿ™