How to Sell Digital Goods with CodeIgniter: New Premium Tutorial
plus

How to Sell Digital Goods with CodeIgniter: New Premium Tutorial

Tutorial Details
  • Program: PHP
  • Version: >=5
  • Difficulty: Intermediate
  • Estimated Completion Time: 1 - 2 hours
Download Source Files

In today’s tutorial, you’ll learn how to create a small web app to sell digital items (eg. eBooks) securely and accept payments from PayPal. Become a Premium member to read this tutorial, as well as hundreds of other advanced tutorials and screencasts.

How to Sell Digital Goods with CodeIgniter: New Premium Tutorial

Join Net Premium

NETTUTS+ Screencasts and Bonus Tutorials

For those unfamiliar, the family of Tuts+ sites runs a premium membership service. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Nettuts+, Psdtuts+, Aetuts+, Audiotuts+, Vectortuts+, and CgTuts+ For the price of a pizza, you’ll learn from some of the best minds in the business. Become a Premium member to read this tutorial, as well as hundreds of other advanced tutorials and screencasts.


Other Awesome Premium Tuts you may Like

Dan Harper is danharper on Themeforest
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.twitter.com/mamunabms Abdullah Al Mamun

    I’m badly in need of a mooneybookers php class for CodeIgniter as some countries do not allow transaction via PayPal.
    Thanks.

    • http://eyoosuf.com Yoosuf

      not some, many!

  • Eduardo Barros

    Hello, just a question: Will this tutorial use paypal IPN (Instant Payment Notification)? If so, I’ll probably buy Premium for this.

    • http://danharper.me Dan Harper

      Yes it does :)

  • Carlos

    Damn!

    My premium account just expired las week :(

  • http://www.sahutbaju.com Honby

    I can’t login the premium membership.

  • Seth

    Awesome! I’m looking forward to going through this later on. And just to clearify…this is completely secure to use in the real world right now? and should work just fine with selling, for example, psd files?

    • w1sh

      “Completely secure” is kind of relative isn’t it?
      I’d trust a CodeIgniter package with XSS filtering and prepared statements to handle an e-marketplace.

  • http://www.iamhenry.me Henry

    Can I purchase this Tutorial in the Marketplace?

    • http://net.tutsplus.com Jeffrey Way

      Henry – It’s just a matter of when Dan uploads it there. :)

      • http://www.iamhenry.me Henry

        Looking forward to purchase it Dan!

      • http://eyoosuf.com Yoosuf

        :D

      • http://ojs.at Oliver

        looking forward to buy it too :)

    • http://danharper.me Dan Harper

      I’ll be uploading it in a few days as I’m away right now.

      • t_wrecks

        Looks like a great tut. I am looking forward to picking this up on the tutorials marketplace when it is made available.

  • http://www.jsxtech.com Jaspal Singh

    Simple enough to sell digital goods.
    Thanks for sharing.

  • dan

    Meh people should really get away from Paypal and Moneybookers … it’s hardly ever used in some countries, seriously how hard is it to setup creditcard payments :P?

    Paypal / Moneybookers is the only reason I don’t have a nettuts plus account … i just prefer to pay via creditcard.

  • Mcquam

    Login isn’t working so I can’t see the files.

  • http://www.psdstyle.net Chuckles

    Interesting article – I struggled through CodeIgniter over a year ago trying to do just this. Well not just this actually more detailed. But either way I would have killed to read this tut way back then…..

  • http://tutorial-city.net/ Tutorial City

    In this tutorial the author creates a library or just set up everything in the controller?

  • A reader

    Gotta love Pul.ly eh.

  • http://thedevelopertuts.com Bratu Sebastian

    Cool man!

    Great tutorial, I think I will buy it from the markeplace, as I am only interested in this one. I hope it covers IPN

  • subrat

    I am a premium member and I can not download the source files.

  • http://spotdex.com Davidmoreen

    Wow what a super cool app.

    I’ve totally changed my perception of Codeigniter and frameworks as a hole. Not just based on this tut, not on the fact that Codeigniter makes doing things a lot faster and certainly more fun!

  • Neil

    Can I ask, when the user gets sent the item – do they get given a unique url to download the item?

    • http://danharper.me/ Dan Harper

      Yes, they’re emailed a download URL unique to them. As an ‘extra’ section at the end of the tutorial, we use the unique URL to allow download restrictions (eg. up to 4 times every 7 days).

  • david

    i am also a member and cannot view the source files

  • Stefano

    +1 that would buy the item if uploaded to the marketplace :)

  • http://www.windkr89.nl Erik

    Thanks, tutorials like this are the reason I joined Tutsplus Premium. Looking forward to see more like this!

  • http://www.stefanogiordano.it Stefano

    I bought it on the Marketplace, a very well done tutorial, with commented code and working example! :)

  • arnold

    I hope nettuts will come up more tutorials like these, nobody really covers a tutorial which will use Paypal

    same question with Sebastian , does it cover IPN?

    • http://danharper.me Dan Harper

      Yep, it uses IPN.

  • OSXBOY

    Stefano where did you find this on the Marketplace can you supply a URL as I’m interested in buying this one.

    TIA

    • OSXBOY

      Oh how foolish I feel now I’ve scrolled to the top of the page and seen:

      Not Premium? This tutorial is available on the Tuts+ Marketplace

      :-)

      • http://magpielabs.co.uk Yoosuf

        rather paying $5 one month subscription is $9 go for that

  • Tommie

    Can we see a real life example using this code?

  • Agha Zair Ali

    If you need any help related to PAYPAL Pro using code igniter, you can write me back and I will send you the library I’ve created for codeigniter.

  • http://simperit.dk Kevin Simper

    Hi Dan Harper

    Very good tutorial, not for beginners, but defenitly easy to understand.

    I just dont get:

    Why do you not check if the customer actully paid the price you set?

    The customer can change it to just pay 1 cent, and he would get the product, because nothing checks it.

    You should change the hash to be without the time, and then when you get the data back from Paypal, make a new hash and compare them each other, then you will be sure!

    Maybe i should make my own tutorial explaining that!? :P

    Kevin Simper

  • http://www.simonbacquie.com Simon Bacquie

    Hey, awesome tutorial, very useful. I adapted some of this code in an app I’m working on, and I just wanted to point out a small mistake, not sure if anyone caught it yet.

    In testing I found that in my order records, the Paypal transaction ID wouldn’t end up in the database, it’d just be null. I eventually figured out why–in your confirm_payment() function, the parameter for that is called $payment_txn_id, but within the function, it looks for $paypal_txn_id… not quite the same variable name ;) so the value never reached the database.