This commit is contained in:
2025-03-19 09:47:28 +05:00
parent 0e8a34a84b
commit 1181100e29
5 changed files with 29 additions and 11 deletions

View File

@@ -25,7 +25,25 @@ class OnlinePaymentController extends Controller
{ {
$data = OnlinePaymentRepo::checkPaymentVisaMaster($request); $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); return view(OnlinePaymentRepo::statusView(), $data);
} }

View File

@@ -55,8 +55,6 @@ trait HandlesBillingSyncing
curl_close($curl); curl_close($curl);
info($response);
return $response; return $response;
} }
} }

View File

@@ -186,8 +186,6 @@ class OnlinePaymentRepo
/** /**
* Successfully payment response * Successfully payment response
*
* @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string}
*/ */
public static function successfulPaymentResponse( public static function successfulPaymentResponse(
OnlinePaymentHistory $paymentHistory, OnlinePaymentHistory $paymentHistory,
@@ -202,13 +200,14 @@ class OnlinePaymentRepo
'branch_name' => $bank_branch->name, 'branch_name' => $bank_branch->name,
'price_amount' => \convertToOriginalFormat($paymentHistory->amount).' TMT', 'price_amount' => \convertToOriginalFormat($paymentHistory->amount).' TMT',
'return_url' => $returnURL, 'return_url' => $returnURL,
'bank_branch' => $bank_branch,
'resource' => $resource,
'paymentHistory' => $paymentHistory,
]; ];
} }
/** /**
* Failed payment response * Failed payment response
*
* @return array{success: bool, title: string, pnr: string, branch_name: string, price_amount: string, return_url: string}
*/ */
public static function failedPaymentResponse( public static function failedPaymentResponse(
OnlinePaymentHistory $paymentHistory, OnlinePaymentHistory $paymentHistory,
@@ -223,13 +222,14 @@ class OnlinePaymentRepo
'branch_name' => $bank_branch->name, 'branch_name' => $bank_branch->name,
'price_amount' => convertToOriginalFormat($paymentHistory->amount).' TMT', 'price_amount' => convertToOriginalFormat($paymentHistory->amount).' TMT',
'return_url' => $returnURL, 'return_url' => $returnURL,
'paymentHistory' => $paymentHistory,
'bank_branch' => $bank_branch,
'resource' => $resource,
]; ];
} }
/** /**
* Resource not found * 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 protected static function resourceNotFound(): array
{ {
@@ -240,6 +240,9 @@ class OnlinePaymentRepo
'branch_name' => '', 'branch_name' => '',
'price_amount' => '', 'price_amount' => '',
'return_url' => url('/'), 'return_url' => url('/'),
'bank_branch' => null,
'resource' => null,
'paymentHistory' => null,
]; ];
} }
} }

View File

@@ -14,8 +14,6 @@ trait HandlesVisaMasterPayments
* Check payment payment visa master * Check payment payment visa master
* *
* @param Request $request * @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 public static function checkPaymentVisaMaster(Request $request): array
{ {

View File

@@ -0,0 +1 @@
<h2>Welcome</h2>