Git Product home page Git Product logo

developer-docs's Introduction

developer-docs's People

Contributors

alexnightingale123456 avatar beetus1actual avatar chew avatar davidneimeyer avatar downsc avatar jas8522 avatar jrawly avatar jstanford87 avatar l-four avatar markhughes avatar mattpugh avatar mikehayesuk avatar netniv avatar petebishwhip avatar sarahkiniry avatar timucingelici avatar walid-mashal avatar whmcs-ben avatar whmcs-jimmy avatar whmcs-john avatar whmcs-juan avatar whmcs-pete avatar whmcs-smueller avatar whmcschance avatar whmcsjames avatar whmcsjonathan avatar whmcslawrence avatar whmcsmarcus avatar whmcsnathan avatar whmcspeter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

developer-docs's Issues

Unclear reference to "page 7"

I am doing some maintenance on an existing project that uses WHMCS Third Party Gateways. In trying to research my issue, I came across the page located here. It says "...refer to the Refund section on page 7 of the sample module."

From my Googling "WHMCS sample module", it appears there are a whole lot of sample modules, none of which seem to have pages. Could you please link the correct sample module and page to this confusing part of the text? I only started working with WHMCS two days ago and I'm not sure how all of it works, but this looks like something I should be able to click a link on to refer to.

Thank you very much!

WHMCS API GetClientCustomFields

Did GetClientCustomFields get dropped? If so, at what version was this removed? I do not see it listed in the (current) API Index.

UpdateInvoice API

Hello,

Guys I think UpdateInvoice Request Parameter newitemdescription newitemamount newitemtaxed Description Need a update. It only accept array. For example

'newitemdescription' => 'Updated Invoice Item' , 'newitemamount' => 100, 'newitemtaxed' => false
Code above not work, then i try the following. And it working.
'newitemdescription' => array('0' => 'Updated Invoice Item' ), 'newitemamount' => array('0' => 100 ), 'newitemtaxed' => false

Integration issues with Bluepay gateway

Hi,

I have configured whmcs with bluepay and the payment is getting charged. There is only one issue that whmcs is unable to fetch customer's email address and phone number to send to the bluepay system. I talked to them several times and they told me that it's a whmcs issue. Please see what they told:

We are not receiving the phone number or email address data within the transaction request on the BluePay gateway. Can you please verify which fields email address and phone number are mapped to within your whmcs software. The correct field names are below.

Email address = EMAIL
Phone number = PHONE

Tommy Miller
Integration Analyst
Direct: 630.300.2439
[email protected]

Please help me in getting this fixed. Your help will be highly appreciated.

Custom API functions

Hey,

I've been working with WHMCS for quite some time now. Great job btw.

For the project I am working on right now, I am using the API a lot. But it has some shortcomings for what I am doing right now.

A quick sketch:

WHMCS will be used in this case as a pure client management system and provisioning system. All other tasks happen in a standalone laravel/angular web app. Basically, we are creating a whole new front end and backend on a separate system. The reason why we are doing this is that we started developing our own public and internal API and most of our modules are accessible trough this API, this is where WHMCS was giving me a headache. To let everything work well with each other we need some extra API functions in WHMCS. After a lot of experimenting and reading outdated blog posts, I managed to write custom API functions in WHMCS. Maybe it isn't a bad idea to include this in the documentation.

A quick and dirty example how I created a new API function in WHMCS to return some information about the company:

<?php
use Illuminate\Database\Capsule\Manager as Capsule;

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

  function get_env($vars) {
    $array = array('action' => array(), 'params' => array());
    if(isset($vars['cmd'])) {
      //Local API mode
      $array['action'] = $vars['cmd'];
      $array['params'] = (object)$vars['pid'];
      $array['adminuser'] = $vars['adminuser'];
   
    } else {
      //Post CURL mode
      $array['action'] = $vars['_POST']['action'];
      unset($vars['_POST']['username']);
      unset($vars['_POST']['password']);
      unset($vars['_POST']['action']);
      $array['params'] = (object)$vars['_POST'];
    }
    return (object)$array;
  }
   
  try {
   // Get the arguments
    $vars = get_defined_vars();
    $postFields = getParam($vars);

    $data = Capsule::table('tblconfiguration')->get();

    $data = array(
      'companyname' => $data{1}->value,
      'email'       => $data{2}->value,
      'logo'        => $data{4}->value,
      'tos'         => $data{24}->value,
      'address'       => str_replace("\r\n","<br>", $data{40}->value),
    );

    $apiresults = array(“result” => “success”, data => $data);
  } catch (Exception $e) {
    $apiresults = array(“result” => “error”, “message” => $e->getMessage());
  }


?>

This works, but how can this be improved, what are some security measures that I have to include,... I would love to read more about creating custom API functions.

Keep up the good work,
Ilyas

GetTLDPricing Api not working

I am calling the WHMCS api "GetTLDPricing" but i am not getting any results. i am getting only response like {"result":"error","message":"Command Not Found"}.

