Closed (fixed)
Project:
Commerce Authorize.Net
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Mar 2013 at 21:48 UTC
Updated:
25 Apr 2013 at 10:50 UTC
After updating to the newest release of commerce_authnet, I got the following errors on checkout:
Notice: Undefined index: card_types in commerce_authnet_aim_submit_form() (line 280 of /.../sites/all/modules/commerce_authnet/commerce_authnet.module).
Warning: array_values() expects parameter 1 to be array, null given in commerce_authnet_aim_submit_form() (line 280 of /.../sites/all/modules/commerce_authnet/commerce_authnet.module).
Warning: array_diff(): Argument #1 is not an array in commerce_authnet_aim_submit_form() (line 280 of /.../sites/all/modules/commerce_authnet/commerce_authnet.module).After editing the AIM payment settings and clicking Save without modifying anything, it the warnings are then suppressed. It looks like commerce_authnet_aim_submit_form() assumes that the 'card_types' index is available in the payment gateway settings without checking first.
I did not verify, but would assume this is easy to reproduce on a new site by enabling the AIM payment gateway without first editing the settings and then attempting checkout.
Comments
Comment #1
dwkitchen commentedI have changed the lines to:
so it will check if the card_types has been set first.
This will be in the next dev release and then in the 1.1 release.