Reputation: 1060
I have a requirement where I need to know what attempt it is when it is invoked. Consider the scenario below:
I have configured web hook setting as shown below:
Here I have specify configuration to invoke webhook 4 times in a month. My requirement is that I want to know that it is the 4th try. I have explored the request object of charge.fail web hook. But couldn't find any configuration. Can anyone let me know how can I know about the retries?
Upvotes: 0
Views: 400
Reputation: 25552
The Charge object would not have this information. The Charge is associated with an Invoice object which is retried after each failure. The information lives on the Invoice instead under the property attempt_count.
You need to listen for invoice.payment_failed
events instead or fetch the invoice via the API otherwise when you get the failed charge event.
Upvotes: 1