Flutter hook

This commit is contained in:
CHIEFSOFT\ameye
2023-07-28 08:13:29 -04:00
parent 697b971472
commit 683096e59a
4 changed files with 85 additions and 2 deletions
+47
View File
@@ -45,11 +45,58 @@ class WrenchHooks extends BaseController
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["id"] );
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["AccountId"] );
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["fullName"] );
$data = [
"event_type" => $in["event.type"],
"status" => $in["status"],
"txRef" => $in["txRef"],
"flwRef" => $in["orderRef"],
"orderRef" => $in["orderRef"] ,
"amount" => $in["amount"]*100 ,
"appfee" => $in["appfee"]*100,
"customer_id" => $in["customer"]["id"],
"AccountId" => $in["customer"]["AccountId"],
"fullName" => $in["customer"]["fullName"],
"action" => WRECNH_CREDIT_HOOKS_FULUTTER,
"raw_result" => serialize($in),
];
if ( $data["action"] !='' ){
$wrenchboard = new \App\Models\BackendModel();
$ret = $wrenchboard->wrenchboard_api($data, $out);
$out['internal_return'] = $ret;
}
}
}
/*
CREATE TABLE flutterwave_hooks (
id SERIAL,
uid uuid DEFAULT uuid_generate_v4(),
event_type VARCHAR(25),
status VARCHAR(25),
txRef VARCHAR(50),
flwRef VARCHAR(50),
orderRef VARCHAR(50),
amount INT DEFAULT 0,
appfee INT DEFAULT 0,
customer_id VARCHAR(25),
AccountId VARCHAR(25),
fullName VARCHAR(50),
raw_result TEXT,
process_status INT DEFAULT 1,
added timestamp without time zone DEFAULT now(),
updated timestamp without time zone DEFAULT now()
);
ALTER TABLE ONLY flutterwave_hooks
ADD CONSTRAINT flutterwave_hooks_id_key UNIQUE (id);
*{
s:2:"id";i:4490321;
s:5:"txRef";s:13:"1690507667625";