-
How can I verify an online credit card payment then unlock content for a user for an upcoming website?
Posted on January 15th, 2009 1 commentdavey_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.
HERSCHELProgramming & Design Credit Card Payment, Mpeg, Online Content, Online Payment, Payment System, Small Fee, Valid Username, Wmv1 responses to “How can I verify an online credit card payment then unlock content for a user for an upcoming website?”

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



eskwayrd January 17th, 2009 at 02:46