private function updateBilling($data) { //update the users billing address $customer = new Customer(); if ($customer->isGuest()) { $customer->setEmail(trim($data['email'])); } $customer->setValue("billing_first_name", trim($data['fName'])); Session::set('billing_first_name', trim($data['fName'])); $customer->setValue("billing_last_name", trim($data['lName'])); Session::set('billing_last_name', trim($data['lName'])); $customer->setValue("billing_phone", trim($data['phone'])); Session::set('billing_phone', trim($data['phone'])); $address = array("address1" => trim($data['addr1']), "address2" => trim($data['addr2']), "city" => trim($data['city']), "state_province" => trim($data['state']), "postal_code" => trim($data['postal']), "country" => trim($data['count'])); $customer->setValue("billing_address", $address); Session::set('billing_address', $address); }