BILLmanager 6

Account automatic replenishment

Recurring payments are automatic deductions of funds, which occur at set intervals.  They do not require re-entering of bank card or e-wallet details. In BILLmanager, recurring payments are used to automatic replenishment a personal account (auto payment) and to create subscriptions. For more information about subscription settings, see Subscriptions.

In the case of using recurring payments for auto-replenishment of a personal account, the user once sets up automatic replenishment of the account and then his balance is replenished automatically as necessary.

Operating logic

In BILLmanager, automatic replenishment of the personal account occurs when the client's balance is insufficient to pay for a service with automatic renewal or daily debit.

Auto-payment is started by the command warnmoney in the cron scheduler once a day. The command is launched regardless of whether the previous payment was successful or not. If the client has autopayments configured, the system checks whether the client's services are eligible for debiting. The services are checked according to the LowMoneyNoticePeriod parameters in the configuration file. If the service falls under the conditions, the amount of its renewal is included in the autopayment and then every day at startup warnmoney tries to write off money from the linked card.

The amount of each recurring payment is formed from the projected expenses for the next month. BILLmanager counts the number of payments not from the first day of the month, but a month before the date of the next autopayment. Thus, if an autopayment is made on May 23, BILLmanager will count all autopayments from April 24 to May 23 inclusive.

Example: a client orders the Shared hosting service for 150 euro per month and activates the automatic renewal option. The client uses recurring payments. After he had paid for the service, he had 10 euro left on his account. So the estimated expenses for the next month is 140 euro. The system will make a recurring payment for 140 euro. On the third month, the system will pay the full price — 150 euro. 

If the automatic payment failed, the client will receive the error notification "Cannot complete automatic payment". 

Configuration

Admin area

Some payment methods support recurring payments: 

To enable recurring payments, navigate to ProviderPayment methodsEdit → check the Recurring payments box:

This checkbox is also available on a new payment method creation form ProviderPayment methodAddRecurring payments.

With this option enabled, the system will add new configuration fields specific to each payment method. For more information, refer to a certain payment method page.

Note
Automatically created payments for unpaid expenses can only be deleted manually. For more information, see the article Payment method settings.

Client area

Recurring payment management options can be found in Billing Auto payment. This menu section is hidden if the service provider has not configured the payment method supporting automatic invoicing. On the configuration form, a client can choose the desired payment method and enter the maximum payment amount. To create an auto-payment without the limit, leave the Maximum payment amount field blank.

When creating an autopayment, the system will not allow the client to leave the Maximum payment amount field empty if you have specified minimum or maximum payment amount restrictions in the payment method settings.

When the client has insufficient funds in his account for the automatic payment, BILLmanager will send to his email the notification that the monthly auto-payment limit has been reached". The notification is sent only after the first failed attempt to make the automatic payment. 

Eg., the total amount of auto-payments for the current month is 90 euro and the limit is 100 euro. Today is the day when the system will charge the account automatically for 20 euro. The upcoming autopayment amount will be 110 euro. This amount exceeds the specified limit, so BILLmanager will cancel the payment and email the notification to the client. 


Clicking Confirm will redirect the client into the payment system to allow for automatic payments to the provider's company.

How payment is created

The payment will be created provided that the client has insufficient funds on his account balance for renewing services with the enabled auto-renewal option and daily charges. The payment process starts right after creation.

A task to send notifications and top up the balance (if auto-payment is set):

BILLmanager low money notification
0 1 * * * /usr/local/mgr5/sbin/billmaintain --command warnmoney >/dev/null 2>&1
Parameters in the configuration file

A task to prolong services through saved payment methods or from the balance of personal account:

BILLmanager daily billing
15 0 * * * /usr/local/mgr5/sbin/billmaintain --command billdaily >/dev/null 2>&1
Parameters in the configuration file

If the system failed to make a payment 

Check logs 

If an error occurred during the payment process on the payment gateway side, the payment status in BILLmanager will be "New". The log file /usr/local/mgr5/var/logs/billmgr.log will contain the following information: 

core_module INFO Request [pm<payment_system>][root] 'func=payment.recurring.payerror&out=xml&payment=<payment_id>'
Where

To get information about an issue, open the log file of the corresponding payment system. 

Log files of payment systems

Invalid_token

If the payment system sends the response invalid_token, BILLmanager will use an expired or invalid authorization token. In this case, the log file of the payment system contains the following string:

libmgr ERROR Error: Type: '<payment_system>_error' Object: 'expired' Value: 'invalid_token'

To resolve the issue, set up a new auto-payment in the customer's client area:

  1. Go to Finances Auto-payment
  2. Disable the old auto-payment.
  3. Configure a new one.