Ajax Poll Script
php Infinite Scroll
Ajax Likes Script
Address Book Script
Form2DB
PayPal IPN + eProduct Delivery Script
Text Ad Script
Lead Follow-Up Database Script
AdFreely -Ad Board Script-
Fade-In Slideshow
Ajax Poll Admin
URL Shortening Script

PayPal IPN + e-Product Delivery Script

This script will send your e-products as email attachments to buyers upon successful PayPal Buy Now Button transaction. The script can check product information to reject e-thieves who try to get unauthorized "discounts" with bogus Buy Now buttons.

The script includes a built-in Checkout simulator that allows you to test the delivery feature without accessing PayPal.

The script can email a transaction log to the administrator on IPN handler error and/or on every run of IPN handler. It can also log transactions on the server side. No databases are used. Designed to reduce the amount of test time and maintenance efforts of e-product delivery.

Ver 1.06
NE201-106

Download

License

GPL

Demo

In this demo, you will experience the buyer's perspective using the built-in Checkout Simulator. Click the link below to start Checkout Simulator.

Checkout Simulator

Installation Guide

Quick Feedback to Tom, the developer

If you have any suggestions or find any problems, please leave them as a comment down below. we'd appreciate the feedback!

Name:
Subject:
Comment:
Email: (Will not appear online)
Posted by Lumen
2016-11-30

Hi Tom first off; great script, Thank you!

I was wondering if it would be possible to add characteristics to the button and if so how to go about this.

I'm selling vouchers for advantures that ... Read More
Posted by Tom
2016-12-01

Hi,

>I was wondering if it would be possible to add characteristics to the button and if so how to go about this.

It's possible. Please refer to PayPal's Buy-Now Button manual because basically it ... Read More
Posted by Jerry Higgins
2016-11-10

Tom... wonderful script and it works flawlessly. Thanks so much!

Was just wondering if IPN settings on PayPal's website should be turned on (enabled)?
Posted by Tom
2016-11-11

>if IPN settings on PayPal's website should be turned on (enabled)?

Yes, it should be enabled.
Posted by Mohamad
2016-09-16

in a configuration that is useful transactions via paypal
whether the necessary configuration for config.sandbox.inc.php:

define ('SANDBOX_SELLER_EMAIL', '');
define ('SANDBOX_BUYER_EMAIL', ''); ... Read More
Posted by Tom
2016-09-17

>leave empty or needs to be set?

just leave it empty. It's for those who are testing it under PayPal sandbox.
Posted by Mohamad
2016-09-15

Thanks for the script, very helpful, we understand the instructions very easily and clearly.

but we were a little confused put string to synchronize with our website, through which the path when ... Read More
Posted by Tom
2016-09-15

