It drove me nuts looking for it.. unless I just didn't have the latest SDK (which would be horrible) so here's the code I had to write:
it goes in AuthorizeNewCIM.php:
public function getHostedProfilePageRequest($customerProfileId,$setting=0) { $this->_constructXml("getHostedProfilePageRequest"); $this->_xml->addChild("customerProfileId", $customerProfileId); if(!empty($setting)) { $set_settings_global=$this->_xml->addChild("hostedProfileSettings"); foreach($setting as $key=>$val){ $set_settings=$set_settings_global->addChild("setting"); $set_settings->addChild("settingName",$key); $set_settings->addChild("settingValue",$val); }//end each setting }//end has a setting /*hostedProfileReturnUrl, hostedProfileReturnUrlText, hostedProfileHeadingBgColor, hostedProfilePageBorderVisible, hostedProfileIFrameCommunicatorUrl*/ return $this->_sendRequest(); }
And you call it like so:
$request = new AuthorizeNetCIM; $settings=array('hostedProfileIFrameCommunicatorUrl'=>'http://domain.com/contentx/IframeCommunicator.html'); $response = $request->getHostedProfilePageRequest($profileID,$settings); $token=trim($response->xml->token);
And then find the rest of the code in the file with the samples. You don't need to put the DIV exactly before the </body>, but if you don't pass the iframecommunicator.html URL, it won't close the popup.
edit: woops, I'm not sure it will correctly pass an array of values. I only needed and tested the one.
09-05-2011 01:03 PM - edited 09-05-2011 01:04 PM
Hey avimarcus,
Thanks for posting this. We are currently working on getting the hosted CIM feature built into the SDKs, so thanks for posting your code for those working on it in the meantime.
Thanks,
Michelle
Developer Community Manager
09-13-2011 02:24 PM
Hi Michelle,
Is this build into the PHP CIM SDK now?
10-31-2012 01:29 AM