This commit is contained in:
2025-09-09 16:31:30 +05:00
parent 161f993099
commit 5a4759a137
2 changed files with 23 additions and 32 deletions

View File

@@ -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 = [
curl_setopt_array($curl, [ 'Content-Type' => 'application/json',
CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new', 'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz'
CURLOPT_RETURNTRANSFER => true, ];
CURLOPT_ENCODING => '', $body = '{
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"ecomId": "'.$ecomId.'", "ecomId": "'.$ecomId.'",
"agentId": "'.$agentId.'", "agentId": "'.$agentId.'",
"eposId": "'.$eposId.'", "eposId": "'.$eposId.'",
"account": "'.$account.'", "account": "'.$account.'",
"rrn": "'.$rrn.'", "rnn": "'.$rrn.'",
"amount": "'.$amount.'", "amount": "'.$amount.'",
"payPurpose": "'.$payPurpose.'" "payPurpose": "'.$payPurpose.'"
}', }';
CURLOPT_HTTPHEADER => [ $request = new GuzzleRequest('POST', 'http://10.3.158.102:8888/api/paytrn/new', $headers, $body);
'Authorization: Basic YWRtaW46UUFad3N4MTIz',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl); try {
$res = $client->sendAsync($request)->wait();
curl_close($curl); return $res->getBody();
} catch (Exception $e) {
Log::error($e);
return $response; return null;
}
} }
/** /**

View File

@@ -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);