Forum Moderators: coopster

Message Too Old, No Replies

subscription issue

paying for a set period

         

neonpie

3:12 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



Hi all,

OK this is not something i need now, but may come across in the near future and i would be happy if i could confidently say that i can do this when asked (with your help ;o) )

the issue:
when someone pays for a subscription on a site for say 12 months what is the best way to keep this inforced - use a timestamp on payment? which then checks the date and timestamp to see if the subscription is still valid. also run a cronjob every day which could email out a reminder towards the end, say 1 month before?

ok issue two:
if you subscribe to one section thats fine, but then if you pay to access more areas how do you keep tabs on when each part is up for renewal - and to throw the spanner in the works - if you buy more than say 4 areas you then get full access.

confused - well i felt like i had just had a slush puppy and got brain freeze :o)

eelixduppy

3:27 pm on Feb 5, 2008 (gmt 0)



>> use a timestamp on payment?

Yup. You'd have to have a timestamp for each of the subscription areas, though, and compare each to the time limit.

>> if you buy more than say 4 areas you then get full access

You'd have to find which are subscription is to expire the soonest, and if that one expires and drops the number of subscriptions to less than 4, then notify them that their global access will be restricted and that they should renew it.

neonpie

3:49 pm on Feb 5, 2008 (gmt 0)

10+ Year Member



one of the other option i thought about after posting - but this would depend on the clients wishes - would be to calculate the cost over a year for 1 area with one area costing £20, so with 30 days left of the subscription the user might want to add area 2. this would be until the end of the current subscription, so adding area 2 for 30 days would cost £1.50.

but like i said this would be dependent on the client - and knowing my luck they wont want it this way :o(

jatar_k

4:15 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you are mixing 2 issues a bit

1) purchase of access - pricing breakdown

2) access control

the first thing would be for the client to decide what is paid and how they would like to offer pricing

map it all out, different packages, all in ones, one offs, whatever

once you have that then you need to identify those portions of the site as an individual product and control access based on their payments. You need a way to have them be turned on and off, whether it is a certain page, directory or even subdomain, a higher level of control is better or you'll be cutting and pasting access control onto every page.

You then need to have a login, which I assume you do.

Then we need to use a session for control and comparison as they navigate the site. The majority of the access, I assume, would be set at login.

You would load each product/section access from the database. You could do this using a timestamp to compare, again this would only be to set the session. Once you have created the session then you just need to check for a particular value to show content, otherwise you show signup/payment info. If they purchased access to everything then you just set all the product vars in their session.

for reminders you could just have a cron that runs daily/weekly/monthly and search for expiry dates that are less than 30 days away.

a bunch of coding but pretty easy.

the precoding work is the most important in this type of system.