generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
539532d
commit ff8d6c2
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Routegroup\Imoje\Payment\DTO\Casts; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Routegroup\Imoje\Payment\DTO\BaseDto; | ||
use Routegroup\Imoje\Payment\Factories\Casts\ActionDtoFactory; | ||
use Routegroup\Imoje\Payment\Types\ActionType; | ||
|
||
/** | ||
* @property-read ActionType $type | ||
* @property-read string $url | ||
* @property-read string $method | ||
* @property-read string $contentType | ||
* @property-read string $contentBodyRaw | ||
* @property-read string|null $ban | ||
*/ | ||
class ActionDto extends BaseDto | ||
{ | ||
use HasFactory; | ||
|
||
protected array $casts = [ | ||
'type' => ActionType::class, | ||
'url' => 'string', | ||
'method' => 'string', | ||
'contentType' => 'string', | ||
'contentBodyRaw' => 'string', | ||
]; | ||
|
||
protected static function newFactory(): ActionDtoFactory | ||
{ | ||
return ActionDtoFactory::new(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Routegroup\Imoje\Payment\Factories\Casts; | ||
|
||
use Routegroup\Imoje\Payment\DTO\Casts\ActionDto; | ||
use Routegroup\Imoje\Payment\Factories\Factory; | ||
use Routegroup\Imoje\Payment\Types\ActionType; | ||
|
||
class ActionDtoFactory extends Factory | ||
{ | ||
protected $model = ActionDto::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'type' => ActionType::TRANSFER, | ||
'url' => '', | ||
'method' => 'GET', | ||
'contentType' => '', | ||
'contentBodyRaw' => '', | ||
]; | ||
} | ||
|
||
public function wireTransfer(): static | ||
{ | ||
return $this->state([ | ||
'iban' => $this->faker->iban, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Routegroup\Imoje\Payment\Types; | ||
|
||
enum ActionType: string | ||
{ | ||
case REDIRECT = 'redirect'; | ||
case TRANSFER = 'transfer'; | ||
} |