mich_f Posted March 30, 2022 Share Posted March 30, 2022 add_hook('PreCronJob', 1, function() { $table = "gateway_mollie"; $fields = "invoiceid"; $where = array("status"=>'open'); $result = select_query($table,$fields,$where); $data = mysql_fetch_array($result); $invoiceid = $data['invoiceid']; foreach($invoiceid as $key => $invoice ){ $CONFIG = acumulus_connect_getConfig(); $token = Capsule::table('mod_acumulus_connect')->where('id', $invoice)->value('token'); $client = acumulus_connect_getclient($invoiceid, $CONFIG); $res = acumulus_connect_getPaymentStatus($CONFIG, $invoiceid, $client, $token); if(strtolower($res['paymentstatus']) == 'paid' or $res['paymentstatus'] == '1' ){ $table = "gateway_mollie"; $update = array("status"=>"paid"); $where = array("invoiceid"=>"$invoice"); update_query($table,$update,$where); }} }); 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted April 1, 2022 Share Posted April 1, 2022 https://developers.whmcs.com/advanced/db-interaction/ 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.