cancel
Showing results for 
Search instead for 
Did you mean: 

CIM iFrameCommunicator issues

Hey guys,
I am having some issues with my CIM form and I think they are stemming from iFrameCommunicator not having the right URL. I have been told to update the hostedProfileIFrameCommunicatorUrl in the xml, but I am running this all on the client in js and have no idea how to do that.

I have downloaded the sample code for CIM hosted profile and even that is not closing the popup or hitting the iframeCommunicator.html file. 


I have the users token in javascript which I assign to the form values. From there I load the openAddPaymentPopup() function and I am able to successfully save the users information to my Auth.net account. The problem is that the popup is not closing due to iframeCommunicator.html not being hit. Is there a way I can manually assign the iFrameCommunicatorURL property from the popup.js javascript?

What can I do in my javascript to fix this issue?

Thanks.

h34dhun73r
Member
2 REPLIES 2

Ok, disregard this issue. I realize now that the issue was caused when the token was generated in my c# and not when the form was loaded in javascript. 

http://community.developer.authorize.net/t5/Integration-and-Testing/CIM-hosted-form-option-popup-won...

This link cleared it up for me.

h34dhun73r
Member

The URL is part of getHostedProfilePageRequest, so I'm guessing it's encrypted into the token. Here's the relevant function from the PHP API:

 

    /**
     * Get the CIM popup token (good for 15 minutes)
     *
     * @param int $customerProfileId
     *
     * @return AuthorizeNetCIM_Response

       $response = $request->getHostedProfilePageRequest($profileID, array(
            'hostedProfilePageBorderVisible' => 'false',
            'hostedProfileHeadingBgColor' => '#E1E1E1',
            'hostedProfileIFrameCommunicatorUrl' => "https://{$GLOBALS['_domain']}/contentx/IframeCommunicator.html"
       ));
	   $token=trim($response->xml->token);

     */
    public function getHostedProfilePageRequest($customerProfileId, $settings = false)
    {
        $this->_constructXml("getHostedProfilePageRequest");
        $this->_xml->addChild("customerProfileId", $customerProfileId);
  
        if ($settings) {
            $settingsXML = $this->_xml->addChild("hostedProfileSettings");
            foreach ($settings as $key => $val) {
                $settingXML = $settingsXML->addChild("setting");
                $settingXML->addChild("settingName", $key);
                $settingXML->addChild("settingValue", $val);
            }
        }

        return $this->_sendRequest();
    }

And then when I call that:

 

    $response = $request->getHostedProfilePageRequest(
        $company->{'customer-id'}, array(
        'hostedProfilePageBorderVisible' => 'false',
        'hostedProfileHeadingBgColor' => '#E1E1E1',
        'hostedProfileIFrameCommunicatorUrl' => "https://{$GLOBALS['_domain']}/contentx/IframeCommunicator.html"
    ));

Basically, you need to figure out how to set the hostedProfileIFrameCommunicatorUrl value to the URL path for your /contentx/IframeCommunicator.html page. If it still doesn't work after you do that, it's also possible you have an ancient browser that doesn't know how to do cross-browser interactions. But I don't think that's the problem you're having.

TJPride
Expert