5 require_once('freeside.class.php');
7 $xml = file_get_contents('php://input');
10 $doc = new SimpleXMLElement($xml);
11 $cd = $doc->CustomerDetails;
13 error_log(print_r($cd),1);
16 // State and Country are names rather than codes, but we fix that on the other
18 // It doesn't look like TowerCoverage ever sends a company name.
20 'first' => 'FirstName',
22 'address1' => 'StreetAddress',
25 'country' => 'Country',
27 'phone_daytime' => 'PhoneNumber',
28 'emailaddress' => 'EmailAddress',
29 'comment' => 'Comment',
30 'referral_title' => 'HearAbout',
34 // missing from this: any way to set the agent. this should use the API key.
35 foreach ($map_fields as $k => $v) {
36 $prospect[$k] = (string)($cd->$v);
38 error_log(print_r($prospect),1);
39 $freeside = new FreesideSelfService();
40 $result = $freeside->new_prospect($prospect);
41 error_log(print_r($result),1);