From b9348f3343b19d56462b5db9fcac89d95eac7845 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Sat, 23 Nov 2024 12:00:25 +0500 Subject: [PATCH] wip --- app/Repos/Payment/OnlinePaymentRepo.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 81e4ea4..4afe329 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -171,13 +171,15 @@ class OnlinePaymentRepo return static::resourceNotFound(); } - $resource->load('branch'); + $bank_branch = $resource->parent->branch; + + info($bank_branch); $response = Http::asForm()->post('https://mpi.gov.tm/payment/rest/getOrderStatus.do', [ 'language' => 'ru', 'orderId' => $request->orderId, - 'userName' => $resource->branch->billing_visa_master_username, - 'password' => $resource->branch->billing_visa_master_password, + 'userName' => $bank_branch->billing_visa_master_username, + 'password' => $bank_branch->billing_visa_master_password, ]); info($response->json()); @@ -202,9 +204,9 @@ class OnlinePaymentRepo 'success' => $payment_status, 'title' => $payment_status ? __('Payment is successful') : __('Payment has failed'), 'pnr' => $paymentHistory->orderNumber, - 'branch_name' => $resource->branch->name, + 'branch_name' => $bank_branch->name, 'price_amount' => $paymentHistory->amount, - 'return_url' => $resource->panelUrl('index'), + 'return_url' => url('/work-place/resources/nova-visa-master-payment-orders/' . $resource->visa_master_payment_order_id), ]; }