This commit is contained in:
2024-11-25 18:01:18 +05:00
parent 2404feebe6
commit 7259cdcb26
7 changed files with 70 additions and 5 deletions

View File

@@ -9,6 +9,11 @@ use Illuminate\Database\Eloquent\Model;
class LoanOrderRepo
{
/**
* Satisfiable values
*
* @return array<string|null, string>
*/
public static function satisfiableValues(): array
{
return [

View File

@@ -19,6 +19,8 @@ class LoanTypeRepo
/**
* Only guarantor
*
* @return \Illuminate\Support\Collection<string, mixed>|array<int, string>
*/
public static function onlyGuarantor(): Collection|array
{

View File

@@ -2,8 +2,10 @@
namespace App\Repos\Payment;
use App\Models\Branch\Branch;
use App\Models\Payment\OnlinePaymentHistory;
use App\Repos\Payment\VisaMaster\HandlesVisaMasterPayments;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Laravel\Nova\Makeable;
@@ -156,7 +158,13 @@ class OnlinePaymentRepo
return 'orders.cards.online-payment.status';
}
protected static function logResourceNotFound($request, $paymentHistory): void
/**
* Log resource not found
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Payment\OnlinePaymentHistory $paymentHistory
*/
protected static function logResourceNotFound(Request $request, OnlinePaymentHistory $paymentHistory): void
{
Log::channel('halkbank_payment_check_error')
->error('Related resource not found', [
@@ -169,7 +177,12 @@ class OnlinePaymentRepo
]);
}
public static function successfulPaymentResponse($paymentHistory, $bank_branch, $resource)
/**
* Successfully payment response
*
* @return array<string, bool|string>
*/
public static function successfulPaymentResponse($paymentHistory, $bank_branch, $resource): array
{
return [
'success' => true,
@@ -181,6 +194,13 @@ class OnlinePaymentRepo
];
}
/**
* Failed payment response
*
* @param $paymentHistory
* @param $bank_branch
* @param $resource
*/
public static function failedPaymentResponse($paymentHistory, $bank_branch, $resource)
{
return [
@@ -193,6 +213,9 @@ class OnlinePaymentRepo
];
}
/**
* Resource not found
*/
protected static function resourceNotFound(): array
{
return [

View File

@@ -10,7 +10,14 @@ use Illuminate\Support\Facades\Http;
trait HandlesVisaMasterPayments
{
public static function checkPaymentVisaMaster(Request $request)
/**
* Check payment payment visa master
*
* @param Request $request
*
* @return array<string, bool|string>
*/
public static function checkPaymentVisaMaster(Request $request): array
{
// Find order from history
$paymentHistory = OnlinePaymentHistory::where('orderId', $request->orderId)->first();