<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Accept Hosted E00013 C# in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59411#M33997</link>
    <description>&lt;P&gt;Not sure where to look for this problem, Trying to get the C# sample code working but the responce is alwasy E00013&amp;nbsp; Unexpected character encountered while parsing value: h. Path '', line 0, position 0."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    public static string GetCheckoutPage(String ApiLoginID, String ApiTransactionKey, decimal amount)
    {
        Console.WriteLine("GetAnAcceptPaymentPage Sample");
        ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
        ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()
        {
            name = ApiLoginID,
            ItemElementName = ItemChoiceType.transactionKey,
            Item = ApiTransactionKey,
        };

        settingType[] settings = new settingType[3];

        settings[0] = new settingType();
        settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();
        settings[0].settingValue = "{\"text\": \"Pay\"}";

        settings[1] = new settingType();
        settings[1].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();
        settings[1].settingValue = "{\"show\": false}";

        settings[2] = new settingType();
        settings[2].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
        settings[2].settingValue = "https://localhost:44397/WebPort/IframeCommunicator.aspx";

        var transactionRequest = new transactionRequestType
        {
            transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only
            amount = 200.00m //amount

        };

        var request = new getHostedPaymentPageRequest();
        request.transactionRequest = transactionRequest;
        request.hostedPaymentSettings = settings;

        // instantiate the contoller that will call the service
        var controller = new getHostedPaymentPageController(request);
        controller.Execute();

        // get the response from the service (errors contained if any)
        var response = controller.GetApiResponse();
        string token = string.Empty;
        if (response != null &amp;amp;&amp;amp; response.messages.resultCode == messageTypeEnum.Ok)
        {
            token = response.token;
        }
        else if (response == null)
        {
            token = "Unable to connect to Authorize.net Please refresh the page and try again.";
            return token;
        }

        return token;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Aug 2017 21:21:50 GMT</pubDate>
    <dc:creator>PaceDev</dc:creator>
    <dc:date>2017-08-16T21:21:50Z</dc:date>
    <item>
      <title>Accept Hosted E00013 C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59411#M33997</link>
      <description>&lt;P&gt;Not sure where to look for this problem, Trying to get the C# sample code working but the responce is alwasy E00013&amp;nbsp; Unexpected character encountered while parsing value: h. Path '', line 0, position 0."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    public static string GetCheckoutPage(String ApiLoginID, String ApiTransactionKey, decimal amount)
    {
        Console.WriteLine("GetAnAcceptPaymentPage Sample");
        ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
        ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()
        {
            name = ApiLoginID,
            ItemElementName = ItemChoiceType.transactionKey,
            Item = ApiTransactionKey,
        };

        settingType[] settings = new settingType[3];

        settings[0] = new settingType();
        settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();
        settings[0].settingValue = "{\"text\": \"Pay\"}";

        settings[1] = new settingType();
        settings[1].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();
        settings[1].settingValue = "{\"show\": false}";

        settings[2] = new settingType();
        settings[2].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
        settings[2].settingValue = "https://localhost:44397/WebPort/IframeCommunicator.aspx";

        var transactionRequest = new transactionRequestType
        {
            transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only
            amount = 200.00m //amount

        };

        var request = new getHostedPaymentPageRequest();
        request.transactionRequest = transactionRequest;
        request.hostedPaymentSettings = settings;

        // instantiate the contoller that will call the service
        var controller = new getHostedPaymentPageController(request);
        controller.Execute();

        // get the response from the service (errors contained if any)
        var response = controller.GetApiResponse();
        string token = string.Empty;
        if (response != null &amp;amp;&amp;amp; response.messages.resultCode == messageTypeEnum.Ok)
        {
            token = response.token;
        }
        else if (response == null)
        {
            token = "Unable to connect to Authorize.net Please refresh the page and try again.";
            return token;
        }

        return token;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2017 21:21:50 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59411#M33997</guid>
      <dc:creator>PaceDev</dc:creator>
      <dc:date>2017-08-16T21:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted E00013 C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59412#M33998</link>
      <description>&lt;P&gt;Correction:&lt;/P&gt;&lt;PRE&gt;        settings[2] = new settingType();
        settings[2].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
        settings[2].settingValue = "https://localhost:44397/WebPort/IframeCommunicator.aspx";&lt;/PRE&gt;&lt;P&gt;was causing the issue, I forgot to escape the ". I now get back a token.&lt;/P&gt;&lt;PRE&gt;&amp;lt;form id="formAuthorizeNetPayPopup" method="post" action="" name="formAuthorizeNetPopup" target="iframeAuthorizeNet" style="display: none;"&amp;gt;
&amp;lt;input id="PayToken" name="PayToken" value="Z/+2jJUVqLkjdMgSfByqqBd5dY5lHUw25DikVUL6pQTui17IQRbPsNOD05UO2QoPXdb4lQBX4/Hak/8Nbyar05bV2CnsHITsbi6A6bc6WiSRg3RB1X+uAAHOkW+PgRtWECrCSB8SHQ8T9Hn+CkI0sKIFOWsecWLusjOnnTivhD7ytcUhBg9JgCcnIAnrr9okyVvElQRi6wg/h50CsVEEXc+xEHpNksnXDd0haZNUQqLsxcq8pLdMb8hBg8acc3HV1rv8bmcr2BcT4AzcyRrqGzEl/fc6BRqHjOas8+wWARe0vdVDruUfNJihOgtGxdbmEBcbJOiARoAdnwF9s0+Naavz7gL5q2it4rcyBSC9J8JoEKqSt1FOKzySPLswGHtbsS2efC0bLvYvs6pQ5W5PHJol8HOWB5o5lidTNvIfHP2/ZMpnN9/ZuI+/Q//9HuoRtRb4WHvFtbgyKS/gkMatvibgMiRG8PTLNHaze7P/+RtRZfrww2NpQqfThKYZeZHsBdNfIWT3xfJciisH/CBsaf+qpYFibVZCaR/zsDdsOaowayf/8FVUTGC5h7hT/HAKQnn+puDEi66SIOXalBEu/hgfag5blrxfbJ/+ExdIVItoUoVkp9zoctWRPFNe/olcz83zI/EHqRRMqLKL1L5+KX2f9cL2NwfntDzTvqOyfADL+4AynI2BjkOy8N1uOuLMMBsAmiGNnFPCNCTnZDCleHK2kEu2bxm2rYlRs/LzsoUmMgboc5RDrYOxh2Dfl9FLjfrYb74oh7WhqYnPsT1RuRpgrrcE5zRtsXCtTAG/PzeacAGcrE4d58bGiA63Kw35Gu8ZiT2/1Z3v93C2iNZWT8tr2X3S2eUqjFFwRRpFPSY=.6p68gFBha" type="hidden"&amp;gt;
&amp;lt;/form&amp;gt;&lt;/PRE&gt;&lt;P&gt;But the pop up says &lt;SPAN class="ErrorMsg"&gt;Missing or invalid token.&lt;/SPAN&gt; Is there a way to validate a Token?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 21:36:50 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59412#M33998</guid>
      <dc:creator>PaceDev</dc:creator>
      <dc:date>2017-08-16T21:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted E00013 C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59414#M34000</link>
      <description>&lt;PRE&gt; settings[2] = new settingType();
 settings[2].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();
 settings[2].settingValue = "{\"url\": \"https://YOUR_FANCY_WEBSITE.com/icommunicator.aspx\"}";&lt;/PRE&gt;&lt;P&gt;Test token:&amp;nbsp;&lt;A href="https://nexwebsites.com/authorizenet/token-tester.html" target="_blank"&gt;https://nexwebsites.com/authorizenet/token-tester.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, &amp;nbsp;the input name for the token needs to be "token".&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; name="token"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 22:26:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-E00013-C/m-p/59414#M34000</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-08-16T22:26:08Z</dc:date>
    </item>
  </channel>
</rss>

