Joining payments for the Prepay model
Joining payments for an account allows creating a single payment from several payments linked to prepaid orders.
In the platform, payments can be joined as follows:
- Automatically — if a reseller selected the Unite payments for prolong and renew orders checkbox in the system settings (see General system settings, the Prepaid settings section). The automatically created joined payment is always linked to several prepaid prolong or renewal orders.
- Manually — via the Customer Control Panel only (see Join payments in the Customer Control Panel guide). The manually created joined payment may not be linked to several orders, but may include top-up payments.
In this article:
Automatic joining payments for the Prepay model
Automatic creating a joined payment linked to several orders
Automatic creating a joined payment linked to several orders for the Prepay model is performed as follows:
- The platform attempts to join payments for an account every night when the billing process has completed the following actions:
- Create the required prolong orders and renewal orders for the account's subscriptions.
- Attempt to pay from the account balance for the created prolong orders — if the current date is the date specified in the Paid to attribute of the subscriptions (see Prolonging a subscription).
- Attempt to pay from the account balance for the created renewal orders — if the current date is the expiration date for the subscriptions with the activated Auto-renew option (see Auto-renewing a subscription).
- For created orders, the platform joins the linked payments if a payment complies with all the following conditions:
- The payment has the Waiting for payment status.
- The payment is linked to an order of one of the following types:
- Prolong order regardless of the status of the Auto-renew option of the subscription.
- Renewal order for the subscription with the activated Auto-renew option.
- For orders with the joined payments:
- The linked payments are cancelled.
- A single joined payment is created:
- The amount of the joined payment is equal to the sum of the linked orders.
- The joined payment has the Waiting for payment status.
- When a joined payment is created, the platform generates the Joined payment created event.
- For orders with the linked payments that are not included in the joined payment (including the case when only one order was created by the billing process), the platform generates the Order created events.
Automatic completing a joined payment linked to several orders
Automatic completing a joined payment linked to several orders is performed as follows:
- The platform attempts to complete a joined payment from the account balance when any of the following occurs:
- The current date is the date specified in the Paid to attribute of a subscription for any of the linked orders.
- The current date is the expiration date of a subscription for any of the linked orders.
- If the account balance has sufficient funds, after completing the joined payment, all linked orders are completed too.
- If the account balance does not have sufficient funds, only the subscriptions triggered the process of completing the joined payment are stopped. The joined payment remains in the Waiting for payment status.