Craft Posted November 22, 2019 Share Posted November 22, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted November 22, 2019 Share Posted November 22, 2019 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? 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 22, 2019 Author Share Posted November 22, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 24, 2019 Author Share Posted November 24, 2019 (edited) 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 :( Edited November 24, 2019 by Craft 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 25, 2019 Share Posted November 25, 2019 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). 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 25, 2019 Author Share Posted November 25, 2019 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');` 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 25, 2019 Share Posted November 25, 2019 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). 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 25, 2019 Author Share Posted November 25, 2019 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 :) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 25, 2019 Share Posted November 25, 2019 which registrar? 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 25, 2019 Author Share Posted November 25, 2019 23 minutes ago, brian! said: which registrar? The registrar I'm using (registercom) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 26, 2019 Share Posted November 26, 2019 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']); 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 26, 2019 Author Share Posted November 26, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 27, 2019 Share Posted November 27, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
Craft Posted November 28, 2019 Author Share Posted November 28, 2019 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 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.