Processing charge.failed event is too restrict
When endpoint processes charge.failed it calls
getsingle is more restrictive than
get because when contribution does not exist then
getsingle throw exception.
I have such history of Stripe donations:
On 5. step there is no contribution in CiviCRM yet. This is a single donation, not subscription.
My idea is such:
Contribution.getwith trxn_id = chargeId
- when contribution exists, update status to Failed
- when contribution does not exists, create it with Failed status