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
Add Comment

Discussion 39 Comments

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

  2. Eduardo Barros says:

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

  3. Carlos says:

    Damn!

    My premium account just expired las week :(

  4. Honby says:

    I can’t login the premium membership.

  5. Seth says:

    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 says:

      “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.

  6. Henry says:

    Can I purchase this Tutorial in the Marketplace?

  7. Jaspal Singh says:

    Simple enough to sell digital goods.
    Thanks for sharing.

  8. dan says:

    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.

  9. Mcquam says:

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

  10. Chuckles says:

    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…..

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

  12. A reader says:

    Gotta love Pul.ly eh.

  13. 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

  14. subrat says:

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

  15. Davidmoreen says:

    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!

  16. Neil says:

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

    • Dan Harper says:

      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).

  17. david says:

    i am also a member and cannot view the source files

  18. Stefano says:

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

  19. Erik says:

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

  20. Stefano says:

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

  21. arnold says:

    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?

  22. OSXBOY says:

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

    TIA

  23. Tommie says:

    Can we see a real life example using this code?

  24. Agha Zair Ali says:

    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.

  25. Kevin Simper says:

    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

  26. 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.

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.