The AuthNet doesn't send a transaction ID if the transaction failed (responseCode=0). So in this case, we need to get out immediately because there's nothing we can do.
See an example of the error that occurred below:

php.WARNING: Warning: Undefined array key "id" in Drupal\commerce_authnet\Plugin\Commerce\PaymentGateway\AcceptHosted->onNotify() (line 400 of /mnt/www/html/docroot/modules/contrib/commerce_authnet/src/Plugin/Commerce/PaymentGateway/AcceptHosted.php
php.ERROR: TypeError: Drupal\commerce_authnet\Plugin\Commerce\PaymentGateway\AcceptHosted::getPaymentTransactionDetails(): Argument #1 ($transaction_id) must be of type string, null given, called in /mnt/www/html/docroot/modules/contrib/commerce_authnet/src/Plugin/Commerce/PaymentGateway/AcceptHosted.php on line 400
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vmarchuk created an issue. See original summary.

vmarchuk’s picture

Status: Active » Needs review

  • vmarchuk committed 454b6424 on 2.x
    Issue #3584877: Update the onNotify method to only handle webhooks with...
vmarchuk’s picture

Assigned: vmarchuk » Unassigned
Status: Needs review » Fixed

Committed!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • vmarchuk committed 454b6424 on 8.x-1.x
    Issue #3584877: Update the onNotify method to only handle webhooks with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.