Black Friday Foursquare Checkins

I ran across this article yesterday on Mashable and I thought it was pretty interesting.  These graphics represent the percentage of check-ins on Foursquare that each of the major retailers saw on Black Friday. Granted this is only Foursquare, and Gowalla, Brightkite, nor any of the other geo-social apps are represented, but I think it’s still a pretty good indication…

geosocialcheckins

Am I the only one surprised that Target was so far ahead of Wal-Mart? I guess I just assumed since Wal-Mart had a larger operation that they would naturally see more shoppers, but apparently that wasn’t the case on Black Friday…

Checkout the O’Reilly Answers Social Network

Image2 I am typically not one to recommend a social network to my clients w/ the exception, of course, of the already established networks such as Facebook, Twitter, LinkedIn, Tumblr, etc.  My whole philosophy regarding social networking at this stage of the game is that if you want to build a community, build upon what’s already out there as much as possible (Facebook API, Twitter API) and don’t try to re-invent the wheel. 

However, I have always felt that strong, reputable Niche networks could exist externally if they were packaged correctly.  A good example of such a network that is currently in Beta right now is O’Reilly Answers.  O’Reilly has a good vision with this network, and of course they have some really positive things in their favor already such as Awesome Reputation, an Established Following, and a Trusted Name, what more could you ask for?

You can also look at the Network and tell that there were some clear objectives put into place while developing this solution.  They obviously wanted it to be user friendly, functional, and interactive.  There are basically three ways you can interact inside O’Reilly Answers:

Share Your Knowledge    

You can actually enter in blog posts and tag them according to your subject matter and other users can comment you on your posts.  This is one area that I think they could have done a little differently.  We all manage our own blogs externally, why would we want to post our content on their website as well and have 2 comment systems running at the same time to follow up w/ readers?  My thoughts on this part are that they could have put into place some sort of RSS option where you could aggregate your content from your blog and have your friends inside the network click out to read your posts.  Maybe I am not seeing the big picture on this, but as a workaround I posted about 3/4 of 2 blog posts into their network along w/ a link at the bottom to get to the remainder of my post on my blog.

Ask A Question

Since O’Reilly has been catering to the Technically Minded community for so long, you can rest assured that some pretty sharp folks are going to be hanging around in this community.  Well, let’s say you have a question about a project you are working on, you can post that question to the community, tag it, and before you know it some of the sharpest minds in the world are answering your question.  This is an area where I really see this network having value for a lot of us…

Answer a Question

Let’s say someone asks a question and you know the answer, you can provide them w/ your insight w/ ease.  I think that this networking model is going to speed up the “obstacle to solution process” once the network get’s off the ground.

———————————————-

Also, just a few notes regarding the Network as it is right now.  There are obviously some bugs, I had a couple of errors pop up on me when I was setting up my profile, this is to be expected w/ a new release like this.  Give them time, I am sure that O’Reilly will iron out all of the kinks very soon.  Here’s some basic information that was forwarded to me today from our Account Rep at O’Reilly…

We’re launching the beta of O’Reilly Answers, and I’m inviting you to be part of it. In brief, O’Reilly Answers is a community site for sharing knowledge, asking questions, and providing answers that brings together our customers, authors, editors, conference speakers, and Foo (Friends of O’Reilly).

Why Answers, and why now?
O’Reilly is at the center of an amazing exchange of knowledge sharing and idea generation. We’ve created the usual means of facilitating communication between customers, O’Reilly folks, and the outside experts we call "alpha geeks" who contribute to O’Reilly books, conferences, and websites. We can connect through reader reviews, errata submissions, book forums, blog comments, Get Satisfaction, our customer service department, and more. But too much of this conversation is siloed, and not enough is public (e.g., discussions on our internal mailing list for editors, or personal responses to customer questions). O’Reilly Answers will be the place where much of that communication happens from this point forward.

Why participate?
The lofty reason: Like O’Reilly, you want to "change the world by spreading the knowledge of innovators." That’s our mission, and we’ve been fortunate enough to build a community of passionate, committed people who love to learn and share their knowledge as they work towards a better world for us all.

The "nice, but what’s in it for me" reasons: reputation, recognition, and rewards.

Get Recognized: "Find interesting people" is a core activity at O’Reilly, and an important component of our success. We see Answers as an important way to discover and connect with our next authors, online instructors, videographers, and speakers.

