Jump to content

Sync Not Supported by Registrar Module - Custom module


stelian

Recommended Posts

Hello,

I built a custom registrar module for ROTLD.ro (romanian domain names) and most functions works as expected but apparently I'm missing something for the Sync function.  

My rotld_Sync() function returns an array like in WHMCS Sample Registrar Module but our domains are not synced and the received mail has errors like: Sync Not Supported by Registrar Module

Please, do you have any hint for what should I do next or what causes that error?

Link to comment
Share on other sites

On 6/21/2018 at 7:24 PM, stelian said:

Hello,

I built a custom registrar module for ROTLD.ro (romanian domain names) and most functions works as expected but apparently I'm missing something for the Sync function.  

My rotld_Sync() function returns an array like in WHMCS Sample Registrar Module but our domains are not synced and the received mail has errors like: Sync Not Supported by Registrar Module

Please, do you have any hint for what should I do next or what causes that error?

Hello, 

Can you please confirm what logic actually you wrote to sync domains from registrar to your whmcs database?

Logicmaker

Link to comment
Share on other sites

function rotld_Sync($params)
{
    try {
        $ac = new ApiClient($params);
        $ac->set_param('command', 'domain-info');
        $ac->set_param('domain', $params['domain']);
        $response = $ac->commit();
        $response_array = json_decode($response);
        if ($response_array->result_code === '00200') {
            $return_array = [
                'active' => true,
                'expired' => false,
                'transferredAway' => false,
            ];

            $return_array['expirydate'] = substr($response_array->data->expiration_date, 0, 10);
            $statuses = $response_array->data->statuses;

            if (in_array('OK', $statuses)) {
                $return_array['active'] = true;
            }

            return $return_array;
        }
    } catch (\Exception $e) {
        return array(
            'error' => $e->getMessage(),
        );
    }
}

@Logicmaker Thank you very much for your time!

Have I done something wrong?

Link to comment
Share on other sites

On 6/24/2018 at 4:51 PM, stelian said:

function rotld_Sync($params)
{
    try {
        $ac = new ApiClient($params);
        $ac->set_param('command', 'domain-info');
        $ac->set_param('domain', $params['domain']);
        $response = $ac->commit();
        $response_array = json_decode($response);
        if ($response_array->result_code === '00200') {
            $return_array = [
                'active' => true,
                'expired' => false,
                'transferredAway' => false,
            ];

            $return_array['expirydate'] = substr($response_array->data->expiration_date, 0, 10);
            $statuses = $response_array->data->statuses;

            if (in_array('OK', $statuses)) {
                $return_array['active'] = true;
            }

            return $return_array;
        }
    } catch (\Exception $e) {
        return array(
            'error' => $e->getMessage(),
        );
    }
}

@Logicmaker Thank you very much for your time!

Have I done something wrong?

Hello,

Can you please confirm, you are passing following all required config parameters to ApiClient() class :

$config = array(
    'regid'=>'XXXX',
    'password'=>'XXXX',
    'apiurl'=>'https://rest2-test.rotld.ro:6080',
    'registrar_domain'=>'rotest.ro',
    'lang'=>'en',
    'format'=>'xml'
);

Also, according to sample registrar module given by WHMCS at below url shows that how to pass domain name to api call :

https://github.com/WHMCS/sample-registrar-module/blob/master/modules/registrars/registrarmodule/registrarmodule.php

// domain parameters
$sld = $params['sld'];
$tld = $params['tld'];
 
// Build post data
$postfields = array(
'username' => $userIdentifier,
'password' => $apiKey,
'testmode' => $testMo
'domain' => $sld . '.' . $tld,

);

Also, try to change following condition :

if ($response_array->result_code === '00200') {

to following :

if ($response_array->result_code == '00200') {

If you still not getting the issue solve, we need to debug module code at your WHMCS setup.

Let me know if any further help needed.

 

Thanks

Logicmaker

 

 

 

 

 

Link to comment
Share on other sites

@Logicmaker Softwares I figure it out what the problem was. The code was almost OK. Thank you so much for trying to help me!

@cosmin The *.ro domains listed with Sync Not Supported by Registrar Module had other record set to Registrar (other than ROTLD) and I wrongly assumed it is ROTLD. You can check the Registrar by going to Clients > Domain Registration > and select a domain with Sync Not Supported by Registrar Module. Most probably ROTLD is not selected (at least that was my case).

Best regards!

 

Link to comment
Share on other sites

On 26/06/2018 at 5:45 PM, stelian said:

@Logicmaker Softwares I figure it out what the problem was. The code was almost OK. Thank you so much for trying to help me!

@cosmin The *.ro domains listed with Sync Not Supported by Registrar Module had other record set to Registrar (other than ROTLD) and I wrongly assumed it is ROTLD. You can check the Registrar by going to Clients > Domain Registration > and select a domain with Sync Not Supported by Registrar Module. Most probably ROTLD is not selected (at least that was my case).

Best regards!

 

Can you share the module files, so we can see what exactly you done it for ROTLD ?

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated