wip
This commit is contained in:
@@ -447,37 +447,31 @@ function syncWithBankSystem(
|
|||||||
$amount = $online_payment_tmt_amount;
|
$amount = $online_payment_tmt_amount;
|
||||||
$payPurpose = $pay_purpose;
|
$payPurpose = $pay_purpose;
|
||||||
|
|
||||||
$curl = curl_init();
|
$client = new Client();
|
||||||
|
$headers = [
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz'
|
||||||
|
];
|
||||||
|
$body = '{
|
||||||
|
"ecomId": "'.$ecomId.'",
|
||||||
|
"agentId": "'.$agentId.'",
|
||||||
|
"eposId": "'.$eposId.'",
|
||||||
|
"account": "'.$account.'",
|
||||||
|
"rnn": "'.$rrn.'",
|
||||||
|
"amount": "'.$amount.'",
|
||||||
|
"payPurpose": "'.$payPurpose.'"
|
||||||
|
}';
|
||||||
|
$request = new GuzzleRequest('POST', 'http://10.3.158.102:8888/api/paytrn/new', $headers, $body);
|
||||||
|
|
||||||
curl_setopt_array($curl, [
|
try {
|
||||||
CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new',
|
$res = $client->sendAsync($request)->wait();
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
CURLOPT_ENCODING => '',
|
|
||||||
CURLOPT_MAXREDIRS => 10,
|
|
||||||
CURLOPT_TIMEOUT => 0,
|
|
||||||
CURLOPT_FOLLOWLOCATION => true,
|
|
||||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
||||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
|
||||||
CURLOPT_POSTFIELDS => '{
|
|
||||||
"ecomId": "'.$ecomId.'",
|
|
||||||
"agentId": "'.$agentId.'",
|
|
||||||
"eposId": "'.$eposId.'",
|
|
||||||
"account": "'.$account.'",
|
|
||||||
"rrn": "'.$rrn.'",
|
|
||||||
"amount": "'.$amount.'",
|
|
||||||
"payPurpose": "'.$payPurpose.'"
|
|
||||||
}',
|
|
||||||
CURLOPT_HTTPHEADER => [
|
|
||||||
'Authorization: Basic YWRtaW46UUFad3N4MTIz',
|
|
||||||
'Content-Type: application/json'
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
$response = curl_exec($curl);
|
return $res->getBody();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Log::error($e);
|
||||||
|
|
||||||
curl_close($curl);
|
return null;
|
||||||
|
}
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -67,10 +67,7 @@ class SyncWithSystem extends Action
|
|||||||
|
|
||||||
info(['response' => $systemRawResponse]);
|
info(['response' => $systemRawResponse]);
|
||||||
|
|
||||||
return Action::modal('modal-response', [
|
return Action::success('Sync with system success');
|
||||||
'html' => $systemRawResponse,
|
|
||||||
'title' => 'SYSTEM API',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// $systemResponse = json_decode($systemRawResponse);
|
// $systemResponse = json_decode($systemRawResponse);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user