This commit is contained in:
2024-10-14 21:47:19 +05:00
parent 42f3e5512b
commit 2f21e78bf3
3 changed files with 22 additions and 4 deletions

View File

@@ -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',
]);
}
/**

View File

@@ -116,7 +116,9 @@ class OnlinePaymentHistoryResource extends Resource
public function actions(NovaRequest $request)
{
return [
CheckOnlinePayment::make(),
CheckOnlinePayment::make()
->icon('rss')
->sole(),
];
}
}

View File

@@ -62,4 +62,9 @@ class OnlinePaymentHistoryPolicy
{
return false;
}
public function runAction()
{
return true;
}
}