Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/Sipay/Enums/OrderBy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Sipay\Enums;

final class OrderBy
{
public const ASC = 'asc';
public const DESC = 'desc';

/**
* Get all valid order by values.
*
* @return array<string>
*/
public static function getAll(): array
{
return [
self::ASC,
self::DESC,
];
}

/**
* Check if a given value is a valid order by value.
*/
public static function isValid(string $value): bool
{
return in_array($value, self::getAll(), true);
}
}
34 changes: 34 additions & 0 deletions src/Sipay/Enums/TransactionStatusCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

namespace Sipay\Enums;

final class TransactionStatusCode
{
public const SUCCESS = 'success';
public const PENDING = 'pending';
public const FAILED = 'failed';

/**
* Get all valid transaction status codes.
*
* @return array<string>
*/
public static function getAll(): array
{
return [
self::SUCCESS,
self::PENDING,
self::FAILED,
];
}

/**
* Check if a given value is a valid transaction status code.
*/
public static function isValid(string $value): bool
{
return in_array($value, self::getAll(), true);
}
}
34 changes: 34 additions & 0 deletions src/Sipay/Enums/TransactionTypeCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

namespace Sipay\Enums;

final class TransactionTypeCode
{
public const PAYMENT = 'payment';
public const REFUND = 'refund';
public const FEE = 'fee';

/**
* Get all valid transaction type codes.
*
* @return array<string>
*/
public static function getAll(): array
{
return [
self::PAYMENT,
self::REFUND,
self::FEE,
];
}

/**
* Check if a given value is a valid transaction type code.
*/
public static function isValid(string $value): bool
{
return in_array($value, self::getAll(), true);
}
}
Loading