Jump to content

Transfer Domain doesn't choose Registrar


Craft

Recommended Posts

When I try to transfer a domain, it doesn't choose the Registrar automatic (Already set at "Domain Pricing"). I see the Registrar (None).

The system accepts the order, mark it as paid, change the domain status to Active (It should be Pending Transfer)

It works and start transferring when I select the Registrar manual and click on "Transfer" module.

 

Activity Log.png

Domain Transfer Issue.png

Link to comment
Share on other sites

2 hours ago, WHMCS ChrisD said:

Hello @Craft

Thanks for your post, the registrar is not set automatically on the view order screen, this is the expected behaviour the registrar selection is set once the invoice is paid from here it should then start the transfer in process, is this not happening for you?

NO

As you see in the (Activity Log), the invoice is paid but the registrar wasn't selected.

 

Link to comment
Share on other sites

On 11/22/2019 at 9:44 PM, WHMCS ChrisD said:

Hello @Craft

Thanks for your post, the registrar is not set automatically on the view order screen, this is the expected behaviour the registrar selection is set once the invoice is paid from here it should then start the transfer in process, is this not happening for you?

I just notices where is the issue .. here (Automatic Domain Registration Suppressed as Domain Is Already Active)

The issue is in the hook file (Auto Accept Orders), which is works for the hosting orders but doesn't work for domain :(

 

Domain Reg Issue.png

Edited by Craft
Link to comment
Share on other sites

22 hours ago, Craft said:

I just notices where is the issue .. here (Automatic Domain Registration Suppressed as Domain Is Already Active)

if you take a look at the AcceptOrder API, you can pass a registrar value - so it should be possible to modify the hook to assign a registrar based on the domains in the order (which I suspect you'd have to get with a db query).

Link to comment
Share on other sites

16 minutes ago, brian! said:

if you take a look at the AcceptOrder API, you can pass a registrar value - so it should be possible to modify the hook to assign a registrar based on the domains in the order (which I suspect you'd have to get with a db query).

This is the hook code, how can I pass it?

function AutoAcceptOrders_settings()
{
return array(
'apiuser' => '', // one of the admins username
'autosetup' => true, // determines whether product provisioning is performed
'sendregistrar' => false, // determines whether domain automation is performed
'sendemail' => true, // sets if welcome emails for products and registration confirmation emails for domains should be sent
'ispaid' => true, // set to true if you want to accept only paid orders
);
}

function AutoAcceptOrders_accept($vars)
{
$settings = AutoAcceptOrders_settings();

$ispaid = true;

if($vars['InvoiceID'])
{
    $result = localAPI('GetInvoice', array(
        'invoiceid'	=> $vars['invoiceId'],
    ), $settings['apiuser']);

    $ispaid = ($result['result'] == 'success' && $result['balance'] <= 0) ? true : false;

}
logActivity("Order isPaid: ".$ispaid,0);

if(( $settings['ispaid'] && $ispaid))
{
    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'autosetup'	=> $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
    ), $settings['apiuser']);
    logActivity("Order Accept", 0);
    if(is_array($result)){
        foreach($result as $index=>$value){
            logActivity("$index:$value",0);
        }
    }

}
}
add_hook('OrderPaid', 1, 'AutoAcceptOrders_accept');`

 

Link to comment
Share on other sites

16 minutes ago, Craft said:

This is the hook code, how can I pass it?

as per the docs, try changing...

    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
    ), $settings['apiuser']);

to...

    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'registar' => 'enom',
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
    ), $settings['apiuser']);

if there are no domains in the order, then I don't think passing a registrar value will make any difference... however, there will be a problem if the order contains multiple domains that should be assigned to different registrars, but hopefully you only have one registrar (you can change enom to the name of your registrar).

Link to comment
Share on other sites

19 minutes ago, brian! said:

as per the docs, try changing...


    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
    ), $settings['apiuser']);

to...


    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'registar' => 'enom',
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
    ), $settings['apiuser']);

if there are no domains in the order, then I don't think passing a registrar value will make any difference... however, there will be a problem if the order contains multiple domains that should be assigned to different registrars, but hopefully you only have one registrar (you can change enom to the name of your registrar).

I tried that but nothing happened, same issue :)

Link to comment
Share on other sites

19 hours ago, Craft said:

The registrar I'm using (registercom)

ok, I just wanted to check you were sending the correct name of the registrar. 🙂

did you remember to change the setting of the option below to true ??

'sendregistrar' => false, // determines whether domain automation is performed

and then in the API, you would need to add sendregistrar...

    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'registar' => 'registercom',
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
        'sendregistrar' => $settings['sendregistrar'],
    ), $settings['apiuser']);
Link to comment
Share on other sites

20 minutes ago, brian! said:

ok, I just wanted to check you were sending the correct name of the registrar. 🙂

 

Haha don't worry, I'm not a noobie :)

 

22 minutes ago, brian! said:

did you remember to change the setting of the option below to true ??


'sendregistrar' => false, // determines whether domain automation is performed

 

Yes, I changed to "true" when I tried yesterday.

 

22 minutes ago, brian! said:

and then in the API, you would need to add sendregistrar...

 


    $result = localAPI('AcceptOrder', array(
        'orderid' => $vars['orderId'],
        'registar' => 'registercom',
        'autosetup' => $settings['autosetup'],
        'sendemail' => $settings['sendemail'],
        'sendregistrar' => $settings['sendregistrar'],
    ), $settings['apiuser']);

I tried this also now, and unfortunately same issue

 

The problem is we shouldn't set the domain's status to "Active" until it's actually been registered.

Link to comment
Share on other sites

21 hours ago, Craft said:

The problem is we shouldn't set the domain's status to "Active" until it's actually been registered.

but this hook triggers when the order is paid, which will be before there's any interaction between WHMCS and the registrar... so that's when the API function will run... I suppose you could run the updateclientdomain api afterwards (though you'd have to work out the domains in the order) and set the status back to PT.

it might be helpful if you think about exactly what the process should be, e.g what meeds to occur and when... that might help clarify if this is fixable, or whether it's better to start from scratch or a commercial solution.

Link to comment
Share on other sites

10 hours ago, brian! said:

but this hook triggers when the order is paid, which will be before there's any interaction between WHMCS and the registrar... so that's when the API function will run... I suppose you could run the updateclientdomain api afterwards (though you'd have to work out the domains in the order) and set the status back to PT.

it might be helpful if you think about exactly what the process should be, e.g what meeds to occur and when... that might help clarify if this is fixable, or whether it's better to start from scratch or a commercial solution.

Your way of thinking is correct..

But I remember when I was using the old code for the old whmcs versions, there was no any updating to client domain status.

Kindly find the attached old code for the old whmcs versions, it's nearby to the new code.

jetserver_AutoAcceptOrders.php

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