This commit is contained in:
2025-11-02 18:25:42 +05:00
parent 910a7dd1b2
commit 386e74374b

View File

@@ -191,6 +191,8 @@ class OnlinePaymentRepository
return $this->paymentFailed( return $this->paymentFailed(
title: __('Payment has failed'), title: __('Payment has failed'),
paymentHistory: $paymentHistory,
bankBranch: $bankBranch,
); );
} }
@@ -239,7 +241,7 @@ class OnlinePaymentRepository
return $this->paymentCheckResponseTemplate( return $this->paymentCheckResponseTemplate(
success: true, success: true,
pnr: $paymentHistory->orderNumber, pnr: $paymentHistory->online_paymantable_id,
branch_name: $bankBranch->name, branch_name: $bankBranch->name,
price_amount: $paymentHistory->amount.' TMT' price_amount: $paymentHistory->amount.' TMT'
); );
@@ -248,12 +250,19 @@ class OnlinePaymentRepository
/** /**
* Failed payment * Failed payment
*/ */
public function paymentFailed(string $title = '', $paymentHistory = null): array public function paymentFailed(string $title = '', $paymentHistory = null, $bankBranch = null): array
{ {
if ($paymentHistory) { if ($paymentHistory) {
$paymentHistory->update([ $paymentHistory->update([
'paymentStatus' => OnlinePaymentRepository::FAILED, '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); return $this->paymentCheckResponseTemplate(false, $title);