This commit is contained in:
2025-09-09 11:06:36 +05:00
parent 4e1f286eb5
commit 0b63d9098e
3 changed files with 125 additions and 44 deletions

View File

@@ -73,47 +73,4 @@ class OnlinePaymentController extends Controller
return view(OnlinePaymentRepo::statusView(), $data);
}
public function runActions($paymentHistory, $bank, $response, $resource): void
{
$ecomId = $paymentHistory->orderId;
$agentId = $bank->unique_code;
$eposId = $response['terminalId'];
$account = $resource->parent->sender_datas[0]['deposit_account'];
$rrn = $response['authRefNum'];
$amount = $resource->tmt_payment_amount;
$payPurpose = $resource->created_at->translatedFormat('F').' '.$resource->created_at->format('Y');
$curl = curl_init();
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 => sprintf('{
"ecomId": "%s",
"agentId": "%s",
"eposId": "%s",
"account": "%s",
"rrn": "%s",
"amount": "%s",
"payPurpose": "%s"
}', $ecomId, $agentId, $eposId, $account, $rrn, $amount, $payPurpose),
CURLOPT_HTTPHEADER => [
'Authorization: Basic YWRtaW46UUFad3N4MTIz',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
info($response);
}
}