Retrieving customer information to use in drupal commerce payment module I'm new to drupal development and am programming a payment module for the new drupal commerce module.  It's will be a basic api module that allows the user to stay on the site and makes a separate curl call to send the data and use the response to indicate success or failure. 

I copied the authorize.net aim payment module and have so far gotten to a point where I'm correctly posting the information that's being sent using the authorize module.  However the payment system I'm using requires the customer name and billing address and I'm not sure about how to go about gathering that information.  I know in the order there is a user/customer profile id but I don't know how to get any other information about the customer.  I do know that the billing address is gathered, it just isn't sent to authorize.
The customer profile is attached to the order, and it has an address field that holds the information. To get it you could do;

$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
$address = $order_wrapper-&gt;commerce_customer_billing-&gt;commerce_customer_address-&gt;value();
$postal_code = $order_wrapper-&gt;commerce_customer_billing-&gt;commerce_customer_address-&gt;postal_code-&gt;value();
...


It's a lot simpler to use the entity metadata wrapper as shown above. What it does is that it loads the customer profile entity for you and let you access it's field.