-
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.
- Loading branch information
0 parents
commit 36a1863
Showing
30 changed files
with
1,511 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,74 @@ | ||
# Composer dependency directory | ||
/vendor/ | ||
|
||
# Composer package file | ||
composer.lock | ||
|
||
# PHPStorm project files | ||
.idea/ | ||
|
||
# NetBeans project files | ||
nbproject/ | ||
nbproject/private/ | ||
|
||
# Symfony directories | ||
/app/cache/ | ||
/app/logs/ | ||
/var/cache/ | ||
/var/logs/ | ||
/var/sessions/ | ||
|
||
# Laravel directories | ||
/node_modules/ | ||
/public/storage | ||
/public/hot | ||
/storage/*.key | ||
.env | ||
|
||
# Laravel 4 specific | ||
bootstrap/compiled.php | ||
app/storage/ | ||
|
||
# Laravel 5 & 6 specific | ||
public/storage | ||
public/hot | ||
storage/*.key | ||
.env.*.php | ||
.env.php | ||
Homestead.yaml | ||
Homestead.json | ||
.vagrant/ | ||
|
||
# PHPUnit | ||
.phpunit.result.cache | ||
|
||
# Directories for local environments | ||
/.vagrant/ | ||
/homestead/ | ||
|
||
# Log files | ||
*.log | ||
|
||
# Backup files | ||
*.bak | ||
|
||
# Other development environment files | ||
.env.local | ||
.env.*.local | ||
.php-version | ||
/.env.local.php | ||
|
||
# IDE files | ||
/.phpstorm.meta.php | ||
/.idea/ | ||
*.iml | ||
*.iws | ||
*.ipr | ||
/.vscode/ | ||
_ide_helper.php | ||
_ide_helper_models.php | ||
.phpstorm.meta.php | ||
/.phpunit.result.cache | ||
|
||
# eZ Platform | ||
/var/cache |
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,25 @@ | ||
{ | ||
"name": "ghasedaksms/php", | ||
"type": "library", | ||
"description": "a package for use ghasedaksms api services in php programming", | ||
"keywords": ["ghasedak","ghasedaksms", "sms", "sms-api", "sms-gateway", "notification"], | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"Ghasedak\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "mrt", | ||
"email": "mortezaei76@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=8.2", | ||
"ext-curl": "*", | ||
"ext-json": "*" | ||
}, | ||
"minimum-stability" : "stable", | ||
"prefer-stable" : true | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Ghasedak; | ||
|
||
final readonly class Constants | ||
{ | ||
const URL = 'https://gw.ghasedak.me/Rest/api/v1/WebService'; | ||
|
||
const SEND_SINGLE = '/SendSingleSMS'; | ||
|
||
const SEND_BULK = '/SendBulkSMS'; | ||
|
||
const SEND_PAIR_TO_PAIR = '/SendPairToPairSMS'; | ||
|
||
const SEND_OTP = '/SendOtpSMS'; | ||
|
||
const SEND_OTP_WITH_PARAMS = '/SendOtpWithParams'; | ||
|
||
const CHECK_SMS_STATUS = '/CheckSmsStatus'; | ||
|
||
const GET_ACCOUNT_INFORMATION = '/GetAccountInformation'; | ||
|
||
const GET_RECEIVED_SMSES = '/GetReceivedSmses'; | ||
|
||
const GET_RECEIVED_SMSES_PAGING = '/GetReceivedSmsesPaging'; | ||
|
||
const GET_OTP_TEMPLATE_PARAMETERS = '/GetOtpTemplateParameters'; | ||
} |
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,72 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
use DateTimeInterface; | ||
|
||
readonly class BulkMessageDTO | ||
{ | ||
|
||
/** | ||
* @param array<string> $receptors | ||
*/ | ||
public function __construct( | ||
private DateTimeInterface $sendDate, | ||
private string $lineNumber, | ||
private array $receptors, | ||
private string $message, | ||
private ?bool $isVoice = false, | ||
private ?bool $udh = false, | ||
private ?string $clientReferenceId = null, | ||
) | ||
{ | ||
} | ||
|
||
public function getSendDate(): DateTimeInterface | ||
{ | ||
return $this->sendDate; | ||
} | ||
|
||
public function getLineNumber(): string | ||
{ | ||
return $this->lineNumber; | ||
} | ||
|
||
public function getReceptors(): array | ||
{ | ||
return $this->receptors; | ||
} | ||
|
||
public function getMessage(): string | ||
{ | ||
return $this->message; | ||
} | ||
|
||
public function getClientReferenceId(): string | ||
{ | ||
return $this->clientReferenceId; | ||
} | ||
|
||
public function isVoice(): bool | ||
{ | ||
return $this->isVoice; | ||
} | ||
|
||
public function isUdh(): bool | ||
{ | ||
return $this->udh; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'sendDate' => $this->sendDate->format('c'), | ||
'lineNumber' => $this->lineNumber, | ||
'receptors' => $this->receptors, | ||
'message' => $this->message, | ||
'clientReferenceId' => $this->clientReferenceId, | ||
'isVoice' => $this->isVoice, | ||
'udh' => $this->udh | ||
]; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
readonly class CheckSmsStatusDTO | ||
{ | ||
public function __construct( | ||
private array $ids, | ||
private int $type | ||
) | ||
{ | ||
} | ||
|
||
public function getIds(): array | ||
{ | ||
return $this->ids; | ||
} | ||
|
||
public function getType(): int | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'Ids' => implode(',', $this->ids), | ||
'type' => $this->type | ||
]; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/DataTransferObjects/Request/GetOtpTemplateParametersDTO.php
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,24 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
readonly class GetOtpTemplateParametersDTO | ||
{ | ||
public function __construct( | ||
private string $templateName | ||
) | ||
{ | ||
} | ||
|
||
public function getTemplateName(): string | ||
{ | ||
return $this->templateName; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'TemplateName' => $this->templateName | ||
]; | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
readonly class GetReceivedSMSesDTO | ||
{ | ||
public function __construct( | ||
private string $lineNumber, | ||
private ?bool $isRead = null | ||
) | ||
{ | ||
} | ||
|
||
public function getLineNumber(): string | ||
{ | ||
return $this->lineNumber; | ||
} | ||
|
||
public function isRead(): bool | ||
{ | ||
return $this->isRead; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'LineNumber' => $this->lineNumber, | ||
'IsRead' => $this->isRead | ||
]; | ||
} | ||
|
||
|
||
} |
61 changes: 61 additions & 0 deletions
61
src/DataTransferObjects/Request/GetReceivedSMSesPagingDTO.php
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,61 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
use DateTimeInterface; | ||
|
||
readonly class GetReceivedSMSesPagingDTO | ||
{ | ||
public function __construct( | ||
private string $lineNumber, | ||
private ?DateTimeInterface $startDate = null, | ||
private ?DateTimeInterface $endDate = null, | ||
private ?int $pageIndex = null, | ||
private ?int $pageSize = null, | ||
private ?bool $isRead = null | ||
) | ||
{ | ||
} | ||
|
||
public function getLineNumber(): string | ||
{ | ||
return $this->lineNumber; | ||
} | ||
|
||
public function isRead(): bool | ||
{ | ||
return $this->isRead; | ||
} | ||
|
||
public function getStartDate(): DateTimeInterface | ||
{ | ||
return $this->startDate; | ||
} | ||
|
||
public function getEndDate(): DateTimeInterface | ||
{ | ||
return $this->endDate; | ||
} | ||
|
||
public function getPageIndex(): int | ||
{ | ||
return $this->pageIndex; | ||
} | ||
|
||
public function getPageSize(): int | ||
{ | ||
return $this->pageSize; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'LineNumber' => $this->lineNumber, | ||
'IsRead' => $this->isRead, | ||
'StartDate' => $this->startDate?->format('c'), | ||
'EndDate' => $this->endDate?->format('c'), | ||
'PageIndex' => $this->pageIndex, | ||
'pageSize' => $this->pageSize | ||
]; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace Ghasedak\DataTransferObjects\Request; | ||
|
||
readonly class InputDTO | ||
{ | ||
public function __construct( | ||
private string $param, | ||
private string $value, | ||
) | ||
{ | ||
} | ||
|
||
public function getParam(): string | ||
{ | ||
return $this->param; | ||
} | ||
|
||
public function getValue(): string | ||
{ | ||
return $this->value; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'param' => $this->param, | ||
'value' => $this->value | ||
]; | ||
} | ||
} |
Oops, something went wrong.