Build Your Reputation: You’ve learned a lot, why not get credit for all that knowledge? As your submissions to Answers are voted up, your personal reputation on the site increases. At launch, your reputation will be based solely on your participation in O’Reilly Answers. Soon, we’re expanding across oreilly.com, so the book errata and book reviews you’ve submitted, books you’ve registered, and conferences you’ve attended, will add reputation points. You’ll also earn badges to mark accomplishments and milestones.

Earn Rewards: Glory is great, but discounts and deals are nice, too. We want to reward your contributions to the O’Reilly community. Shortly we’ll have a point-based system in place that you can redeem for books, training, courses, and conferences. Details soon, but in the meantime, any actions you take now will count towards your total points.

This is just v.1: The best part of any project on the web is watching it take on a life of its own. With that in mind, we’re looking forward to *your* suggestions about where O’Reilly Answers should go, what features should be added, and what benefits and rewards we can offer all of you.

I’d like to acknowledge the projects that have proceeded Answers and inspired us, such as SitePoint Forums (we distribute their books), StackOverflow, Yahoo! Answers, Knol, and many others. They’re great resources, and we think the O’Reilly community can create a useful site that’s, well, a different kind of animal.

One last thing: O’Reilly Answers is in beta and you may encounter bugs. We’re still working on many improvements to the site, such as feeds for each tag, but would love to hear your suggestions for features and improvements. Please send any suggestions/questions/bug reports to answers@oreilly.com.

Until next time–
Marsee Henon

Also, if you should signup, be sure to add me as a friend, http://people.oreilly.com/cotton

Best Buy’s $10 Television

bestbuy Yesterday morning about this time there was a mad dash of people trying to get on Best Buy’s website to cash in on a $9.99 flat-screen television.  Obviously this was a huge typo on Best Buy’s end, but before they could catch it online they already had sold no telling how many televisions.

Obviously, Best Buy is not going to make good or honor the purchases that came through on their website, especially in this economy.  I heard a lot of people yesterday complaining that the lucky ones who were able to get in orders should get their televisions.  Fortunately for Best Buy, they had a store policy in place that covered their tails, the people who jumped on this bargain will all get refunds in the mail, likely in the form of a best buy gift card. 

If you missed the story, here’s a snippet from the Associated Press.  And, if you own an online store of any kind, this might be an awesome opportunity to review your stores posted policies.

Few if any of the deals retailers have offered online during the recession have been as good as Best Buy Inc.’s sale price of $9.99 on a 52-inch TV Wednesday. But it quickly turned out the offer was too good to be true.

The electronics retailer said it will not honor the $9.99 price posted Wednesday morning on its Web site for a 52-inch Samsung flat-screen TV. By early afternoon, the TV was listed at $1,799.99, almost half off the original $3,399.99 price.

Bloggers and Twitterers lit up the Internet with posts about the offer, some insisting Best Buy must honor it, others making jokes.

Best Buy, based in Richfield, Minn., said it has corrected an online pricing error and will not honor the incorrect price. Orders made Wednesday morning at the incorrect price will be canceled and customers will receive refunds, the company said.

Critch on Drupal Security / PCI Compliance

drupal-logo Resident Server Administrator and all around Linux Guru, Matt Critcher, recently posted an entry on his blog about Drupal Security and PCI compliance.  Matt has been running Drupal on his site for a while now and it seems to be working out well for him.  I always look to Matt for security issues because he has an enormous knowledgebase between his ears when it comes to that sort of thing.

Making your website secure is one thing, but going the extra mile and making it PCI compliant is another thing.  In the past I have recommended PCI Compliance only to our clients that do e-commerce, or gather sensitive client data, but it’s rapidly becoming a buzzword in the industry.  I first learned about it in 2006 at a conference we attended in Las Vegas.

My business partners and I even partnered with HackerSafe, now owned by Mcafee, to sell PCI compliance solutions and certification to our clients back in 2006.  If you are interested in learning more about PCI compliance or securing your website, be sure to give us a shout.

This site is running in a CMS called Drupal. It, like most CMS systems, allows users to easily create, edit, and delete content and manage many features of a website. But, like most, it is not without a few security flaws. Me, being a geek, and having more than a passing interest in security, decided to try to make this site a little more secure, and possibly even PCI Compliant.

