diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc
index 7ad8e1a0..ec396c56 100644
--- a/wrenchboard/src/shared_tool/site_crons.cc
+++ b/wrenchboard/src/shared_tool/site_crons.cc
@@ -185,11 +185,20 @@ long ScheduleTransferJobs(CVars in, CVars &out){
}
long TestNotificationsJobs(CVars in, CVars &out){
-// if ( load_db_record(out, "SELECT count(uid) AS pending_count FROM money_transfer WHERE status =1 AND completed IS NULL ")> 0){
-// if ( out["pending_count"].Long() > 0 ){
-// alert_email(WRB_CRONJOB_PENDINGSM,out, out);
-// }
-// }
+
+ CVars xx;
+ xx["member_uid"] = "70d8ecc4-490f-40e5-9cea-0484f0a9f584"; xx["member_uid"].set_valid( true );
+ xx["push_text"] = "Notification test system...Olu"; xx["push_text"].set_valid( true );
+ push_ret = BkoSendPush( xx, out);
+
+ xx["member_uid"] = "d96607ee-37ac-458f-a57d-7f2027a9ba11"; xx["member_uid"].set_valid( true );
+ xx["push_text"] = "Notification test system...Obax"; xx["push_text"].set_valid( true );
+ push_ret = BkoSendPush( xx, out);
+
+ xx["member_uid"] = "52cee358-759f-42f5-8cfb-d3f77b323c1a"; xx["member_uid"].set_valid( true );
+ xx["push_text"] = "Notification test system...Toks"; xx["push_text"].set_valid( true );
+ push_ret = BkoSendPush( xx, out);
+
return 0;
}
diff --git a/www-api/app/Helpers/flutterwave_helper.php b/www-api/app/Helpers/flutterwave_helper.php
new file mode 100644
index 00000000..14e933ef
--- /dev/null
+++ b/www-api/app/Helpers/flutterwave_helper.php
@@ -0,0 +1,174 @@
+ $in['id'],
+ "account_bank" => $in['bank_code'],
+ "account_number" => $in['account_no'],
+ "amount" => $in['amount'],
+ "narration" => $in['narration'],
+ "currency" => "NGN",
+ "reference" => $reference,
+ "debit_currency" => "NGN"
+ ));
+
+ curl_setopt($ch, CURLOPT_URL,"http://host.docker.internal:9086/create");
+ // curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
+
+ // Receive server response ...
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+
+ $result = curl_exec($ch);
+
+ curl_close ($ch);
+
+ $data = json_decode($result, true);
+
+ //var_dump( $data);
+ //exit;
+ /*
+ {"account_bank":"044","account_number":"0690000031","amount":"123.00","narration":"Transfer from Olusesan Amey
+ ses66181+1@gmail.com","currency":"NGN","reference":"120-0-97165300 1652605656","debit_currency":"NGN"} //// {"status":200,"statusText":"OK","data":{"status":"success","message":"Transfer Queued Successfully","data":{"id":345332,"account_number":"0690000031","bank_code":"044","full_name":"Forrest Green","created_at":"2022-05-15T09:07:37.000Z","currency":"NGN","debit_currency":"NGN","amount":123,"fee":10.75,"status":"NEW","reference":"120-0-97165300 1652605656","meta":null,"narration":"Transfer from Olusesan Amey
+ ses66181+1@gmail.com","complete_message":"","requires_approval":0,"is_approved":1,"bank_name":"ACCESS BANK NIGERIA"}}}
+ */
+
+ // Further processing ...
+ if ($data!=null && is_array($data)) {
+ if (array_key_exists('status',$data) && $data['status']=='success') {
+ $out['result'] = 0; // OK
+ $out['status'] = 'Transfer successful';
+ if (array_key_exists('message',$data) && $data['message']!='') {
+ $out['status'].= ': '.$data['message'];
+ }
+ } else {
+ $out['result'] = -3;
+ $out['status'] = 'failure';
+ if (array_key_exists('status',$data) && $data['status']!='') {
+ $out['status'] = (is_array($data['status'])?implode("
\n",$data['status']):$data['status']);
+ }
+ if (array_key_exists('message',$data) && $data['message']!='') {
+ $out['status'].= ': '.(is_array($data['message'])?implode("
\n",$data['message']):$data['message']);
+ }
+ if (array_key_exists('details',$data) && $data['details']!='') {
+ $out['status'].= ':
'.json_encode($data['details'],JSON_PRETTY_PRINT).''; + //$out['status'].= ': '.(is_array($data['details'])?implode("
${response}";
+
+ if ($response != "") {
+ $data = json_decode($response,true);
+ if (is_array($data) && count($data)>0) {
+ $out["data"] = $data;
+ if (array_key_exists("recipients",$data) && $data["recipients"] > 0
+ && (!array_key_exists("errors",$data) || count($data["errors"]) < 1)) {
+ $out["status"] = "Sent to ".$data["recipients"]." recipeint(s)";
+ $out["result"] = 1;
+ } else {
+ $out["status"] = "errors: ".
+ (array_key_exists("errors",$data)?json_encode($data["errors"]):"unknown error");
+ }
+ } else {
+ $out["status"] = "Invalid OneSignal API response: ".$response;
+ }
+ } else {
+ $out["status"] = "Missing OneSignal API response";
+ }
+ return $out;
+ }
+}