From: Mark Wells Date: Wed, 13 Apr 2016 22:07:40 +0000 (-0700) Subject: create prospects from towercoverage.com EUS, #39776 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=916c7d12076875cfc090ffaebde8f5add436430e create prospects from towercoverage.com EUS, #39776 --- diff --git a/ng_selfservice/coverage_post.php b/ng_selfservice/coverage_post.php new file mode 100644 index 000000000..657a2ffb8 --- /dev/null +++ b/ng_selfservice/coverage_post.php @@ -0,0 +1,43 @@ +CustomerDetails; +if ($DEBUG) { + error_log(var_dump($cd)); +} + +// State and Country are names rather than codes, but we fix that on the other +// end. +// It doesn't look like TowerCoverage ever sends a company name. +$map_fields = Array( + 'first' => 'FirstName', + 'last' => 'LastName', + 'address1' => 'StreetAddress', + 'city' => 'City', + 'state' => 'State', + 'country' => 'Country', + 'zip' => 'ZIP', + 'phone_daytime' => 'PhoneNumber', + 'emailaddress' => 'EmailAddress', + 'comment' => 'Comment', + 'referral_title' => 'HearAbout', +); + +$prospect = Array(); +// missing from this: any way to set the agent. this should use the API key. +foreach ($map_fields as $k => $v) { + $prospect[$k] = (string)($cd->$v); +} +error_log(var_dump($prospect)); +$freeside = new FreesideSelfService(); +$result = $freeside->new_prospect($prospect); +error_log(var_dump($result)); + +?>