<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JSF Blog &#187; markup</title>
	<atom:link href="http://www.jsfblog.info/tag/markup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jsfblog.info</link>
	<description>Discussion on all things Java and JSF</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>3D Secure and the PaReq field in Google Chrome &amp; Safari Browsers</title>
		<link>http://www.jsfblog.info/2010/03/3d-secure-and-the-pareq-field-in-google-chrome-safari-browsers/</link>
		<comments>http://www.jsfblog.info/2010/03/3d-secure-and-the-pareq-field-in-google-chrome-safari-browsers/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 17:45:15 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[3D Secure]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[PaReq]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://www.jsfblog.info/?p=128</guid>
		<description><![CDATA[I recently had to implement the 3D Secure payment system. In order to do this 3 fields must be sent to the 3D Secure ACS (Access Control Server) MD Term Url PaReq (Payer authentication request) Initally everything went well until we tested our pages in Google Chrome and Safari. Under both browsers the 3D Secure [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to implement the <a href="http://en.wikipedia.org/wiki/3-D_Secure">3D Secure</a> payment system.</p>
<p>In order to do this 3 fields must be sent to the 3D Secure ACS (Access Control Server)</p>
<ul>
<li>MD</li>
<li>Term Url</li>
<li>PaReq (Payer authentication request)</li>
</ul>
<p>Initally everything went well until we tested our pages in Google Chrome and Safari. Under both browsers the 3D Secure inline frame displayed the following message</p>
<p>&#8220;Error decoding PAREQ message&#8221;</p>
<p>A <a href="https://datacash.custhelp.com/cgi-bin/datacash.cfg/php/enduser/std_adp.php?p_faqid=1025">support page</a> mentions that a PaReq contains newlines and that if <em>any</em> of these are missing the PaReq decoding will fail. The page also mentions that there are issues with Chrome and Safari but provides no solution.</p>
<h2>So what is the problem?</h2>
<p>The problem is indeed the newline.</p>
<p>In our markup we use and EL (Expression Language) to output the PaReq e.g.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;hidden&quot; name=&quot;PaReq&quot; value=&quot;#{paReq}&quot; /&gt;
</pre>
<p>If the PaReq returned a string such as</p>
<pre class="brush: xml; title: ; notranslate">
&quot;I am
The PaReq
&quot;
</pre>
<p>Note the quotes above mark the begining and end of the string. The string itself is terminated by a newline, in code it would be:</p>
<pre class="brush: java; title: ; notranslate">
String paReq = &quot;I am\nThe PaReq\n&quot;;
</pre>
<p>The browser <em>should</em> generate the following markup</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;hidden&quot; name=&quot;PaReq&quot; value=&quot;I am
The PaReq
&quot; /&gt;
</pre>
<p>However Chrome and Safari generate the following markup (as both browsers do this I assume its a <a href="http://webkit.org/">Webkit</a> thing)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;hidden&quot; name=&quot;PaReq&quot; value=&quot;I am
The PaReq&quot; /&gt;
</pre>
<p><strong>Note, the traililng newline has disappeared</strong> and herein lies the problem, the server fails to recoginse the PaReq as the <em>trailing newline</em> has gone (currently Chrome 4.0.429.89 contains the above bug).</p>
<p>The fix? Dont use Chrome or Safari, Only kidding</p>
<p>The way we overcame this was to use a &#8220;hidden&#8221; textarea</p>
<pre class="brush: xml; title: ; notranslate">
&lt;textarea name=&quot;PaReq&quot; style=&quot;display:none&quot;&gt;#{paReq}&lt;/textarea&gt;
</pre>
<p>Which renders</p>
<pre class="brush: xml; title: ; notranslate">
&lt;textarea name=&quot;PaReq&quot; style=&quot;display:none&quot;&gt;I am
The PaReq
&lt;/textarea&gt;
</pre>
<p>In all browsers and preserves the trailing newline. The style=&#8221;display:none&#8221; hides the textarea. Although this is crude it does provide a fix for Chrome and Safari.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jsfblog.info/2010/03/3d-secure-and-the-pareq-field-in-google-chrome-safari-browsers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

