HostOnNet Blog

Add Cash Payment option in WHMCS

Looking for Linux Server Admin or WordPress Expert? We can help.

To add Cash Payment option, you need to create a module based on

http://docs.whmcs.com/Bank_Transfer

Create file

modules/gateways/cash.php

With following content

<?php

# Cash Payment Gateway Module

if (!defined("WHMCS")) die("This file cannot be accessed directly");

function cash_config() {

    $configarray = array(
     "FriendlyName" => array(
        "Type" => "System",
        "Value" => "Cash Payment"
        ),
     "instructions" => array(
        "FriendlyName" => "Cash Payments Instructions",
        "Type" => "textarea",
        "Rows" => "5",
        "Value" => "Bank Name:\nPayee Name:\nSort Code:\nAccount Number:",
        "Description" => "The instructions you want displaying to customers who choose this payment method - the invoice number will be shown underneath the text entered above",
        ),
    );

    return $configarray;

}

function cash_link($params) {
    global $_LANG;

    $code = '<p>'.nl2br($params['instructions']).'<br />'.$_LANG['invoicerefnum'].': '.$params['invoiceid'].'</p>';

    return $code;

}

To Activate plugin, go to

Setup > Payments > Payment Gateways

On next Page, you will see the new Cash Payment Gateway. Click on it to activate.

whmcs_cash_paymnet_1

If you don’t show cash payment option during online order process, you can un-check the Show on Order Form check box.

whmcs_cash_paymnet_2

Posted in Windows

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.