Yes, it is still pending in admin area.
I have also checked that the hook loads, which is does.
This is exactly how the hook looks at my side.
function AutoAcceptOrders_settings()
{
return array(
'apiuser' => 'whmscroot', // one of the admins username
'autosetup' => true, // determines whether product provisioning is performed
'sendregistrar' => true, // 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');