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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | commerce-cardonfile-alter-verify-payment-method-1976866-2.patch | 701 bytes | BassistJimmyJam |
| #1 | commerce-cardonfile-alter-verify-payment-method-1976866-1.patch | 699 bytes | BassistJimmyJam |
Comments
Comment #1
BassistJimmyJam commentedPatch attached.
Comment #2
BassistJimmyJam commented...
$payment_methodis an array, not an object.Comment #3
dwkitchen commentedI keep on discovering this sort of bug on other payment gateways as well.