Hi, You don't need to configure these
define ('SIM_BUYER_EMAIL', 'email@domain.com');
define ('SIM_BUYER_FIRST_NAME', 'John');
define ('SIM_BUYER_LAST_NAME', Last Jhon ');
They are for the ... Read More
Posted by Nick Collinson
2016-02-14

I have been successfully using v1.03. It's a very good system, easy to install and simple to use
- Do you have a changelog? Is there any point in upgrading from v1.03 to 1.06?
- Would it be easy to ... Read More
Posted by Tom
2016-02-15

Hi,

>Is there any point in upgrading from v1.03 to 1.06?

v1.06 exposes a few APIs that allow you to override the default method of loading files. If you don't plan to write code, then there is no ... Read More
Posted by traskin
2016-02-01

good but....dont work with smtp ssl or tsl
Posted by Tom
2016-02-03

Sorry, it's not compatible with TSL.
Posted by Richad
2015-10-17

I am having my website graphicarta .com for selling my images in four category how i use this script for Paypal automatic download. Please watch website and give download method for each category. ... Read More
Posted by Tom
2015-10-18

How about just creating four products?
Posted by Loris Perazzoli
2015-09-17

Hi,
your script is wonderful ad I use it since 1 year, do you know if recent change of security certificate in PayPal is compatible?
Posted by Tom
2015-09-18

Hi,

>do you know if recent change of security certificate in PayPal is compatible?

No changes are necessary in the php script. But you have to be sure that your web server is compatible with ... Read More
Posted by Kyle
2015-08-24

Thank you Tom for the reply. Basically if the simulator works locally, when you go live it should provide the customer with the same result back on the site which would show the details of the ... Read More
Posted by Tom
2015-08-25

>Basically if the simulator works locally, when you go live it should provide the customer with the same result back

That's right.
Posted by Kyle
2015-08-20

Locally the script works great and get success. However when testing with PayPal sandbox it does not send back to site or I get error about buyer and or seller. I entered the correct email ... Read More
Posted by Tom
2015-08-24

> when testing with PayPal sandbox it does not send back to site

No, the script does not work with PayPal sandbox. PayPal sandbox uses fake email addresses and so the script can't send emails.
Posted by Fred Ebony Lobos
2015-08-18

I just needed something simple to sell my documents, this was exactly what I needed. I like your approach to scripting. Simple, Functional, ergonomic, user friendly and a common sense approach to ... Read More
Posted by Tom
2015-08-19

Thank you!
Posted by Adron
2015-08-12

in the simulator i have to put in the sellers email and the buyers email if i go live hoe do i define the buyer. i assume the sellers will stay the same like the paypal email the seller gits paid at
Posted by Tom
2015-08-19

The buyer's email address is used for the simulator only. If you go live, you no longer use the buyer's email address because a real buyer will supply one.
Posted by Silvia
2015-07-28

Hi,
I think that your script really fits my needs, thank you! It's possibile to sell multiple products using paypal's chart?

Silvia
Posted by Tom
2015-07-29

Hi, sorry currently it doesn't work with paypal cart but I think that's a good idea. Thank you for your suggestion!
Posted by Fabio
2015-02-28

Ok, thank you Tom.

Fabio
Posted by Tom
2015-03-03

You are welcome :)
Posted by ysmailtest
2015-02-02

To be clear I meant a PayPal button where I could donate somthing to you for this great script.
Posted by Tom
2015-02-13

Yes, I know what you mean. Thanks for your suggestion!
Posted by Fabio
2015-02-02

Hi,
I installed your script. I uploaded the folder and when I do the Checkout Simulator I have always the same IPN problem:

IPN Result: ERROR: IPN handler did not return array:

My OS is Ubuntu ... Read More
Posted by Tom
2015-02-13

OK, this could be the PHP version issue. I'm aware that this error message appears on certain php installations but I haven't collected enough information to give you a general solution to solve it. ... Read More
Posted by ysmailtest
2015-02-01

Hi Tom, never mind found the answer, the support tech had given me the wrong server name. Great script! Do you have a donate button?
Posted by ysmailtest
2015-01-30

I get this error with the simulator. How should the email be configured to correct it?

email error: Permission denied(13) [CProductMailer]

Thanks so much
Posted by Men you this guy !!!!!
2015-01-10

good gracious, tom you make my tommy go yummi yummi and when i think of the good code your website gives to my surfing journey you make me go falling like a falling body. hmmmmmmnnnn.. such a great ... Read More
Posted by Tom
2015-01-29

You are welcome!!
Posted by Brian
2014-12-13

If I change some of the code in this to make it so site visitors can purchase multiple e-products at a time by adding them to the cart, rather than "Buy Now":

Change this:
<form name="_xclick" ... Read More
Posted by Tom
2014-12-20

>If I change some of the code in this to make it so site visitors can purchase multiple e-products at a time by adding them to the cart, rather than "Buy Now"

Sorry, they can't. The script isn't ... Read More
Posted by Aries
2014-07-20

time: 2014-07-21 01:47:02
url: http://www.multipleincom.esy.es/web/ipn/ipn.php
result: ERROR : email error: Operation now in progress(115) [CProductMailer]
=====
[CSystem:time]
-----------
2014-07-21 ... Read More
Posted by Tom
2014-07-21

Looks like the email server is not responding immediately. This isn't a simple case where I can point out the cause right away. The easiest and quickest solution is use other email servers.

If you ... Read More
Posted by Aries
2014-07-16

The error received:

result: ERROR : email error: Operation now in progress(115) [CProductMailer]
Posted by Tom
2014-07-16

Like "HTTP Error 408", the error is too weird. I think there is something wrong outside of the script. I can't say what it is without looking into it, though. I don't think you can fix it just by ... Read More
Posted by Aries
2014-07-16

