If a site has multiple payment gateways enabled that support commerce_cardonfile, when updating a stored card from a gateway other than Authorize.Net there are numerous notices on the page:

  • Notice: Undefined offset: 1 in commerce_authnet_form_commerce_cardonfile_update_form_alter() (line 431 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Undefined index: txn_mode in commerce_authnet_cim_request() (line 848 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Undefined index: login in commerce_authnet_cim_request() (line 854 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Undefined index: tran_key in commerce_authnet_cim_request() (line 855 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Undefined index: log in commerce_authnet_cim_request() (line 900 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Trying to get property of non-object in commerce_authnet_form_commerce_cardonfile_update_form_alter() (line 436 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Trying to get property of non-object in commerce_authnet_form_commerce_cardonfile_update_form_alter() (line 436 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).
  • Notice: Trying to get property of non-object in commerce_authnet_form_commerce_cardonfile_update_form_alter() (line 436 of /mnt/apci/store/www/profiles/apci_store/modules/contrib/commerce_authnet/commerce_authnet.module).

These notices come from commerce_authnet_form_commerce_cardonfile_update_form_alter(), which does not check to make sure the payment method is authnet_aim before attempting to alter the form.

Comments

BassistJimmyJam’s picture

Status: Active » Needs review
StatusFileSize
new699 bytes

Patch attached.

BassistJimmyJam’s picture

...$payment_method is an array, not an object.

dwkitchen’s picture

Status: Needs review » Fixed

I keep on discovering this sort of bug on other payment gateways as well.

Status: Fixed » Closed (fixed)

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