This commit is contained in:
nurmuhammet committed 2024-11-25 18:01:18 +05:00
1 parent 2404feebe6
commit 7259cdcb26
7 files changed
+70 -5

No files matched your search

@@ -5,6 +5,31 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $refunded_amount
* @property string $booking_number
* @property string $amount
* @property string $depositedAmount
* @property string $orderNumber
* @property string $description
* @property string $orderId
* @property string $cardholderName
* @property string $pan
* @property string $approvalCode
* @property string $expiration
* @property string $formUrl
* @property string $successUrl
* @property string $errorUrl
* @property string $api_client
* @property string $paymentStatus
* @property string $callbackStatus
* @property string $username
* @property int $online_paymantable_id
* @property string $online_paymantable_type
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
*/
class OnlinePaymentHistory extends Model
{
use HasFactory;
@@ -82,7 +82,7 @@ public function lenses(NovaRequest $request)
/**
* Get the actions available for the resource.
*
* @return array
* @return array<int, \Laravel\Nova\Actions\Action>
*/
public function actions(NovaRequest $request): array
{
+4 -1
View File
@@ -63,7 +63,10 @@ public function forceDelete(User $user, OnlinePaymentHistory $onlinePaymentHisto
return false;
}
public function runAction()
/**
* Run the action
*/
public function runAction(): bool
{
return true;
}
+5
View File
@@ -9,6 +9,11 @@
class LoanOrderRepo
{
/**
* Satisfiable values
*
* @return array<string|null, string>
*/
public static function satisfiableValues(): array
{
return [
+2
View File
@@ -19,6 +19,8 @@ public static function values(): Collection|array
/**
* Only guarantor
*
* @return \Illuminate\Support\Collection<string, mixed>|array<int, string>
*/
public static function onlyGuarantor(): Collection|array
{
+25 -2
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 @@ public static function statusView(): string
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 @@ protected static function logResourceNotFound($request, $paymentHistory): void
]);
}
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 @@ public static function successfulPaymentResponse($paymentHistory, $bank_branch,
];
}
/**
* Failed payment response
*
* @param $paymentHistory
* @param $bank_branch
* @param $resource
*/
public static function failedPaymentResponse($paymentHistory, $bank_branch, $resource)
{
return [
@@ -193,6 +213,9 @@ public static function failedPaymentResponse($paymentHistory, $bank_branch, $res
];
}
/**
* Resource not found
*/
protected static function resourceNotFound(): array
{
return [
@@ -10,7 +10,14 @@
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();