This commit is contained in:
2025-11-02 20:12:34 +05:00
parent 7f394b90fa
commit 94badf95b8
4 changed files with 45 additions and 4 deletions

View File

@@ -10,6 +10,17 @@ class CreateCardOrder extends CreateRecord
{
protected static string $resource = CardOrderResource::class;
/**
* @return array<Action | ActionGroup>
*/
protected function getFormActions(): array
{
return [
$this->getCreateFormAction(),
$this->getCancelFormAction(),
];
}
protected function getRedirectUrl(): string
{
$defaultUrl = $this->getResource()::getUrl('index');
@@ -17,11 +28,11 @@ class CreateCardOrder extends CreateRecord
/** @var \App\Modules\CardOrder\Models\CardOrder */
$record = $this->record;
$OnlinePayment = CardOrderRepository::make()
$onlinePayment = CardOrderRepository::make()
->createOnlinePaymentOrder($record);
return $OnlinePayment->successful()
? $OnlinePayment->paymentLink()
return $onlinePayment->successful()
? $onlinePayment->paymentLink()
: $defaultUrl;
}
}