It is possible to make Drupal PCI Compliant, but it takes a little work. Now, for the record I don’t have nor do I collect data that falls under this standard, but some people do, and some run Drupal. There’s not much information about the subject on the net, so I figure it’s worth writing about. But be warned that there is a trade-off. By default, Drupal is set up to be more convenient for its users. Putting these modifications in place will make you login EVERY time you close your browser window. To me, that’s not a problem. I actually prefer that to be the case. Others, well, you may not like it as much. YMMV.

First thing that you need to do is to force Drupal to use HTTPS for login. There are tutorials all over the net on how to install mod_ssl or Apache-SSL and configure it for HTTPS traffic, which is a pre-requisite for this. There is currently no drupal module that does just this, but you can get around it using .htaccess. In the root of your website, put the following somewhere in the .htaccess file

You can read the rest of Matt’s post here: Making Drupal More Secure | www.mcritch.com

Every Company Needs a Blog…

I deal with a lot of clients today that have been with me since I got into this industry almost a decade ago, and for the most part my partners and I have had a hand in developing every aspect of their web presence from the bottom up so when they see their competitors launching these things called “blogs” they naturally reach out to us for advice as to whether they need one or not.  My answer 90% of the time is yes, and here is my reasoning…

Your corporate website is what it is, it’s a great resource for information about your company, products & services, etc., but a blog can bring so much more to the table.  A blog is a lot more personable and interactive in my opinion, and in a lot of ways it should be viewed as a direct link between you and your consumers where they also have the opportunity to communicate their needs or perspectives on your posts.  This can be extremely valuable not only in making sales but also in improving your product or service offerings.

A lot of the companies that my partners and I work with on a daily basis have blogs, and for the most part I subscribe to each of them if for no other reason than to stay in the loop with what’s going on within their organization, but it has also helped me to find additional products and services offered by these providers that are well suited for our company. 

If your company isn’t providing a blog right now, you could be missing out on establishing a much closer relationship with your existing clients as well as reaching new ones.  One misconception we run into is that given the fact that some organizations we have worked with might already have 20 or 30 thousand dollars already tied into their web presence, they instinctively think that adding more functionality to their site is going to be expensive, and that could not be further from the truth.  Adding a blog to your existing web presence is extremely cost effective and can possibly have a larger return than any other component of your web presence if it is managed correctly…

For more information about adding a blog to your corporate or business website, please don’t hesitate to contact my partners and I for a free consultation, click here.

Converting to Add to Cart Button (PayPal)

paypal300 While talking with a pro bono client today they were wondering how hard it would be to add an “add to cart” button instead of a single item “buy now” button on their site.  At the time their website was developed (approximately 7 years ago) they only offered one item for sale. 

Of course 7 years later they now have 5 items they sell online.  Currently the solution is not setup to add items to cart but after doing a little bit of research today, it’s not hard to covert those… This is an example of what the “single purchase button” is coded…

   1: <form method="post" action="https://www.paypal.com/cgi-bin/webscr">
   2: <input type="hidden" name="cmd" value="_xclick">
   3: <input type="hidden" name="business" value="payments@yoursite.com">
   4: <input type="hidden" name="item_name" value="Baseball Hat">
   5: <input type="hidden" name="item_number" value="123">
   6: <input type="hidden" name="amount" value="5.95">
   7: <input type="hidden" name="shipping" value="1.00">
   8: <input type="hidden" name="shipping2" value="0.50">
   9: <input type="hidden" name="handling" value="2.00">
  10: <input type="hidden" name="currency_code" value="USD">
  11: <input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
  12: <input type="hidden" name="undefined_quantity" value="1">
  13: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" width="68" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
  14: </form>

The first step to converting the button is to add this to the form tag:

   1: <form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">

The next thing you will want to do is to locate this line of code:

   1: <input type="hidden" name="cmd" value="_xclick">

and replace it with this:

   1: <input type="hidden" name="cmd" value="_cart">

This line will also need to be added to the form tag:

   1: <input type="hidden" name="add" value="1">

Then you will want to locate the input-type-image area and replace that code with this:

   1: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">

