PDA

View Full Version : PayPal digital download order processing - automated via email.



abripl
03-31-2008, 02:13 AM
I sell software online. PayPal credit card auto return feature does not work well for customers who do not have PayPal accounts.

I have written a php script solution that uses PayPal payment notification email to me. The email with the PayPal "Subject: Notification of payment received" is piped to a script |/home/mydomain/phpscriptdir/processorder.php using bluehost email filter feature. The script parses the email, picks out the order number and goes to a file (or MySQL if desired) with order details (written when the customer goes to my page to fill out the order). The script then sends an automated email to the customer with download links. The links use random numbers for filenames to link to my software and are deleted after about a week. You can find a discussion how to pipe email to a php script at http://www.bluehostforum.com/showthread.php?t=5786

My sample order form is at http://www.abri.net/recorder.php
There is quite a bit of code involved and sufficient security to thwart anyone trying for free software.

If anyone interested, I can be available to modify the scripts to suit their needs.

felgall
03-31-2008, 02:44 AM
Sounds extremely complicated. I just use an IPN script to email their digital purchase to them immediately that their payment clears. No need to pipe emails or anything like that, I just have the IPN script generate an email with an attachment.

felgall
03-31-2008, 03:00 PM
I have not had anyone make any payments to my Paypal account that haven't called the IPN script during the payment process so either the problem with people without Paypal accounts only happens if you don't have it configured properly or all of the thousands of people who have paid me have their own Paypal account.

I have the "return to seller" option turned off in Paypal since I have Paypal always pass control to my own thankyou page identified in the parameters passed to Paypal in the first place. I wouldn't expect anyone to end up on a page where that button would therefore appear at all regardless of whether they have an account or not. Perhaps the problem with people who don't have a Paypal account only happens if you try to use the return to seller option rather than defining your own destination page. I don't think the return to seller option even existed when I wrote my IPN script.

Anyway if the way you have come up with works for you then that is the important thing. It just sounds a lot more difficult than the way I did it (and I have not tried to process emails into PHP as yet, only generating them from PHP).

abripl
03-31-2008, 03:34 PM
>>I "just" use an IPN script to email their digital purchase to them immediately
I am glad your approach works well for you. But I am sure that it is more than few lines of code.

I don't see piping in itself so complicated - easy to setup in blue host panel (or use .procmailrc). And email parsing script is publicly available - http://tinyurl.com/qwekm

My "complexity" is more in my custom pricing, order processing requirements and ease of future changes.

Note that email piping is an alternate method that can easily be modified when switching to a different credit card processors - most of them send you email notifications, but vary in methods like PayPal "IPN", authorize.net "silent post URL" or whatever.

felgall
03-31-2008, 04:52 PM
I agree that it would be easier if you switch between or use different payment processors. I only use the one way for collecting payments and have never looked into having PHP read incoming emails so your method sounds harder to me. I guess its a matter of what you know.