need help in creating scratch card type payment system!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
coolman_nyc
Forum Newbie
Posts: 3
Joined: Sun Mar 18, 2007 2:13 pm

need help in creating scratch card type payment system!

Post by coolman_nyc »

its kinda hard for me to explain the idea but lets give it a shot...


i have a classified type site which was till now free! but now i am planning to charge a fees of around $1 a year. since my site is sooo very local and i cant afford to use c card right now. i have come upwith an idea to sell these cards which has a alpha-numeric scratch-and-reveal type system.


now all the user has to do is buy the card, login make an add and in the end or after 7 days enter the code in their card and his/her ad would be active for 1 year!

in some countries prepaid mobile companies use the same system!


please help me out here! is there any class for this purpose?
much thanks in advance :D
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

I doubt you'll find the code for a system like that already written for you. Two reasons come into my head: firstly, it sounds pretty easy to develop. Secondly, people don't usually release code that is designed to make profit.

All you need to do is decide how many of these cards you want to initially produce, then, create a database table. Now make a script to populate this table with the same number of rows as cards that you're producing. Have atleast a field for the unique card identification numbers. Then print all these cards off with the numbers from the table. When one gets activated (entered into your system), credit the users account and delete the row (or just check the row off). If you're wanting to do expiration then you'll need a time stamp field too.
coolman_nyc
Forum Newbie
Posts: 3
Joined: Sun Mar 18, 2007 2:13 pm

Post by coolman_nyc »

thanks jay,

i plan to make around 60,000 cards in 6 months and one more thing i forgot to mention.
there are 2 types of scratch recharge option there is one $1 card for 1 year duration and another $2 for the life time duration.

how would this function workout? and adding 60,000 entries in a database sounds pretty server heavy! is there any way to make this an checksum type system?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

60,000 will be alright. If not just make a cron job to do a thousand every second. Different cards is no problem, just add an extra field in your table indicating which type it is and when it's activated credit the user accordingly.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

That's an incredibly good idea for tackling micropayments.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

How much would these cards be to produce!?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

$2 for the life time duration..
What is your definition of "life time".. Make sure terms and conditions are set well. Are you saying that in 20 years this site is running or customers have access to it's replacement if your "company" is around in 20 years ? Even worse is if you wish to change your pricing model again.

Not knowing your adverts what happens if you want to charge different levels for different types/formats of advert. If you want to insert an ad with a photo compared to a text ad, are they both free now and "forever". What about business users compared with personal users ?

As you are only local I will mention this but the costs are almost certainly too high.. How about getting an SMS from users via a mobile phone to unlock an account and have the "phone number" have an additional charge ?
coolman_nyc
Forum Newbie
Posts: 3
Joined: Sun Mar 18, 2007 2:13 pm

Post by coolman_nyc »

thanks goblin ill ask the [s]ppl[/s] people responsible for writing the tos to redifine unlimited life offer to be limited an a way.
this should be quite cheap to manufacture, i think it can be done inhouse and it will give much more security too.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Post Reply