The finished product once you have finished inputting everything and swapping out these snippets of code should look something like this:

   1: <form method="post" action="https://www.paypal.com/cgi-bin/webscr">
   2: <input type="hidden" name="cmd" value="_cart">
   3: <input type="hidden" name="add" value="1">
   4: <input type="hidden" name="business" value="payments@yoursite.com">
   5: <input type="hidden" name="item_name" value="Baseball Hat">
   6: <input type="hidden" name="item_number" value="123">
   7: <input type="hidden" name="amount" value="5.95">
   8: <input type="hidden" name="shipping" value="1.00">
   9: <input type="hidden" name="shipping2" value="0.50">
  10: <input type="hidden" name="handling" value="2.00 ">
  11: <input type="hidden" name="currency_code" value="USD">
  12: <input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
  13: <input type="hidden" name="undefined_quantity" value="1">
  14: <input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
  15: </form>

Fortunately for me the non-profit that was asking about this has now got their in-house IT guy to make the changes, it’s somewhat time consuming and if you only have 5 products or so, you can probably almost generate new add to cart buttons just as fast, which is what I recommended.

 

Creating an Add to Cart button – PayPal

Integrate PayPal Recurring Subscriptions / Payments

paypal300 From time to time I do some pro bono consulting for non-profit organizations and lately I had one such client that I had worked for several years ago reach out to me for advise on setting up a subscription based service solution using PayPal as the payment gateway.

Being forced to reacquaint myself with the solution I wrote for the client almost 4 years ago I realized that there weren’t any “off the shelf” solutions that I could roll into the solution, so I explored PayPal’s API and found that they now offer Recurring Payments and Subscriptions as a service.  No sense in recreating the wheel when you can just piggyback off of their product.

Here is a case study that I ran across that really helped me get up and running quickly.  Also, be sure to skip down for the sample codes to get you started.

Recurring payments case study

In order to explain this PayPal feature, consider a simple case study. An online service offers customers a monthly subscription for US$10.00 per month. Users may sign up for the service through the online service’s Web site, and each user is assigned a unique account username that serves as an identifier.

With such a service, subscribers would normally be invoiced on a monthly basis. To understand how this would work with PayPal’s Subscriptions And Recurring Payments feature, consider the following process flow:

  1. The user (let’s name him Sam Subscriber) arrives at the service Web site to sign up and, after entering and saving the required profile information, is assigned a unique username. Sam can then either try the service out for free (if a free trial is available) or immediately sign up for paid service. The latter is accomplished by hitting a clearly-visible Subscribe button.
  2. The Subscribe button is actually an entry point into the PayPal system. On clicking it, Sam is redirected to the PayPal Web site, where he can either log in to an existing account or create a new one. This is because, to use PayPal to send or receive money, both parties in the transaction must have PayPal accounts; PayPal does not process payments between non-PayPal parties (for this same reason, the service provider must have a business account with PayPal to receive payments). Account signup is free.

    The Subscribe button is preprogrammed with certain important informationâ€"the service provider’s account details on PayPal, the billing cycle and amount, and the currency in which the payment is to be billed. This tells the PayPal system how much money is to be billed, how often, and where to send it. Since Sam’s account name at PayPal may not necessarily match his newly-minted account on the service provider’s site, the account username assigned to Sam is also passed to PayPal to simplify reconciliation later.

  3. Once Sam authorises the PayPal payment, an e-mail containing details about the transaction is dispatched to the service provider (who also has a PayPal account, remember). The provider then logs in, checks that the payment has been received, and activates paid service for Sam. The account username passed to PayPal also appears in the e-mail, and helps the service provider identify which user made the payment and thus activate the correct account.
  4. Because the first payment took place through PayPal’s Subscriptions And Recurring Payments, PayPal automatically keeps track of the billing cycle stated at the time of first payment, and rebills Sam on a monthly basis until Sam manually cancels his subscription. The service provider receives e-mail notification of payment from PayPal on a monthly basis, and thus keeps Sam’s service alive until a cancellation notice arrives from PayPal.

    This recurring payment process is completely automatic, and requires no intervention from either Sam or the service provider.

Programming the PayPal button

