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
- Go to Extensions → Available Extensions and click Upload Extension.
- Choose the zip you downloaded and upload it.
- Open the Ready to Install tab and click Install next to ServicePausing.
Over SFTP
-
Extract the zip.
-
Upload the
ServicePausingfolder to the extensions folder of Paymenter:/var/www/paymenter/extensions/Others/ServicePausing -
Give the web server user ownership of the files:
chown -R www-data:www-data /var/www/paymenter/extensions/Others/ServicePausing -
Go to Extensions → Available Extensions, open the Ready to Install tab and click Install next to ServicePausing.
2. Enable the extension
- Go to Extensions → Extensions and edit ServicePausing.
- 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.