#Murder
1 messages · Page 1 of 1 (latest)
Hi, can you add ore details here please? I'm not fully understanding the ask here.
So im using Python, and i want to be able to notify the user when a invoice has been payed. But i have no idea if i can do that and if so, then how
You'd want to listen to https://stripe.com/docs/api/events/types#event_types-invoice.paid event in this case.
This webhook event will be fired when an invoice is paid
So just loop through the recent events and if its that type then do x, right?
Just wanna make sure haha
and it would be the "type" that would identify it
What do you mean by 'type'? Can yo share an example?
Can you share this request id? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I'm unsure what you're asking here sorry, can you help reword this?
That in the API docs
And all good i think i got it
Is there a way to simulate this event so i dont have to send money to myself every time i want to test it?
In test mode, you can simulate any of the scenarios without moving any funds with these test cards, https://stripe.com/docs/testing#cards-responses
Additionally, you can trigger events via the Stripe CLI, https://stripe.com/docs/cli/trigger
Oh cool
So with the test mode, al i need to do is toggle it in the dashboard and all my requests and etc is sent to the test mode?
that is correct. If you want to test it programmatically, you can use your test API key: https://stripe.com/docs/keys
It would be located in your Dashboard, https://dashboard.stripe.com/test/apikeys
You can use the test cards from here, https://stripe.com/docs/testing#cards-responses. Specifically, the 4242 card: https://stripe.com/docs/api/invoices/pay
Is there a way to pay the invoice in the dashboard in test mode?
Trying to make a system that generates invoices that a customer can then pay through Stripe
ohhhh i was looking at the wrong thing 🤣
Ah works, that is so cool haha
One more thing
Is there a way to add a field to the event so i can set it as that my code has looked over it already? So i dont log the same invoice multiple times?
Hmm, I do not understand the question. Can you reword it please?
All good i think i got it