As a service provider interested in offering customers a subscription service via PayPal, the first step for you is to acquire a PayPal account. This is pretty simple: drop by the PayPal Web site and sign up for a Business Account. Then log in to your new account and navigate to the Subscriptions And Recurring Payments option. The resulting page allows you to specify various parameters for the subscription:

  1. Subscription Name: A descriptive name for the service/item that a user will sign up for
  2. Reference Item: A reference number or code that you can use for internal tracking purposes
  3. Subscription Price: The amount to be billed
  4. Length of the Billing Cycle: The period (days, weeks, months or years) over which subscribers are to be billed
  5. Once you’ve filled in all the data, choose a PayPal button to display on your Web site. If needed, you can even allow users a free trial period or give them a link to cancel their subscription if they’re not satisfied.

Examples:

Listing A shows what the button code, generated by PayPal from the basic information you provided, might look like.

   1: <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   2: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
   3: <input type="hidden" name="cmd" value="_xclick-subscriptions">
   4: <input type="hidden" name="business" value="john.doe@johndoe.com">
   5: <input type="hidden" name="item_name" value="My Special Service">
   6: <input type="hidden" name="item_number" value="SS-001">
   7: <input type="hidden" name="no_note" value="1">
   8: <input type="hidden" name="currency_code" value="USD">
   9: <input type="hidden" name="a3" value="10.00">
  10: <input type="hidden" name="p3" value="1">
  11: <input type="hidden" name="t3" value="M">
  12: <input type="hidden" name="src" value="1">
  13: <input type="hidden" name="sra" value="1">
  14: </form> 

When placed on your Web site, this code generates a PayPal button which links into the PayPal payment system. You should place this code somewhere on your How To Pay page. But before you do that, you need to add one more field to the automatically-generated code…a hidden field that contains the subscriber’s username. This field will be dynamically populated at runtime by your Web site.

Assuming you’ve got a PHP site and store your user’s account name in a session variable called username, Listing B shows what the updated code for the PayPal button would look like.

   1: <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   2: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
   3: <input type="hidden" name="cmd" value="_xclick-subscriptions">
   4: <input type="hidden" name="business" value="john.doe@johndoe.com">
   5: <input type="hidden" name="item_name" value="My Special Service">
   6: <input type="hidden" name="item_number" value="SS-001">
   7: <input type="hidden" name="no_note" value="1">
   8: <input type="hidden" name="currency_code" value="USD">
   9: <input type="hidden" name="a3" value="10.00">
  10: <input type="hidden" name="p3" value="1">
  11: <input type="hidden" name="t3" value="M">
  12: <input type="hidden" name="src" value="1">
  13: <input type="hidden" name="sra" value="1">
  14: <input type="hidden" name="custom" value="&lt;?php echo $_SESSION['username']; ?>">
  15: </form> 

Once a subscriber logs in to your Web site, his or her username will be stored in a PHP session variable for use where required. On the How To Pay page, this session variable is used to dynamically populate the hidden field inside the PayPal button. The advantage of this little modification: since PayPal will now incorporate the additional username information in all its notifications and e-mails pertaining to the transaction, you, as the service provider, will be able to clearly distinguish between different users and transaction records.

In case you’re wondering what all the other fields are, they’re related to the subscription period, bill amount, and billing frequency. Look in the PayPal manual for a complete explanation of each variable.

When a subscriber clicks the button generated by the code above, the username is transferred to PayPal along with the billing details. Once the subscriber completes the PayPal payment process, an e-mail receipt is generated and sent to the subscriber, and an e-mail payment notification is generated and sent to you, the service provider. You can then activate paid service for the subscriber, matching the payment with the subscriber through the unique username that PayPal supplies from the button’s Custom field.

Now, while the process above is fairly simple and works well in practice, it has one fatal flaw: It requires you, as the service provider, to manually perform the task of reading PayPal’s e-mail and activating each subscriber account. As your subscriber base increases, such manual account activation becomes less feasible, especially if you’d prefer to take all the money you’re making and go to the Bahamas for a week. And that’s where IPN comes in.

Integrating IPN With subscriber payments

IPN, which stands for Instant Payment Notification, is PayPal’s automated notification system for payments. Once you begin using IPN, you can completely alter the way you deal with subscriber accounts, replacing the earlier manual process with an automated one. This is because IPN sends you a signal every time you receive a subscriber payment or when a subscriber cancels a subscription; you can then intercept this signal and write code to "do something" with it, such as automatically activating or deleting a subscriber account.

