Solved! Go to Solution.
โ01-08-2014 04:48 AM
added services reference in visual studio but, not about create object for CustomerProfileAPI
โ01-08-2014 08:23 AM
So you are not using the sample code? then just use whatever name you create the service reference with.
โ01-08-2014 09:22 AM
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.
โ01-09-2014 03:31 AM
There is an example on page 66 on the CIM_XML_guide.pdf
โ01-09-2014 04:11 AM - edited โ01-09-2014 04:11 AM
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.
โ01-09-2014 05:30 AM
In the code behind, use HttpWebRequest to send the xml to
โ01-09-2014 05:48 AM
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.
โ01-09-2014 06:36 AM
A quick google search give me this
โ01-09-2014 07:12 AM
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>
โ01-09-2014 07:17 AM
The XML guide said customerProfileId is required.
โ01-09-2014 07:27 AM