M
M
Michael2017-07-25 11:23:27
Programming
Michael, 2017-07-25 11:23:27

How to auto-renew a subscription?

On what principle do auto-renewal of subscriptions work for services like google play, music and the like?
So far, there is an assumption that a certain daemon is running, which starts at a certain period of time and selects subscriptions that will expire in the near future, and write off money in advance.
So it is, all services are written off in advance? Or is it at the end of the subscription?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
aynur_safin, 2017-07-25
@aynur_safin

Run, for example every hour, checking the expiration of the subscription string for all clients.
If the subscription has expired and auto-renewal is enabled and there is money on the account (or the ability to deduct from the card) - we renew, if not - we block and send a message to the user (well, you can remind in advance).
If at some hour the check fails, it’s okay, you’ll think, the client will use the service for an hour more, in the next. the hour will be blocked or extended, unless of course you eliminate the cause of the failure during this hour by receiving an alarm from the service.

M
Maxim Fedorov, 2017-07-25
@qonand

As for google services, I won’t say, but renewing after the end of the current subscription is not a good option. There is a risk that the renewal process will be delayed, or some kind of failure will occur during its renewal, and this will accordingly lead to the fact that the user will not be able to use the functionality he needs for some time. Therefore, it is better to implement subscription renewal earlier, say, 5-10 minutes before the end of the current subscription (respectively, do it all through the daemon).

A
Alexander Aksentiev, 2017-07-25
@Sanasol

To begin with, you need to be a very trusted acquiring user in order to be allowed to make debits from the server side, i.e. you can’t just take and start signing people, and then automatically take money from the card at any time.
Or use a service that knows how to issue subscriptions, although it will already be an automatic machine on the side of the service and I have not seen / did not look for such Russians.
Well, or a rogue option - an advance payment and the user's balance from which the amount is debited, if any. This is already as you wish for the crown, etc.

P
Philipp, 2017-07-25
@zoonman

Everything works quite simply.
The user has a plan, a model of access to various features of your application is associated with it. By default, the user has a free plan.
There is a subscription queue, an entry is added to it when the next charge is made. If the debit succeeds, the current plan is extended. If the write-off fails, the reason is looked at, if this reason is of a financial nature, for example, there is not enough money in the account, then a free plan is installed for the client, and if the reason is of a technical nature, for example, the gateway is unavailable or does not perform operations today, then the task of extending for an hour is put in the queue / a day later. With this approach, the client does not lose access, but you do not lose money either. If there is some persistent problem on the gateway, then you have the opportunity to fix your infrastructure before you start receiving complaints from customers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question