crons new
This commit is contained in:
@@ -641,6 +641,7 @@ long WrenchFlutterCreditHook(CVars in, CVars &out) {
|
||||
xn["amount"] = cc["amount"]; xn["amount"].set_valid(true);
|
||||
xn["currency"] = cc["currency"]; xn["currency"].set_valid(true);
|
||||
xn["transaction_id"] = xx["txRef"]; xn["transaction_id"].set_valid(true);
|
||||
logfmt(logINFO, "WrenchBoardStartBalanceTopup() start ***** ");
|
||||
long trx_id = WrenchBoardStartBalanceTopup(xn, out);
|
||||
if ( trx_id > 0 ){
|
||||
CVars tx;
|
||||
@@ -649,8 +650,12 @@ long WrenchFlutterCreditHook(CVars in, CVars &out) {
|
||||
tx["tx_ref"] = xx["txRef"]; tx["tx_ref"].set_valid(true);
|
||||
tx["transaction_id"] = xx["txRef"]; tx["transaction_id"].set_valid(true);
|
||||
tx["flutterwave_payments_id"] = trx_id; tx["flutterwave_payments_id"].set_valid(true);
|
||||
|
||||
long credit_id = WrenchBoardCompleteBalanceTopup(tx, out);
|
||||
logfmt(logINFO, "WrenchBoardCompleteBalanceTopup() call ***** ");
|
||||
long credit_id = WrenchBoardCompleteBalanceTopup(tx, out);
|
||||
if (credit_id > 0 ){
|
||||
ret = PHP_API_OK;
|
||||
out["log_status"] = "completed";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -662,7 +667,7 @@ long WrenchFlutterCreditHook(CVars in, CVars &out) {
|
||||
} catch (bad_parameter) {
|
||||
out["log_status"] = "Something went wrong";
|
||||
}
|
||||
logfmt(logINFO, "WrenchFlutterCreditHook()");
|
||||
logfmt(logINFO, "/out WrenchFlutterCreditHook()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,10 @@ $routes->post('/en/wrench/hooks/v1/stripes', 'WrenchHooks::stripes');
|
||||
|
||||
// cron jobs ------------ ===== ------------
|
||||
$routes->post('/en/wrench/api/v1/cron', 'WrenchCrons::apigate');
|
||||
|
||||
$routes->get('/en/wrench/api/v1/cron', 'WrenchCrons::apigate');
|
||||
$routes->get('/en/wrench/api/v1/cron_jobalerts', 'WrenchCrons::jobalerts');
|
||||
$routes->get('/en/wrench/api/v1/cron_notifications', 'WrenchCrons::notifications');
|
||||
|
||||
$routes->get('/en/wrench/api/v1/bko', 'Bko::apigate');
|
||||
$routes->post('/en/wrench/api/v1/bko', 'Bko::apigate');
|
||||
|
||||
@@ -19,27 +19,6 @@ class WrenchCrons extends BaseController
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_SIGNUP_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_JOBDUE_REMINDER;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_JOBDUE_REMINDER'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_PENDOFFER_ALERT;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_PENDOFFER_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_JOBDUE_PAYMENTS;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_JOBDUE_PAYMENTS'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_PASTDUE_ALERT;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_PASTDUE_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_OFFER_REFUND_ALERT;
|
||||
$in['one_limit'] = 1;
|
||||
$ret['WRB_CRONJOB_OFFER_REFUND_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
// $out['internal_return'] = $ret;
|
||||
$out = $ret;
|
||||
@@ -49,4 +28,51 @@ class WrenchCrons extends BaseController
|
||||
return $this->response->setJson($out);
|
||||
}
|
||||
|
||||
//$routes->get('/en/wrench/api/v1/cron', 'WrenchCrons::apigate');
|
||||
//$routes->get('/en/wrench/api/v1/cron_jobalerts', 'WrenchCrons::jobalerts');
|
||||
//$routes->get('/en/wrench/api/v1/cron_notifications', 'WrenchCrons::notifications');
|
||||
|
||||
public function cron_notifications()
|
||||
{
|
||||
$in["action"] = WRB_JOB_CRONJOB;
|
||||
$wrenchboard = new \App\Models\BackendModel();
|
||||
$out=[];
|
||||
|
||||
log_message('critical', "WrenchCrons ===> 0001");
|
||||
//$response = []; //json_decode($complete, true);
|
||||
return $this->response->setJson($out);
|
||||
}
|
||||
public function jobalerts(){
|
||||
$in["action"] =WRB_JOB_CRONJOB;
|
||||
$wrenchboard = new \App\Models\BackendModel();
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_JOBDUE_REMINDER;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_JOBDUE_REMINDER'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_PENDOFFER_ALERT;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_PENDOFFER_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_JOBDUE_PAYMENTS;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_JOBDUE_PAYMENTS'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_PASTDUE_ALERT;
|
||||
$in['one_limit'] = 3;
|
||||
$ret['WRB_CRONJOB_PASTDUE_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
$in['call_action'] = WRB_CRONJOB_OFFER_REFUND_ALERT;
|
||||
$in['one_limit'] = 1;
|
||||
$ret['WRB_CRONJOB_OFFER_REFUND_ALERT'] = $wrenchboard->wrenchboard_api($in, $out);
|
||||
|
||||
// $out['internal_return'] = $ret;
|
||||
$out = $ret;
|
||||
|
||||
log_message('critical', "WrenchCrons ===> 0001");
|
||||
//$response = []; //json_decode($complete, true);
|
||||
return $this->response->setJson($out);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user