api_response)) { info(OnlinePaymentRepo::syncWithBilling( uuid: $paymentHistory->orderId, bank_code: $bank->unique_code, terminal_id: $paymentHistory->api_response['terminalId'], account_number: $resource->parent->sender_datas[0]['deposit_account'], rrn: $paymentHistory->api_response['authRefNum'], amount: $resource->tmt_payment_amount, pay_purpose: $resource->created_at->translatedFormat('F').' '.$resource->created_at->format('Y'), )); } return view(OnlinePaymentRepo::statusView(), $data); } /** * Sber online payment */ public function sber(OnlinePaymentStoreRequest $request): View { $data = OnlinePaymentRepo::checkPaymentSber($request); /** @var \App\Models\Payment\OnlinePaymentHistory */ $paymentHistory = $data['paymentHistory']; /** @var \App\Models\Branch\Branch */ $bank = $data['bank_branch']; /** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrderItem */ $resource = $data['resource']; $response = $data['response']; // if ($data['success'] && $paymentHistory) { // $this->runActions($paymentHistory, $bank, $response, $resource); // } 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); } }