Qhiliqq Posted June 11 Share Posted June 11 (edited) Hi there, maybe it's just a bug or sth. like that. If I use the localAPI call "GetOrders" with a order which only contains a domain, no result will be shown. The order is present in the database. Do you know about that? test.php in whmcs root directory <?php define("WHMCS", true); require_once __DIR__ . '/init.php'; // Test Order-ID $orderId = 3053; // API Call try { $results = localAPI('GetOrders', [ 'id' => $orderId ]); echo "<pre>"; print_r($results); echo "</pre>"; } catch (Exception $e) { echo "Error: " . $e->getMessage(); } WHMCS: 8.13.1 PHP: 8.1.32 Edited June 11 by Qhiliqq 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted June 12 Share Posted June 12 Works perfectly fine for me. Same setup. Array ( [result] => success [totalresults] => 1 [startnumber] => 0 [numreturned] => 1 [orders] => Array ( [order] => Array ( [0] => Array ( [id] => 23 [ordernum] => 7556659495 [userid] => 82 [contactid] => 1 [requestor_id] => 0 [admin_requestor_id] => 1 [date] => 2023-09-23 16:11:24 [nameservers] => [transfersecret] => [renewals] => [promocode] => [promotype] => [promovalue] => [orderdata] => [] [amount] => 10.00 [paymentmethod] => mailin [invoiceid] => 3 [status] => Pending [ipaddress] => [fraudmodule] => [fraudoutput] => [notes] => [purchase_source] => 4 [has_referral_products] => 0 [paymentmethodname] => Mail In Payment [paymentstatus] => [name] => Firstname Lastname [currencyprefix] => [currencysuffix] => DKK [frauddata] => [validationdata] => [renewalsByType] => Array ( [domains] => [services] => [addons] => ) [lineitems] => Array ( [lineitem] => Array ( [0] => Array ( [type] => domain [relid] => 4 [producttype] => Domain [product] => Register [domain] => example.com [billingcycle] => 1 [amount] => WHMCS\View\Formatter\Price Object ( [price:protected] => 10 [currency:protected] => Array ( [id] => 1 [code] => DKK [prefix] => [suffix] => DKK [format] => 3 [rate] => 1.00000 ) [defaultFormat:protected] => {PREFIX}{PRICE}{SUFFIX} [defaultCurrencyDescriptor:protected] => Array ( [format] => 1 [prefix] => [suffix] => ) ) [status] => Expired [dnsmanagement] => 0 [emailforwarding] => 0 [idprotection] => 0 ) ) ) ) ) ) ) 0 Quote Link to comment Share on other sites More sharing options...
Qhiliqq Posted June 13 Author Share Posted June 13 I don't get it. I checked if a hook or sth. else cuts off the orders key, but no... In my whole whmcs dir there is nothing with getorders, except my test.php file. The test.php gives me: Array ( [result] => success [totalresults] => [startnumber] => 0 [numreturned] => ) The weird thing is, my tblorders has the order: stdClass Object ( [id] => 3053 [ordernum] => 1406xxxxxx [userid] => 30 [contactid] => 0 [requestor_id] => 0 [admin_requestor_id] => 2 [date] => 2025-06-11 08:45:29 [nameservers] => [transfersecret] => [renewals] => {"domains":[],"services":[],"addons":[]} [promocode] => [promotype] => [promovalue] => [orderdata] => [] [amount] => 0.00 [paymentmethod] => mollierecurring [invoiceid] => 10439 [status] => Pending [ipaddress] => 176.xxx.xxx.xxx [fraudmodule] => [fraudoutput] => [notes] => [purchase_source] => 3 [has_referral_products] => 0 ) I installed a fresh whmcs on my dev system and here it works. So there has to be something in my current production system which changes the api output. My whmcs installation was 2015, ten years ago and just upgraded it every time. Maybe something old is causing this error. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted June 13 Share Posted June 13 The list of items in the order is not in the actual tblorders - it is in tblhosting, tblhostingaddons, tbldomains and tblupgrades. Make sure there's a row in tbldomains with that order ID. 0 Quote Link to comment Share on other sites More sharing options...
Solution Qhiliqq Posted June 13 Author Solution Share Posted June 13 Got it! My collation was utf8mb3 and something other. I changed the whole db and all tables to utf8mb4 and now its running! 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.