diff --git a/app/Nova/Actions/CheckOnlinePayment.php b/app/Nova/Actions/CheckOnlinePayment.php index f7937c6..e1eb36d 100644 --- a/app/Nova/Actions/CheckOnlinePayment.php +++ b/app/Nova/Actions/CheckOnlinePayment.php @@ -37,14 +37,21 @@ class CheckOnlinePayment extends Action $relatedResource->load('branch'); + $username = ''; + $password = ''; + + if ($onlinePaymentResource->api_client == 'billing_visa_master_username') { + $username = $relatedResource->branch->billing_visa_master_username; + $password = $relatedResource->branch->billing_visa_master_password; + } + if ($onlinePaymentResource->api_client == 'billing_username') { $username = $relatedResource->branch->billing_username; $password = $relatedResource->branch->billing_password; } - if ($onlinePaymentResource->api_client == 'billing_visa_master_username') { - $username = $relatedResource->branch->billing_visa_master_username; - $password = $relatedResource->branch->billing_visa_master_password; + if ($username == '') { + return ActionResponse::danger('Ulanyjy ady bn acar sozuni gabat gelmedi'); } $response = Http::asForm()->post('https://mpi.gov.tm/payment/rest/getOrderStatus.do', [ @@ -61,6 +68,10 @@ class CheckOnlinePayment extends Action 'message' => 'Tölenen', ]); } + + return Action::modal('modal', [ + 'message' => 'Tölenmedik', + ]); } /** diff --git a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php index e36204a..f36c194 100644 --- a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php +++ b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php @@ -116,7 +116,9 @@ class OnlinePaymentHistoryResource extends Resource public function actions(NovaRequest $request) { return [ - CheckOnlinePayment::make(), + CheckOnlinePayment::make() + ->icon('rss') + ->sole(), ]; } } diff --git a/app/Policies/OnlinePaymentHistoryPolicy.php b/app/Policies/OnlinePaymentHistoryPolicy.php index 142f2ba..383bff9 100644 --- a/app/Policies/OnlinePaymentHistoryPolicy.php +++ b/app/Policies/OnlinePaymentHistoryPolicy.php @@ -62,4 +62,9 @@ class OnlinePaymentHistoryPolicy { return false; } + + public function runAction() + { + return true; + } }