Is there any hook or rules event that will help to catch the payment failure in Drupal Commerce?
Thank you
Is there any hook or rules event that will help to catch the payment failure in Drupal Commerce?
Thank you
There is no direct hook or event, but essential to payment transactions in Drupal Commerce is that they should be created for every attempted transaction, not just complete ones. This means when a payment fails, a payment transaction will still be created for your order. Thus you can hook into the payment transaction creation process (or use Rules on the related event) to look for failed transactions based on the transaction status.
Try using the hook_commerce_payment_transaction_status_info()