Skip to content

Installing Contract Terms

Upload the files

Use one of the two methods.

Copy the folder

  1. Unpack the download.
  2. Copy the ContractTerms folder into your Paymenter installation so that the main class is at:

    extensions/Others/ContractTerms/ContractTerms.php
    

Upload the zip in the admin area

  1. In the admin area, open Extensions, then Available Extensions.
  2. Switch to the Ready to Install / Upload tab.
  3. Click Upload Extension, select the zip file and confirm. Paymenter accepts zip files up to 10 MB and moves the extension to extensions/Others/ContractTerms.

Install and enable

  1. Open Extensions, then Available Extensions, tab Ready to Install / Upload.
  2. Find Contract Terms (Jube Hosting) in the list and click Install, then confirm. Paymenter opens the extension's settings page.
  3. Switch on Enabled and save.

Installing and enabling both run the extension's database migration. It creates two tables:

Table Content
ext_contract_settings Contract terms per product
ext_service_contracts One contract per service

After enabling, two new entries appear in the admin navigation group Extensions: Contract Terms and Service Contracts. Customers get a My Contracts entry in their account navigation.

First-time setup

  1. On the extension's settings page, set the global defaults. See Configuration.
  2. For products that need different terms, add a row under Extensions > Contract Terms. See Configuration.
  3. If your shop already has services, create their contracts:

    php artisan contract-terms:sync
    

    To limit the run to one customer, pass the user ID:

    php artisan contract-terms:sync --user=42
    

Warning

Set the defaults and the per-product terms before you run contract-terms:sync. A contract copies the terms that apply at the moment it is created and keeps them. Changing the terms later does not change contracts that already exist.

The command goes through all services, regardless of their status, and creates a contract for every service that has a product and no contract yet. For an existing service the term starts on the day the service was created. If the cancellation deadline of that first term is already in the past and automatic renewal is on, the term is extended by the renewal term until the deadline is today or later.

The command prints a line such as Checked 120 services, created 118 contracts. The second number counts every service that has a contract after the run, including contracts that existed before.

Contracts are also created without the command: for every new service, when the status or expiry date of an existing service changes, and when a customer opens the service page while the contract box is enabled.

Updating

  • Upload: upload the new zip with Upload Extension. Paymenter replaces the folder and calls the extension's upgrade step, which runs any new migrations.
  • Manual copy: replace the extensions/Others/ContractTerms folder with the new version. To run new migrations, disable the extension, save, enable it again and save. Enabling runs the migrations.

Disabling and enabling does not delete data.

Disabling

Switch off Enabled on the extension's settings page and save. The tables and all contracts stay in the database. While the extension is disabled, no contracts are created or renewed, the customer pages and the contract box are gone, and immediate cancellations are processed by Paymenter as usual.

Uninstalling

  1. Open the extension's settings page under Extensions.
  2. Click Uninstall Extension and confirm.

Warning

Uninstalling drops both tables, ext_service_contracts and ext_contract_settings. All contracts, per-product terms and internal notes are deleted. Disable the extension instead if you only want to stop its behaviour.

After uninstalling you can delete the extensions/Others/ContractTerms folder.