Hi Tom, I tried everything was ok until I clicked the simulator pay now button. Am I missing something?


HTTP Error 408: The server timed out while waiting for your request

The server did not ... Read More
Posted by Tom
2014-07-16

>HTTP Error 408: The server timed out while waiting for your request

I suspect there is something fundamentally wrong with your web server/ php. It could be misconfigured php.ini. Anyway, I can't ... Read More
Posted by Request
2014-07-10

Hey Tom: Ya, i have fixed right now. ! damn. i was blind. i tried with everything and only not with the localhost.! at my server with cpanel from linux is localhost! so everything works now. Thanks!
Posted by Tom
2014-07-10

Great!
Posted by Request
2014-07-09

Hello Tom!

Thanks for this Script.! One Question i'm with GoDaddy. which one i need to use from the config.email.inc.php ? is that the right way? Looking forward. -
Posted by Tom
2014-07-09

For the sender's eamil address, use an email account of your domain. For example, if your domain name is www.mydomain.com, use something like info@mydomain.com.
Posted by Philip
2014-07-08

Thanks for your reply Tom. The email adress is the same. I think the problem is on the gmail server. Philip
Posted by Tom
2014-07-08

OK!
Posted by Philip
2014-07-01

Hi,
I'm French, and I need some explanation for your script.
Excuse for my language.

I have just a little question :
Is the email adress at step 2 (From=info@mydomain.com) is the same as the step 3 ... Read More
Posted by Tom
2014-07-03

Hi Philip,

>I have just a little question : Is the email adress at step 2 (From=info@mydomain.com) is the same as the step 3?

They can be the same, but not necessarily the same. Using the same ... Read More
Posted by Raman
2014-06-14

Installed several of your scripts without any trouble whatsoever. Your coding skills are of the very highest order, Tom. Many thanks.
Posted by Tom
2014-06-16

You are welcome!
Posted by Raman
2014-06-14

How can anyone not be friendly to a generous person like you, Tom? May you prosper! The downloads came through without hiccups, thanks.
Posted by Raman
2014-06-11

Download links for all the scripts fail with this error ---
Parse error: syntax error, unexpected T_CLASS, expecting T_FUNCTION in /home/phpkobo/public_html/oosite/sys/CDownload.class.php on line 509 ... Read More
Posted by Tom
2014-06-11

Thaaaaanks! It's nice to have friendly visitors like you ;)
Posted by giampiero
2014-06-04

by entering my email the result does not change. Php version 5.3
url simulator: http://astroamore2000.altervista.org/web/sim/index.php
Posted by Tom
2014-06-05

I PMed you.
Posted by giampiero
2014-06-03

I solved the two previous problems a) commenting on web / sim / include / CCheckoutSimulator.inc.php and comment out line 110 to suppress the error message b) on altervista.org I set the "connect ... Read More
Posted by Tom
2014-06-03

Would you send me the url of your checkout simulator?
Posted by giampiero
2014-06-03

do you know if the script works with host altervista.org
Posted by Tom
2014-06-03

Sorry, have never used the host.
Posted by giampiero
2014-06-03

ERROR:
IPN handler did not return array:

help
Posted by Tom
2014-06-03

Hi giampiero, Would you tell me your PHP version and the OS type of your web server( Windows, Linux )?
Posted by John
2014-06-02

Hi Tom

Error message is as follows:

IPN Result:

ERROR:

http response error:
Posted by Tom
2014-06-02

The error message means that the IPN handler didn't return anything. It could be due to a wrong path to the checkout simulator. Did you move the simulator folder? If you move it, you need to update ... Read More
Posted by John
2014-05-24

Hello Tom. Re: Paypal IPN?eproduct delivery script.
I'm a novice to this kind of script work but am seriously keen to get this working as it could just be the answer that I'm looking for. HOWEVER, I ... Read More
Posted by Tom
2014-05-25

Hi John,

>when I click to test the simulator I get an failed/error message.

So what error message did you get when you clicked?
The error message may reveal the problems you are dealing with.
Posted by Robert
2014-05-19

I keep getting the following error message:

IPN Result:
ERROR:

email error: Connection timed out(110) [CProductMailer]
Posted by Tom
2014-05-19

Hi Rebert,

>email error: Connection timed out(110) [CProductMailer]

