#WannaLearn-invoice events
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
the difference is especially important when the amount of the invoice is 0
in the first invoice the payment is 0 and the invoice doesn't go through payment but it would be considered as paid
this could be either because there was a discount applied or a trial period
ok great
can you help me a bit more in understanding how to make the webhook works in production environment?
how do I distinguish a particular invoice from another?
from the test that there is on the webhook dashboard, it appears that you only handle every invoice.paid event in the same way
my goal is to (for example) notify a user when their invoice is padi
paid*
sorry I'm not following
even if the invoice is 0 you would also need to send the invoice to the Customer
right?
correct
okay so, my goal is to send a message to a user once his invoice is paid, from my testing I am triggering the same action to every invoice paid, instead I want to trigger slightly different action based on the particular invoice
so you can listen to the invoice.paid event and then use the invoice_pdf https://stripe.com/docs/api/invoices/object#invoice_object-invoice_pdf field on the object you receive in the event
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how the PDF would help me out sir? ๐
if you want to send the invoice to your Customer
it will be automatically generated for you
let me show you real quick
currently, I generate an invoice, it's paid and in my terminal I print "operation successful"
what if I want to print: "operation successful dear {CUSTOMER NAME}"
?
are you talking about Stripe Terminal?
no
look, with this python script I generate a sample invoice
when I pay it, this appears on my local app terminal, as intended
what if want to customize more the action that it triggers?
like pulling email of the customer
what do you need as information?
this is the object you will receive for that event https://stripe.com/docs/api/invoices/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.