This collection of articles and blog entries is representative of the full spectrum of commerce-related content published on PayPal’s Developer Network over the past year. You will find tutorials and quick reference pieces for developers. With the creation of x.commerce we have expanded our coverage to address the needs of eBay and Magento developers and you can expect to see more content focused on helping both the developer and merchant communities in the coming year. This book covers a wide variety of topics including building mobile shopping carts, QR codes, working with various PayPal APIs, including how to integrate PayPal with other technologies such as WordPress. Three main themes have emerged in the commerce world today: Mobile, Social, and Local. Table of Contents 5 Introduction 11 Chapter 1. Creating a Mobile Enabled Shopping Cart with HTML5, jQuery, and TaffyDB, Part 1 13 Step 1: Set Up the Tutorial Directory on Your Web Server 13 Step 2: Provide the Entire Product Catalog in JSON Format from the eCommerce System 14 Step 3: Set Up the Catalog HTML Page 16 Step 4: Load the Product Catalog in JSON Format from the eCommerce System 17 Step 5: Display the Store View 18 Step 6: Display the Category View 20 Step 7: Display the Product View 21 Step 8: Style the Links and Buttons 23 That’s It 24 Chapter 2. Creating a Mobile Enabled Shopping Cart with HTML5, jQuery, and TaffyDB, Part 2 27 Step 1: Bind the Add to Cart Button to the addToCart() Function 32 Step 2: Initialize the HTML5 Cart Database 32 Step 3: Store the Product Information in the cartItems Database 34 Step 4: Add the HTML for the Cart View and Bind the View Cart Button to the demo.viewCart() Function 37 Step 5: Display the Cart 38 Step 6: Format the Cart View 42 Step 7: Stringify the Cart to Send to the Server 42 Step 8: Clear the Cart Contents 43 That’s It 43 Chapter 3. Analyzing Open Data for Fun (and Profit?), Part 1 45 Getting the World Bank Data 46 Loading the Data into MySQL 46 Downloading Google Visualization Tools 48 Configuring a Visualization Web App with Tomcat 49 Implementing and Querying a SQL Data Source 50 Next Steps... 52 Chapter 4. Analyzing Open Data for Fun (and Profit?), Part 2 53 Implementing Table and Line Chart Visualizations 53 Creating an Event-Driven Line Chart Application 57 Next Steps 62 Until Next Time 62 Chapter 5. Analyzing Open Data for Fun (and Profit?), Part 3 63 PayPal X: Your Global Payment Platform 63 Dollars and Sense 64 Adaptive Payments Configuration 66 V-Rupees for Graphs 67 Generating a Pay Key with the AdaptivePayments API 69 Kickstart the Embedded Payments Flow 72 Handling Payment Responses 76 Wrapping Up 78 Chapter 6. Build an MLM Engine with Neo4j and MassPay, Part 1 79 What Is Multi-Level Marketing? 79 MLMs Are Graphs 80 The Design and Implementation of an MLM Engine 81 Traversing the Graph to Compute Commissions 88 Wrapping Things Up 92 Chapter 7. Build an MLM Engine with Neo4j and MassPay, Part 2 93 Introduction 93 Defining the Class 94 Authentication and API Resolution 95 Making the Call 97 Putting It All Together 99 Chapter 8. Getting Started with PayPal on Django 101 Introduction 101 Requirements 101 Paypal Accounts 101 PDT (Payment Data Transfer) 102 Django 102 Sample Application 102 Running the Sample Application 102 Configuration 102 Database 102 Web Server 103 A Basic Payment Workflow 103 The Model 103 URL Mappings 103 Step 1—List Content Available for Purchase 104 Step 2—Attempt to Access Content 104 Step 3—Purchase Content 105 Step 4—Verify Payment 106 PDT validation 107 Step 5—Successful Purchase 108 Further Enhancements 109 Conclusion 109 Further Information and Other Resources 109 Chapter 9. Accelerate Your Development Using the Apigee API Console 111 What Is the Apigee PayPal API Console? 111 APIs Available to You in the Console 112 Using the Console 113 Linking Calls Together 115 Other Apigee Consoles You Might Want to Check Out 116 Accelerate Your Own Development 117 About the Author 117 Chapter 10. Interview with iConcessionStand 119 About the Author 127 Chapter 11. Magento, Part 1: How to Install Magento 129 Comparing the Editions 129 Server Requirements 130 Installing Magento, Step 1: Download, Extract, and Upload 130 Installing Magento, Step 2: Set Up Permissions 131 Installing Magento, Step 3: Creating the Database 131 Installing Magento, Step 4: Run the Setup Wizard 132 Installing Magento, Step 5: Verify the Installation 133 Next Steps 133 About the Author 134 Chapter 12. Magento, Part 2: How to Set Up Your Magento Store 135 Creating Categories 135 Adding a Product in your Magento Store 137 Wrapping Up 146 About the Author 146 Chapter 13. Magento, Part 3: Accepting PayPal Payments 149 How to Accept Payments with PayPal in Magento 150 Wrapping Up 156 About the Author 157 Chapter 14. Magento, Part 4: Integrating Magento and WordPress Using the FishPig Extension 159 Integrating Magento and WordPress with FishPig 160 Wrapping Up 170 About the Author 171 Chapter 15. The Convergence of Local, Social, and Mobile, Part 1: Local 173 Breaking Silos 174 Defining Local 174 The Evolution of Local 175 Phase 1: Pre–personal transportation and technology 175 Phase 2: Introduction of personal transportation 176 Phase 3: The information “superhighway” 177 Share Your Thoughts 178 About the Author 179 Chapter 16. The Convergence of Local, Social, and Mobile, Part 2: Social 181 Briefly Defining Social 182 The Evolution of Social 182 Phase 1: “Can I borrow your goat?” 182 Phase 2: Pen pals, trade, and travel 183 Phase 3: The rise of instant communication 184 A Final Note on Social Media 185 Share Your Thoughts 185 About the Author 185 Chapter 17. The Convergence of Local, Social, and Mobile, Part 3: Mobile 187 The Evolution of Mobile 188 Phase 1: Can you hear me now? 188 Phase 2: The “G” wars 189 Phase 3: The phone gets a brain and learns to surf 190 Observation #1: Smartphones + Tablets > PC shipments 190 Observation #2: Social is driving mobile adoption 190 Observation #3: Time spent talking on smartphones is minimal 191 Observation #4: Mobile is revolutionizing commerce online and IRL 191 Stay Tuned 192 Share Your Thoughts 192 About the Author 192 Chapter 18. The Convergence of Local, Social, and Mobile, Part 4: The Convergence 193 First, A Look at the Data 194 What Does This Mean for the Future of Local, Social, and Mobile? 195 Share Your Thoughts 197 About the Author 197 Chapter 19. To Catch a (Quantum) Thief 199 Data Security in the Quantum Age 199 The Downside 200 Bad News 201 Hacking Accelerated 201 Game Changer 202 5 to 10 202 Chapter 20. 10 Best Practices for Employing QR Codes 205 Size Matters (the Bigger, the Better) 206 Short Is Sweet 206 Location Matters 206 Know Why You’re Using It 207 Make It Count 207 A Little Goes a Long Way 207 Tell People How to Use It 208 Provide an Alternative 208 Respect the Border 208 Bring the Wow 208 About the Author 208 Chapter 21. Integrating Payments into WordPress, Part 1: Features and Getting Started 209 What Is WordPress? 210 WordPress Documentation 211 Installing WordPress 212 First Steps After Installation 213 Coming Next Time 214 About the Author 214 Chapter 22. Integrating Payments into WordPress, Part 2: PayPal Plugins 215 Extending WordPress with Plugins 215 Plugin Recommendations 216 PayPal Plugins 218 Plugin Learnings and Where They’ll Take Us 222 About the Author 223 Chapter 23. Integrating Payments into WordPress, Part 3: Build Your Own PayPal Plugin 225 A Note About PHP 225 Understanding “The Loop” 226 The Anatomy of a WordPress Plugin 226 PayPal Functionality in Our Plugin 230 Deploying and Testing the Plugin 230 Things to Learn from This WordPress Series 232 About the Author 232 Chapter 24. Crowd Marketing 233 Viral Isn’t a Plan—It Is a Consequence 233 Making a Good Fire 234 What Happened? 234 Life Ahead Is eBay Without Having to Ship Stock from the Attic 235 Let Them Buy Wholesale and Distribute 235 Fans, Friends, Launchpads, and New Markets 236 About the Author 236 Chapter 25. Bitcoin: Money Without Governments 237 What Is Bitcoin? 237 Acquiring and Storing Bitcoins 239 Using and Accepting Bitcoins 242 Threats and Opportunities 242 About the Author 244