<?php require_once '../QuickBooks.php'; $Customer = new QuickBooks_QBXML_Object_Customer(); $Customer->setName('Child Derpé Customer Name'); $Customer->setPhone('860-634-1602'); $Customer->setEmail('*****@*****.**'); $Customer->setFirstName('Keith'); $Customer->setLastName('Palmer'); // Set the parent of the customer $Customer->setParentFullName('Parent & Customer Name'); // You could also set the parent customer by ListID too //$Customer->setParentListID('ABCD-1234'); print $Customer->asQBXML(QUICKBOOKS_ADD_CUSTOMER, 6.0, QUICKBOOKS_LOCALE_ONLINE_EDITION);
function _quickbooks_customer_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) { //Fetch the customer using ORM with the unique ID $mycustomer = ORM::factory('customer', $ID); //Fetch all your customer details using the ID passed back up to this function $firstname = $mycustomer->firstname; $lastname = $mycustomer->lastname; $fullname = $firstname . ' ' . $lastname; //Generate a QBXML object $Customer = new QuickBooks_QBXML_Object_Customer(); $Customer->setFullName($fullname); $Customer->setFirstName($firstname); $Customer->setLastName($lastname); $Customer->setCompanyName($companyname); //Format the proper QBXML to return to the web connector $qbxml = $Customer->asQBXML('CustomerAddRq'); $qbxml = $this->formatForOutput($qbxml); //Log that the customer has been generated Kohana::$log->add(Log::NOTICE, "\nCustomer QBXML:\n" . $qbxml); //send down to web connector return $qbxml; }