Click here to Skip to main content
15,886,199 members

Comments by huhuhhuhuh (Top 2 by date)

huhuhhuhuh 12-Nov-21 5:03am View    
Hi,
Yes, i'm getting the payload with the following code within php (in WHMCS it's a hook in php):

$command = 'GetOrders';
$postData = array(
'id' => '1',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later

$results = localAPI($command, $postData, $adminUsername);

The following works, if i test it on the following site but it doesn't work within the WHMCS app, when i decode the $results variable. Why? (It's php 7.4.16 on the server):
https://sandbox.onlinephpfunctions.com/

$obj = '{"result":"success","totalresults":1,"startnumber":0,"numreturned":1,"orders":{"order":[{"id":6,"ordernum":8015255572,"userid":3,"contactid":0,"requestor_id":0,"admin_requestor_id":2,"date":"2021-11-05 13:21:32","nameservers":"","transfersecret":"","renewals":"","promocode":"","promotype":"","promovalue":"","orderdata":"[]","amount":"0.00","paymentmethod":"banktransfer","invoiceid":3,"status":"Pending","ipaddress":"xxx","fraudmodule":"","fraudoutput":"","notes":"","paymentmethodname":"Bank Transfer","paymentstatus":"Paid","name":"Emma Test","currencyprefix":"\u20ac","currencysuffix":" EUR","frauddata":"","validationdata":"","lineitems":{"lineitem":[{"type":"product","relid":9,"producttype":"Other Product\/Service","product":"xxx","domain":"xxx","billingcycle":"Free Account","amount":{},"status":"Pending"},{"type":"addon","relid":3,"producttype":"Addon","product":"Exchange Postfach","domain":"","billingcycle":"Free Account","amount":{},"status":"Pending"}]}}]}}';

$decoded = json_decode($obj,true);


echo $decoded['orders']['order'][0]['ordernum'];
huhuhhuhuh 2-Dec-20 10:55am View    
The support answered this but it's not the case (https://www.screenpresso.com/de/support/hot-keys/). It's installed in Program Files so it's not a Security Problem?!