I am developing api access point for drupal commerce, from that access point user can upload his/her billing information during checkout process. Here is my code, but it can not add user full name in billing information. Any suggestion is greatly appreciated.
Thanks
function commerce_services_bill_ship_create($data, $flatten_fields) {
$status; $message;
$orderId; $uid;
$orderId =$data["orderId"];
$uid = $data["uid"];
$fullname = $data['fullname'];
$order = commerce_cart_order_load($uid);
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
$order_wrapper->commerce_customer_billing->commerce_customer_address->name_line = $fullname;
$order_wrapper->commerce_customer_billing->commerce_customer_address->thoroughfare = "No.1, ABC street";
$order_wrapper->commerce_customer_billing->commerce_customer_address->locality = "New York";
try{
// Save the order.
commerce_order_save ($order);
$status = 1;
$message = "order update successfully.";
}catch(Exception $ex){
$status = 0;
$message = "order can't update successfully.";
}
$reply= (array('status' => $status,'message' => $message));
return $reply;
}