<?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>SecureSlash.com &#187; Paypal</title>
	<atom:link href="http://secureslash.com/category/paypal/feed/" rel="self" type="application/rss+xml" />
	<link>http://secureslash.com</link>
	<description>Because security matters</description>
	<lastBuildDate>Mon, 20 Feb 2012 12:05:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Add Paypal Button</title>
		<link>http://secureslash.com/php-scripting/add-paypal-button/</link>
		<comments>http://secureslash.com/php-scripting/add-paypal-button/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 14:28:40 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Paypal]]></category>
		<category><![CDATA[PHP Scripting]]></category>
		<category><![CDATA[Web Administration]]></category>

		<guid isPermaLink="false">http://secureslash.com/paypal/add-paypal-button/</guid>
		<description><![CDATA[Tweet You can add Paypal button in your website easily. DO NOT Scroll this page as it is.. Just download the IPN class file and read below. Else it wont looks nice. I tried my level best to explain important code lines. You can use that button for getting donation or selling some products. Here [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fphp-scripting%2Fadd-paypal-button%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/php-scripting/add-paypal-button/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/php-scripting/add-paypal-button/"  data-text="Add Paypal Button" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/php-scripting/add-paypal-button/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/php-scripting/add-paypal-button/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>You can add Paypal button in your website easily.</p>
<p><strong>DO NOT Scroll this page as it is.. Just download the IPN class file and read below. Else it wont looks nice.<br />
</strong><br />
<strong>I tried my level best to explain important code lines.</strong></p>
<p>You can use that button for getting donation or selling some products. Here is one Paypal IPN class in PHP. It is absolutely easy to setup and use.</p>
<p>Download the compressed file and extract it in your document  root.<br />
<a href="http://secureslash.com/paypal-ipn-class-1.10.rar">download and use the Paypal IPN class</a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
And you have to edit some lines in paypal.php<br />
at line 37<br />
<span class="code">switch ($_GET['action']) {</span></p>
<p>case  &#8216;process&#8217;:      // Process and order&#8230;      // There should  be no output at this point.  To process  the POST data,<br />
// the  submit_paypal_post() function will output all the HTML tags which<br />
// contains a  FORM which is submited instantaneously using the BODY onload<br />
//  attribute.  In other words, don&#8217;t echo or  printf anything when you&#8217;re<br />
// going to be  calling the submit_paypal_post() function.</p>
<p>// This is where  you would have your form validation  and  all that jazz.<br />
// You would  take your POST vars and load them into the class like below,<br />
// only using  the POST values instead of constant string expressions.</p>
<p>// For example,  after ensureing all the POST variables from your custom<br />
// order form  are valid, you might have:<br />
//<br />
//  $p-&gt;add_field(&#8216;first_name&#8217;, $_POST['first_name']);<br />
//  $p-&gt;add_field(&#8216;last_name&#8217;, $_POST['last_name']);</p>
<p><span class="code">$p-&gt;add_field(&#8216;business&#8217;, &#8216;YOUR PAYPAL (OR SANDBOX) EMAIL ADDRESS  HERE!&#8217;);<br />
$p-&gt;add_field(&#8216;return&#8217;, $this_script.&#8217;?action=success&#8217;);<br />
$p-&gt;add_field(&#8216;cancel_return&#8217;, $this_script.&#8217;?action=cancel&#8217;);<br />
$p-&gt;add_field(&#8216;notify_url&#8217;, $this_script.&#8217;?action=ipn&#8217;);<br />
$p-&gt;add_field(&#8216;item_name&#8217;, &#8216;Paypal Test Transaction&#8217;);<br />
$p-&gt;add_field(&#8216;amount&#8217;, &#8217;1.99&#8242;);</span></p>
<p><span class="code">       $p-&gt;submit_paypal_post(); // submit the fields to paypal</span><br />
//$p-&gt;dump_fields();      //  for debugging, output a table of all the fields<br />
break;</p>
<p><span class="code">case  &#8216;success&#8217;:  </span>    // Order was  successful&#8230;</p>
<p>// This is where  you would probably want to thank the user for their order<br />
// or what have  you.  The order information at this point  is in POST<br />
//  variables.  However, you don&#8217;t want to  &#8220;process&#8221; the order until you<br />
// get  validation from the IPN.  That&#8217;s where  you would have the code to<br />
// email an  admin, update the database with payment status, activate a<br />
// membership,  etc.</p>
<p>echo &#8220;&lt;html&gt;&lt;head&gt;&lt;title&gt;Success&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h3&gt;Thank you for your order.&lt;/h3&gt;&#8221;;<br />
foreach ($_POST  as $key =&gt; $value) { echo &#8220;$key: $value&lt;br&gt;&#8221;; }<br />
echo  &#8220;&lt;/body&gt;&lt;/html&gt;&#8221;;</p>
<p>// You could  also simply re-direct them to another page, or your own<br />
// order status page which presents the user  with the status of their<br />
// order based  on a database (which can be modified with the IPN code<br />
// below).</p>
<p>break;</p>
<p><span class="code">case &#8216;cancel&#8217;:  </span>     // Order was canceled&#8230;</p>
<p>// The order was  canceled before being completed.</p>
<p>echo &#8220;&lt;html&gt;&lt;head&gt;&lt;title&gt;Canceled&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h3&gt;The order was canceled.&lt;/h3&gt;&#8221;;<br />
echo  &#8220;&lt;/body&gt;&lt;/html&gt;&#8221;;</p>
<p>break;</p>
<p><span class="code">case &#8216;ipn&#8217;: </span>         // Paypal is calling page for IPN  validation&#8230;</p>
<p>// It&#8217;s  important to remember that paypal calling this script.  There<br />
// is no output  here.  This is where you validate the IPN  data and if it&#8217;s<br />
// valid, update  your database to signify that the user has payed.  If<br />
// you try and  use an echo or printf function here it&#8217;s not going to do you<br />
// a bit of  good.  This is on the  &#8220;backend&#8221;.  That is why, by  default, the<br />
// class logs  all IPN data to a text file.</p>
<p>if  ($p-&gt;validate_ipn()) {</p>
<p>// Payment  has been recieved and IPN is verified.   This is where you<br />
// update  your database to activate or process the order, or setup<br />
// the  database with the user&#8217;s order details, email an administrator,<br />
// etc.  You can access a slew of information via the  ipn_data() array.</p>
<p>// Check the  paypal documentation for specifics on what information<br />
// is  available in the IPN POST variables.   Basically, all the POST vars<br />
// which paypal  sends, which we send back for validation, are now stored<br />
// in the  ipn_data() array.</p>
<p>// For this  example, we&#8217;ll just email ourselves ALL the data.<br />
$subject =  &#8216;Instant Payment Notification &#8211; Recieved Payment&#8217;;<br />
$to = &#8216;YOUR  EMAIL ADDRESS HERE&#8217;;    //  your email<br />
$body =  &#8220;An instant payment notification was  successfully recieved\n&#8221;;<br />
$body .=  &#8220;from &#8220;.$p-&gt;ipn_data['payer_email'].&#8221; on  &#8220;.date(&#8216;m/d/Y&#8217;);<br />
$body .=  &#8221; at &#8220;.date(&#8216;g:i A&#8217;).&#8221;\n\nDetails:\n&#8221;;</p>
<p>foreach  ($p-&gt;ipn_data as $key =&gt; $value) { $body .= &#8220;\n$key: $value&#8221;; }<br />
mail($to,  $subject, $body);<br />
}<br />
break;<br />
}</p>
<p>Save paypal.php</p>
<p>And use the below code to display paypal button image.</p>
<p><span class="code">&lt;form action=&#8221;paypal.php&#8221;&gt;<br />
&lt;input type=&#8221;image&#8221; src=&#8221;https://www.paypal.com/en_US/i/logo/paypal_logo.gif&#8221; border=&#8221;0&#8243; name=&#8221;submit&#8221; alt=&#8221;Make payments with PayPal &#8211; it&#8217;s fast, free and secure!&#8221;&gt;<br />
&lt;/form&gt;</span><br />
action=&#8221;paypal/paypal.php&#8221; change it based on your  directory structure.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/php-scripting/add-paypal-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paypal Hacking</title>
		<link>http://secureslash.com/learn-hacking/paypal-hacking/</link>
		<comments>http://secureslash.com/learn-hacking/paypal-hacking/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 14:26:56 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Learn Hacking]]></category>
		<category><![CDATA[Paypal]]></category>
		<category><![CDATA[Website Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/paypal/paypal-hacking/</guid>
		<description><![CDATA[Tweet This is not about hacking paypal.com. Paypal knows enough about securing itself. Are you using Paypal IPN script in your websites? Then you have to take care on something. First of all plan and decide your product delivery strategy. Product delivery methods 1.Email product after a successful payment 2.Redirect user to product page to [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Flearn-hacking%2Fpaypal-hacking%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://secureslash.com/learn-hacking/paypal-hacking/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/learn-hacking/paypal-hacking/"  data-text="Paypal Hacking" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/learn-hacking/paypal-hacking/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://secureslash.com/learn-hacking/paypal-hacking/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>This is not about hacking paypal.com. Paypal knows enough about securing itself. Are you using Paypal IPN script in your websites? Then you have to take care on something.</p>
<p>First of all plan and decide your product delivery strategy.</p>
<h5>Product delivery methods</h5>
<p><script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
1.Email       product after a successful payment</p>
<p>2.Redirect       user to product page to download directly</p>
<p>Invalidated data always put you in  a hell.</p>
<p>See the below example:</p>
<blockquote><p>&lt;form  action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221;  method=&#8221;post&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221;  name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221;  name=&#8221;business&#8221; value=&#8221;<a href="mailto:you@yourbusiness.com"></a>see the #Hidden Code#below&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221;  name=&#8221;item_name&#8221; value=&#8221;Your Product&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221;  name=&#8221;item_number&#8221; value=&#8221;100&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221;  name=&#8221;amount&#8221; value=&#8221;15.00&#8243;&gt;<br />
<strong>&lt;input type=&#8221;hidden&#8221;  name=&#8221;return&#8221;<br />
value=&#8221;hxxp://www.yourbusiness.com/secret-location/product.zip&#8221;&gt;</strong><br />
&lt;input type=&#8221;image&#8221;  src=&#8221;hxxp://www.paypal.com/images/x-click-butcc.gif&#8221;<br />
border=&#8221;0&#8243; name=&#8221;submit&#8221;&gt;<br />
&lt;/form&gt;</p>
<p>#Hidden Code #</p>
<blockquote><p>&lt;!&#8211;  var prefix = &#8216;ma&#8217; + &#8216;il&#8217; + &#8216;to&#8217;;  var path = &#8216;hr&#8217; + &#8216;ef&#8217; + &#8216;=&#8217;;  var addy81733 = &#8216;you&#8217; + &#8216;@&#8217; + &#8216;yourbusiness&#8217; + &#8216;.&#8217; + &#8216;com&#8217;;  document.write( &#8216;&lt;a &#8216; + path + &#8216;\&#8221; + prefix + &#8216;:&#8217; + addy81733 + &#8216;\&#8217;&gt;&#8217; + addy81733 + &#8216;&lt;/a&gt;&#8217; );  //&#8211;&gt;</p></blockquote>
</blockquote>
<p>This is for redirecting user to your exact product page after a successful payment. Donâ€™t do such a worse code ever. Just give some transaction or purchase code to user and ask that code while they trying to download.</p>
<h5>Encrypted values</h5>
<blockquote><p>$hash = $paypal_transcation_id.$productno.$user_id;<br />
$purchase_code = md5($hash);</p></blockquote>
<p>Put this $purchase_code in a `transactions`  table for the user and email to them.</p>
<p>Ok now user is trying to download  product. What should we check?</p>
<p>Considerations:<br />
1.Ask the purchase code in a  &lt;form&gt;<br />
2. Force user to login in your  site.<br />
3. Check weather you have any rows  in `transactions` table for the user.<br />
4. If yes then fetch row and  arrange one checker variable<br />
$checker = $row[â€˜paypal_transactionâ€™].$row[â€˜productnoâ€™].$user_id;<br />
$user_entered_hash = $_POST[â€˜purchase_idâ€™];<br />
$our_checker_hash = md5($checker);<br />
If($our_checker_hash ==  $user_entered_hash)</p>
<p>By this manner you can proceed.<br />
You have to take care on url  encode.<br />
Temporary product url generation. It  must expire after some hours.<br />
All information should be encoded  and highly validated.<br />
Then only you can see profit.  So donâ€™t just install/write ipn scripts as it is. Take care on input and url validation always.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/learn-hacking/paypal-hacking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

