centralnicgroup-opensource / rtldev-middleware-whmcs

CentralNic's WHMCS Software Bundle
https://centralnicreseller.com
Other
35 stars 15 forks source link

apikey is null on domain lookup #275

Closed tonnyorg closed 8 months ago

tonnyorg commented 8 months ago

Describe the bug If you configure InternetBS module as the lookup provider in the /admin/configdomains.php, the lookup doesn't fetch IBS API because apikey parameter is missing, and that is caused because the ibs_CheckAvailability function's $params variable doesn't include the expected $params['Username'] and $params['Password'] in the ibs_call function.

To Reproduce Steps to reproduce the behavior:

  1. Go to /admin/configdomains.php

  2. Under the Lookup Provider section, click on 'change'

  3. Select Domain Registrar and under Choose a registrar... section pick Internet.bs v4.0.30

  4. In the next screen select all the TLDs and save

  5. Edit the ibs.php file and var_dump:

    function ibs_domainCheck($params)
    {
    $domainName = ibs_getInputDomain($params);
    
    $result = ibs_call($params, "Domain/Check", [
        "domain" => $domainName,
        "currency" => "USD"
    ]);
    var_dump([
    'params' => $params,
    'result'=> $result,
    ]);
    die();
  6. Open the chrome's web inspector (so you can see the var_dump in the network tab) and perform any domain lookup in the WHMCS' public page.

Expected behavior It should perform the domain lookup properly and not fallback on default whois

Screenshots Screenshot 2023-12-19 at 9 02 56 AM Screenshot 2023-12-19 at 9 07 09 AM

var_dump output:

array(2) { ["params"]=> array(10) { ["whmcsVersion"]=> string(15) "8.7.2-release.1" ["sld"]=> string(8) "19216813" ["tlds"]=> array(1) { [0]=> string(4) ".xyz" } ["searchTerm"]=> string(8) "19216813" ["tldsToInclude"]=> array(1) { [0]=> string(4) ".xyz" } ["isIdnDomain"]=> bool(false) ["punyCodeSearchTerm"]=> string(0) "" ["premiumEnabled"]=> bool(true) ["original"]=> array(7) { ["sld"]=> string(8) "19216813" ["tlds"]=> array(1) { [0]=> string(4) ".xyz" } ["searchTerm"]=> string(8) "19216813" ["tldsToInclude"]=> array(1) { [0]=> string(4) ".xyz" } ["isIdnDomain"]=> bool(false) ["punyCodeSearchTerm"]=> string(0) "" ["premiumEnabled"]=> bool(true) } ["domainname"]=> string(12) "19216813.xyz" } ["result"]=> array(4) { ["transactid"]=> string(32) "a1b1bcaf207216aab00fb4e7d55518b8" ["status"]=> string(7) "FAILURE" ["message"]=> string(36) "Required parameter "apikey" missing!" ["code"]=> string(6) "100003" } }

Context (please complete the following information):

KaiSchwarz-cnic commented 8 months ago

Good Morning @tonnyorg !

I wonder that we don't see anything related to Registrar Module Configuration Settings in your dump of $params. Tested this in our dev container:

image image image

As you see, it works perfectly well.

Can you double check to have the Registrar Module configured? Ensure to have our custom internet.bs module installed + configured (v4.0.30 is part of the module label) and not the one shipped with WHMCS.

If all looks good on your end, please share a screenshot of the registrar module configuration with us for reference. As this includes sensible information, please reach out to internet.bs support via https://internetbs.net/en/contact.html and share the screenshot with us.

tonnyorg commented 8 months ago

@KaiSchwarz-cnic thanks for your response, I've double checked so far looks good, idk what could be wrong

I'm running WHMCS Version 8.7.2, are you running any beta or other version?

Screenshot 2023-12-20 at 8 29 33 AM Screenshot 2023-12-20 at 8 47 02 AM Screenshot 2023-12-20 at 8 47 47 AM

KaiSchwarz-cnic commented 8 months ago

The Registrar Module you've configured isn't our Module. Maybe you upgraded WHMCS? It is then resetting the module to the one shipped with WHMCS. Please reinstall our version. The label of the Module in the registrar overview is imho usually containing the module version. After reinstallation, please save the registrar module configuration again to ensure the settings are saved correctly.

tonnyorg commented 8 months ago

I mean... the module says Internet.bs v4.0.30 in my screen shoot above... it's installed under modules/registrars/ibs folder, but I also noticed the one that comes by default it's under modules/registrars/internetbs

KaiSchwarz-cnic commented 8 months ago

Sorry for replying that late... vacation followed by sick leave.

As mentioned, there must be something wrong with the registrar module installation on your end. The logo of the registrar module shared by you is the logo of the module shipped with whmcs and not our module.

Compare with our one: image

It feels like a bad mixture of things here, I fully agree. At least check this please again. Also strange that no settings are present in $params. I can't do more than asking you to save the settings again. If that still does not help, I highly recommend reaching out to WHMCS Support. Having no settings in $params is that strange, I've never seen that on my end. I mean, it looks like you have the module configured, so settings must be present. We are not responsible for loading, saving and providing the settings - WHMCS is doing that.

KaiSchwarz-cnic commented 8 months ago

I am closing this case. Still, feel free to follow-up to continue the discussion. I can just ensure this isn't an issue of our module especially because others are using it as well. The problem must be specific to your installation as mentioned.

KaiSchwarz-cnic commented 8 months ago

Ehm, sorry for the late follow-up. I had a bit too much around. I noticed now this comment of you:

I mean... the module says Internet.bs v4.0.30 in my screen shoot above... it's installed under modules/registrars/ibs folder, but I also noticed the one that comes by default it's under modules/registrars/internetbs

Yes exactly, you've the wrong one configured (and eventually in use). Ensure to configure the module with the logo I shared and deactivate the other one. Whois Lookup provider is already correctly configured. Then also ensure that the Domain Pricing Overview's TLD configuration is pointing also to the right module. Domains you manage over internet.bs have also to point to the right module.

When done, all should work fine.