Check if the mail server address is correct. If it looks OK, then check if the mail server is up and running. You can ping the ... Read More
Posted by Agarwal
2014-04-28

sir, how can I purchase multiple products at a time..?
Posted by Tom
2014-04-28

Hi Agarwal,

>how can I purchase multiple products at a time

Sorry, the script doesn't have the feature.
Posted by Aries
2014-04-20

Hi, may I know does this cater to multiple purchase?
Posted by Tom
2014-04-21

Hi Aries,
>does this cater to multiple purchase?
Sorry, it doesn't.
Posted by Lion
2014-04-10

after commenting out line 110

im getting this error

ERROR:

Unkonwn
Posted by Tom
2014-04-12

OK, I've been trying to come up with a method to figure out the cause indirectly but there doesn't seem to be a simple way. If you are interested in letting me debug it on your site, let me know. my ... Read More
Posted by Lion
2014-04-09

im using the checkout simulater i keep getting this
ERROR:

IPN handler did not return array:

this is the error log that sent to my email result: ERROR : paypal did not return status [CIpnReceiver] ... Read More
Posted by Tom
2014-04-10

Hi Lion,

The error message(IPN handler did not return array) is for developers only and have no significance for users, so you can remove it. Open web/sim/include/CCheckoutSimulator.inc.php and ... Read More
Posted by Leo
2014-04-08

Hello Tom, me again, a friend of me, purchased my e-product. i got the cash, but he dont got the e-product... ?! and i got an IPN error back with this >> time: 2014-04-07 10:55:13
url: ... Read More
Posted by Tom
2014-04-09

OK, the error message says the recipient is greylisted. So, that's why it couldn't sent. Please ask your web administrator why it's greylisted!
Posted by Leo
2014-03-28

? what's that? are you have see my link (picture) in my last submit https://lh4.googleusercontent.com/--ASkezbu9tc/UzXU1pu97QI/AAAAAAAAAhg/tsfnVkwIoc0/w1107-h603-no/example.png ?
Posted by Tom
2014-03-29

Yes, I checked your pic. You want to erase your email and put a logo, right? I may be repeating myself but they have nothing to do to with the script. So i gave you a link to the information you are ... Read More
Posted by Leo
2014-03-28

Hallo Tom, Me Again... becaue the last question. why it shows the e-mail adress left top.? here a screenshot ... Read More
Posted by Tom
2014-03-28

Hi Leo, this article may help.
http://www.visser.com.au/blog/adding-your-business-logo-to-paypal-checkout/
Posted by Leo
2014-03-12

ah, okey now i check it :) but my another question is.. at the step 10? when i forward to the paypal pay site, there show the e-mail adress left top.? can i hide the e-mail adress?
Posted by Tom
2014-03-13

> can i hide the e-mail adress?

The script has no control over it. I think if you have a business type account, you can change it. ( But don't take my word for it. You should ask paypal people )
Posted by Leo
2014-03-12

?.. in the step 8 ? >> First, create a product ID ( or item_number in PayPal terminology ) for your new e-product. << need i make that in the paypal account? where can i make that ID or item_number ... Read More
Posted by Tom
2014-03-13

>where can i make that ID or item_number of the product in Paypal

You just make up one! You don't need to register it to PayPal.
Posted by Leo
2014-03-12

Hello Tom :) Me again... something is not so clear... in the paypal terminology.. is that the Create an Invoice? because i have one done but the status is in Draft? so is that the right way.? Best. ... Read More
Posted by Tom
2014-03-12

>is that the Create an Invoice?

Honestly, I have no idea about this terminology. I don't think there is any connection with Buy Now Button, though.
Posted by Leo
2014-03-10

Hello Tom. Now, fixed that with the mail accounts. ! now my other question is.. can i hide the Checkout Simulator with a .htaccess file so that the Checkout Simulator is close and not open anymore?
Posted by Tom
2014-03-10

If you don't need Checkout simulator, you can remove the Checkout simulator folder. Or you can rename it. The step 9 of the installation guide explains about renaming Checkout simulator.
Posted by Leo
2014-03-09

Hello Tom. Thanks much for your Answer. but, my e-mail adress from the paypal is gmail. > SIM_SELLER_EMAIL is an email address that you registered to PayPal.
so need i change the e-mail adress from ... Read More
Posted by Leo
2014-01-27

