Reply
Highlighted
Contributor
Posts: 19
Registered: ‎12-08-2013

Re: CIM Hosted Page

added services reference in visual studio but, not about create object for CustomerProfileAPI 

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM Hosted Page

So you are not using the sample code? then just use whatever name you create the service reference with.

Highlighted
Contributor
Posts: 19
Registered: ‎12-08-2013

Re: CIM Hosted Page

Thanks for the giving reply, here we are not implementing through soap but we are decided to go with xml.

 

But as you said that using “getHostedProfilePageRequest

We can access the authorize.net but we are unable to understand how to send the request of getHostedProfilePageRequest using xml through coding. So please let us know the solution.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM Hosted Page

[ Edited ]

There is an example on page 66 on the CIM_XML_guide.pdf

Highlighted
Contributor
Posts: 19
Registered: ‎12-08-2013

Re: CIM Hosted Page

We already referred your “CIM_XML_guide.pdf” page 66, we are unable to understated how to implement the code in c# (code behind) for xml which was shown in page no 66,

 

Below is Aspx code snippet were we have implemented

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CIMSample.aspx.cs" Inherits="CIMSample" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

 

</head>

<body>

    <form method="post" action="https://test.authorize.net/profile/manage" id="formAuthorizeNetPage"

    style="display: none;">

    <input type="hidden" name="Token" value="pfGaUNntoTxZYeqqYDjGCQ4qyCHcsXGXLJ2i7MPCEiH6CH5n5qKqcl8EBiTClxu01B

SeH5eZg7LVUVVzw5kJKVMitQ3pyMB5UZCduMWd6Ku9aT2gyFm69EKMGfyWPmI4p+Bb4TJf2F0

7rInSrn2MWlM6f2xd7aRu1XBn0WXoPxK1j9FMGX2CNCoCBp3cOXB7" />

    </form>

    <button type="button" onclick="document.getElementById(

'formAuthorizeNetPage').submit();">

        Manage my payment and shipping information</button>

 

</body>

</html>

 

But I haven’t implemented any code for code behind file that is .cs file in c# and as we are a beginner we are not able to understand to send the xml request to your api and also we are unable to find the “getHostedProfilePageRequest”.

 

How to work with the hosted page for creating customer profile.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM Hosted Page

In the code behind, use HttpWebRequest to send the xml to 

read the respone to get the token and put it on the input name="Token" value.
Highlighted
Contributor
Posts: 19
Registered: ‎12-08-2013

Re: CIM Hosted Page

Thanks for the giving reply

 

Code behind the code looks like as below:

string url;

url = @"https://api.authorize.net/xml/v1/request.api";

WebRequest webRequest = WebRequest.Create(url);

HttpWebResponse httpWebResponse = webRequest.GetResponse() as HttpWebResponse;

Stream dataStream = httpWebResponse.GetResponseStream();

StreamReader streamReader = new StreamReader(dataStream);

String responseFromServer = streamReader.ReadToEnd();

 

It is response we getting unable to find the token

 

<?xml version="1.0" encoding="utf-8"?>

<ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

  <messages>

    <resultCode>Error</resultCode>

    <message>

      <code>E00002</code>

      <text>The content-type specified is not supported.</text>

    </message>

  </messages>

</ErrorResponse>

 

Please solved problem as soon as possible.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM Hosted Page

Highlighted
Contributor
Posts: 19
Registered: ‎12-08-2013

Re: CIM Hosted Page

Thanks for the giving reply,

 

Input XML:

<?xml version="1.0" encoding="utf-8"?>

<getHostedProfilePageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

<merchantAuthentication>

<name>*****</name>

<transactionKey>******</transactionKey>

</merchantAuthentication>

<hostedProfileSettings>

<setting>

<settingName>hostedProfileReturnUrl</settingName>

<settingValue>https://www.google.co.in/</settingValue>

</setting>

<setting>

<settingName>hostedProfileReturnUrlText</settingName>

<settingValue>Continue to xtg.</settingValue>

</setting>

<setting>

<settingName>hostedProfilePageBorderVisible</settingName>

<settingValue>true</settingValue>

</setting>

</hostedProfileSettings>

</getHostedProfilePageRequest>

 

Output XML:

<?xml version="1.0" encoding="utf-8"?>

<ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

  <messages>

    <resultCode>Error</resultCode>

    <message>

      <code>E00003</code>

      <text>The element 'getHostedProfilePageRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'hostedProfileSettings' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'refId, customerProfileId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text>

    </message>

  </messages>

</ErrorResponse>

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM Hosted Page

The XML guide said customerProfileId is required.