generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduces factories and different types of responses
- Loading branch information
1 parent
2f763c4
commit c898482
Showing
42 changed files
with
824 additions
and
407 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,52 @@ | ||
<?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\PaymentProfileDtoFactory; | ||
|
||
/** | ||
* @property-read string|null $id | ||
* @property-read string $merchantMid | ||
* @property-read string|null $merchantCustomerId | ||
* @property-read string|null $firstName | ||
* @property-read string|null $lastName | ||
* @property-read string|null $maskedNumber | ||
* @property-read int|null $month | ||
* @property-read int|null $year | ||
* @property-read string|null $organization | ||
* @property-read bool|null $isActive | ||
* @property-read string|null $profile | ||
*/ | ||
class PaymentProfileDto extends BaseDto | ||
{ | ||
use HasFactory; | ||
|
||
protected $attributes = [ | ||
'id' => null, | ||
'merchantMid' => null, | ||
'merchantCustomerId' => null, | ||
'firstName' => null, | ||
'lastName' => null, | ||
'maskedNumber' => null, | ||
'month' => null, | ||
'year' => null, | ||
'organization' => null, | ||
'isActive' => null, | ||
'profile' => null, | ||
]; | ||
|
||
protected array $casts = [ | ||
'month' => 'int', | ||
'year' => 'int', | ||
'isActive' => 'bool', | ||
]; | ||
|
||
protected static function newFactory(): PaymentProfileDtoFactory | ||
{ | ||
return PaymentProfileDtoFactory::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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Routegroup\Imoje\Payment\DTO\Notifications; | ||
|
||
use Routegroup\Imoje\Payment\DTO\BaseDto; | ||
use Routegroup\Imoje\Payment\DTO\Casts\PaymentDto; | ||
use Routegroup\Imoje\Payment\DTO\Casts\TransactionDto; | ||
|
||
/** | ||
* @property-read TransactionDto $transaction | ||
* @property-read string $originalTransactionId | ||
* @property-read PaymentDto $payment | ||
*/ | ||
class RefundNotificationDto extends BaseDto | ||
{ | ||
protected array $casts = [ | ||
'transaction' => TransactionDto::class, | ||
'originalTransactionId' => 'string', | ||
'payment' => PaymentDto::class, | ||
]; | ||
} |
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
Oops, something went wrong.