Me, again, its that intelligence to host the script on a free host? and which host (package) at go daddy is the best to run this script up.?
Posted by Tom
2014-01-30

I got a couple of reports that the script did not work with gmail. So just avoid gmail and use other email servers.

Saturday, June 8, 2013

e-Product Delivery Script: How to send plane text emails only

By default, e-Product Delivery Script will send buyers HTML emails as well as plane text emails. If you want to force the script to send plane text emails only, you can remove the HTML section from product configuration files, or better disable it. You can disable HTML section by adding an underscore ( or any characters ) at the beginning of it like "_Html."

(example)

_Html=<<<_EOM_
<html>
<head>
.......................
.......................
.......................
.......................
</body>
</html>
_EOM_

Tuesday, January 8, 2013

e-Product Delivery Script v1.06 Update

This upgrade is for advanced users who want to set up "virtual products" in e-Product Delivery Script.

So, what are "virtual products"?

Consider the following. You have 1000 products whose product configurations (e.g. "item_name", "amount", etc ) are exactly the same except, say, the file attachment. The standard way to set up 1000 products is to create 1000 product folders and set up a product configuration file for each product.

As you can guess, it's really time comsuming and very hard to maintain. That's definitly the last thing you want to do.

Instead of creating 1000 product folders, you can set up one folder and modify the configurations on the fly. That way, you can deliver all the products without setting up product folders for each of them.

Now, we need to take a look at the code where the script obtains product configurations. Open web/ipn/sublcass/CProductInfo.inc.php in a text editor and find the following php function:

function getProductInfo( $item_number, &$pi )
{
	if ( !parent::getProductInfo( $item_number, $pi ) )
		return false;

	//-- [BEGIN] Modify the contents of $pi (ProductInfo)

	// Write your code here

	//-- [END] Modify the contents of $pi (ProductInfo)

	return true;
}

The getProductInfo function is called when the script needs to get the configurations of a product specified by $item_number, which is a product ID in PayPal terminology. The function will pack the product configurations (e.g. "item_name", "amount", etc ) into the $pi array and returns true if successful, or false otherwise.

The default implementation is that it calls parent::getProductInfo, which loads config.txt into $pi.

parent::getProductInfo works only on products that have physical product folders on the web site.

To return configurations for virtual products, which don't have any physical product folders, we need to modify a few lines of code there.

Before we proceed, let's make sure the specification of the modification.

  • The only product-001 has a physical product folder and it's config.txt is properly set up. There are no physcial folders for other products.
  • All the attachments for the products are stored in the "C:/MyAttachments/" folder. The filename of an attachment is the item_number followed by ".zip" For example, the attachment for "product-999" is "product-999.zip."

OK, here is the modified code:

function getProductInfo( $item_number, &$pi )
{
	if ( !parent::getProductInfo( "product-001", $pi ) )
		return false;

	$pi['files'] = array( "C:/MyAttachments/{$item_number}.zip" );

	return true;
}

Notice that I replaced $item_number in parent::getProductInfo with "product-001", so that parent::getProductInfo will always return the product configurations for "product-001" in the $pi array

The difference between "product-001" and other virtual products is the file path of the attachment only. All you have to do is to modify the file path stored in the $pi array.

The file path of the attachment is stored in $pi['files']. ( $pi['files'] must be an array so that it can accept multiple paths. ) The following line of code does the job.

$pi['files'] = array( "C:/MyAttachments/{$item_number}.zip" );

OK, basically, that's it.

Similarly, you can replace other items in config.txt with anything you want. Here is the list of items you can read and write:

  • $pi['item_name']
  • $pi['amount']
  • $pi['currency_code']
  • $pi['Subject']
  • $pi['Body']

Lastly, I want to point out that getProductInfo is the best place to modify if you want to load the product configurations from other sources like a database.

If you want to load all the product configurations from the database instead of the product folders, you can get rid of parent::getProductInfo because it's for loading configurations from physical product folders.

Thursday, December 20, 2012

e-Product Delivery Script v1.03 Update

"e-Product Delivery Script" was updated to v1.03. I added a description regarding enabling SMTP Authentication to web/config/config.email.inc.php Also, cleaned up line-endings of each file for Windows users.