learn the ins and outs of credi cards
RSS icon Email icon Home icon
  • How can I verify an online credit card payment then unlock content for a user for an upcoming website?

    Posted on January 15th, 2009 admin 1 comment
    davey_s asked:


    The user will purchase short videos (wmv and mpeg) for a small fee using an online payment system. I need to verify this payment has gone through, subsequently emailing them a valid username and password where they can log in and download the content they have purchased. I dont know where to start.

    HERSCHEL
    Share and Enjoy:
    • Print
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • Blogplay
    • LinkedIn
    • Propeller
    • Reddit
    • Technorati
    • Tumblr
    • Twitter
     

    1 responses to “How can I verify an online credit card payment then unlock content for a user for an upcoming website?” RSS icon

    • JOESPH

      If you’re trying to clear transactions yourself, rather than using an Internet payment service, the hard part will be to establish a merchant account with a bank that allows for payments sourced from the Internet.

      If you have the payment side of things sorted, then each completed transaction will provide a completion code. You can use that code, along with a secret that you have previously generated for your server to calculate the code to email to your user. Typically, this is done with a hash, like MD5, SHA-1, or SHA-256.

      You store the hash in a local database of some kind that associates the hash with the content the user has ‘purchased’, usually by storing the filename.

      E-mail the hash to the user with some credentials to authenticate them later (I’ll assume you know how to authenticate users).

      When they login, at some point you provide a form where they can enter the code you sent to them. If the code matches the one you have in the local database, you then initiate a download of the data.

      This whole process is made a lot more straightforward with a web application development framework that takes care of handling sessions, but you can certainly write your own from scratch.


    Leave a reply

    You must be logged in to post a comment.