whmcs / sample-provisioning-module Goto Github PK
View Code? Open in Web Editor NEWSample provisioning/server module for WHMCS
License: MIT License
Sample provisioning/server module for WHMCS
License: MIT License
I am trying to create a provisioning module for whmcs based on the documentation.
According to loader function sections I have created my own function.
But I get the following error
No server found so unable to fetch values
I tested, the loader function is not called.
php version 7.4.4
whmcs version 8.5.2
$params in config function
{
"whmcsVersion": "8.5.2-release.1",
"producttype": "other",
"isAddon": false,
"action": "ConfigOptions"
}
main code:
<?php
if (!defined("WHMCS")) {
die("This file cannot be accessed directly");
}
function perstashoplancher_MetaData()
{
return array(
'DisplayName' => 'some str',
'APIVersion' => '1.1',
'RequiresServer' => true
);
}
function perstashoplancher_getallpackages($params)
{
return array('test' => 'Test', 'test1' => 'Test1');
}
function perstashoplancher_ConfigOptions($params)
{
return array(
"package_name" => array(
"FriendlyName" => "some str",
"Type" => "text",
"Size" => '25',
"Description" => "some str",
'Loader' => 'perstashoplancher_getallpackages',
"SimpleMode" => true
),
// another fields...
);
}
I can't get the "_TestConnection()" function to work as described here: https://github.com/WHMCS/sample-provisioning-module/blob/master/modules/servers/provisioningmodule/provisioningmodule.php#L381
I return an array just like the example shows, but if I press the "Test Connection" button in the server settings, a loading wheel next to the button spins indefinitely. I know my code is executing fine, because I can use the "logModuleCall()" function to log expected values to the module debug log right before I return the array.
I also notice that "_TestConnection()" is not listed as a supported function in the documentation: https://developers.whmcs.com/provisioning-modules/supported-functions/
It seems like something about this function isn't documented right.
Hello,
i'm missing any documentation or example about the "Add-On Feature" function, which is available since whmcs 8.2.
In my provisioning module, i want to create an object in a database.
I have to save the objectId of this object for downgrade/upgrades for example.
How can i save a new field in this function ?
How can i get Server Detail in ConfigOptions?
I need to set options dynamic.
Please help me asap.
Hey,
i don't figure out, how to add custom Fields, like a Dropdown in the Server Details at "Setup > Products/Services > Servers". Does somebody knows it? The documentation is not very helpful there....
Hello,
Is there any way we can update Provisioning Module's Configuration Options programmatically? Like querying localAPI
Something Like
$command = 'UpdateModuleConfiguration';
$post_data = array(
'moduleType' => 'provisioning',
'moduleName' => 'modulename',
'parameters[configoption1]' => 'some new value'
);
$admin_username = 'admin';
$result = localAPI($command, $post_data, $admin_username);
Thanks!
It would be really awesome, if WHMCS would be downloadable via composer, and you could define all your own modules using compose.json... this would actually make updating WHMCS even easier for people who use their own implemented modules and use of additional vendor components also.
That also means that please restrain your original composer.json and composer.lock as well..(since it is effectively public.. everyone already knows that you use composer.. stop hiding that
The provisioningmodule_ConfigOptions function don't have input parameters, or not at least the full list of them.
It will be very easy for the developers if some of the server connection parameters are passed in this function to, so we could avoid manually fetching server connection data and decryption it's password.
According to https://developers.whmcs.com/provisioning-modules/supported-functions/ there is a Renew method that get's called as soon as a renewal invoice is paid.
However it's unclear what request parameters are available. I would need to know for example for how long I need to renew the hosting subscription. i.e. what the new expiry date should be.
Can you please update the example code to reflect this?
Good afternoon, you need to create a VPS reseller module for WHMCS according to the API documentation
Here is the documentation: https://docs.hostkey.com/xwiki/bin/view/API documentation/
Payment of $100
I would like to know if language override are possible on provisioning modules, and if so, where to store them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.