BuiltByOtte Cloud is live: managed panel hosting, 30% off year one. Configure yours

Service Pausing for Paymenter

Install Service Pausing, add the button to your theme and pause a test service.

On this page

Requirements

  • Paymenter 1.x.
  • The Paymenter cron job. It keeps paused services out of billing and resumes them on time.
  • The Paymenter queue worker, to suspend and unsuspend the server.
  • Access to the theme files, to add the button to the service page.

1. Upload the extension

From the admin panel

  1. Go to Extensions → Available Extensions and click Upload Extension.
  2. Choose the zip you downloaded and upload it.
  3. Open the Ready to Install tab and click Install next to ServicePausing.

Over SFTP

  1. Extract the zip.

  2. Upload the ServicePausing folder to the extensions folder of Paymenter:

    /var/www/paymenter/extensions/Others/ServicePausing
    
  3. Give the web server user ownership of the files:

    chown -R www-data:www-data /var/www/paymenter/extensions/Others/ServicePausing
    
  4. Go to Extensions → Available Extensions, open the Ready to Install tab and click Install next to ServicePausing.

2. Enable the extension

  1. Go to Extensions → Extensions and edit ServicePausing.
  2. Turn on Enabled and save.

The extension creates its database tables when you enable it. Paused services appears under Pause in the admin menu.

3. Add the button to your theme

The pause button needs two small changes to the service page of your theme. For the default theme, open:

/var/www/paymenter/themes/default/views/services/show.blade.php

Change 1. Find the line that starts the button row:

@if($service->cancellable || $service->upgradable || count($buttons) > 0)

Replace it with:

@php($canPause = view()->exists('servicepausing::service-button')
    && \Paymenter\Extensions\Others\ServicePausing\Services\PausingService::isEligible($service))
@if($service->cancellable || $service->upgradable || count($buttons) > 0 || $canPause)

Change 2. A few lines lower, find:

<div class="mt-2 flex flex-row gap-2 flex-wrap">

Add this directly below it:

@if($canPause)
    @include('servicepausing::service-button')
@endif

Then clear the compiled views:

cd /var/www/paymenter
php artisan view:clear

If RenewAhead is already in that file, keep its lines and add these next to them, with both conditions in the same @if.

Make the change again when a Paymenter update replaces the theme file.

4. Test it

Open an active test service that is older than 30 days. Click the pause button, choose a number of days and confirm. The service is paused and the server is suspended.

Last updated

Still stuck? Open a ticket on the help page or ask in Discord. Mention your version and what you tried.