- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CIM - php SDK for getHostedProfilePageRequest for hosted CIM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Michelle,
Is this build into the PHP CIM SDK now?
โ10-31-2012 01:29 AM