To enable IPN for your Business Account on PayPal, simply visit your account on the PayPal Web site and turn the feature on. As part of this process, you also need to supply PayPal with the URL to a script on your Web site; this is the script PayPal will invoke every time it generates an IPN, and this script must therefore be capable of trapping IPN signals and taking appropriate action based on each.

IPN signals can be intercepted by scripts written in most common Web development languages, including ASP.NET, PHP, and Perl. Take a look at the PHP pseudo-code in Listing C, which shows you how such a script might work.

   1: <?php
   2:  
   3: // define array to store PayPal request
   4: // as key-value pair
   5: $postvars = array();
   6:  
   7: // read post from PayPal into local array while (list ($key, $value) = each ($HTTP_POST_VARS)) {
   8:     $postvars[] = $key;
   9: }
  10:  
  11: // add a 'cmd' parameter to the parameter list that is POSTed // back, as required by PayPal $req = 'cmd=_notify-validate';
  12:  
  13: // append each parameter posted by the PayPal // as name value pair to the "req" variable for ($var = 0; $var < count ($postvars); $var++) {
  14:  
  15:     $postvar_key = $postvars[$var];
  16:     $postvar_value = $$postvars[$var];
  17:     $req .= "&" . $postvar_key . "=" . urlencode ($postvar_value); }
  18:  
  19: // post the request back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
  20: $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n";
  21:  
  22: // open file pointer to the paypal server $fp = fsockopen ("www.paypal.com", 80, $errno, $errstr, 30);
  23:  
  24: if (!$fp) {
  25:     // HTTP error
  26:     // log an error    
  27: } else {
  28:  
  29:   // POST the data using the file pointer created above
  30:   fputs ($fp, $header . $req);
  31:     
  32:   while (!feof($fp)) {
  33:     
  34:     // read the response from the PayPal server
  35:     $res = fgets ($fp, 1024);
  36:         
  37:     // check if the request has been VERIFIED by PayPal 
  38:     // if it is, then you can proceed further
  39:     // if it is INVALID, then abort the process
  40:     if (strcmp ($res, "VERIFIED") == 0) {
  41:  
  42:       // get the value stored in the "custom" field 
  43:       // (username) in a local variable
  44:       $username = $HTTP_POST_VARS["custom"];
  45:  
  46:       // check if the username sent with the PayPal IPN request exists in the database
  47:       // using a custom function called userExists()
  48:       if(userExists($username)) {
  49:  
  50:         // check the transaction type for the subscription sent by PayPal 
  51:         // and take action accordingly
  52:         if(isset($HTTP_POST_VARS["txn_type"]) &&
  53: strtolower($HTTP_POST_VARS["txn_type"]) == "subscr_payment") {
  54:  
  55:           // a subscriber just paid
  56:           // increase the subscription period by X days
  57:  
  58:         } else {
  59:  
  60:           // incorrect transaction type
  61:           // log an error 
  62:  
  63:         } 
  64:  
  65:       }
  66:  
  67:     } else if (strcmp ($res, "INVALID") == 0) {
  68:  
  69:     // an INVALID transaction
  70:     // log an error
  71:  
  72:     }
  73:  
  74:   } 
  75:  
  76: }
  77: ?>
  78:  

This looks pretty complicated, but it’s actually not. The first bit of the code involves verifying that the IPN is actually from PayPal and not from a hacker trying to break into the payment system. This verification is accomplished using a standard process outlined in PayPal’s IPN manual, reposting the entire request back to PayPal, and using the encrypted key within it to check the source of the request. Look in the PayPal IPN manual for more on how this authentication system works.

Assuming the response is VERIFIED, you can go ahead and process the data sent by PayPal in the IPN. First, extract the value of the "custom" variable the subscriber’s username"and check that the subscriber actually exists in your system. If the test is successful and the named subscriber does hold an account with your service, proceed to handle the txn_type field, which contains information on the PayPal transaction that generated the IPN.

In the context of subscription payments, the txn_type field may contain any of the following values:

  • subscr_signup – a subscriber has signed up for the service
  • subscr_payment – a subscriber has paid for the service
  • subscr_failed – a subscriber tried to pay for the service but things didn’t work out
  • subscr_cancelled – a subscriber cancelled a subscription
  • subscr_eot – a subscriber has reached the end of the subscription term
  • subscr_modify – a subscriber profile has been modified

