Hi, I searched and didn't find if this is a known problem. If you create a profile_type using hook_commerce_customer_profile_type_info() and set 'addressfield' => TRUE (resulting in a second "Billing information" pane), it will auth/capt payments but will not post the addressfield to Authorize.net. This seems to be because "commerce_customer_billing" is being used to check for commerce_customer_address->value() instead of using all declared profile types to check for a value (see commerce_authnet_aim_submit_form_submit() around line 400). I added the following to the function to fix the problem:

  $modules = module_implements('commerce_customer_profile_type_info');
  foreach ($modules as $module) {  	
    if (module_hook($module, 'commerce_customer_profile_type_info')) {
      $profile_types = module_invoke($module, 'commerce_customer_profile_type_info');            
      foreach ($profile_types as $type => $profile_type) {
        $type = 'commerce_customer_'.$type; 
        if ($order_wrapper->$type->value()) {
      	  $profile_id = $type; 
        }
      }  		
    }  	
  }	

Then I just replaced commerce_customer_billing with $profile_id. I would add a patch but this seems more like a hack than anything else. ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rj’s picture

rj’s picture

Title: checkout panes from custom profile_types fail to post addressfield to Authorize.net during checkout » Support for multiple profile types

Renaming the issue and providing a better summary.

AFAIK, commerce_authnet supports only one billing pane, provided by commerce_customer_billing. This becomes an issue if you want to add additional billing panes in a custom module. The above patch allows a site builder to create multiple billing panes.

dwkitchen’s picture

Status: Active » Postponed

I'm note sure why you would not use the billing address in the billing profile. Can you please give some use cases.

rj’s picture

Sure. The billing address cannot be used on more than one checkout page, which is an issue if you have multiple checkout processes.

In my case, I have a 'single page checkout' process that has all checkout panes on a single checkout_page that is then attached to node. In other words, a user selects a product, enters billing address, enters cc info, selects the "buy now" button and the order is immediately processed without leaving the node.

I also need to support a second checkout process, one that follows the traditional checkout -> review order -> checkout complete process. AFAIK, I cannot add the billing address to more than one checkout_page at a time, hence I have two billing addresses: one for the 'single page checkout' and one for the 'traditional' checkout process.

dwkitchen’s picture

Category: bug » feature
Status: Postponed » Needs review

I am still not 100% sure about the requirements, but I can see there is some potential.

I am changing this to a feature request rather than a bug though.

DamienMcKenna’s picture