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 57 Build an Order-Tracking Page

figs/moderate.gif figs/hack57.gif

Keep your customers informed of order status using an automated system.

The Internet sped up everything, including your customers' expectations. Once you have the code in place to display the merchant transaction ID on your return page [Hack #52] and insert payment details into a database [Hack #82], it's easy to create a page that enables customers to check on the status of an order. You need to place two new pages on your system: a query page that allows your customers to ask the question and a results page that gives them the answer. Figure 5-11 shows a completed results page.

Figure 5-11. A completed order-tracking page
figs/pph_0511.gif


An order-tracking page like this one is easy to implement and goes a long way in placating customers.

5.14.1 Asking the Question

The query page can be quite simple. All you need is a form that allows your customer to enter the transaction ID you previously provided. Once the customer clicks Submit, the results page takes over.

<html><body>

Enter the transaction ID corresponding to the order you wish to look up:

<form action="order_tracking.asp" method="post">

<input type="text" name="txn_id">

<input type="button" value="submit" name="submit">

</form>

</body></html>

The form is only the beginning. Obviously, the preferred method is to display a list of all relevant transaction IDs, from which the customer can select one to view the transaction details. See [Hack #22] for more information, as well as [Hack #94] for a way to get this information using the PayPal API.

5.14.2 Getting the Answer

This example (especially the tblOrders table) assumes a database structure similar to the structure used in [Hack #82] . Any web scripting language will work for this task. This example uses ASP:

<%

'Read back customers input

Dim txn_id

Txn_id = Request ("txn_id")



'Connect to database and create recordset

connStore = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=

                "C:/InetPub/wwwroot/database/dbPayPal.mdb")

set rsOrder = Server.CreateObject("ADODB.Recordset")

rsOrder.ActiveConnection = connStore

rsOrder.Source = SELECT payer_email, payer_id, payment_status, txn_id, 

                mc_gross, mc_fee, payment_date FROM tblOrders WHERE txn_id = '" & 

                txn_id &"'"

rsOrder.Open( )

%>



<!--  Check to see if the order information can be found; if so, display it.-->

<% If NOT rsOrder.EOF OR NOT rsOrder.BOF Then %>

Here are the details of your order:

<p>

Customer Email: <%=rsOrder("payer_email")%>

<br>Customer ID: <%=rsOrder("payer_id") %>

<br>Payment Status:  <%=rsOrder("payment_status") %>

<br>Transaction ID:  <%=rsOrder("txn_id") %>

<br>Payment Gross: <%=rsOrder("mc_gross") %>

<br>Payment Date: <%=rsOrder("payment_date") %>

<% Else %>

No matching Record Found. Please search again.

<% End If %>

5.14.3 Hacking the Hack

Here are a few ways you can extend this hack:

  • Place another copy of the query form on the results page. This way, if your customers need to query for more than one transaction ID, they won't have to use their browser's Back button to enter another.

  • Change the query page to accept a list of transaction IDs in a textarea box. Then modify the results page to display the results of searching for each.

  • Use Instant Payment Notifications (IPN) to send an email with a tracking link [Hack #67] .

    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
    Introduction: Hacks #45-50
    Hack 45 Hack Shopping Cart Buttons
    Hack 46 Create Shopping Cart Links
    Hack 47 Specify the Size of the Shopping Cart Window
    Hack 48 Deal with Design and Layout Issues
    Hack 49 Put Both Cart Buttons in One Form
    Hack 50 Integrate a Third-Party Shopping Cart with PayPal
    Hack 51 Customize Checkout Pages
    Hack 52 Display the Merchant Transaction ID on Your Return Page
    Hack 53 Remember Your Customers
    Hack 54 Create a Dynamic Storefront
    Hack 55 Add Dynamic Storefront Details
    Hack 56 Insert Dynamic Images
    Hack 57 Build an Order-Tracking Page
    Hack 58 Offer Discount Coupons
    Hack 59 Increase Search Engine Exposure
    Hack 60 Sell Digital Goods with PayLoadz
    Chapter 6. Managing Subscriptions
    Chapter 7. IPN and PDT
    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