Most of the time, you only need to be concerned with the subscr_payment type this indicates that a payment has been made to your PayPal account. On receipt of this signal, the script can immediately (and automatically) update your subscription database, and activate paid service for the subscriber. You may also be interested in intercepting the subscr_cancelled and subscr_eot signals, to update your database with the change in subscriber state.

This automated process does away with the need for manual processing of PayPal e-mails. The script above automatically intercepts payment notifications via the IPN service, and turns a subscription "on" or "off" depending on the contents of the notification. As with the manual process outlined previously, the Custom field with the subscriber’s username is used throughout for reconciliation and tracking. Try it out for yourself, and you’ll quickly see how valuable it is.

I found this excellent case study and sample code here: Integrate your online service with PayPal – Web Development – Builder AU

Targeted Advertising for Nascar Fans

nascar_logo_whitex200 It’s no secret that Nascar is by far one of the most popular sports today, it’s even surpassed baseball and football in some reports.  My partners and I own and operate an extremely popular Nascar community driven portal that provides blog posts, news & information, forums, message boards, and live racing chat to the Nascar community.

If you have a product that you are trying to promote online, you should consider advertising on NascarView.  We can put your product in front of our readers and active members and give you unprecedented exposure.  If you are interested, please feel free to contact us: editor@nascarview.com or visit our website, http://nascarview.com and click on advertise.  We would love the opportunity to help promote your products or services…

From the NascarView website:

NascarView.com offers a potent venue on which you can target your most-desired customers. Our reach and readership provide incomparable value for your advertising investment. Through our site you will get your message to the right audience at the right time.

NascarView.com exists as joint project spearheaded by Pleth, LLC. Pleth, LLC is an Arkansas based company whose mission is to provide web development, search engine optimization, internet marketing, managed hosting, & email services accompanied by unsurpassed, long-term project support.

By advertising with NascarView.com, you tap our expertise and creative services to target the customers you value most. To contact us call 888.276.0848 or email us at editor@nascarview.com

Advertise : Nascar View

Facebook Advertising w/ Tim Kendall

One of the things that make Jeremy Schoemaker stand out from the rest of the “how to make mo money” folks out there is that Jeremy actually makes money!  He has done quite well over the years w/ his business and has earned my respect, which is not easy to do these days.  My business partner Greg sent me a link to his latest podcast where he as talking w/ Tim Kendall about monetization on Facebook.

Personally, I have clients that are already diving into Facebook and actually seeing some results.  I have been crying Facebook, Facebook, Facebook, for a while now and it’s great to see that folks are jumping on board w/ it and doing well.

If you have thought about placing ads on the Facebook network, you should listen to this podcast.  Here’s an excerpt from Shoemoney.com:

On yesterday’s ShoeMoney Show we talked about making money with Facebook.  Tim Kendall, Director of Monetization, was my guest during the show.  Tim is in charge of monetizing the entire Facebook advertising system.

I started off the show by talking about the current state of affiliate marketing and some of my recent experiences.  I also addressed some of the comments made on last Monday’s post about my recent Facebook campaigns.

After the first break Tim came on the program, talked a little bit about his background and explained some general things about the Facebook advertising platform. Then we dove into users’ questions!

Right off the bat, I blindsided Tim with some questions about the Beacon Project (mostly because I thought it was a ingenious way to make money).  Although I did give Tim a list of questions before the show started, this question was not on the list.  He was great, and I was glad he still answered my questions.  I think you are somewhat seeing Beacon in a small amount through advertisements you can target by social actions. I have a feeling we have not seen the last of the Beacon Project.

During the show Tim answers many questions… I tackle a few also. We cover everything from how to get started with Facebook advertising to how to conduct split testing on your ads. Tim also addressed all the questions about their ad approval proccess (of which there were many).

Throughout the great interview, I thought one of the key points Tim made was that Facebook is still in the "start-up phase".  The ad platform is only about 1 year old and people are already trying to compare it to Google Adwords which is about 9 years old.

I want to thank Tim for his time, great answers, and for coming on the show with very short notice.  I thought he awesome.

You can listen to the show here on WebmasterRadio.

Making Money With Facebook – ShoeMoney Show – ShoeMoney®

Predictions for 2009

I just posted Josh Catone’s Top 15 Stories of 2008 on my blog a few minutes ago and then stumbled upon his predictions for 2009, I figured this was worthy of posting as well. 

