News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Subscriptions again..

Started by Dave J, March 24, 2025, 11:02:00 AM

Previous topic - Next topic

Dave J

I've set up a subscription called '1 Day Subscription'

I want it to start at midnight on day 1 and end at midnight on day 2.

When I set the status to 'Active' the member's subscription is activated straight away, which I don't want as I want the start time to be midnight. So would setting the status to finished automatically restart the subscription at midnight?

On this occasion I've disabled the subscription that started and set it back to nil in his account (I should add that this is a test account not a real member).

Sesquipedalian

When a payment notification is received and confirmed by subscriptions.php, the subscription always starts from the moment that the notification arrives. So if you create a subscription with a duration of one day, then a user who subscribes to it will have it for 24 hours from the time when the payment goes through.

You could try hacking up subscriptions.php to impose specific start and end times under certain conditions, but even apart from getting the code right, you'd also need to think carefully about the following:

  • What happens if the user subscribes to this midnight-to-midnight subscription at 11:00 pm? Is it fair to charge for a full day but only give them an hour? According to the laws governing your nation and/or the user's nation, could an angry user bring legal action against you for that?
  • When does midnight occur, anyway? Should this be midnight-to-midnight according to the forum's default time zone, the user's preferred time zone, UTC, or what? If you use the user's preferred time zone, what should happen if they change their time zone?

In light of those considerations, I myself would say that it is best to stick with letting a one day subscription mean 24 hours from the time when payment is received.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sir Osis of Liver

You could set start time for paid subs scheduled task for midnight.  That would end all expired subs at the desired time, but I think it would allow subs to range from 24 to 48 hours, depending on when payment is completed and sub is activated.
When in Emor, do as the Snamors.
                              - D. Lister

Dave J


Advertisement: