Quantcast
Channel: WHMCS Community Forums
Viewing all 13458 articles
Browse latest View live

Custom Third Party Gateway

$
0
0
I am integrating alliedwallet.com quick pay which is third party payment gateway.

It is simple as I configured and forwarding all relevant detail to gateway and once I made payment there and returned back to invoice page its not marking invoice paid.


Here is my configration file.

PHP Code:

<?php
/**
 * WHMCS Sample Payment Gateway Module
 *
 * Payment Gateway modules allow you to integrate payment solutions with the
 * WHMCS platform.
 *
 * This sample file demonstrates how a payment gateway module for WHMCS should
 * be structured and all supported functionality it can contain.
 *
 * Within the module itself, all functions must be prefixed with the module
 * filename, followed by an underscore, and then the function name. For this
 * example file, the filename is "alliedwallet" and therefore all functions
 * begin "alliedwallet_".
 *
 * If your module or third party API does not support a given function, you
 * should not define that function within your module. Only the _config
 * function is required.
 *
 * For more information, please refer to the online documentation.
 *
 * @see http://docs.whmcs.com/Gateway_Module_Developer_Docs
 *
 * @copyright Copyright (c) WHMCS Limited 2015
 * @license http://www.whmcs.com/license/ WHMCS Eula
 */

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

/**
 * Define module related meta data.
 *
 * Values returned here are used to determine module related capabilities and
 * settings.
 *
 * @see http://docs.whmcs.com/Gateway_Module_Meta_Data_Parameters
 *
 * @return array
 */
function alliedwallet_MetaData()
{
    return array(
        
'DisplayName' => 'Sample Payment Gateway Module',
        
'APIVersion' => '1.1'// Use API Version 1.1
        
'DisableLocalCredtCardInput' => true,
        
'TokenisedStorage' => false,
    );
}

/**
 * Define gateway configuration options.
 *
 * The fields you define here determine the configuration options that are
 * presented to administrator users when activating and configuring your
 * payment gateway module for use.
 *
 * Supported field types include:
 * * text
 * * password
 * * yesno
 * * dropdown
 * * radio
 * * textarea
 *
 * Examples of each field type and their possible configuration parameters are
 * provided in the sample function below.
 *
 * @return array
 */
function alliedwallet_config()
{
    return array(
        
// the friendly display name for a payment gateway should be
        // defined here for backwards compatibility
        
'FriendlyName' => array(
            
'Type' => 'System',
            
'Value' => 'Allied Wallet',
        ),
        
// a text field type allows for single line text input
        
'accountID' => array(
            
'FriendlyName' => 'Merchant ID',
            
'Type' => 'text',
            
'Size' => '25',
            
'Default' => '',
            
'Description' => 'Enter your account ID here',
        ),
        
// a text field type allows for single line text input
        
'siteID' => array(
            
'FriendlyName' => 'SiteID',
            
'Type' => 'text',
            
'Size' => '25',
            
'Default' => '',
            
'Description' => 'Enter your site ID here',
        ),
        
// a password field type allows for masked text input
        
'secretKey' => array(
            
'FriendlyName' => 'Secret Key',
            
'Type' => 'text',
            
'Size' => '25',
            
'Default' => '',
            
'Description' => 'Enter secret key here',
        ),
        
// the yesno field type displays a single checkbox option
        
'testMode' => array(
            
'FriendlyName' => 'Test Mode',
            
'Type' => 'yesno',
            
'Description' => 'Tick to enable test mode',
        ),

    );
}

/**
 * Payment link.
 *
 * Required by third party payment gateway modules only.
 *
 * Defines the HTML output displayed on an invoice. Typically consists of an
 * HTML form that will take the user to the payment gateway endpoint.
 *
 * @param array $params Payment Gateway Module Parameters
 *
 * @see http://docs.whmcs.com/Payment_Gateway_Module_Parameters
 *
 * @return string
 */
function alliedwallet_link($params)
{
    
// Gateway Configuration Parameters
    
$accountId $params['accountID'];
    
$siteID $params['siteID'];
    
$secretKey $params['secretKey'];
    
$testMode $params['testMode'];
    
$dropdownField $params['dropdownField'];
    
$radioField $params['radioField'];
    
$textareaField $params['textareaField'];

    
// Invoice Parameters
    
$invoiceId $params['invoiceid'];
    
$description $params["description"];
    
$amount $params['amount'];
    
$currencyCode $params['currency'];

    
// Client Parameters
    
$firstname $params['clientdetails']['firstname'];
    
$lastname $params['clientdetails']['lastname'];
    
$email $params['clientdetails']['email'];
    
$address1 $params['clientdetails']['address1'];
    
$address2 $params['clientdetails']['address2'];
    
$city $params['clientdetails']['city'];
    
$state $params['clientdetails']['state'];
    
$postcode $params['clientdetails']['postcode'];
    
$country $params['clientdetails']['country'];
    
$phone $params['clientdetails']['phonenumber'];

    
// System Parameters
    
$companyName $params['companyname'];
    
$systemUrl $params['systemurl'];
    
$returnUrl $params['returnurl'];
    
$langPayNow $params['langpaynow'];
    
$moduleDisplayName $params['name'];
    
$moduleName $params['paymentmethod'];
    
$whmcsVersion $params['whmcsVersion'];

    
$url 'https://quickpay.alliedwallet.com';

    
$postfields = array();
    
$postfields['MerchantID'] = $accountId;
    
$postfields['QuickPayToken'] = $secretKey;
    
$postfields['SiteID'] = $siteID;

    
$postfields['MembershipRequired'] = 'false';
    
$postfields['ShippingRequired'] = 'false';

    
$postfields['ItemName[0]'] = $invoiceId;
    
$postfields['ItemQuantity[0]'] = '1';
    
$postfields['ItemDesc[0]'] = $description;
    
$postfields['ItemAmount[0]'] = $amount;

    
$postfields['MerchantReference'] = $invoiceId;
    
$postfields['ItemAmount[0]'] = $amount;
    
$postfields['AmountTotal'] = $amount;
    
$postfields['CurrencyID'] = $currencyCode;

    
$postfields['FirstName'] = $firstname;
    
$postfields['LastName'] = $lastname;
    
$postfields['Email'] = $email;
    
$postfields['Address'] = $address1;
    
$postfields['Address2'] = $address2;
    
$postfields['City'] = $city;
    
$postfields['State'] = $state;
    
$postfields['PostalCode'] = $postcode;
    
$postfields['Country'] = $country;
    
$postfields['Phone'] = $phone;

    
$postfields['ConfirmURL'] = $systemUrl '/modules/gateways/callback/' $moduleName '.php';
    
$postfields['ApprovedURL'] = $returnUrl;
    
$postfields['DeclinedURL'] = $returnUrl;

    
$htmlOutput '<form method="post" action="' $url '">';
    foreach (
$postfields as $k => $v) {
        
$htmlOutput .= '<input type="hidden" name="' $k '" value="' urlencode($v) . '" />';
    }
    
$htmlOutput .= '<input type="submit" value="' $langPayNow '" />';
    
$htmlOutput .= '</form>';

    return 
$htmlOutput;
}



------------------------------------------

And here is callback file.

PHP Code:

<?php
/**
 * WHMCS Sample Payment Callback File
 *
 * This sample file demonstrates how a payment gateway callback should be
 * handled within WHMCS.
 *
 * It demonstrates verifying that the payment gateway module is active,
 * validating an Invoice ID, checking for the existence of a Transaction ID,
 * Logging the Transaction for debugging and Adding Payment to an Invoice.
 *
 * For more information, please refer to the online documentation.
 *
 * @see http://docs.whmcs.com/Gateway_Module_Developer_Docs
 *
 * @copyright Copyright (c) WHMCS Limited 2015
 * @license http://www.whmcs.com/license/ WHMCS Eula
 */

// Require libraries needed for gateway module functions.
require_once __DIR__ '/../../../init.php';
require_once 
__DIR__ '/../../../includes/gatewayfunctions.php';
require_once 
__DIR__ '/../../../includes/invoicefunctions.php';

// Detect module name from filename.
$gatewayModuleName basename(__FILE__'.php');

// Fetch gateway configuration parameters.
$gatewayParams getGatewayVariables($gatewayModuleName);

// Die if module is not active.
if (!$gatewayParams['type']) {
    die(
"Module Not Activated");
}

// Retrieve data returned in payment gateway callback
// Varies per payment gateway
$success $_POST["TransactionStatus"];
$invoiceId $_POST["MerchantReference"];
$transactionId $_POST["TransactionID"];
$paymentAmount $_POST["Amount"];
#$paymentFee = $_POST["x_fee"];


$transactionStatus $success 'Successful' 'Failure';


/**
 * Validate Callback Invoice ID.
 *
 * Checks invoice ID is a valid invoice number. Note it will count an
 * invoice in any status as valid.
 *
 * Performs a die upon encountering an invalid Invoice ID.
 *
 * Returns a normalised invoice ID.
 */
$invoiceId checkCbInvoiceID($invoiceId$gatewayParams['name']);

/**
 * Check Callback Transaction ID.
 *
 * Performs a check for any existing transactions with the same given
 * transaction number.
 *
 * Performs a die upon encountering a duplicate.
 */
checkCbTransID($transactionId);

/**
 * Log Transaction.
 *
 * Add an entry to the Gateway Log for debugging purposes.
 *
 * The debug data can be a string or an array. In the case of an
 * array it will be
 *
 * @param string $gatewayName        Display label
 * @param string|array $debugData    Data to log
 * @param string $transactionStatus  Status
 */
logTransaction($gatewayParams['name'], $_POST$transactionStatus);

if (
$success) {

    
/**
     * Add Invoice Payment.
     *
     * Applies a payment transaction entry to the given invoice ID.
     *
     * @param int $invoiceId         Invoice ID
     * @param string $transactionId  Transaction ID
     * @param float $paymentAmount   Amount paid (defaults to full balance)
     * @param float $paymentFee      Payment fee (optional)
     * @param string $gatewayModule  Gateway module name
     */
    
addInvoicePayment(
        
$invoiceId,
        
$transactionId,
        
$paymentAmount,
        
$gatewayModuleName
    
);

}

----------------------------

Gateway return status is: TransactionStatus and result is for success: Successful

There is no error on success transcation but its not making invoice paid. Can any one point where is issue?

Thanks,
Raza

Tickets ids not listed in Intelligent search results

$
0
0
Hi All. While searching a customer name in the WHMCS intelligent search bar, we generally get the Client name, contact, support tickets etc in the search results.
However some searches using the customer name or company name or email address does not display the tickets but only the client and contact. I noticed this mainly happens for customer having gmail ids or live.com ids. The only option that works is to get the client profile and use the View all Support ticket option. Any help with a work around to display the tickets also using the intelligent search? Thank you.

Cart+

$
0
0
Cart+ (Cart Plus) extends the poor design of WHMC product listing by giving you the ability to insert a product page between the Product listing and Add to Cart. Mainly focus to those who are using WHMCS for anything other than Hosting, but even for Hosting plans works fine as you can add plenty of details. Works with Products and Bundles too.

What extra information you can add:
  1. First of all you'll decide what type of page template the product will uses:
    1. None. In this case in the listing the button will links to cart.
    2. Page with tabs. This is for those who add lot of data
    3. Simple page. In this case all data will appear on the same (long) page

  2. Product details using HTML editor
  3. Requirements
  4. Main Photo
  5. Photo Gallery
  6. File attachments
  7. Links (eg Forums, Support, FAQ etc). Depending on your settings (per Link) you can open the link in new window or on the same window).
  8. Versions
  9. Comments. Comments work globally and/or per product. Available options:
    1. No Comments
    2. Disqus comments
    3. Facebook comments

  10. Rich content Social share to Facebook, Twitter, Google+
  11. Licenses. This is very nice feature for those (eg selling themes and/or modules) who have different version. The product detail page is one but they can link as many hidden products they want
  12. For Links & Licenses you can set even the button collor and for Licenses, in addition, the text to appear. eg Buy Now for most cases, but if it's a free download maybe you want to show "Download it".


There are also some global features like:
  1. Currency converter in product pages
  2. Has its onwn product.tpl, child template of standard_cart template but you can edit file theme.yaml and change to your own theme.
  3. Unlike WHMCS product listing which displays products and bandles on the same listing, Cart+ displays bundles in the sidebar so they're more well visible.


I'm preparing some screenshots to include but you can give a look in my site: https://www.teriakis.com/cart.php

Chris
Attached Images

Client login problem after updating to WHMCS 7.2.1

$
0
0
After updating to WHMCS 7.2.1 all the users need to reset their password to login.
When they will logout then again they need to reset their password.
This issue is happening for every client.
Any solution for this?

cPanel usage statistics not updating

$
0
0
I am having an issue with the usage report for hosting packages, the usage report has not update since 16/05/2017. Manual update also does not work.

Bug Error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'where clause' in /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php:333
Stack trace:
#0 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(333): PDO->prepare('select * from `...')
#1 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\D atabase\MySqlConnection), 'select * from `...', Array)
#2 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#3 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select * from `...', Array, Object(Closure))
#4 /home/kdhosting/public_html/members/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select * from `...', Array, true)
#5 /home/kdhosting/public_html/members/vendor/illuminate/database/Query/Builder.php(1569): Illuminate\Database\Query\Builder->runSelect()
#6 /home/kdhosting/public_html/members/vendor/illuminate/database/Eloquent/Builder.php(624): Illuminate\Database\Query\Builder->get(Array)
#7 /home/kdhosting/public_html/members/vendor/illuminate/database/Eloquent/Builder.php(316): Illuminate\Database\Eloquent\Builder->getModels(Array)
#8 /home/kdhosting/public_html/members/modules/servers/plesk/plesk.php(0): Illuminate\Database\Eloquent\Builder->get()
#9 /home/kdhosting/public_html/members/vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php(0): plesk_UsageUpdate(Array)
#10 /home/kdhosting/public_html/members/vendor/whmcs/whmcs-foundation/lib/Module/Server.php(0): WHMCS\Module\AbstractModule->call('UsageUpdate', Array)
#11 /home/kdhosting/public_html/members/includes/modulefunctions.php(0): WHMCS\Module\Server->call('UsageUpdate', Array)
#12 /home/kdhosting/public_html/members/modules/reports/disk_usage_summary.php(13): ServerUsageUpdate()
#13 /home/kdhosting/public_html/members/admin/reports.php(0): unknown()
#14 {main}
Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'where clause' (SQL: select * from `tblhosting` where `server` = 1 and `status` in (Active, Suspended)) in /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php:713
Stack trace:
#0 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#1 /home/kdhosting/public_html/members/vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select * from `...', Array, Object(Closure))
#2 /home/kdhosting/public_html/members/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select * from `...', Array, true)
#3 /home/kdhosting/public_html/members/vendor/illuminate/database/Query/Builder.php(1569): Illuminate\Database\Query\Builder->runSelect()
#4 /home/kdhosting/public_html/members/vendor/illuminate/database/Eloquent/Builder.php(624): Illuminate\Database\Query\Builder->get(Array)
#5 /home/kdhosting/public_html/members/vendor/illuminate/database/Eloquent/Builder.php(316): Illuminate\Database\Eloquent\Builder->getModels(Array)
#6 /home/kdhosting/public_html/members/modules/servers/plesk/plesk.php(0): Illuminate\Database\Eloquent\Builder->get()
#7 /home/kdhosting/public_html/members/vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php(0): plesk_UsageUpdate(Array)
#8 /home/kdhosting/public_html/members/vendor/whmcs/whmcs-foundation/lib/Module/Server.php(0): WHMCS\Module\AbstractModule->call('UsageUpdate', Array)
#9 /home/kdhosting/public_html/members/includes/modulefunctions.php(0): WHMCS\Module\Server->call('UsageUpdate', Array)
#10 /home/kdhosting/public_html/members/modules/reports/disk_usage_summary.php(13): ServerUsageUpdate()
#11 /home/kdhosting/public_html/members/admin/reports.php(0): unknown()
#12 {main}

change the default currency

$
0
0
Hello, good day, we've some problems trying to reconfigure the currency in our whmcs, right now the default currency is Bs but we wan't to change it because we need than will be american dollar... we setup the dollar currency and we put 1.0000 as Base conversion rate, then we go to Bs currency but isn't enable the input box for Base conversion, please refer to the image
Screenshot_2.png

what could be the best way for change the default currency to US dollar?

we tried changing the prefix,currenc code and value from Bs to dollar for the default currency, then we change also the dollar to Bs for the second currency, unfortunately this mades a mess in our whmcs and the Bulk Pricing Updater stop working

please let me know how can achieve this, thank you!!!

Best regards and have a wonderful day!!!
Attached Images

What is wrong with my JSON results?

$
0
0
Ok, this may be dumb, but I'm really struggling with processing the data from a JSON result from the API with PHP.

Using exactly the official example on my tests:
https://developers.whmcs.com/api-ref...lientsdomains/



I cannot access any results with PHP.


The results are there and I get the correct information with the API call, as I can see the data with:
var_dump($jsonData);


I'm not sure why, but I get a nicer output using instead:
print_r($jsonData);


Either way, my problem is that I cannot access any variable from PHP or turn them into variables.


No output. An example I tried using:
$domain_one = $jsonData[0]["domainname"];


Nothing.


I tried multiple variations, and I can't get anything. The WHMCS documentation does not explain how to convert them into variables either with PHP but this is supposed to work with JSON arrays, 0 is the first one, 1, is the second and so on. My problem is not with getting the data. The JSON data is there and the API works fine. It is how to process or use the data after getting the results.

Query domain pricing and filter by client group.

$
0
0
Hi all,
I'm trying to write a query to find domain pricing of a client group.
This is my query to list all domain pricing.

PHP Code:

select tbldomainpricing.extensiontblpricing.*
from tbldomainpricing join tblpricing on tbldomainpricing.id tblpricing.relid
where type in
('domainregister''domaintransfer''domainrenew'); 

Now how i can filter the result by client group ?

Thanks.

Pending Product upgrade

$
0
0
Yesterday I performed an upgrade for a client (from Silver to Gold product), but the procedure didn't really do the upgrade (I'm on WHMCS 7.2.1 with DirectAdmin)

- Logged in as admin
- Went to client panel and logged in as client
- Performed upgrade as client
- Pending upgrade was reported in the admin system, wich I confirmed
- Order Confirmation mail was sent out
- Invoice was made, but apparently NOT sent to customer (I'm not 100% about this)

BUT ...

- Product did not change in WHMCS (stayed Silver)
- Product did not change in DirectAdmin (stayed Silver)

SO ...

I tried to redo the upgrade, but this time as admin (by pressing the upgrade product button in the admin panel)
But I get the notification "Upgrade Already In Progress Cannot Upgrade/Downgrade because the product already has an Upgrade/Downgrade in progress."

Cron did run (every 5 minutes), and daily cron ran also (at midnight), but no changes to the client product.

Help ? :)

Using Affiliate Balance to pay Hosting bill

$
0
0
Is it possible to somehow use the Affiliate Balance to auto pay for the hosting bill each month?

I know I can credit his hosting account and subtract the affiliate balance manually but the problem is that he would have to contact me and remind me each time he wants to do this. It would be much more convenient if he can use his affiliate balance as hosting credit.

DNSbe module by Tools 4 ISP

$
0
0
Below a number of options you can do with this DNSbe Module. Your orders are executed directly by the registrar, this is made possible by the built-in API. Registering and changing a domain name has never been easier with WHMCS. Control over the entire domain name... You can all do it easy with this WHMCS DNSbe Module.

Functions WHMCS DNSbe Module

Register domain
Domain Transfer
Domain cancel
Domain renewal
Provide EPP Code
Managing DNSsec settings
Managing DNS Settings (coupling with PowerDNS)
Changing Name Servers
Change contact information (holder / tech / admin)
Automatically process incoming transfers

Price will be calculated in Euro, a one time fee € 200,-

https://marketplace.whmcs.com/product/2194

http://tools4isp.com/module-whmcs-dnsbe.html

Questions please ask here or send us a mail.

How Can I Becomer an Expert Web Developer

$
0
0
I want to be a skilled website Developer, i'm looking out a some best web development firms and companies for internship? Please share best web development companies list with me!

Best Android App Development Companies

$
0
0
I am a business owner and searching best android app Development Company for my business app. I found some companies in google WillowTree, Inc., Appster, Fueled, Etc. I’m confuse to pick out one best robot app development company, If anyone have experience with any company then please suggest me or also share a list of most-trusted android app development companies.

No logo image is available at 7.2.1

$
0
0
After updating to 7.2.1 the template six stopped displaying the logo, now it shows a text with the name of my company.
I could help to correct this, I need to show my company logo
Attached Images

template Six in 7.2.1

$
0
0
After updating to 7.2.1 the template six stopped displaying the logo, now it shows a text with the name of my company.
I could help to correct this, I need to show my company logo
magazine10.png
Attached Images

Why is There No Support from Whmcs

$
0
0
I just purchased a license and there is no support from them.

I believe they think you know everything about Whmcs, well I do not.

I made 3 tickets to them and not one was answered, they refuse to answer anything. I think they want you to pay $30 to get support.

I did not move to this to get this ridiculous service.

I am paying for a monthly service, so give me some kind of support.

I think everyone should leave this company until they fix this no support issue.

Sudden Error After 7.2.1 Upgrade

$
0
0
Upgraded a few days ago. I just noticed now in admin > products page (configproducts.php) I get this

Quote:

Oops!
Something went wrong and we couldn't process your request.
Please go back to the previous page and try again.

What is this about? System health all good too.

Change backend site name

$
0
0
The backend site name title says WHMCS, I want to change this to my company name.

How do I do this?

Thanks!

Customizing WHMCS Administration Area Issues

$
0
0
I am trying to customize WHMCS admin area and the changes I am saving aren't being applied to WHMCS. Your help is appreciated!

CSS

FILE: whmcs/administration/templates/login.css
body {
background-color: #fff !important;
}

FILE: whmcs/administration/templates/lara/css/all.min.css
table.datatable th {
border-radius:0px; background-color:#3076be;
}


IMAGES
I also uploaded a new image called whmcs.png and placed it in this folder (whmcs/assets/img) overwriting the original image but the new image isn't displaying on the login screen.

How to add a image to downloads?

$
0
0
I am adding some custom themes to our download section and would to be able to add images for people to preview the template first.

Is there a way to add images to the download item section?
Viewing all 13458 articles
Browse latest View live