From 1181100e297528d3dba4387bea7af917ba49547e Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 19 Mar 2025 09:47:28 +0500 Subject: [PATCH] wip --- .../Controllers/OnlinePaymentController.php | 20 ++++++++++++++++++- .../Payment/Billing/HandlesBillingSyncing.php | 2 -- app/Repos/Payment/OnlinePaymentRepo.php | 15 ++++++++------ .../VisaMaster/HandlesVisaMasterPayments.php | 2 -- resources/views/welcome.blade.php | 1 + 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 resources/views/welcome.blade.php diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index 66d291d..b171d00 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -25,7 +25,25 @@ class OnlinePaymentController extends Controller { $data = OnlinePaymentRepo::checkPaymentVisaMaster($request); - // OnlinePaymentRepo::syncWithBilling(); + /** @var \App\Models\Payment\OnlinePaymentHistory */ + $paymentHistory = $data['paymentHistory']; + + /** @var \App\Models\Branch\Branch */ + $bank = $data['bank_branch']; + + info([$paymentHistory->api_response]); + + // if ($data['success'] && $paymentHistory) { + // info(OnlinePaymentRepo::syncWithBilling( + // uuid: $paymentHistory->orderId, + // bank_code: $bank->unique_code, + // terminal_id: $paymentHistory->api_response, + // account_number:, + // rrn, + // amount, + // pay_purpose: + // )); + // } return view(OnlinePaymentRepo::statusView(), $data); } diff --git a/app/Repos/Payment/Billing/HandlesBillingSyncing.php b/app/Repos/Payment/Billing/HandlesBillingSyncing.php index 904f3f1..5e7a3e6 100644 --- a/app/Repos/Payment/Billing/HandlesBillingSyncing.php +++ b/app/Repos/Payment/Billing/HandlesBillingSyncing.php @@ -55,8 +55,6 @@ trait HandlesBillingSyncing curl_close($curl); - info($response); - return $response; } } diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 20a0c35..f04908e 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -186,8 +186,6 @@ class OnlinePaymentRepo /** * Successfully payment response - * - * @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string} */ public static function successfulPaymentResponse( OnlinePaymentHistory $paymentHistory, @@ -202,13 +200,14 @@ class OnlinePaymentRepo 'branch_name' => $bank_branch->name, 'price_amount' => \convertToOriginalFormat($paymentHistory->amount).' TMT', 'return_url' => $returnURL, + 'bank_branch' => $bank_branch, + 'resource' => $resource, + 'paymentHistory' => $paymentHistory, ]; } /** * Failed payment response - * - * @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string} */ public static function failedPaymentResponse( OnlinePaymentHistory $paymentHistory, @@ -223,13 +222,14 @@ class OnlinePaymentRepo 'branch_name' => $bank_branch->name, 'price_amount' => convertToOriginalFormat($paymentHistory->amount).' TMT', 'return_url' => $returnURL, + 'paymentHistory' => $paymentHistory, + 'bank_branch' => $bank_branch, + 'resource' => $resource, ]; } /** * Resource not found - * - * @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string} */ protected static function resourceNotFound(): array { @@ -240,6 +240,9 @@ class OnlinePaymentRepo 'branch_name' => '', 'price_amount' => '', 'return_url' => url('/'), + 'bank_branch' => null, + 'resource' => null, + 'paymentHistory' => null, ]; } } diff --git a/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php b/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php index 8c912e3..f6e12a5 100644 --- a/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php +++ b/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php @@ -14,8 +14,6 @@ trait HandlesVisaMasterPayments * Check payment payment visa master * * @param Request $request - * - * @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string} */ public static function checkPaymentVisaMaster(Request $request): array { diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php new file mode 100644 index 0000000..9a347eb --- /dev/null +++ b/resources/views/welcome.blade.php @@ -0,0 +1 @@ +

Welcome