PayPal Hacks. 100 Industrial-Strength Tips and Tools Free Open Book

PayPal Hacks. 100 Industrial-Strength Tips and Tools

Previous Section  < Day Day Up >  Next Section

Hack 71 Deliver Digital Goods with IPN

figs/moderate.gif figs/hack71.gif

Use IPN to have your server automatically send digital goods to customers as soon as they purchase them from your web site.

The Internet revolution allows instant gratification when purchasing an item. You can purchase digital goods—eBooks, digital music, video files, software, and anything else that can be delivered via the Internet—from the comfort of your customer's home and use them almost instantly.

This hack shows you how to leverage PayPal's ease of use, security, and brand name to sell digital goods with large margins and low overhead. PayPal's IPN system [Hack #65] lets you deliver those goods without any interaction as a seller.

7.11.1 The Code

The code in this hack uses Microsoft VBScript, but the same process can be implemented with any web scripting language.

Since this solution employs IPN to deliver a product without any action on your part, you should take steps to ensure that the payment is legitimate (e.g., no price tampering has taken place) [Hack #73] .


This script, when used in conjunction with the IPN script from [Hack #73], sends your customer an email with your digital product as an attachment:

'Declare and populate email address for delivery

Dim payer_email

Payer_email = Request.Form("payer_email")



'Create file variable and set path to file

Dim file_location

1.  file_location = "C:\InetPub\wwwroot\yoursite\filestore\file.zip"



'Send an email to customer and attach file

Dim objCDO

Set objCDO = Server.CreateObject("CDOSYS.NewMail")

2.  objCDO.From = "sales@paypalhacks.com"

'Add customer email address

objCDO.To = payer_email

'Add file attachement

objCDO.AttachFile(file_location)

3.  objCDO.Subject = "PayPal Hacks Software Exo"

4.  objCDO.Body = "Thank you for your order. Your file is attached to this email."

objCDO.Send( )

Set objCDO = Nothing

Place your digital product in a file (presumably zipped up) on your server, and specify the full path and filename in the file_location variable (line 1). Include your email address as the return address (line 2); in most cases, this should be the same as the email address used for your PayPal account. Finally, you'll want to customize the subject and message body text (lines 3 and 4, respectively) to suit your needs.

When delivering files via email, be sure to keep the file size relatively small (less than 500 KB). Otherwise, you run the risk of overfilling your customer's email inbox or having the message rejected by the customer's ISP.


7.11.2 See Also

This hack shows the most simplistic way to implement digital goods sales for your site. For an improved method, see [Hack #72] .

    Previous Section  < Day Day Up >  Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]


         Main Menu
    PayPal Hacks
    Table of Contents
    Copyright
    Credits
    Preface
    Chapter 1. Account Management
    Chapter 2. Making Payments
    Chapter 3. Selling with PayPal
    Chapter 4. Payment Buttons
    Chapter 5. Storefronts and Shopping Carts
    Chapter 6. Managing Subscriptions
    Chapter 7. IPN and PDT
    Introduction: Hacks #65-86
    What IPN and PDT Are
    How IPN Works
    Advantages of PDT
    Hack 65 Receive Instant Payment Notifications
    Hack 66 Troubleshoot Instant Payment Notifications
    Hack 67 Send a Purchase Confirmation Email with IPN
    Day Day Up
    Hack 69 Use IPN with eBay Listings
    Hack 70 Track Your eBay Products with IPN
    Hack 71 Deliver Digital Goods with IPN
    Hack 72 Deliver Digital Goods with a Return Page
    Hack 73 Implement Price Checking with IPN
    Hack 74 Provide an Order Summary with IPN
    Hack 75 Upsell Your Customers
    Hack 76 Enable Multiple IPN Pages
    Hack 77 Use Mass Pay to Create an Affiliate System
    Hack 78 Manage Your Inventory with IPN
    Hack 79 Display Donation Goals on Your Web Site
    Hack 80 Display a Recent Donor List
    Hack 81 Capture Customer Information with IPN
    Hack 82 Insert Payment Details into a Database with IPN
    Hack 83 Insert Cart Details into a Database
    Hack 84 Track Google Referrals
    Hack 85 Process Payments like a Credit Card with PDT
    Hack 86 Synchronizing PDT and IPN
    Chapter 8. The PayPal Web Services API
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele