From 386e74374b7ed72ab403c78c754b3456bfb002c9 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Sun, 2 Nov 2025 18:25:42 +0500 Subject: [PATCH] wip --- .../Repositories/OnlinePaymentRepository.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php b/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php index 3d817a3..eefac87 100644 --- a/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php +++ b/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php @@ -191,6 +191,8 @@ class OnlinePaymentRepository return $this->paymentFailed( title: __('Payment has failed'), + paymentHistory: $paymentHistory, + bankBranch: $bankBranch, ); } @@ -239,7 +241,7 @@ class OnlinePaymentRepository return $this->paymentCheckResponseTemplate( success: true, - pnr: $paymentHistory->orderNumber, + pnr: $paymentHistory->online_paymantable_id, branch_name: $bankBranch->name, price_amount: $paymentHistory->amount.' TMT' ); @@ -248,12 +250,19 @@ class OnlinePaymentRepository /** * Failed payment */ - public function paymentFailed(string $title = '', $paymentHistory = null): array + public function paymentFailed(string $title = '', $paymentHistory = null, $bankBranch = null): array { if ($paymentHistory) { $paymentHistory->update([ 'paymentStatus' => OnlinePaymentRepository::FAILED, ]); + + return $this->paymentCheckResponseTemplate( + success: false, + pnr: $paymentHistory->online_paymantable_id, + branch_name: $bankBranch->name, + price_amount: $paymentHistory->amount.' TMT' + ); } return $this->paymentCheckResponseTemplate(false, $title);