<?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 Re: AMPERSANDS break the Accept Hosted Payment Form! in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75096#M46779</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try URLEncoding the URLs:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#333333"&gt;http://1.1.1.1%2FclearPayment%3ForderID%3D2540%26cancelPaymentID%3D459b4c8b-e257-4d02-84e3-5f0965b16b8&lt;/FONT&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Feb 2021 19:51:04 GMT</pubDate>
    <dc:creator>NexusSoftware</dc:creator>
    <dc:date>2021-02-19T19:51:04Z</dc:date>
    <item>
      <title>AMPERSANDS break the Accept Hosted Payment Form!</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75095#M46778</link>
      <description>&lt;P&gt;Help! We are using ampersands in our cancel URL and submit URL and the payment form is failing to load! We need to build a URL with &lt;STRONG&gt;multiple&lt;/STRONG&gt; GET parameters to have proper security with the cancel and submission of orders on our website. Which means we need use ampersands to divide up our parameters. The problem is if we pass an ampersand at all to the hostedPaymentReturnOptions the entire payment form fails to load! There is no errors in the logs. It just simply only draw the words "Order Summary" and nothing else. If we remove the ampersands everything works correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SettingType &lt;SPAN&gt;returnSettings &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;SettingType();&lt;BR /&gt;&lt;SPAN&gt;returnSettings&lt;/SPAN&gt;.setSettingName(&lt;SPAN&gt;"hostedPaymentReturnOptions"&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;JSONObject &lt;SPAN&gt;returnSettingsJSON &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;JSONObject();&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"url"&lt;/SPAN&gt;, &lt;SPAN&gt;"http://1.1.1.1/submitPayment?orderID=2540&amp;amp;orderAmount=13.99&amp;amp;submitPaymentID=4a11f608-4196-4365-929e-&lt;BR /&gt;9e01c5fa975d"&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"urlText"&lt;/SPAN&gt;, "Complete Order" );&lt;BR /&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"cancelUrl"&lt;/SPAN&gt;, &lt;SPAN&gt;"http://1.1.1.1/clearPayment?orderID=2540&amp;amp;cancelPaymentID=459b4c8b-e257-4d02-84e3-5&lt;BR /&gt;f0965b16b81" &lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"cancelUrlText"&lt;/SPAN&gt;, "Cancel Order" );&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;returnSettings&lt;/SPAN&gt;.setSettingValue( &lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.toString() );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We desperately need this fixed. We won't have security without it! Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 16:37:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75095#M46778</guid>
      <dc:creator>lightwave365</dc:creator>
      <dc:date>2021-02-19T16:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: AMPERSANDS break the Accept Hosted Payment Form!</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75096#M46779</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try URLEncoding the URLs:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#333333"&gt;http://1.1.1.1%2FclearPayment%3ForderID%3D2540%26cancelPaymentID%3D459b4c8b-e257-4d02-84e3-5f0965b16b8&lt;/FONT&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 19:51:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75096#M46779</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2021-02-19T19:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: AMPERSANDS break the Accept Hosted Payment Form!</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75112#M46790</link>
      <description>&lt;P&gt;You mean partially encode. Because that http:// is still not encoded. And encoding only part of a URL is weird and clunky. Because I want to just do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"url"&lt;/SPAN&gt;, URLEncoder.&lt;SPAN&gt;encode&lt;/SPAN&gt;( &lt;SPAN&gt;submitOrderURL&lt;/SPAN&gt;, StandardCharsets.&lt;SPAN&gt;ISO_8859_1 &lt;/SPAN&gt;) );&lt;BR /&gt;&lt;SPAN&gt;returnSettingsJSON&lt;/SPAN&gt;.put(&lt;SPAN&gt;"cancelUrl"&lt;/SPAN&gt;, URLEncoder.&lt;SPAN&gt;encode&lt;/SPAN&gt;(  &lt;SPAN&gt;cancelURL&lt;/SPAN&gt;, StandardCharsets.&lt;SPAN&gt;ISO_8859_1 &lt;/SPAN&gt;) );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Encode everything is one simple call and be done. But now I need to extract the http:// portion and only encode the back half and then put the URL back together again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because when I try to encode the entire thing I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[2021-02-22 10:24:20,385] [ERROR] Failed to retrieve Nonce token for building AuthorizeNet Payment Form:&lt;BR /&gt;Response Code: [E00013]&lt;BR /&gt;Response Text: [Failed to add Option hostedPaymentReturnOptions&lt;BR /&gt;String 'http%3A%2F%2F1.1.1.1%3ForderID%3D2548%26orderAmount%3D540.0%26submitToken%3D011a7a33-bcea-4de9-9c8b-d0ceb9246c3d' does not match regex pattern '(http|https)://.*'. Line 1, position 160.]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your regex validation should account for the encoding. Or simply do the validation after you decode the URL I give you.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 15:36:10 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75112#M46790</guid>
      <dc:creator>lightwave365</dc:creator>
      <dc:date>2021-02-22T15:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: AMPERSANDS break the Accept Hosted Payment Form!</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75114#M46792</link>
      <description>&lt;P&gt;Technically, you only need to URL Encode the &amp;amp; with&amp;nbsp;%26. So, you could replace the ampersands in your URLs with the appropriate encoding and be done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 17:35:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75114#M46792</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2021-02-22T17:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: AMPERSANDS break the Accept Hosted Payment Form!</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75116#M46794</link>
      <description>&lt;P&gt;Yeah...that is still weird. I have never seen a partial encoding like that. You either encode the params themselves or the entire URL. Not one particular character. The goal of an API is to make the job easier for the person using it. Why not just do your funky replace all after we set the url instead of making us do it. Is this even in the documentation anywhere either?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we discussed and our solution is we're changing our implentation so we now only have one URL parameter. The secret token. And we'll keep the information we need paired with that token on our end. Sacrifice a tiny bit of security but this is just in case AuthNet decides to change the encoding rules and break us again.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 21:35:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AMPERSANDS-break-the-Accept-Hosted-Payment-Form/m-p/75116#M46794</guid>
      <dc:creator>lightwave365</dc:creator>
      <dc:date>2021-02-22T21:35:47Z</dc:date>
    </item>
  </channel>
</rss>

