Script code
class Deposit extends MY_Controller
{
public function coinPaymentCron()
{
$this->load->model('user_model','apimodel');
$apikeys = $this->apimodel->getApiKey();
foreach ($apikeys as $keysapi) {
# code...
$publickey = $keysapi->public_key;
$privatekey = $keysapi->private_key;
}
$cps = new CoinPaymentsAPI();
$cps->Setup($privatekey, $publickey);
$getTxIds = $this->apimodel->gettxids();
foreach ($getTxIds as $txid) {
# code...
$tx_id = $txid->txn_id;
echo $tx_id;
$txinfo = $cps->gettxinfo($tx_id);
if ($txinfo['error'] == 'ok') {
# code...
$statusText = $txinfo['result']['status_text'];
$amountReceived = $txinfo['result']['receivedf'];
$statusPayment = $txinfo['result']['status'];
$this->apimodel->updateStatus($tx_id, $statusText);
}
}
}
}
The code command i am using for running cron job is
/usr/local/bin/php /home/name/public_html/index.php deposit coinPaymentCron
I have also tried many methods like using wget and curl but unfortunately none work for me. Also checked the script using url and the script is running fine and updating the database but the cron job is not running. Some other cron jobs are running using this method
/usr/local/bin/php /home/name/public_html/index.php
Can anyone please help regarding this issue or let me know what I am doing wrong?