<?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>2Checkout.com &#187; script</title>
	<atom:link href="http://www.2checkout.com/blog/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.2checkout.com</link>
	<description>merchant account / credit card processing alternative</description>
	<lastBuildDate>Thu, 09 Feb 2012 15:02:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How do I use the MD5 Hash?</title>
		<link>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/3rd-party-carts/md5-hash-checking/how-do-i-use-the-md5-hash/</link>
		<comments>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/3rd-party-carts/md5-hash-checking/how-do-i-use-the-md5-hash/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 07:00:00 +0000</pubDate>
		<dc:creator>knowledgebase</dc:creator>
				<category><![CDATA[MD5 Hash Checking]]></category>
		<category><![CDATA[MD5 hash]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[secret word]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">https://192.168.2.217/fresh/blog/2006/12/30/how-do-i-use-the-md5-hash/</guid>
		<description><![CDATA[The MD5 hash is provided to help you verify the authenticity of a sale. This is especially useful for vendors that sell downloadable products, or e-goods, as it can be used to verify whether sale actually came from 2Checkout and was a legitimate live sale. We intentionally break the hash code for demo orders so [...]]]></description>
			<content:encoded><![CDATA[<p>The MD5 hash is provided to help you verify the authenticity of a sale. This is especially useful for vendors that sell downloadable products, or e-goods, as it can be used to verify whether sale actually came from 2Checkout and was a legitimate live sale. We intentionally break the hash code for demo orders so that you can compare the hash we provide with what it should be to determine whether or not to provide the customer with your goods.</p>
<p>To calculate the MD5 hash, you need to make a string that contains the information described below and pass it in as the value to your scripting languages MD5 function. Below is an example:</p>
<blockquote><p><strong>md5 ( secret word + vendor number + order number + total )</strong></p></blockquote>
<p>The secret word is set by yourself on the Site Managment page. The vendor number is your numerical vendor/seller ID number. The order number is the order number for the sale. The total is the numerical value for the total amount of the sale.</p>
<p><span style="text-decoration: underline"><strong>Demonstration:</strong></span></p>
<blockquote><p><strong>Secret Word =&gt; tango<br />
Vendor Number =&gt; 123456<br />
Order Number =&gt; 9999999<br />
Total =&gt; 5.99</strong></p>
<p><strong>md5hash = md5( tango12345699999995.99 )</strong></p></blockquote>
<p>It is important to note that the MD5 hash must also be converted to upper case letters for a clean comparison. How this is done depends on the scripting language that you use. Below are some examples of how to compute the MD5 hash using PHP. This should illustrate how this process works.</p>
<p>The following code would be applicable to orders placed using our Plug and Play cart and our proprietary third party set of parameters.</p>
<blockquote><p><strong>$string_to_hash = &#8220;tango123456&#8243; . $_POST["order_number"]<br />
.<br />
$_POST["total"];<br />
$check_key = strtoupper(md5($string_to_hash));</strong></p>
<p><strong> echo (&#8220;Returned MD5 Hash : &#8221; . $_POST["key"]<br />
. &#8220;&lt;BR&gt;&#8221;);<br />
echo (&#8220;Should be : &#8221; . $check_key . &#8220;&lt;BR&gt;&#8221;);</strong></p>
<p><strong> if($check_key == $_POST["key"]){<br />
// At this point the expected key and the returned key match, so the customer should be given access to the download<br />
// This is where you would want to put the code or page for the download<br />
echo (&#8220;&lt;center&gt;They match!&lt;/center&gt;&#8221;); }<br />
else {<br />
// At this point the keys do not match, so either the attempt was fraudulent or a demo order<br />
// This is where you would put the code or page for an unsuccessful attempt<br />
echo (&#8220;&lt;center&gt;They do NOT match! Was this a demo order?&lt;/center&gt;&#8221;);}</strong></p></blockquote>
<p>The following code would then be applicable to orders placed using the Authorize.net<br />
parameter set.</p>
<blockquote><p><strong>$string_to_hash = &#8220;tango123456&#8243; . $_POST["x_trans_id"]<br />
.<br />
$_POST["x_amount"];<br />
$check_key = strtoupper(md5($string_to_hash));</strong></p>
<p><strong> echo (&#8220;Returned MD5 Hash : &#8221; . $_POST["x_MD5_Hash"]<br />
. &#8220;&lt;BR&gt;&#8221;);<br />
echo (&#8220;Should be : &#8221; . $check_key . &#8220;&lt;BR&gt;&#8221;);</strong></p>
<p><strong> if($check_key == $_POST["x_MD5_Hash"]){<br />
// At this point the expected key and the returned key match, so the customer<br />
should be given access to the download<br />
// This is where you would want to put the code or page for the download<br />
echo (&#8220;&lt;center&gt;They match!&lt;/center&gt;&#8221;); }<br />
else {<br />
// At this point the keys do not match, so either the attempt was fraudulent<br />
or a demo order<br />
// This is where you would put the code or page for an unsuccessful attempt echo (&#8220;&lt;center&gt;They do NOT match! Was this a demo order?&lt;/center&gt;&#8221;);}</strong></p></blockquote>
<p>The MD5 hash is also provided to help you verify the authenticity of INS posts. The MD5 hash that is sent with INS posts is a hash of sale_id + vendor_id + invoice_id + secret word in the md5_hash parameter.</p>
<p><strong><br />
<span style="text-decoration: underline"><strong>Demonstration:</strong></span><br />
<strong><br />
</strong></strong></p>
<blockquote><p><strong><strong>sale_id =&gt; 9999999999<br />
vendor_id =&gt; 123456<br />
invoice_id =&gt; 1111111111<br />
Secret Word =&gt; tango<br />
md5hash = md5( 99999999991234561111111111tango ) </strong></strong></p></blockquote>
<p><strong></strong></p>
<p>The following code would be applicable to orders placed using our Plug and Play cart and our proprietary third party set of parameters.</p>
<blockquote><p><strong><strong>$string_to_hash = $_POST[“sale_id”] . “123456” . $_POST[“invoice_id”] . “tango”;<br />
$check_key = strtoupper(md5($string_to_hash));<br />
echo (“Returned MD5 Hash : ” . $_POST[“md5_hash”]<br />
. “<br />
”);<br />
echo (“Should be : ” . $check_key . “<br />
”);<br />
if($check_key == strtoupper($_POST[“md5_hash”])){<br />
// If the expected key and the returned key match the authenticity of the message has been validated.<br />
echo (”They match!”); }<br />
else {<br />
// At this point the keys do not match.<br />
// This is where you would put the code for an unsuccessful attempt.<br />
echo (“They do NOT match!”);}<br />
</strong> </strong></p></blockquote>
<p><strong>Please note that help with implementing the MD5 hash into your return script is beyond the realm of 2Checkout.com&#8217;s support.</strong> This document is provided merely as a reference document to help point you in the right direction. How the MD5 hash is computed is dependent upon the scripting language that you use. Implementation of any MD5 hash checking is solely on your end or your server. 2Checkout.com can not provide you with support in implementing this or troubleshooting your implementation. We provide you with the hashes as a convenience to help you protect your digital goods.</p>
<p>The following links may be of interest to you if you are looking for more information on the MD5 algorithm and its use.</p>
<p><a href="http://userpages.umbc.edu/%7Emabzug1/cs/md5/md5.html">http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html</a><br />
<a href="http://en.wikipedia.org/wiki/MD5">http://en.wikipedia.org/wiki/MD5</a><br />
<a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemSecurityPolicyHashClassMD5Topic.asp">http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemSecurityPolicyHashClassMD5Topic.asp</a></p>
<p>We have also intentionally designed the MD5 hash not to work for demo sales as was explained earlier. If the sale is in demo mode, the order number used to create the hash will be forced to a one, which will cause the hashes to be different when you compare them. If you wish to test the hashes, you&#8217;ll have to place a live test order using a real credit card number.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/3rd-party-carts/md5-hash-checking/how-do-i-use-the-md5-hash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What PHP code can I use to test return parameters?</title>
		<link>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/passbacks-and-returns/what-php-code-can-i-use-to-test-return-parameters/</link>
		<comments>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/passbacks-and-returns/what-php-code-can-i-use-to-test-return-parameters/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 07:00:00 +0000</pubDate>
		<dc:creator>knowledgebase</dc:creator>
				<category><![CDATA[Passbacks and Returns]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[passback]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">https://192.168.2.217/fresh/blog/2006/12/30/what-php-code-can-i-use-to-test-return-parameters/</guid>
		<description><![CDATA[Below is a sample PHP script that will catch all POST and GET parameters upon return and print the names of the parameters with their value back to the screen. This may help you develop your return process. Please note that we do not support third party scripts, so we also can not troubleshoot the [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a sample PHP script that will catch all POST and GET parameters upon return and print the names of the parameters with their value back to the screen. This may help you develop your return process. Please note that we do not support third party scripts, so we also can not troubleshoot the script itself. It is being provided for your convenience only. We can help you if you are having problems receiving any passback parameters though.</p>
<p>Additionally, you can make use of our <a href="http://developers.2checkout.com/return_script">developers.2Checkout area</a> to test out your own return script with sample return data. This can assist you when building your 2Checkout return script.</p>
<pre>
&lt;?php //display all post and get parameters

	echo "&lt;h1&gt;Get Parameter/s:&lt;/h1&gt;";
	echo "&lt;pre&gt;";
	if($_GET)
		print_r($_GET);
	else
		echo "There are no get parameters.";
	echo "&lt;/pre&gt;";
	echo "&lt;hr/&gt;";
	echo "&lt;h1&gt;Post Parameter/s:&lt;/h1&gt;";
	echo "&lt;pre&gt;";
	if($_POST)
		print_r($_POST);
	else
		echo "There are no post parameters.";
	echo "&lt;/pre&gt;";

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/passbacks-and-returns/what-php-code-can-i-use-to-test-return-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