I think that Josh has hit the nail on the head again w/ this article.  I share his belief that technologies like Twitter and Facebook can’t be ignored by developers going into 2009.  We owe it to our clients to provide them with the best tools to tap into these social networks.

It’s that time of the year again. As we noted earlier in the week, nothing is more fun for tech bloggers than looking ahead to next year and trying to predict the future. Prediction posts are an annual tradition in the blogosphere, and we enjoy doing them.

So below are eight prognostications for the new year in web tech. Of course, if you saw our list of 2008’s top stories, you’ll know that reality is often too wacky to predict — and that A LOT happens in a single year. Remember to check out how we did with last year’s predictions, as well. And let us know in the comments what you think 2009 has in store for the web.

Note: I use the corporate “we” in this post, but these predictions are really just my own and not those of anyone else at SitePoint. So, don’t blame them for the terrible lack of foresight!

1. Twitter gets a business model.
Twitter has a bunch of different options when it comes to monetization. Targeted ads in the Twitter stream based on what you tweet about, built in micro payments, charging high volume users, charging developers to use the API, etc. Twitter may try some or all of these options, but we think the most likely path to monetization is in corporate accounts. When SitePoint ran our highly successful and well publicized book giveaway via Twitter, it was only really made possible because we were able to get on Twitter’s white list and send a large number of direct messages without being blocked. Prior to getting on that list, things didn’t go nearly as smoothly. That’s the sort of added functionality that only corporate accounts would likely need, and that Twitter could charge for.

2. Lifestreaming gets big, but not via FriendFeed.
FriendFeed made a huge impact over the past year among the early adopter crowd, but lifestreaming hasn’t quite made its way into the mainstream. People are just now beginning to regularly use enough social services at once — YouTube, Flickr, Twitter, Digg, blogging — that aggregation will start to make sense. In 2009, it will be commonplace to publish your online life in a single stream, but it will be done via Facebook.

3. The Web OS will really start to become a reality.
The Web OS race is on. In 2009 we’ll start to see the vision really begin to coalesce from major players like Adobe (Flash, Flex, AIR), Google (Chrome, Gears, Native Client), and Microsoft (Silverlight, Live Mesh), among others.

4. Some really great stuff will come out of Yahoo!, but it won’t be enough to save them.
Yahoo! has been doing some awesome stuff by opening up their search results and most popular pages and applications by making them more social and giving developers more hooks. That’s the sort of thing that will ultimately make the web a better place, but unfortunately it won’t be enough to save Yahoo! on Wall Street. Their stock will continue to slide, unless they sign a big search deal with Microsoft or sell their search business outright to focus on the content/platform side.

5. Chrome will take at least 5% but not more than 10% of the browser market by year’s end.
Google’s browser, now out of beta and being actively promoted by Google, will take at least 5% of the browser market by year’s end and as much as 10%. IE will continue to decline with both Chrome and Mozilla Firefox on the scene, but Chrome will actually cause Mozilla’s growth to stall, and will probably even steal some market share from Firefox once it supports extensions.

6. Microsoft Office will make people comfortable with web applications.
When Microsoft pushes out a web-based version of Office, users in the mainstream will finally start to become comfortable will web apps. Google’s Docs and Spreadsheets apps have certainly already pushed a fair number of people in that direction, but Microsoft will have a vastly bigger impact on the adoption of web applications by mainstream users. Their software + services vision will emerge in 2009 as the clear future of software.

7. Facebook takes over the web.
Well, not literally. But Facebook will continue to grow in size worldwide, and will finally over take MySpace as the biggest social network in the US. A lot of the cool web applications that early adopters love, such as FriendFeed, will reach the mainstream as features of Facebook, and Facebook Connect will help spread the Facebook brand by entangling it with other popular sites on the web that people know and trust. The company will also expand their search deal with Microsoft and make web search integration more prominent and more powerful. For many users, Facebook will become their default search engine in 2009, and this will pave the way for an IPO in 2010.

8. Palm will surprise everyone at CES
Palm’s new entry into the smartphone market will be very impressive. The Nova operating system will look like something that could challenge Android, Blackberry, and the iPhone in the mobile market, but success will depend on the hardware.

 

SitePoint » What’s On Tap: Predictions for 2009