Payment links
Overview
Payment links module enables your customers to pay for their invoices without the need to log-in. When the new invoice is generated the customer can receive a "pay now" link which once visited will automatically log the client in only to make a payment. If the customer attempts to visit any HostBill section unrelated to the payment session, they will be automatically logged out.
Activating the module
- If the plugin is included in your HostBill edition you can download it from your client portal.
- If the plugin is not included in your HostBill edition you can purchase it from our marketplace and then download it from the client area.
- Once you download the plugin extract it in the main HostBill directory.
- Go to Settings → Modules, find and activate Pay Now plugin.
- The plugin does not require any additional configuration.Â
Adding payment link to email template
When sending a new invoice to the customer over email HostBill uses Client: Invoice:New email template (Settings → Email Templates → Client Emails).Â
You should edit this email and add following variable to it (this variable will be replaced with valid PayNow url):
Make a fast payment for this invoice: {$invoice.db_id|paymenturl}
Adding Payment link as QR code to PDF invoice template
If using HostBill 2023-11-27 or higher, You can update invoice template in Document templates section, in your code you can add QR code with payment link using following block.
Note that this change will only affect PDF invoice, you would not see a QR code on HTML version of invoice
<barcode code="{$invoice.db_id|paymenturl}" type="QR" class="barcode" size="1" error="M" disableborder="1" />
Generating payment link using Admin API
Payment Links module extends HostBill's admin API by adding new call for it:Â payNowGenerateÂ
When executed, API will return paynow_url in JSON response body, allowing your customer to make payment without login.
Required Paramters:
- invoice_id - unpaid invoice id to generate payment link for
Sample Request:
GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=payNowGenerate&invoice_id=ID
Sample Response:
{ "paynow_url": "https://url.to.your.hostbill/?cmd=paynow&id=2tg13412crt123gasd2345123t13452431tg23451234", "success": "true" }