News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Bug in payd subscriptions ?

Started by CapadY, March 24, 2012, 06:04:55 AM

Previous topic - Next topic

CapadY

I think I found a bug in the subscription system.

One of my members had a subscription for full site acces for a half a year, from 2011 juli till 2012 january. Let's say it's subscription_id 2.

Now, in 2012 march, she want full acces again. So, she did a subscription, I received a message from PayPal, but she wasn't in the subscribtion list.
I start looking in the database and find out the subscription wasn't in there because there is a unique key in it, consiting of the fields member_id + subscribtion_id. This means, a member can never have the same subscription twice, neither when the time period of the subscription is over and the subscription is no longer active.
Once they have got a subscription for a halve a year they will never be able to have a subscription for a halve a year again.

I was thinking of adding the active field to the unique key but this will give problems when she want to have the same subscription for the third time. In that case there will be 2 old subscriptions with the same unique key.

Maybe I am doing something wrong and an solution is available, please tell me.

By the way, the option to use several prices for several time periods is no option to me, because this don't give me the possibility to have a subscription for 3 or 6 months.

BTW, using SMF2.0.1
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

NanoSector

Dunno if this is related, but does SMF 2.0.2 fix this?

If not, this may indeed be considered a bug.
I'd suggest checking if the subscription isn't already made, and if it is, error with something like "Sorry, you can't have two of these packages at the same time".
Or maybe build an option where you can extend the period. Up to you.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

Hi CapadY!

Quote from: CapadY on March 24, 2012, 06:04:55 AM
I start looking in the database and find out the subscription wasn't in there because there is a unique key in it, consiting of the fields member_id + subscribtion_id. This means, a member can never have the same subscription twice, neither when the time period of the subscription is over and the subscription is no longer active.
I did few tests in a local environment so far from being a real-worlds case scenario.
What should happen when you do a second (or third) order is that SMF adds the informations for the already existing subscription (that's why there is the index).

If you start having more than one line per each member+subscription in smf_log_subscribed you will most likely have problems, so I'd suggest you to not add any index there. ;)

I managed to have get a similar problem (though I don't know if it was the same) while testing: the transaction didn't complete for some reason (no idea what happened), but in the end the user was in the database, but it was not visible in the admin page showing the subscribed users.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

I believe the code is working as intended on this score - I just tested it on a 2.0 installation and when I completed the subscription on top of the first one (one year subscription, took out another one year subscription), my original subscription was extended by a year as it should be.

Unless further information comes to light, I'm going to mark this as not a bug.

Advertisement: