<?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>DesignerTuts &#187; Paypal and Paypal IPN</title>
	<atom:link href="http://designertuts.com/category/paypal-ipn/feed/" rel="self" type="application/rss+xml" />
	<link>http://designertuts.com</link>
	<description>Photoshop Tutorials</description>
	<lastBuildDate>Wed, 21 Jul 2010 18:49:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Paypal IPN &#8211; How to Sell Digital Downloads</title>
		<link>http://designertuts.com/paypal-ipn-1/</link>
		<comments>http://designertuts.com/paypal-ipn-1/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 09:35:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=709</guid>
		<description><![CDATA[
How to Sell Downloadable Products with Paypal IPN
I&#8217;ve been experimenting with Paypal IPN for some time now and I&#8217;ve had in the back of my mind that I wanted to put all the different tutorials I&#8217;d written together into one big explanation of what you need to do to sell downloadable products. When I tried [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/lokpaypal.gif"   border="0" /></a></p>
<h2>How to Sell Downloadable Products with Paypal IPN</h2>
<p>I&#8217;ve been experimenting with Paypal IPN for some time now and I&#8217;ve had in the back of my mind that I wanted to put all the different tutorials I&#8217;d written together into one big explanation of what you need to do to sell downloadable products. When I tried this I realised there is just too much information for one tutorial.<br />
So I&#8217;ve created a series. And despite my frog like voice I have decided to give video tutorials a go.<br />
<span id="more-709"></span><br />
I&#8217;m not going to explain how to write your own code from scratch. It&#8217;s just too difficult. Commercially available scripts have mostly been around long enough to iron out the bugs, to add on new features and create spin off scripts that do other related tasks. They also have established support systems to help with any problems you might encounter.</p>
<p>The one I recommend is <a href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack=">Linklok from Vibralogix</a>. (This is an affiliate link so I gain financially if you purchase after following this link)</p>
<p>Vibralogix provide an excellent user guide and there is plenty of help available on their support site but despite this I found it all a bit overwhelming so hopefully you will find my video tutorials helpful. They cover all the other things you need to do as well such as setting up your Paypal account, creating Paypal Buy Now buttons and so on.</p>
<p>This first tutorial covers the basics. The next ones will be more advanced. e.g. using a database to store products and log orders, high security, generating serial numbers, invoices, product specific emails, complex products and so on.</p>
<p><div id="saiweb_1f632bd75fb830bac3d2412f55975df3" style="width:640px; height:379px;" class="flowplayer"></div><script language="Javascript" type="text/javascript">
	WPFP(document).ready(function() {
		//load player
		$f("saiweb_1f632bd75fb830bac3d2412f55975df3", "/wp-content/plugins/word-press-flow-player/flowplayer/gpl/flowplayer-3.1.5.swf", {
				plugins: {
  					 controls: {    					
      					
      					
      					
      					sliderGradient: 'none',
      					progressGradient: 'medium',
      					
      					
      					
      					
      					
      					backgroundGradient: 'none',
      					bufferGradient: 'none',
   						opacity:1.0
   						}
				},
			clip: {
					url:'/wp-content/uploads/2010/07/tut1b.mp4',
					autoPlay: false,
       				autoBuffering: false
				},
				canvas: {
					backgroundColor:''
				}})
			});</script>
				</p>
<p>The next 3 tutorials will be free to use but you will need to register to receive them. </p>
<blockquote>
<p><a href="http://designertuts.com/wp-login.php?action=register">====================CLICK HERE TO REGISTER====================</a></p>
</blockquote>
<h2>Tutorial #2: How to Customise the Download Page</h2>
<div class="ym_private_no_access"><div style="border-style:solid; border-width:1px; margin-bottom:1em; background-color:#E4F2FD; border-color:#C6D9E9; margin:5px; font-family:'Lucida Grande','Lucida Sans Unicode',Tahoma,Verdana,sans-serif; font-size:13px; color:#333333;"><div style="margin: 5px 10px;">You need to be logged in to see this part of the post </div></div>
<span id="ym_login_link"><a href="http://designertuts.com/wp-login.php?redirect_to=http%3A%2F%2Fdesignertuts.com%2Fpaypal-ipn-1%2F">[ Login ]</a></span> 
<span id="ym_register_link"><a href="http://designertuts.com/wp-login.php?action=register&ym_redirector=http%3A%2F%2Fdesignertuts.com%2Fpaypal-ipn-1%2F">[ Register ]</a></span></div>
<h2>Tutorial #3: Using a Database or External Product File</h2>
<div class="ym_private_no_access"><div style="border-style:solid; border-width:1px; margin-bottom:1em; background-color:#E4F2FD; border-color:#C6D9E9; margin:5px; font-family:'Lucida Grande','Lucida Sans Unicode',Tahoma,Verdana,sans-serif; font-size:13px; color:#333333;"><div style="margin: 5px 10px;">You need to be logged in to see this part of the post </div></div>
<span id="ym_login_link"><a href="http://designertuts.com/wp-login.php?redirect_to=http%3A%2F%2Fdesignertuts.com%2Fpaypal-ipn-1%2F">[ Login ]</a></span> 
<span id="ym_register_link"><a href="http://designertuts.com/wp-login.php?action=register&ym_redirector=http%3A%2F%2Fdesignertuts.com%2Fpaypal-ipn-1%2F">[ Register ]</a></span></div>
<h2>Coming Soon: Many more Linklok Tutorials.</h2>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/paypal-ipn-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Payment</title>
		<link>http://designertuts.com/web-payment/</link>
		<comments>http://designertuts.com/web-payment/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 14:28:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=697</guid>
		<description><![CDATA[There are many situations in which you might want to accept Web Payments. The most obvious being an online shop but there are others such as having a restricted area on your website for which payment is necessary. Also if you are selling a digital product then an ordinary website shop will often not meet [...]]]></description>
			<content:encoded><![CDATA[<p>There are many situations in which you might want to accept <strong>Web Payments</strong>. The most obvious being an online shop but there are others such as having a restricted area on your website for which payment is necessary. Also if you are selling a digital product then an ordinary website shop will often not meet your requirements.<br />
<span id="more-697"></span><br />
<strong>Web Payment</strong> with Paypal</p>
<p>One of the commonest methods of accepting Web Payment is to use Paypal but there are others such as 2Checkout.</p>
<p>Unless you have some programming skills or your application is very simple I would recommend you buy one of the programs that do everything for you.<br />
One of the best companies is <a href="http://www.shareasale.com/r.cfm?b=12671&#038;u=344862&#038;m=3826&#038;urllink=&#038;afftrack=">Vibralogix</a> (This is an affiliate link. I am paid for this recommendation.) They do all the hard work for you and have a number of different products for handling memberships systems, digital downloads and the rest.</p>
<p>But if you would rather work it all out yourself there are plenty of tutorials on the site.</p>
<ul>
<li><a href="http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/">How to receive Web Payments with Paypal</a> </li>
<li><a href="http://designertuts.com/paypal-ipn/">Paypal IPN </a></li>
<li><a href="http://designertuts.com/adding-a-really-simple-paypal-buy-now-button/">Adding a simple Buy Now button </a></li>
<li><a href="http://designertuts.com/adding-a-more-complex-paypal-buy-now-button/">Adding a more complex Buy Now button</a></li>
<li><a href="http://designertuts.com/adding-an-advanced-paypal-buy-now-button/">Adding an advanced Buy Now button </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/web-payment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding an Advanced Paypal Buy Now Button</title>
		<link>http://designertuts.com/adding-an-advanced-paypal-buy-now-button/</link>
		<comments>http://designertuts.com/adding-an-advanced-paypal-buy-now-button/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 16:35:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=616</guid>
		<description><![CDATA[This tutorial explains in some detail what you can do to get the most from a Paypal Buy Now button. There are many options available to you and I include example code where possible. Paypal has some really good documentation on the subject so I have also included links to their site.

HTML variables
Buy Now buttons
Website [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial explains in some detail what you can do to get the most from a Paypal Buy Now button. There are many options available to you and I include example code where possible. Paypal has some really good documentation on the subject so I have also included links to their site.<br />
<span id="more-616"></span><br />
<a href="https://cms.paypal.com/us/cgi-bin/?&#038;cmd=_render-content&#038;content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables">HTML variables</a></p>
<p><a href="https://cms.paypal.com/us/cgi-bin/?&#038;cmd=_render-content&#038;content_ID=developer/e_howto_html_buynow_buttons">Buy Now buttons</a></p>
<p>Website Payments Standard uses a normal HTML Form to get information from your website. When you use their Create a Button wizard the HTML created is basically an HTML Form containing hidden HTML input variables that contain all the relevant details of the purchase.</p>
<p><strong>1. Saved Buttons<br />
</strong><br />
Buttons created and saved on the Paypal website will have much of the information associated with them stored on the Paypal site. Consequently the HTML form on your website will be much simpler than one that is not stored on Paypal&#8217;s site. A saved button will have a variable with button id such as</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;hosted_button_id&#8221; value=&#8221;10954267&#8243;&gt;</p>
<p>You should not edit this or try to generate your own hosted button ids but you can enhance the HTML form by adding extra value as custom variables. These should be added to a Paypal hosted button in Step 3 (Customise Advanced Features)</p>
<p>If you try to mix a hosted button with a manually created button you can get unexpected results. Paypal may ignore your manual additions. So I would recommend you go for one or the other.</p>
<p><strong>2. The Form tag<br />
</strong><br />
The form tag will look like this. You should leave this alone.</p>
<p>&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221;&gt;</p>
<p><strong>3. Input variables<br />
</strong><br />
The input variables don&#8217;t need to be seen by the purchaser so they are marked as hidden. They will take the following format.</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;variableName&#8221; value=&#8221;variableValue&#8221;&gt;</p>
<p><strong>4. cmd variable<br />
</strong><br />
The &#8220;cmd&#8221; variable is always required in the Form. It always takes the value &#8220;_s-xclick&#8221; or &#8220;_xclick&#8221; for a &#8220;Buy Now&#8221; button. Don&#8217;t alter this.</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_s-xclick&#8221;&gt;</p>
<p><strong>5. Passthru variables.<br />
</strong><br />
Paypal lets you set variables and it will pass them on unaltered. Their use is optional and will depend on your situation. The following are passthru variables.</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;item_number&#8221; value=&#8221;test1&#8243;&gt; (up to 127 chars)<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;custom&#8221; value=&#8221;anythingyouwant&#8221;&gt; (up to 256 chars)<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;invoice&#8221; value=&#8221;123456&#8243;&gt; (up to 127 chars. Intended for use as invoice number)</p>
<p><strong>6. Character Set and Currency code<br />
</strong><br />
You can specify which character set you wish to use. e.g. to use UTF-8</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;charset&#8221; value=&#8221;utf-8&#8243;&gt;</p>
<p>and currency code (USD is assumed if not present) Codes accepted can be found here <a href="https://cms.paypal.com/us/cgi-bin/?&#038;cmd=_render-content&#038;content_ID=developer/e_howto_api_nvp_currency_codes">Currency Codes</a></p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;currency_code&#8221; value=&#8221;CurrencyCode&#8221;&gt;</p>
<p><strong>7. Return URL for specific transactions.<br />
</strong><br />
There is the option to set a global return URL in your Paypal account which will apply in all cases for Paypal buttons you create. You may however want to override this for specific buttons or you may want to include session related information in the return url. How to use session information is beyond the scope of this tutorial.</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;return&#8221; value=&#8221;URLspecificToThisTransaction&#8221;&gt;</p>
<p>&#8220;cancel_ return&#8221; is a URL to which the payer’s browser is redirected if payment is cancelled; for example, a URL on your website that displays a “Payment Canceled” page.</p>
<p>&#8220;rm&#8221; specifies the Return method. The FORM METHOD used to send data to the URL specified by the return variable after payment completion. Allowable values:</p>
<p>      0 – all shopping cart transactions use the GET method<br />
      1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent<br />
      2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted</p>
<p>The default is 0.<br />
Note: The rm variable takes effect only if the return variable is also set.</p>
<p>&#8220;cbt&#8221; sets the text for the Return to Merchant button on the PayPal Payment Complete page. For Business accounts, the return button displays your business name in place of the word “Merchant” by default. For Donate buttons, the text reads “Return to donations coordinator” by default.<br />
Note: The return variable must also be set.</p>
<p><strong>8. Pre filling the form to make things easier for your customer.</strong></p>
<p>If you already know the answer to some of the questions Paypal will need to know such as the Buyers Billings Address you can pre populate the form. This feature is not available in all countries. It is available in the US and UK.</p>
<p>Keep in mind that regardless of the address you fill in, when address_override=1 is passed a member&#8217;s confirmed address on file will be used as the shipping address and will be uneditable. When a non-PayPal account holder pays, their billing address and shipping address will need to match.</p>
<p> &lt;input type=&#8221;hidden&#8221; name=&#8221;first_name&#8221; value=&#8221;John&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;last_name&#8221; value=&#8221;Doe&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;address1&#8243; value=&#8221;9 Elm Street&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;address2&#8243; value=&#8221;Apt 5&#8243;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;city&#8221; value=&#8221;Berwyn&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;state&#8221; value=&#8221;PA&#8221;&gt;  (or as appropriate for non US)<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;country&#8221; value=&#8221;US&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;zip&#8221; value=&#8221;19312&#8243;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;night_phone_a&#8221; value=&#8221;610&#8243;&gt; (Buyers home phone. Area code for US. Country code for non US. 3 digit max)<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;night_phone_b&#8221; value=&#8221;555&#8243;&gt; (Buyers home phone. 3 digit prefix for US. Entire phone number for non US. 16 char max)<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;night_phone_c&#8221; value=&#8221;1234&#8243;&gt;  (Buyers home phone. 4 digit phone number for US.)<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;email&#8221; value=&#8221;jdoe@zyzzyu.com&#8221;&gt;<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;lc&#8221; value=&#8221;US&#8221;&gt;  (payers language for the billing info/log in page only. Default is US. Use UK for United Kingdom)<br />
 &lt;input type=&#8221;hidden&#8221; name=&#8221;charset&#8221; value=&#8221;utf-8&#8243;&gt;</p>
<p><strong>9. Product Options<br />
</strong><br />
Specify product options such as size on a dropdown box or text box. You can specify up to 7 options on a single button (Up to 5 dropdown and 2 text)<br />
You can either use the create button wizrd to do this or specify the code manually.</p>
<p>for example</p>
<p>&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221;&gt;</p>
<p><!-- Identify your business so that you can collect the payments. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;business&#8221; value=&#8221;herschelgomez@xyzzyu.com&#8221;&gt; </p>
<p><!-- Specify a Buy Now button. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221;&gt;</p>
<p><!-- Specify details about the item that buyers will purchase. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;item_name&#8221; value=&#8221;Hot Sauce-12 oz. Bottle&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;amount&#8221; value=&#8221;5.95&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;currency_code&#8221; value=&#8221;USD&#8221;&gt; </p>
<p><!-- Provide a dropdown menu option field. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;on0&#8243; value=&#8221;Type&#8221;>Type of sauce <br /> <br />
&lt;select name=&#8221;os0&#8243;&gt;<br />
&lt;option value=&#8221;Select a type&#8221;&gt;&#8211; Select a type &#8211;</option><br />
&lt;option value=&#8221;Red&#8221;&gt;Red sauce</option><br />
&lt;option value=&#8221;Green&#8221;&gt;Green sauce</option><br />
&lt;/select&gt;  </p>
<p><!-- Display the payment button. --><br />
&lt;input type=&#8221;image&#8221; name=&#8221;submit&#8221; border=&#8221;0&#8243; src=&#8221;https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#8221; alt=&#8221;PayPal &#8211; The safer, easier way to pay online&#8221;&gt;<br />
&lt;img alt=&#8221;" border=&#8221;0&#8243; width=&#8221;1&#8243; height=&#8221;1&#8243; src=&#8221;https://www.paypal.com/en_US/i/scr/pixel.gif&#8221; &gt; </p>
<p>&lt;/form&gt;</p>
<p><strong>10. Product Quantity.<br />
</strong><br />
The default is 1 item but you can use the button wizard to change this. Or use this example code.</p>
<p>&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221;&gt; </p>
<p><!-- Identify your business so that you can collect the payments. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;business&#8221; value=&#8221;herschelgomez@xyzzyu.com&#8221;&gt; </p>
<p><!-- Specify a Buy Now button. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221;&gt; </p>
<p><!-- Specify details about the item that buyers will purchase. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;item_name&#8221; value=&#8221;Hot Sauce-12 oz. Bottle&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;amount&#8221; value=&#8221;5.95&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;currency_code&#8221; value=&#8221;USD&#8221;&gt; </p>
<p><!-- Prompt buyers to enter their desired quantities by setting this variable to 1--><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;undefined_quantity&#8221; value=&#8221;1&#8243;&gt; </p>
<p><!-- Display the payment button. --><br />
&lt;input type=&#8221;image&#8221; name=&#8221;submit&#8221; border=&#8221;0&#8243; src=&#8221;https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#8221; alt=&#8221;PayPal &#8211; The safer, easier way to pay online&#8221;&gt;<br />
&lt;img alt=&#8221;" border=&#8221;0&#8243; width=&#8221;1&#8243; height=&#8221;1&#8243; src=&#8221;https://www.paypal.com/en_US/i/scr/pixel.gif&#8221; &gt; </p>
<p>&lt;/form&gt; </p>
<p><strong>11. Offering a discount.<br />
</strong><br />
Paypal allows you to offer a discount.<br />
- &#8220;Discount_amount&#8221; must be less than &#8220;amount&#8221;.<br />
- If you don&#8217;t specify &#8220;discount_amount2&#8243; then &#8220;discount_amount&#8221; will apply to all items not just the first.<br />
- To use &#8220;discount_amount2&#8243; you must specify &#8220;discount&#8221; as greater than or equal to 0.</p>
<p>You can specify &#8220;discount_rate&#8221; and &#8220;discount_rate2&#8243; as an alternative to &#8220;discount_amount&#8221; and &#8220;discount_amount2&#8243;. This applies a percentage from 0 to 100.<br />
Unlike &#8220;discount_amount&#8221; if you don&#8217;t specify &#8220;discount_rate2&#8243; then &#8220;discount_rate&#8221; only applies to the first item.</p>
<p>Use &#8220;discount_num&#8221; to specify an upper limit on the number of items to which &#8220;discount_amount2&#8243; or &#8220;discount_rate2&#8243; applies.</p>
<p>Use the button creation tool wizard or this example code that provides a $0.15 discount on the first item ordered and a $0.20 discount on the next four items.<br />
&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221;&gt; </p>
<p><!-- Identify your business so that you can collect the payments. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;business&#8221; value=&#8221;herschelgomez@xyzzyu.com&#8221;&gt;</p>
<p><!-- Specify a Buy Now button. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221;&gt; </p>
<p><!-- Specify details about the item that buyers will purchase. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;item_name&#8221; value=&#8221;Hot Sauce-12 oz. Bottle&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;amount&#8221; value=&#8221;5.95&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;currency_code&#8221; value=&#8221;USD&#8221;&gt; </p>
<p><!-- Specify the discount amounts that apply to the item. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;discount_amount&#8221; value=&#8221;0.15&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;discount_amount2&#8243; value=&#8221;0.20&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;discount_num&#8221; value=&#8221;4&#8243;&gt; </p>
<p><!-- Prompt buyers to enter their desired quantities. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;undefined_quantity&#8221; value=&#8221;1&#8243;&gt; </p>
<p><!-- Display the payment button. --><br />
&lt;input type=&#8221;image&#8221; name=&#8221;submit&#8221; border=&#8221;0&#8243; src=&#8221;https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#8221; alt=&#8221;PayPal &#8211; The safer, easier way to pay online&#8221;&gt;<br />
&lt;img alt=&#8221;" border=&#8221;0&#8243; width=&#8221;1&#8243; height=&#8221;1&#8243; src=&#8221;https://www.paypal.com/en_US/i/scr/pixel.gif&#8221; &gt; </p>
<p>&lt;/form&gt; </p>
<p><strong>12. Shipping and Handling charges<br />
</strong><br />
&#8220;shipping&#8221; and &#8220;shipping2&#8243; specify the cost of shipping an item and subsequent items.<br />
&#8220;handling&#8221; applies  regardless of number of items.</p>
<p><strong>13. Tax<br />
</strong><br />
Use &#8220;tax&#8221; and &#8220;tax_rate&#8221; to apply a transaction based tax amount or tax rate irrespective of customers location.<br />
&#8220;tax_rate&#8221; can be 0.001 to 100</p>
<p><strong>14. Weight<br />
</strong><br />
&#8220;weight&#8221; and &#8220;weight_unit&#8221; (lbs or kgs)</p>
<p><strong>15. How the Paypal Checkout Looks<br />
</strong><br />
&#8220;page_style&#8221; can be set to &#8220;paypal&#8221; to use the Paypal page style<br />
&#8220;page_style&#8221; can be set to &#8220;primary&#8221; to use page style you defined as primary in your account<br />
&#8220;page_style&#8221; can also be set to any custon style you created in your account profile.</p>
<p>&#8220;image_url&#8221; specifies where the 150&#215;50 pixel image is that will be used as your logo. If you don&#8217;t specifiy this then your business name will be used if you have a business acccount otheriwise your email address.</p>
<p>&#8220;cpp_header_image&#8221; specifies the image at the top left of the checkout page. maximum size is 750&#215;90 pixels. PayPal recommends that you provide an image that is stored only on a secure (https) server.</p>
<p>&#8220;cpp_headerback_color&#8221; specifies the background color for the header of the checkout page. Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII.</p>
<p>&#8220;cpp_headerborder_color&#8221;specifies the border color around the header of the checkout page. The border is a 2-pixel perimeter around the header space, which has a maximum size of 750 pixels wide by 90 pixels high. Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII.</p>
<p>&#8220;cpp_payflow_color&#8221; specifies the background color for the checkout page below the header. Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII. Note: Background colors that conflict with PayPal’s error messages are not allowed; in these cases, the default color is white.</p>
<p>&#8220;cs&#8221; specifies the background color of the checkout page. Allowable values:</p>
<p>      0 – background color is white<br />
      1 – background color is black</p>
<p>The default is 0.</p>
<p>&#8220;lc&#8221; specifies the language of the login or sign-up page that subscribers see when they click the Subscribe button. If unspecified, the language is determined by a PayPal cookie in the subscriber’s browser. If there is no PayPal cookie, the default language is U.S. English.</p>
<p>&#8220;no_note&#8221; specifies to not prompt payers to include a note with their payments. Allowable values:<br />
      0 – provide a text box and prompt for the note<br />
      1 – hide the text box and the prompt</p>
<p>The default is 0.</p>
<p>&#8220;cn&#8221; is a label that appears above the note field. This value is not saved and will not appear in any of your notifications. If omitted, the default label above the note field is “Add special instructions to merchant.” The cn variable is not valid with Subscribe buttons or if you include no_note=&#8221;1&#8243;.</p>
<p>&#8220;no_shipping&#8221; specifies to not prompt payers for shipping address. Allowable values:</p>
<p>      0 – prompt for an address, but do not require one<br />
      1 – do not prompt for an address<br />
      2 – prompt for an address, and require one</p>
<p>The default is 0.</p>
<p><strong>A Basic Non hosted Buy Now button sample code<br />
</strong><br />
&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221;&gt; </p>
<p><!-- Identify your business so that you can collect the payments. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;business&#8221; value=&#8221;herschelgomez@xyzzyu.com&#8221;&gt; </p>
<p><!-- Specify a Buy Now button. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221;&gt; </p>
<p><!-- Specify details about the item that buyers will purchase. --><br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;item_name&#8221; value=&#8221;Hot Sauce-12 oz. Bottle&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;amount&#8221; value=&#8221;5.95&#8243;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;currency_code&#8221; value=&#8221;USD&#8221;&gt; </p>
<p><!-- Display the payment button. --><br />
&lt;input type=&#8221;image&#8221; name=&#8221;submit&#8221; border=&#8221;0&#8243; src=&#8221;https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#8221; alt=&#8221;PayPal &#8211; The safer, easier way to pay online&#8221;&gt;<br />
&lt;img alt=&#8221;" border=&#8221;0&#8243; width=&#8221;1&#8243; height=&#8221;1&#8243; src=&#8221;https://www.paypal.com/en_US/i/scr/pixel.gif&#8221; &gt; </p>
<p>&lt;/form&gt; </p>
<p><strong>A Basic hosted Buy Now button sample code<br />
</strong><br />
&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;_s-xclick&#8221;&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;hosted_button_id&#8221; value=&#8221;10954267&#8243;&gt;<br />
&lt;input type=&#8221;image&#8221; src=&#8221;https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif&#8221; border=&#8221;0&#8243; name=&#8221;submit&#8221; alt=&#8221;PayPal &#8211; The safer, easier way to pay online.&#8221;&gt;<br />
&lt;img alt=&#8221;" border=&#8221;0&#8243; src=&#8221;https://www.paypal.com/en_GB/i/scr/pixel.gif&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243;&gt;<br />
&lt;/form&gt;</p>
<p>Have you seen the other Paypal tutorials on DesignerTuts?</p>
<p><a href="http://designertuts.com/adding-a-more-complex-paypal-buy-now-button/">Adding a More Complex Buy Now Button</a><br />
<a href="http://designertuts.com/adding-a-really-simple-paypal-buy-now-button/">Adding a Really Simple Buy Now Button</a><br />
<a href="http://designertuts.com/paypal-ipn/">Paypal IPN</a><br />
<a href="http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/">Paypal IPN Receiving Instant Payments</a></p>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/adding-an-advanced-paypal-buy-now-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a more Complex Paypal Buy Now Button</title>
		<link>http://designertuts.com/adding-a-more-complex-paypal-buy-now-button/</link>
		<comments>http://designertuts.com/adding-a-more-complex-paypal-buy-now-button/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:29:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=611</guid>
		<description><![CDATA[Question: The &#8220;Buy Now&#8221; button was easier than I thought. What extra options are available.

Answer: 
1. Inventory Tracking.
If you know how many of a product you have in stock you can let Paypal keep track of how many you are selling and they will warn you by email when stock is getting low. To set [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Questio</strong>n: The &#8220;Buy Now&#8221; button was easier than I thought. What extra options are available.<br />
<span id="more-611"></span><br />
Answer: </p>
<p><strong>1. Inventory Tracking.</strong></p>
<p>If you know how many of a product you have in stock you can let Paypal keep track of how many you are selling and they will warn you by email when stock is getting low. To set this up edit your existing button or make a new button as described in <a href-"http://designertuts.com/adding-a-really-simple-paypal-buy-now-button">simple paypal buy now button tutorial</a> but when you have finished Step 1 click on Step 2 where it says &#8220;Track Inventory&#8221; and then check the &#8220;Track Inventory&#8221; checkbox.</p>
<p>You can then enter your existing stock level and the level at which you want to receive an email warning.<br />
You can also decide whether to allow customers to make a purchase when an item is sold out and specify a page to send them to when they click &#8220;Continue Shopping&#8221; after a sold out situation.</p>
<p><strong>The following are all setup in Step 3 of the button creation process.<br />
</strong><br />
2. Let customer change order quantities.</p>
<p>3. Let customer add special instructions in a message to you</p>
<p>The default is to allow this so if you want this you don&#8217;t need to do anything.</p>
<p>4. Don&#8217;t ask for customers postal address</p>
<p>If you don&#8217;t need the customers postal address don&#8217;t ask for it. </p>
<p>5. Specify which page the customer goes to if they cancel e.g. https://www.mystore.com/cancel</p>
<p>6. Specify which page the customer goes to if they complete the purchase e.g. https://www.mystore.com/thanks</p>
<p>Here is the finished article</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="10954267">
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p>The &#8220;top of the range&#8221; in terms of extra things you can do with a &#8220;Buy Now&#8221; button is to specify your own advanced variables. I will be covering this in my next Paypal Button tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/adding-a-more-complex-paypal-buy-now-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Really Simple Paypal Buy Now Button</title>
		<link>http://designertuts.com/adding-a-really-simple-paypal-buy-now-button/</link>
		<comments>http://designertuts.com/adding-a-really-simple-paypal-buy-now-button/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:28:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=606</guid>
		<description><![CDATA[Question: I want a really simple &#8220;Buy Now&#8221; button on my website. How do I do it.
Answer: Use Paypal Website Payments Standard. Its very easy to set up. The customer clicks a &#8220;Buy Now&#8221; button. They are taken to Paypal&#8217;s site where they enter their card details or pay from their paypal account if they [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Question</strong>: I want a really simple &#8220;Buy Now&#8221; button on my website. How do I do it.</p>
<p><strong>Answer</strong>: Use Paypal Website Payments Standard. Its very easy to set up. The customer clicks a &#8220;Buy Now&#8221; button. They are taken to Paypal&#8217;s site where they enter their card details or pay from their paypal account if they have one. The money then appears in your paypal account.<br />
<span id="more-606"></span><br />
<strong>Question</strong>: What does it cost.</p>
<p><strong>Answer</strong>: There are no setup charges, fees or cancellation charges for Website Payments Standard. There are charges on each transaction though. The amount depends on sales volume. You will need a Paypal account.<br />
<strong><br />
Question</strong>: So how do I do it.<br />
<strong>Answer</strong>:</p>
<p>1. Get a Paypal account</p>
<p>Go to the paypal website and click Sign Up. Then choose the Paypal Business account.</p>
<p>2. Make a button. </p>
<p>Log in to your paypal account and click to go to your &#8220;Profile&#8221;. Under &#8220;Selling Preferences&#8221; click the &#8220;Create New Button&#8221; (or &#8220;My Saved Buttons&#8221;) link.</p>
<p>On the question about selling multiple items change the checkbox to &#8220;No&#8221; so that it creates a &#8220;Buy Now&#8221; button.</p>
<p>Fill in the name of the item and its price.</p>
<p>Click Customize Appearance and you can change a few basic features.</p>
<p>There are more advanced features available but for a basic &#8220;Buy Now&#8221; button that is all you need so just click &#8220;Create Button&#8221;</p>
<p>Here is one I made earlier.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="10945421">
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p>I will be showing some of the more advanced features in a future tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/adding-a-really-simple-paypal-buy-now-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paypal IPN</title>
		<link>http://designertuts.com/paypal-ipn/</link>
		<comments>http://designertuts.com/paypal-ipn/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 23:28:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/?p=550</guid>
		<description><![CDATA[
Instant Payment Notification is better known as Paypal IPN and is Paypal&#8217;s interface for handling real time confirmation of purchases.
A typical use for IPN is where you want a customer to pay for a software download but there can be more to it than that and the IPN interface provides a wealth of options some [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/lokpaypal.gif"   border="0" /></a></p>
<p>Instant Payment Notification is better known as <strong>Paypal IPN</strong> and is Paypal&#8217;s interface for handling real time confirmation of purchases.</p>
<p>A typical use for IPN is where you want a customer to pay for a software download but there can be more to it than that and the IPN interface provides a wealth of options some of which I will go through in this article.<br />
<span id="more-550"></span></p>
<blockquote><p>
See my new <a href="http://designertuts.com/paypal-ipn-1">Video Tutorial for Linklok</a>. Videos make things much easier to understand.
</p></blockquote>
<p>Paypal have a simple demo of the<a href="https://www.paypal.com/cgi-bin/webscr?cmd=p/dmo/demo_ipn_1-outside"> basics of a Paypal IPN purchase</a>, plus a good explanation called <a href="https://www.x.com/docs/DOC-1084">Introducing IPN</a> and I have a more in depth <a href="http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/">Paypal IPN Tutorial</a> available on this site which includes example php code. You should view these explanations before reading on but a very simple summary goes as follows:</p>
<ol>
<li>Customer clicks the buy button and makes the payment through Paypal</li>
<li>Paypal posts a notification to your server with all the payment details</li>
<li>Your server echoes back the details</li>
<li>Paypal authenticates the transaction and sends VERIFIED or INVALID response</li>
<li>When your server sees VERIFIED it makes some checks and processes the order</li>
</ol>
<p>The best place to search for information is the <a href="http://www.paypal.com/integration">Paypal Integration centre.</a> which has guides, code and links for everything to do with integrating your website with Paypal. It covers much more than just IPN. This article will assume you have decided that IPN is right for you.</p>
<p>The one place you MUST visit is the <a href="https://www.x.com/community/ppx/xspaces/web_checkout/ipn_pdt?view=discussions">Paypal IPN Forum</a> on the developer website. As well as a constantly changing list of discussion topics about IPN, there are some good sticky posts about troubleshooting tips, IPN variables, template code etc.</p>
<h3>Paypal Sandbox</h3>
<p>When you are developing your website you really don&#8217;t want to be trying to get it working by experimenting on a real money system. Any early bugs in the system could leave security holes but even if you write perfect code it is best not to do your testing using real money.</p>
<p>Paypal provides what they call a sandbox, almost identical to the live Paypal system. You can setup fake customers with fake money and make as many test purchases as you want. The perfect system to fully test your web application.</p>
<p>The Sandbox sets the variable test_ipn with a value of 1 in the HTTP response back to your IPN page. You may want to check for this so you know you are dealing with the real or the sandbox system.</p>
<p>There is a <a href="https://www.x.com/community/ppx/testing?view=discussions&#038;start=0">Testing Forum</a> on the developer network. It&#8217;s a great place for advice.</p>
<h3>Paypal Account</h3>
<p>Paypal provide 3 different types of account. Personal, Premier and Business. You will need Premier or Business to use IPN.</p>
<h3>Paypal IPN Events</h3>
<p>IPN messages are normally generated to indicate a payment has occurred but this is not the only situation and you should be prepared to handle all of the following situations.</p>
<ul>
<li>Instant payments, including Express Checkout and direct credit card payments</li>
<li>eCheck payments and associated status, such as pending, completed, or denied</li>
<li>Payments that may be pending for other reasons, such as those being reviewed for potential fraud</li>
<li>Events related to recurring payments and subscriptions</li>
<li>Authorizations, which indicate a sale whose payment has not yet been collected</li>
<li>Chargebacks, which are initiated by a credit card processor; for example, when a customer disputes a charge</li>
<li>Disputes, which are initiated by a buyer using the PayPal resolution process</li>
<li>Reversals, which occur when you win a dispute or a chargeback is canceled</li>
<li>Refunds, which you may choose to give</li>
</ul>
<h3>Listener</h3>
<p><strong>Paypal IPN</strong> messages are not synchronized with actions on your website. You detect IPN messages from Paypal with a piece of code known as a listener. Paypal provides <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&#038;content_ID=developer/library_code_ipn_code_samples">example code</a> and there is also an example IPN code snippet in the <a href="http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/">IPN tutorial</a>.</p>
<p>You specify the URL of your listener in your Paypal account’s profile (Profile, Selling Preferences, Instant Payment Notification Preferences) but you can override this for specific transactions when you setup a button or API operation (Set the notify_url HTML form variable). You can also temporarily turn off the sending of IPN messages, useful if your site is down for maintenance. They are still generated and stored until you switch sending back on again.</p>
<p>Paypal expects an acknowledgement from you (within 30secs) to show you have received the IPN message ok. If you don&#8217;t send an acknowledgement Paypal will resend the IPN message at intervals for up to 4 days after the first message. So even if you don&#8217;t intend to process the message you must acknowledge it or Paypal will send it again. If you receive a re transmission from Paypal even though you sent an acknowledgement you should send another acknowledgement. There may be a timing problem or the first acknowledgement may have been lost. Your listener code must be able to cope with this retry situation without processing the transaction twice.</p>
<p>Paypal recommends that your checkout flow should NOT wait for an IPN message before it is allowed to complete.</p>
<h3>Listener Processing</h3>
<p>You must perform a number of checks on the IPN message received from Paypal.</p>
<ul>
<li>Check the email address to make sure it is yours</li>
<li>Check that you have not already processed the transaction identified by the transaction ID</li>
<li>Make sure that the transaction&#8217;s payment status is &#8220;completed&#8221;</li>
<li>Verify that the payment amount actually matches what you intend to charge</li>
</ul>
<h3>Example IPN Message</h3>
<p>A typical IPN message:</p>
<p>mc_gross=19.95&#038;protection_eligibility=Eligible&#038;address_status=confirmed&#038;payer_id=LPLWNMTBWMFAY&#038;tax=0.00&#038;address_street=1+Main+St&#038;payment_date=20%3A12%3A59+Jan+13%2C+2009+PST&#038;payment_status=Completed&#038;charset=windows-1252&#038;address_zip=95131&#038;first_name=Test&#038;mc_fee=0.88&#038;address_country_code=US&#038;address_name=Test+User&#038;notify_version=2.6&#038;custom=&#038;payer_status=verified&#038;address_country=United+States&#038;address_city=San+Jose&#038;quantity=1&#038;verify_sign=AtkOfCXbDm2hu0ZELryHFjY-Vb7PAUvS6nMXgysbElEn9v-1XcmSoGtf&#038;payer_email=gpmac_1231902590_per%40paypal.com&#038;txn_id=61E67681CH3238416&#038;payment_type=instant&#038;last_name=User&#038;address_state=CA&#038;receiver_email=gpmac_1231902686_biz%40paypal.com&#038;payment_fee=0.88&#038;receiver_id=S8XGHLYDW9T3S&#038;txn_type=express_checkout&#038;item_name=&#038;mc_currency=USD&#038;item_number=&#038;residence_country=US&#038;test_ipn=1&#038;handling_amount=0.00&#038;transaction_subject=&#038;payment_gross=19.95&#038;shipping=0.00</p>
<h3>Testing your Listener</h3>
<p>The Sandbox has an excellent IPN Simulator (under Test Tools) which lets you choose the transaction type, fill in all the parameter values and send a test IPN to a specified address.</p>
<p>Some advice on the forum about using <a href="http://developer.paypal-portal.com/pdn/board/message?board.id=ipn&#038;thread.id=19906">curl/fsockopen/local testing</a>.</p>
<p><strong>When things go wrong&#8230;</strong></p>
<p>If you receive nothing at all.</p>
<ul>
<li>check that you have specified not only the correct file name for your IPN listener but also the correct path to the file.</li>
<li>Check your firewall isn&#8217;t blocking HTTP POST messages from PayPal.</li>
<li>Check the webserver logs for any errors</li>
</ul>
<p>If you receive some messages but not all.</p>
<ul>
<li>Make sure the listener is processing ALL messages</li>
<li>Make sure account is valid and confirmed</li>
</ul>
<p>If you receive INVALID message.</p>
<ul>
<li>Check you are sending your responses to the correct paypal address</li>
<li>Verify that your response contains exactly the same IPN variables and values in the same order, preceded with cmd=_notify-validate.</li>
<li>Ensure that you are encoding your response string and are using the same character encoding as the original message.</li>
</ul>
<h3>IPN History</h3>
<p>Paypal provides an IPN history page under the My Account tab. Click on History to see it. It includes everything you want to know about each IPN message including the following Status values.</p>
<ul>
<li>Sent: indicates that PayPal sent the message to your IPN listener</li>
<li>Failed: indicates that PayPal did not receive an acknowledgement to the message</li>
<li>Queued: indicates that PayPal is ready to send the message</li>
<li>Retrying: indicates that message was resent between 1 and 15 times and PayPal continues to be resend the message</li>
<li>Disabled: indicates that the message will not be resent because the merchant’s account has been disabled</li>
</ul>
<h3>IPN Resending</h3>
<p>Use the History page to resend an IPN.</p>
<h3>Conclusion</h3>
<p>Paypal IPN is a difficult subject but the combination of an excellent testing environment in the form of the sandbox and the good quality advice provided through the forums should make it possible for you to get your website application up and running.</p>
<p><a target="_blank" href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/lokpaypal.gif"   border="0" /></a></p>
<h3>Interesting External Blogs</h3>
<ul>
<li>
<p><a href="http://www.james-vandyne.com/2009/08/process-paypal-ipn-requests-through-wordpress/">Process Paypal IPN Requests Through Wordpress « James Van Dyne</a> &#8211; Process Paypal IPN Requests Through Wordpress. Introduction. Paypal is perhaps the easiest way to send/receive money online and Wordpress is perhaps the most popular blogging platform out there. Wouldn&#8217;t it be great if there was a way &#8230;</p>
</li>
<li>
<p><a href="http://blog.awarelabs.com/2008/paypal-ipn-python-code/">PayPal IPN Python Code | Django Aware</a> &#8211; PayPal has Instant Payment Notification (IPN) libraries with examples for Perl, Java, and even Ruby, but look as hard as I may none for Python. Then again I.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/paypal-ipn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paypal IPN: receiving instant payments in your web application.</title>
		<link>http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/</link>
		<comments>http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 14:04:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Paypal and Paypal IPN]]></category>

		<guid isPermaLink="false">http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/</guid>
		<description><![CDATA[
This paypal ipn tutorial explains how to use Paypals IPN system with a simple single item purchase. Instant Payment Notification allows you to integrate your PayPal payments with your website&#8217;s back-end operations, so you get immediate notification and authentication of the PayPal payments you receive. The main use of IPN is where your website needs [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/lokpaypal.gif"   border="0" /></a></p>
<p>This<strong> paypal ipn tutorial</strong> explains how to use Paypals IPN system with a simple single item purchase. Instant Payment Notification allows you to integrate your PayPal payments with your website&#8217;s back-end operations, so you get immediate notification and authentication of the PayPal payments you receive. The main use of IPN is where your website needs to know immediately that payment has been made. For example you might have sold something that you will then make available for the user to download.</p>
<p>There is a lot of information on the Paypal website which is worth looking at but the following <strong>paypal ipn example</strong> will show you in detail a real world example of how to use it.</p>
<p><span id="more-145"></span></p>
<blockquote><p>
See my <a href="#tips">Paypal Tips Section </a> at the end of the Tutorial for the following</p>
<ul>
<li>Using CURL instead of fsockopen</li>
<li>Paypal&#8217;s IPN Script and Docs</li>
</ul>
<p>Jump to the <a href="#tips">Tips Section </a> at the end of the Tutorial or continue on this page with the <strong>IPN tutorial</strong> itself.
</p></blockquote>
<p>There are 3 main parts to an IPN system.</p>
<p>1) A webpage that initiates a call to Paypal to make a payment<br />
2) A php page on your webserver that Paypal calls to notify you that payment has been made<br />
3) A webpage that confirms the above have occurred, and continues on to the next phase of you web application.</p>
<p>1 and 3 will be part of your website and accessible to users in the normal way. 2 however is only ever accessed by paypal.</p>
<p>I will first explain some of the issues that you need to understand if you want to know <strong>how to use IPN</strong>.</p>
<h2>Paypal Account Setup</h2>
<p>Your Paypal account must be setup correctly to use IPN. Check the following in your paypal account (under edit profile).</p>
<p>under &#8220;Selling Preferences&#8221; , &#8220;Instant Payment Notification Preferences&#8221;</p>
<ul>
<li>set IPN to &#8220;On&#8221;</li>
<li>set IPN Url to the page containing the ipn code shown later in the tutorial. The name I use is &#8220;http://&lt;yourwebsite address&gt;/paypalipn.php&#8221; but you can use anything here.</li>
</ul>
<p>Under &#8220;Selling Preferences&#8221;, &#8220;payment receiving preferences&#8221;</p>
<ul>
<li>block payments from users who pay with echeck. (This is because these will not be instant)</li>
</ul>
<p>Under &#8220;account information&#8221; , &#8220;email&#8221;</p>
<ul>
<li>make a note of your primary email address. You will need to embed it in the code below. This email will be visible to users so make it a professional one. Users don&#8217;t get a good feeling about sending money to a hotmail address or to an address that doesnt match the website.</li>
</ul>
<h2>Sequence of Events</h2>
<p>The way IPN works is a bit unusual so to explain&#8230;</p>
<p>You initiate IPN by sending a message to Paypal from the webpage that the user is on when they confirm a purchase.<br />
What happens next is that 2 completely separate chains of events occur.</p>
<ul>
<li>The first is the obvious one where the user goes to the paypal website, makes the payment and is returned to your website where they can be told their purchase is confirmed.</li>
<li>The second is initiated by Paypal and envolves Paypal calling up a predetermined webpage on your site (paypalipn.php). Paypal will send a message to this page which indicates that the payment has happened, how much was paid, who paid it, who was paid etc. On this page you need to check these details and somehow log that the payment has happened, usually by updating a database.</li>
</ul>
<p>These two chains of events are happening at the same time (only the first is visible to the user). Although as the paypal event is more complex it will usually take longer. For this reason when you send the user to the confirmation page and it checks the database that payment has happened ok it may well find that the payment hasn&#8217;t yet been made. You will need to create some code that waits for the payment to go through and as this can take quite a few seconds you will need to inform the user with a message along the lines of &#8220;Waiting for Paypal to confirm payment&#8230;&#8221;.</p>
<p>So in summary</p>
<ol>
<li>Customer makes a payment through your website.</li>
<li>Paypal sends an IPN to your specified ipn webpage specifying what has been bought etc</li>
<li>Your webpage validates the IPN and sends Paypal an acknowledgement.</li>
<li>Customer continues to access your website.</li>
</ol>
<p>2 and 3 occur in parallel with what the user is doing in 4) on your website.</p>
<h2>The purchase page</h2>
<p>The easiest way to generate the code to use on this page is to use Paypals &#8220;Buy Now Button&#8221; function. Log in to Paypal and look under Merchant Services for &#8220;Buy It Now&#8221; button.</p>
<p>Fill in the information as required</p>
<p>You must take steps to ensure the security of the purchase.<br />
There are various ways of doing this</p>
<ul>
<li>Encrypt the button on the paypal site (there is an option for this)</li>
<li>Encrypt the button yourself (complex and beyond this tutorial)</li>
<li>Manually check all prices before shipping. I assume this isn&#8217;t appropriate for this tutorial.</li>
<li>Check all the values in the IPN processing. (Explained below in the paypalipn.php code)</li>
</ul>
<p>If you enter an image for the button make sure it is on a secure (https) server otherwise the user will get a warning about insecure items which may scare them off continuing with the purchase.</p>
<p>Click to &#8220;Create Button&#8221; and copy and paste the code produced into your purchase web page.</p>
<p>The code will look something like this&#8230;</p>
<p><a href="http://designertuts.com/wp-content/uploads/2007/10/but-code" title="button code">button code</a></p>
<h2>The IPN webpage code</h2>
<p><a href="http://designertuts.com/wp-content/uploads/2007/10/paypalipnphp.txt" title="Paypal IPN page">Paypal IPN page</a><br />
Save this as paypalipn.php</p>
<h2>Notes</h2>
<p>There are two methods of validating the IPN sent by Paypal. Shared Secret and Postback. Paypal recommends shared secret as it is more secure but this tutorial uses Postback. Shared Secret requires that you have dedicated hosting, SSL enabled and you use Paypal Encypted website payments. Paypal recommends Postback for shared hosting applications and where you dont have SSL.<br />
They also don&#8217;t recommend you use IPN unless you have SSL !</p>
<h2>This is too complicated!</h2>
<p>Hope you enjoyed the tutorial. IPN is a complicated subject. If you found it too complicated there are a few commercial products out there that will handle everything for you, such as (this is an affiliate link so I am paid for this recommendation)</p>
<p>Have a look at my new Video Tutorials about <a href="http://designertuts.com/paypal-ipn-1/">Paypal IPN</a>.</p>
<ul>
<li> <a href="vibralogix.htm">Vibralogix Linklok Paypal</a></li>
</ul>
<p>Here are some useful websites to help you.</p>
<p><a href="https://www.paypal.com/IntegrationCenter/ic_ipn.html">Overview</a></p>
<p><a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&#038;content_ID=developer/e_howto_html_IPNandPDTVariables">IPN Variables</a></p>
<p><a href="https://www.paypal.com/en_US/pdf/PP_OrderManagement_IntegrationGuide.pdf">Order Management Guide</a></p>
<p><a href="http://paypaltech.com/SG2/">Script Generator</a></p>
<p><a href="https://www.x.com/community/ppx/xspaces/web_checkout/ipn_pdt?view=discussions">Forum</a></p>
<p><a target="_blank" href="http://www.shareasale.com/r.cfm?b=16357&amp;u=344862&amp;m=3826&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/lokpaypal.gif"   border="0" /></a></p>
<hr />
END OF TUTORIAL | END OF TUTORIAL | END OF TUTORIAL | END OF TUTORIAL | END OF TUTORIAL | </p>
<hr />
<a name="tips">IPN Tips Section</a> </p>
<blockquote>
<ul>
<li>Using CURL</li>
<p>$url= &#8216;https://www.sandbox.paypal.com/cgi-bin/webscr&#8217;;<br />
    $curl_result=$curl_err=&#8221;;<br />
    $ch = curl_init();<br />
    curl_setopt($ch, CURLOPT_URL,$url);<br />
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);<br />
    curl_setopt($ch, CURLOPT_POST, 1);<br />
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);<br />
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(&#8220;Content-Type: application/x-www-form-urlencoded&#8221;, &#8220;Content-Length: &#8221; . strlen($req)));<br />
    curl_setopt($ch, CURLOPT_HEADER , 0);<br />
    curl_setopt($ch, CURLOPT_VERBOSE, 1);<br />
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);<br />
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);<br />
    $res = @curl_exec($ch);<br />
    $curl_err = curl_error($ch);<br />
    curl_close($ch);</p>
<li><a href="https://www.x.com/docs/DOC-1632">Paypal&#8217;s IPN Script and Docs</a></li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://designertuts.com/paypal-ipn-receiving-instant-payments-in-your-web-application/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
	</channel>
</rss>
