wip
This commit is contained in:
@@ -447,37 +447,31 @@ function syncWithBankSystem(
|
||||
$amount = $online_payment_tmt_amount;
|
||||
$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, [
|
||||
CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new',
|
||||
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'
|
||||
],
|
||||
]);
|
||||
try {
|
||||
$res = $client->sendAsync($request)->wait();
|
||||
|
||||
$response = curl_exec($curl);
|
||||
return $res->getBody();
|
||||
} catch (Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user