what will be the issue?

Config Option Radio

The Default value of "radio" does not work as described in the documentation. The Example provided does also not work:

        "disk" => [
            "FriendlyName" => "Disk Space",
            "Type" => "radio", # Radio Selection of Options
            "Options" => "100MB,200MB,300MB",
            "Description" => "Radio Options Demo",
            "Default" => "200MB",
        ],

Add examples for using classes

I'm finding it difficult to find any examples of how to use the internal classes outlined here. It also seems to be missing WHMCS\Database\Capsule but has what I'm looking for here (these docs seem all over the place!).

Currently I'm trying to look for a method to create an invoice with the type AddFunds. There doesn't seem to be any easy way to do this via the API or available methods.

Perhaps I can create a new invoice and use a new WHMCS\Billing\Invoice\Item class on the WHMCS\Billing\Invoice class? I can't even find information about the constructors, so these could just be 'dummy' classes for holding information. But again, there is no information available.

E.g. can I create an invoice like this:

$addFundsInvoice = new WHMCS\Billing\Invoice;
// there is no addLine()?
$addFundsLine = new WHMCS\Billing\Invoice\Item;

// ... something? 

I've done heavy research online and have been made aware of the methods like createInvoices($userid); but I feel these might be going away (are they?) because WHMCS seems to be stepping away from using functions and using classes.

This seems like a solution but it also doesn't seem like the safest way to go about it:

$userid = ...;
$amount = ...;

// I think true here = no email?
include_once(WHMCS_ROOT_PATH . "/includes/processinvoices.php");
$invoiceid = createInvoices(userid, true);

Capsule::table("tblinvoiceitems")
	->insert([
		"userid" => $userid, 
		"type" => "AddFunds", 
		"relid" => $invoiceid, 
		"description" => $_LANG['addfunds'], 
		"amount" => $amount, 
		"taxed" => "0", 
		"duedate" => "now()", 
		"paymentmethod" => "paypal"
	]);

Looking forward to some help here :)

Incorrect casting within modules/reports/income_forecast.php

Wasn't sure where else to provide this. Running the income forecast report in WHMCS 6.3.1 via
admin/reports.php?report=income_forecast produces a string of "mktime() expects parameter 6 to be long, string given in [...]" errors.

I identified the issue as an incorrect cast on line 40 of modules/reports/income_forecast.php. Replacing the original line:
$new_time = mktime(0,0,0,$month+$i,1,$year);
With this revision:
$new_time = mktime(0,0,0,$month+$i,1,(int) $year);
Resolves the error. Cheers.

Improve documentation for AddOrder

The documentation for AddOrder does not describe how to add standard fields - only custom and optional fields.

Such as:

  • server
  • dedicated ip
  • username
  • password
  • status

Lots of problems

There must be lots of things just like use WHMCS\ClientArea;. But there is no documents about it.
Where is those documents?
For example: what method dose ClientArea had?

sample-addon-module not working

I noticed that that the following needs changed from:
use WHMCS\Module\Addon
use WHMCS\Module\Addon\

To:
use WHMCS\Modules\Addons
use WHMCS\Modules\Addons

also, when I configure the module, a name doesn't even show when I try and activate it from the admin console.

Client->GetEmails API Error Result Type

Hi, WHMCS APIs usually error result type is;

{
result: "error",
message: "Client Not Found",
}

But GetEmails API show error result like that;
{
status: "error",
message: "Client ID Not Found",
}

For your information.
Best Regards

Custom Functions for Provisioning Modules

I wroted a Provisioning Module called license and it works well. But i am confused with Custom Functions.
For example, i wroted this:

function license_reset($vars){
    file_put_contents('/homw/wwwroot/leotome.org/a.txt','a');
    die();
}

and the TPL file is like this:

                    <form method="post" action="clientarea.php?action=productdetails">
                        <input type="hidden" name="id" value="{$serviceid}" />
                        <input type="hidden" name="modop" value="custom" />
                        <input type="hidden" name="a" value="reset" />
                        <input class="btn btn-warning btn-xs" type="submit" value="Reset License" />
                    </form>

But once i click that button, i only get the page refreshed.
How can i deal with that?

Confusing instructions in Creating Pages

https://developers.whmcs.com/advanced/creating-pages/

Instructions are fine until this line:

"Now when ready to test, upload the PHP file to the root WHMCS directory and the template file to your active template directory. Then visit the PHP file in your browser to try it."

But this is confusing - nowhere in the example does it mention the need for both the PHP and a template file. I think what the instructions mean are; you need to create two files 1) a tpl page and 2) your custom php page - however, the article on really deals with creating one file (the example). It also doesn;t really explain how the two files are linked.

The page could be written more clearly with better instructions for creating both files (php file and the tpl file).

Thanks

CreateInvoice API parameters

In the list of Request parameters, it shows autoapplycredit; but in the code examples this is displayed as "autoappliedcredit". Need some clarity on which is correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.