allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
2026-03-30 14:54:57 +07:00
parent 66aed7c4e8
commit b5e3a778ce
21316 changed files with 2777892 additions and 13 deletions

32
vendor/melipayamak/php/composer.json vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "melipayamak/php",
"type": "library",
"version": "1.0.0",
"description": "A PHP wrapper for melipayamak's web services",
"keywords": ["melipayamak", "sms", "api"],
"homepage": "http://github.com/Melipayamak/melipayamak-php",
"license": "MIT",
"authors": [
{
"name": "Melipayamak Team",
"email": "melipayamak.ir@gmail.com"
},
{
"name": "Ara Code It",
"email": "ahnara92@gmail.com"
},
{
"name": "Amirhossein Mehrvarzi",
"email": "info@trigger.ir"
}
],
"require": {
"php": ">=5.4.0"
},
"autoload": {
"psr-4": {
"Melipayamak\\": "src/"
}
},
"minimum-stability" : "stable"
}

529
vendor/melipayamak/php/readme.md vendored Normal file
View File

@@ -0,0 +1,529 @@
# Melipayamak PHP
<div dir='rtl'>
### معرفی وب سرویس ملی پیامک
ملی پیامک یک وب سرویس کامل برای ارسال و دریافت پیامک و پیامک صوتی و مدیریت کامل خدمات دیگر است که براحتی میتوانید از آن استفاده کنید.
<hr>
### نصب
<p>قبل از نصب نیاز به ثبت نام در سایت ملی پیامک دارید.</p>
<p></p>
[**ثبت نام به همراه دریافت 200 پیامک هدیه جهت تست وبسرویس**](http://www.melipayamak.com/)
<p>پس ازثبت نام برای نصب از راههای زیر میتوانید اقدام کنید.</p>
</div>
```php
composer require melipayamak/php
```
<div dir='rtl'>
یا از طریق اضافه کردن خط زیر به فایل
composer.json
</div>
```json
"melipayamak/php": "*"
```
<div dir='rtl'>
و سپس اجرای دستور
</div>
composer update
<div dir='rtl'>
#### نحوه استفاده
نمونه کد برای ارسال پیامک
</div>
```php
require __DIR__ . '/vendor/autoload.php';
use Melipayamak\MelipayamakApi;
try{
$username = 'username';
$password = 'password';
$api = new MelipayamakApi($username,$password);
$sms = $api->sms();
$to = '09123456789';
$from = '5000...';
$text = 'تست وب سرویس ملی پیامک';
$response = $sms->send($to,$from,$text);
$json = json_decode($response);
echo $json->Value; //RecId or Error Number
}catch(Exception $e){
echo $e->getMessage();
}
```
<div dir='rtl'>
از آنجا که وب سرویس ملی پیامک تنها محدود به ارسال پیامک نیست شما از طریق زیر میتوانید به وب سرویس ها دسترسی کامل داشته باشید:
</div>
```php
// وب سرویس پیامک
$smsRest = $api->sms();
$smsSoap = $api->sms('soap');
// وب سرویس تیکت پشتیبانی
$ticket = $api->ticket();
// وب سرویس برای مدیریت کامل ارسال انبوه پیامک
$branch = $api->branch();
//وب سرویس کاربران
$users = $api->users();
//وب سرویس دفترچه تلفن
$contacts = $api->contacts()
```
<div dir='rtl'>
##### حالت آسنکرون
شما میتوانید از وب سرویس ملی پیامک در حالت آسنکرون هم استفاده کنید. آماده سازی آسنکرون در PHP به صورت زیر است. توجه کنید که دستورات آسنکرون به شرط فراخوانی متد `execute` (بطور موازی) انجام می شوند.
</div>
```php
// وب سرویس پیامک
$smsRestAsync = $api->sms('async');
$smsSoapAsync = $api->sms('soap', 'async');
// وب سرویس تیکت پشتیبانی
$ticket = $api->ticket('async');
// وب سرویس برای مدیریت کامل ارسال انبوه پیامک
$branch = $api->branch('async');
//وب سرویس کاربران
$users = $api->users('async');
//وب سرویس دفترچه تلفن
$contacts = $api->contacts('async');
```
<div dir='rtl'>
#### تفاوت های وب سرویس پیامک rest و soap
از آنجا که ملی پیامک وب سرویس کاملی رو در اختیار توسعه دهندگان میگزارد برای راحتی کار با وب سرویس پیامک علاوه بر وب سرویس اصلی soap وب سرویس rest رو هم در اختیار توسعه دهندگان گزاشته شده تا راحتتر بتوانند با وب سرویس کار کنند. تفاوت اصلی این دو در تعداد متد هاییست که میتوانید با آن کار کنید. برای کار های پایه میتوان از وب سرویس rest استفاده کرد برای دسترسی بیشتر و استفاده پیشرفته تر نیز باید از وب سرویس باید از وب سرویس soap استفاده کرد.
جهت مطالعه بیشتر وب سرویس ها به قسمت وب سرویس پنل خود مراجعه کنید.
<hr/>
### اطلاعات بیشتر
برای مطالعه بیشتر و دریافت راهنمای وب سرویس ها و آشنایی با پارامتر های ورودی و خروجی وب سرویس به صفحه معرفی
[وب سرویس ملی پیامک](https://github.com/Melipayamak/Webservices)
مراجعه نمایید .
<hr/>
### وب سرویس پیامک
متد های وب سرویس:
</div>
#### ارسال
```php
$smsRest->send($to,$from,$text,$isFlash);
$smsSoap->send($to,$from,$text,$isFlash);
```
#### ارسال از خط خدماتی اشتراکی
```php
$smsRest->sendByBaseNumber($text,$to,$bodyId);
$smsSoap->sendByBaseNumber($text,$to,$bodyId);
```
* در وب سرویس soap به جای ارسال یک شماره آرایه ای از شماره ها نیز قابل قبول است
#### دریافت وضعیت ارسال
```php
$smsRest->isDelivered($recId);
$smsSoap->isDelivered($recId);
```
* به در وب سرویس soap به جای تک آیدی میتوان آرایه نیز ارسال کرد.
#### لیست پیامک ها
```php
$smsRest->getMessages($location,$index,$count,$from);
$smsSoap->getMessages($location,$index,$count,$from);
$smsSoap->getMessagesStr($location,$index,$count,$from);
// جهت دریافت به صورت رشته ای
$smsSoap->getMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo);
//جهت دریافت بر اساس تاریخ
$smsSoap->getUsersMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo);
// جهت دریافت پیام های کاربران بر اساس تاریخ
```
#### موجودی
```php
$smsRest->getCredit();
$smsSoap->getCredit();
```
#### تعرفه پایه / دریافت قیمت قبل از ارسال
```php
$smsRest->getBasePrice();
$smsSoap->getPrice($irancellCount,$mtnCount,$from,$text);
```
#### لیست شماره اختصاصی
```php
$smsRest->getNumbers();
```
#### بررسی تعداد پیامک های دریافتی
```php
$smsSoap->getInboxCount($isRead);
//پیش فرض خوانده نشده
```
#### ارسال پیامک پیشرفته
```php
$smsSoap->send2($to,$from,$text,$isflash,$udh);
```
#### مشاهده مشخصات پیام
```php
$smsSoap->getMessagesReceptions($msgId,$fromRows);
```
#### حذف پیام دریافتی
```php
$smsSoap->remove($msgIds);
```
#### ارسال زماندار
```php
$smsSoap->sendSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period);
```
#### ارسال زماندار متناظر
```php
$smsSoap->sendMultipleSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period);
```
#### ارسال سررسید
```php
$smsSoap->addUsance($to,$from,$text,$isflash,$scheduleStartDateTime,$repeatAfterDays,$scheduleEndDateTime);
```
#### مشاهده وضعیت ارسال زماندار
```php
$smsSoap->getScheduleStatus($schId);
```
#### حذف پیامک زماندار
```php
$smsSoap->removeSchedule($schId);
```
### وب سرویس پیامک صوتی
#### ارسال پیامک همراه با تماس صوتی
```php
$smsSoap->sendWithSpeech($to,$from,$text,$speech);
```
#### ارسال پیامک همراه با تماس صوتی به صورت زمانبندی
```php
$smsSoap->sendWithSpeechSchduleDate($to,$from,$text,$speech,$scheduleDate);
```
#### دریافت وضعیت پیامک همراه با تماس صوتی
```php
$smsSoap->getSendWithSpeech($recId);
```
#### تماس انبوه زماندار
```php
$smsSoap->SendBulkSpeechText($title, $body, $receivers, $DateToSend, $repeatCount);
```
#### تماس انبوه زماندار با انتخاب فایل
```php
$smsSoap->SendBulkVoiceSMS($title, $voiceFileId, $receivers, $DateToSend, $repeatCount);
```
#### آپلود فایل صوتی
```php
$smsSoap->UploadVoiceFile($title, $base64StringFile);
```
### وب سرویس ارسال انبوه/منطقه ای
#### دریافت شناسه شاخه های بانک شماره
```php
$branch->get($owner);
```
#### اضافه کردن یک بانک شماره جدید
```php
$branch->add($branchName,$owner);
```
#### اضافه کردن شماره به بانک
```php
$branch->addNumber($mobileNumbers,$branchId);
```
#### حذف یک بانک
```php
$branch->remove($branchId);
```
#### ارسال انبوه از طریق بانک
```php
$branch->sendBulk($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo);
$branch->sendBulk2($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo);
```
#### تعداد شماره های موجود
```php
$branch->getBulkCount($branch,$rangeFrom,$rangeTo);
```
#### گزارش گیری از ارسال انبوه
```php
$branch->getBulkReceptions($bulkId,$fromRows);
```
#### تعیین وضعیت ارسال
```php
$branch->getBulkStatus($bulkId);
```
#### تعداد ارسال های امروز
```php
$branch->getTodaySent();
```
#### تعداد ارسال های کل
```php
$branch->getTotalSent();
```
#### حذف ارسال منطقه ای
```php
$branch->removeBulk($id);
```
#### ارسال متناظر
```php
$branch->sendMultipleSms($to,$from,$text,$isflash,$udh);
```
#### نمایش دهنده وضعیت گزارش گیری
```php
$branch->updateBulkDelivery($bulkId);
```
### وب سرویس تیکت
#### ثبت تیکت جدید
```php
$ticket->add($title,$content,$aletWithSms);
```
#### جستجو و دریافت تیکت ها
```php
$ticket->getReceived($ticketOwner,$ticketType,$keyword);
```
#### دریافت تعداد تیکت های کاربران
```php
$ticket->getReceivedCount($ticketType);
```
#### دریافت تیکت های ارسال شده
```php
$ticket->getSent($ticketOwner,$ticketType,$keyword);
```
#### دریافت تعداد تیکت های ارسال شده
```php
$ticket->getSentCount($ticketType);
```
#### پاسخگویی به تیکت
```php
$ticket->response($ticketId,$type,$content,$alertWithSms);
```
### وب سرویس دفترچه تلفن
#### اضافه کردن گروه جدید
```php
$contacts->addGroup($groupName,$Descriptions,$showToChilds);
```
#### اضافه کردن کاربر جدید
```php
$contacts->add($options);
```
#### بررسی موجود بودن شماره در دفترچه تلفن
```php
$contacts->checkMobileExist($mobileNumber);
```
#### دریافت اطلاعات دفترچه تلفن
```php
$contacts->get($groupId,$keyword,$from,$count);
```
#### دریافت گروه ها
```php
$contacts->getGroups();
```
#### ویرایش مخاطب
```php
$contacts->change($options);
```
#### حذف مخاطب
```php
$contacts->remove($mobilenumber);
```
#### دریافت اطلاعات مناسبت های فرد
```php
$contacts->getEvents($contactId);
```
### وب سرویس کاربران
#### ثبت فیش واریزی
```php
$users->addPayment($options);
```
#### اضافه کردن کاربر جدید در سامانه
```php
$users->add($options);
```
#### اضافه کردن کاربر جدید در سامانه(کامل)
```php
$users->addComplete($options);
```
#### اضافه کردن کاربر جدید در سامانه(WithLocation)
```php
$users->addWithLocation($options);
```
#### بدست آوردن ID کاربر
```php
$users->authenticate();
```
#### تغییر اعتبار
```php
$users->changeCredit($amount,$description,$targetUsername,$GetTax);
```
#### فراموشی رمز عبور
```php
$users->forgotPassword($mobileNumber,$emailAddress,$targetUsername);
```
#### دریافت تعرفه پایه کاربر
```php
$users->getBasePrice($targetUsername);
```
#### دریافت اعتبار کاربر
```php
$users->getCredit($targetUsername);
```
#### دریافت مشخصات کاربر
```php
$users->getDetails($targetUsername);
```
#### دریافت شماره های کاربر
```php
$users->getNumbers();
```
#### دریافت تراکنش های کاربر
```php
$users->getTransactions($targetUsername,$creditType,$dateFrom,$dateTo,$keyword);
```
#### دریافت اطلاعات کاربران
```php
$users->get();
```
#### دریافت اطلاعات فیلترینگ
```php
$users->hasFilter($text);
```
#### حذف کاربر
```php
$users->remove($targetUsername);
```
#### مشاهده استان ها
```php
$users->getProvinces();
```
#### مشاهده کد شهرستان
```php
$users->getCities($provinceId);
```
#### مشاهده تاریخ انقضای کاربر
```php
$users->getExpireDate();
```

27
vendor/melipayamak/php/src/BaseSms.php vendored Normal file
View File

@@ -0,0 +1,27 @@
<?php
namespace Melipayamak;
abstract class BaseSms
{
const PATH = '';
protected $username;
protected $password;
public function __construct($username,$password)
{
$this->username = $username;
$this->password = $password;
}
protected function getPath($path,$method)
{
return sprintf($path, $method);
}
}

299
vendor/melipayamak/php/src/Branch.php vendored Normal file
View File

@@ -0,0 +1,299 @@
<?php
namespace Melipayamak;
class Branch
{
protected $username;
protected $password;
protected $client;
const PATH = 'http://api.payamak-panel.com/post/Actions.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->client = new \SoapClient(self::PATH);
}
public function get($owner)
{
$result = $this->client->GetBranchs([
'username' => $this->username,
'password' => $this->password,
'owner'=>$owner
]
)->GetBranchsResult;
return $result;
}
public function remove($branchId)
{
$result = $this->client->RemoveBranch([
'username' => $this->username,
'password' => $this->password,
'branchId'=>$branchId
]
)->RemoveBranchResult;
return $result;
}
public function add($branchName,$owner)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branchName' => $branchName,
'owner'=>$owner
];
$result = $this->client->AddBranch($data
)->AddBranchResult;
return $result;
}
public function addNumber($mobileNumbers,$branchId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branchId'=> $branchId,
'mobileNumbers'=>$mobileNumbers
];
$result = $this->client->AddNumber($data
)->AddNumberResult;
return $result;
}
public function sendBulk($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from'=> $from,
'title' => $title,
'message' => $message,
'branch'=> $branch,
'DateToSend'=>$DateToSend,
'requestCount'=>$requestCount,
'bulkType'=> $bulkType,
'rowFrom'=> $rowFrom,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
$result = $this->client->AddBulk($data
)->AddBulkResult;
return $result;
}
public function sendBulk2($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from'=> $from,
'title' => $title,
'message' => $message,
'branch'=> $branch,
'DateToSend'=>$DateToSend,
'requestCount'=>$requestCount,
'bulkType'=> $bulkType,
'rowFrom'=> $rowFrom,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
$result = $this->client->AddBulk2($data
)->AddBulk2Result;
return $result;
}
public function getBulkCount($branch,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branch'=> $branch,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
$result = $this->client->GetBulkCount($data
)->GetBulkCountResult;
return $result;
}
public function getBulkReceptions($bulkId,$fromRows)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $bulkId,
'fromRows'=>$fromRows,
];
$result = $this->client->GetBulkReceptions($data
)->GetBulkReceptionsResult;
return $result;
}
public function getBulkStatus($bulkId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $bulkId,
];
$result = $this->client->GetBulkStatus($data
)->GetBulkStatusResult;
return $result;
}
public function getTodaySent()
{
$data = [
'username' => $this->username,
'password' => $this->password,
];
$result = $this->client->GetTodaySent($data
)->GetTodaySentResult;
return $result;
}
public function getTotalSent()
{
$data = [
'username' => $this->username,
'password' => $this->password,
];
$result = $this->client->GetTotalSent($data
)->GetTotalSentResult;
return $result;
}
public function removeBulk($id)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $id
];
$result = $this->client->RemoveBulk($data
)->GetTotalSentResult;
return $result;
}
public function sendMultipleSms($to,$from,$text,$isflash,$udh)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'to'=> $to,
'from'=> $from,
'text' => $text,
'isflash' => $isflash,
'udh'=> $udh
];
$result;
if(is_array($from)){
$result = $this->client->SendMultipleSMS2($data);
}
else{
$result = $this->client->SendMultipleSMS($data);
}
return $result;
}
public function updateBulkDelivery($bulkId)
{
$data=[
'bulkId'=> $bulkId,
'username' => $this->username,
'password' => $this->password,
];
$result = $this->client->UpdateBulkDelivery($data)->UpdateBulkDeliveryResult;
return $result;
}
}

View File

@@ -0,0 +1,328 @@
<?php
namespace Melipayamak;
class BranchAsync
{
protected $username;
protected $password;
protected $queue;
const PATH = 'http://api.payamak-panel.com/post/Actions.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->queue = array();
}
public function execute(){
$method = '';
$requestIds = [];
$parseResultFn = function ($method, $res) {
if (isset($res->{$method . 'Result'})) {
return $res->{$method . 'Result'};
}
return $res;
};
$options = [
'connection_timeout' => 40,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_BOTH,
'encoding' => 'UTF-8',
'resFn' => $parseResultFn,
];
$client = new \Soap\ParallelSoapClient(self::PATH, $options);
$client->setMulti(true);
$responses = [];
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value))
$method = $value;
else $requestIds[] = $client->{$method}($value);
}
$responses = $client->run();
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
/** handle the exception here */
print 'SoapFault: ' . $response->faultcode . ' - ' . $response->getMessage() . "\n";
} else {
if (!is_string($response)) {
$response = json_encode($response, JSON_UNESCAPED_SLASHES);
}
print 'Response is : ' . $response . "\n";
}
}
//clean queue
$this->queue = array();
}
public function get($owner)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'owner'=>$owner
];
array_push($this->queue, 'GetBranchs');
array_push($this->queue, $data);
}
public function remove($branchId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branchId'=>$branchId
];
array_push($this->queue, 'RemoveBranch');
array_push($this->queue, $data);
}
public function add($branchName,$owner)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branchName' => $branchName,
'owner'=>$owner
];
array_push($this->queue, 'AddBranch');
array_push($this->queue, $data);
}
public function addNumber($mobileNumbers,$branchId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branchId'=> $branchId,
'mobileNumbers'=>$mobileNumbers
];
array_push($this->queue, 'AddNumber');
array_push($this->queue, $data);
}
public function sendBulk($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from'=> $from,
'title' => $title,
'message' => $message,
'branch'=> $branch,
'DateToSend'=>$DateToSend,
'requestCount'=>$requestCount,
'bulkType'=> $bulkType,
'rowFrom'=> $rowFrom,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
array_push($this->queue, 'AddBulk');
array_push($this->queue, $data);
}
public function sendBulk2($from,$title,$message,$branch,$DateToSend,$requestCount,$bulkType,$rowFrom,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from'=> $from,
'title' => $title,
'message' => $message,
'branch'=> $branch,
'DateToSend'=>$DateToSend,
'requestCount'=>$requestCount,
'bulkType'=> $bulkType,
'rowFrom'=> $rowFrom,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
array_push($this->queue, 'AddBulk2');
array_push($this->queue, $data);
}
public function getBulkCount($branch,$rangeFrom,$rangeTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'branch'=> $branch,
'rangeFrom'=>$rangeFrom,
'rangeTo'=>$rangeTo,
];
array_push($this->queue, 'GetBulkCount');
array_push($this->queue, $data);
}
public function getBulkReceptions($bulkId,$fromRows)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $bulkId,
'fromRows'=>$fromRows,
];
array_push($this->queue, 'GetBulkReceptions');
array_push($this->queue, $data);
}
public function getBulkStatus($bulkId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $bulkId,
];
array_push($this->queue, 'GetBulkStatus');
array_push($this->queue, $data);
}
public function getTodaySent()
{
$data = [
'username' => $this->username,
'password' => $this->password,
];
array_push($this->queue, 'GetTodaySent');
array_push($this->queue, $data);
}
public function getTotalSent()
{
$data = [
'username' => $this->username,
'password' => $this->password,
];
array_push($this->queue, 'GetTotalSent');
array_push($this->queue, $data);
}
public function removeBulk($id)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'bulkId'=> $id
];
array_push($this->queue, 'RemoveBulk');
array_push($this->queue, $data);
}
public function sendMultipleSms($to,$from,$text,$isflash,$udh)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'to'=> $to,
'from'=> $from,
'text' => $text,
'isflash' => $isflash,
'udh'=> $udh
];
if(is_array($from))
array_push($this->queue, 'SendMultipleSMS2');
else array_push($this->queue, 'SendMultipleSMS');
array_push($this->queue, $data);
}
public function updateBulkDelivery($bulkId)
{
$data=[
'bulkId'=> $bulkId,
'username' => $this->username,
'password' => $this->password,
];
array_push($this->queue, 'UpdateBulkDelivery');
array_push($this->queue, $data);
}
}

147
vendor/melipayamak/php/src/Contacts.php vendored Normal file
View File

@@ -0,0 +1,147 @@
<?php
namespace Melipayamak;
class Contacts
{
protected $username;
protected $password;
protected $client;
const PATH = 'http://api.payamak-panel.com/post/contacts.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->client = new \SoapClient(self::PATH);
}
public function addGroup($groupName,$Descriptions,$showToChilds)
{
$result = $this->client->AddGroup([
'username'=> $this->username,
'password' => $this->password,
'groupName'=> $groupName,
'Descriptions'=> $Descriptions,
'showToChilds'=> $showToChilds
])->AddGroupResult;
return $result;
}
public function add($options)
{
$result = $this->client->AddContact($options+[
'username'=> $this->username,
'password' => $this->password
])->AddContactResult;
return $result;
}
public function checkMobileExist($mobileNumber)
{
$result = $this->client->CheckMobileExistInContact([
'username'=> $this->username,
'password' => $this->password,
'mobileNumber'=> $mobileNumber
])->CheckMobileExistInContactResult;
return $result;
}
public function get($groupId,$keyword,$from,$count)
{
$result = $this->client->GetContacts([
'username'=> $this->username,
'password' => $this->password,
'groupId'=> $groupId,
'keyword'=> $keyword,
'from'=> $from,
'count'=> $count
])->GetContactsResult;
return $result;
}
public function getGroups()
{
$result = $this->client->GetGroups([
'username'=> $this->username,
'password' => $this->password
])->GetGroupsResult;
return $result;
}
public function change($options)
{
$result = $this->client->ChangeContact($options+[
'username'=> $this->username,
'password' => $this->password
])->ChangeContactResult;
return $result;
}
public function remove($mobilenumber)
{
$result = $this->client->RemoveContact([
'username'=> $this->username,
'password' => $this->password,
'mobilenumber'=> $mobilenumber
])->RemoveContactResult;
return $result;
}
public function getEvents($contactId)
{
$result = $this->client->GetContactEvents([
'username'=> $this->username,
'password' => $this->password,
'contactId'=> $contactId
])->GetContactEventsResult;
return $result;
}
}

View File

@@ -0,0 +1,217 @@
<?php
namespace Melipayamak;
class ContactsAsync
{
protected $username;
protected $password;
protected $queue;
const PATH = 'http://api.payamak-panel.com/post/contacts.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->queue = array();
}
public function execute(){
$method = '';
$requestIds = [];
$parseResultFn = function ($method, $res) {
if (isset($res->{$method . 'Result'})) {
return $res->{$method . 'Result'};
}
return $res;
};
$options = [
'connection_timeout' => 40,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_BOTH,
'encoding' => 'UTF-8',
'resFn' => $parseResultFn,
];
$client = new \Soap\ParallelSoapClient(self::PATH, $options);
$client->setMulti(true);
$responses = [];
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value))
$method = $value;
else $requestIds[] = $client->{$method}($value);
}
$responses = $client->run();
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
/** handle the exception here */
print 'SoapFault: ' . $response->faultcode . ' - ' . $response->getMessage() . "\n";
} else {
if (!is_string($response)) {
$response = json_encode($response, JSON_UNESCAPED_SLASHES);
}
print 'Response is : ' . $response . "\n";
}
}
//clean queue
$this->queue = array();
}
public function addGroup($groupName,$Descriptions,$showToChilds)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'groupName'=> $groupName,
'Descriptions'=> $Descriptions,
'showToChilds'=> $showToChilds
];
array_push($this->queue, 'AddGroup');
array_push($this->queue, $data);
}
public function add($options)
{
$data = $options + [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'AddContact');
array_push($this->queue, $data);
}
public function checkMobileExist($mobileNumber)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'mobileNumber'=> $mobileNumber
];
array_push($this->queue, 'CheckMobileExistInContact');
array_push($this->queue, $data);
}
public function get($groupId,$keyword,$from,$count)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'groupId' => $groupId,
'keyword' => $keyword,
'from' => $from,
'count' => $count
];
array_push($this->queue, 'GetContacts');
array_push($this->queue, $data);
}
public function getGroups()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'GetGroups');
array_push($this->queue, $data);
}
public function change($options)
{
$data = $options + [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'ChangeContact');
array_push($this->queue, $data);
}
public function remove($mobilenumber)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'mobilenumber'=> $mobilenumber
];
array_push($this->queue, 'RemoveContact');
array_push($this->queue, $data);
}
public function getEvents($contactId)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'contactId'=> $contactId
];
array_push($this->queue, 'GetContactEvents');
array_push($this->queue, $data);
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace Melipayamak;
class MelipayamakApi
{
protected $username;
protected $password;
private $namespace = '\Melipayamak\\';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
$this->username = $username;
$this->password = $password;
}
public function __call($name,$arguments)
{
$method = 'rest';
$class = $this->namespace.ucfirst($name);
$type = '';
if($name == 'sms') {
if(isset($arguments[0])) {
if($arguments[0] == 'soap')
$method = 'soap';
else if($arguments[0] == 'async')
$type = 'async';
}
if(isset($arguments[1])){
if($arguments[1] == 'async')
$type = 'async';
}
$class .= ucfirst($method);
$class .= ucfirst($type);
}
else if(isset($arguments[0])) {
$class .= ucfirst('async');
}
if(class_exists($class))
return new $class($this->username,$this->password);
}
}

182
vendor/melipayamak/php/src/SmsRest.php vendored Normal file
View File

@@ -0,0 +1,182 @@
<?php
namespace Melipayamak;
class SmsRest extends BaseSms
{
const PATH = "https://rest.payamak-panel.com/api/SendSMS/%s";
protected $username;
protected $password;
public function __construct($username,$password)
{
parent::__construct($username,$password);
}
protected function execute($url, $data = null)
{
$fields_string = "";
if (!is_null($data)) {
$fields_string = http_build_query($data);
}
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $fields_string);
$response = curl_exec($handle);
$code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
$curl_errno = curl_errno($handle);
$curl_error = curl_error($handle);
if ($curl_errno) {
throw new \Exception($curl_error);
}
curl_close($handle);
return $response;
}
public function send($to,$from,$text,$isFlash=false)
{
$url = $this->getPath(self::PATH,'SendSMS');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password,
'To' => $to,
'From' => $from,
'Text' => $text,
'IsFlash' => $isFlash
];
return $this->execute($url,$data);
}
public function sendByBaseNumber($text,$to,$bodyId)
{
$url = $this->getPath(self::PATH,'BaseServiceNumber');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password,
'text' => $text,
'to' => $to,
'bodyId' => $bodyId
];
return $this->execute($url,$data);
}
public function isDelivered($id)
{
$url = $this->getPath(self::PATH,'GetDeliveries2');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password,
'recId' => $id
];
return $this->execute($url,$data);
}
public function getMessages($location,$index,$count,$from='')
{
$url = $this->getPath(self::PATH,'GetMessages');
$options = [
'UserName'=> $this->username,
'PassWord'=> $this->password,
'location'=> $location,
'index'=> $index,
'count' => $count,
'from' => $from
];
return $this->execute($url,$options);
}
public function getCredit()
{
$url = $this->getPath(self::PATH,'GetCredit');
$data=[
'UserName' => $this->username,
'PassWord' => $this->password
];
return $this->execute($url,$data);
}
public function getBasePrice()
{
$url = $this->getPath(self::PATH,'GetBasePrice');
$data=[
'UserName' => $this->username,
'PassWord' => $this->password
];
return $this->execute($url,$data);
}
public function getNumbers()
{
$url = $this->getPath(self::PATH,'GetUserNumbers');
$data=[
'UserName' => $this->username,
'PassWord' => $this->password
];
return $this->execute($url,$data);
}
}

View File

@@ -0,0 +1,170 @@
<?php
namespace Melipayamak;
//Async Version
class SmsRestAsync extends BaseSms
{
const PATH = "https://rest.payamak-panel.com/api/SendSMS/%s";
protected $username;
protected $password;
protected $queue;
public function __construct($username,$password)
{
parent::__construct($username,$password);
$this->queue = array();
}
public function execute()
{
$mh = curl_multi_init();
$handlers = array();
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value)){
//create handler
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $value);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($this->queue[$key + 1]));
curl_multi_add_handle($mh, $handle);
array_push($handlers, $handle);
}
}
$responses = array();
do {
$status = curl_multi_exec($mh, $active);
if ($active) {
// Wait a short time for more activity
curl_multi_select($mh);
}
} while ($active && $status == CURLM_OK);
//close the handles
foreach ($handlers as $key => $value) {
$html = curl_multi_getcontent($value); // get the content
array_push($responses, $html);
curl_multi_remove_handle($mh, $value);
}
curl_multi_close($mh);
return $responses;
}
public function send($to,$from,$text,$isFlash=false)
{
$url = $this->getPath(self::PATH,'SendSMS');
$data = [
'Username' => $this->username,
'Password' => $this->password,
'To' => $to,
'From' => $from,
'Text' => $text,
'isFlash' => $isFlash
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
public function isDelivered($id)
{
$url = $this->getPath(self::PATH,'GetDeliveries2');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password,
'recId' => $id
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
public function getMessages($location,$index,$count,$from='')
{
$url = $this->getPath(self::PATH,'GetMessages');
$data = [
'UserName'=> $this->username,
'PassWord'=> $this->password,
'Location'=> $location,
'Index'=> $index,
'Count' => $count,
'From' => $from
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
public function getCredit()
{
$url = $this->getPath(self::PATH,'GetCredit');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
public function getBasePrice()
{
$url = $this->getPath(self::PATH,'GetBasePrice');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
public function getNumbers()
{
$url = $this->getPath(self::PATH,'GetUserNumbers');
$data = [
'UserName' => $this->username,
'PassWord' => $this->password
];
array_push($this->queue, $url);
array_push($this->queue, $data);
}
}

640
vendor/melipayamak/php/src/SmsSoap.php vendored Normal file
View File

@@ -0,0 +1,640 @@
<?php
namespace Melipayamak;
class SmsSoap extends BaseSms
{
const PATH = "http://api.payamak-panel.com/post/%s.asmx?wsdl";
protected $username;
protected $password;
protected $sendUrl;
protected $receiveUrl;
protected $voiceUrl;
protected $scheduleUrl;
public function __construct($username,$password)
{
parent::__construct($username,$password);
ini_set("soap.wsdl_cache_enabled", "0");
$this->sendUrl = $this->getPath(self::PATH,'send');
$this->receiveUrl = $this->getPath(self::PATH,'receive');
$this->voiceUrl = $this->getPath(self::PATH,'Voice');
$this->scheduleUrl = $this->getPath(self::PATH,'Schedule');
}
public function getCredit()
{
$client = new \SoapClient($this->sendUrl);
$data =
[
'username' => $this->username,
'password' => $this->password
];
$result = $client->GetCredit($data)->GetCreditResult;
return $result;
}
public function sendByBaseNumber($text,$to,$bodyId)
{
$client = new \SoapClient($this->sendUrl);
$data =
[
'username' => $this->username,
'password' => $this->password,
'text'=> $text,
'to' => $to,
'bodyId' => $bodyId
];
$result;
if(is_array($text))
$result = $client->SendByBaseNumber($data)->SendByBaseNumberResult;
else
$result = $client->SendByBaseNumber2($data)->SendByBaseNumber2Result;
return $result;
}
public function isDelivered($id)
{
$client = new \SoapClient($this->sendUrl);
$data =
[
'username' => $this->username,
'password' => $this->password,
];
$result;
if(is_array($id)){
$data['recId'] = $id;
$result = $client->GetDeliveries3($data)->GetDeliveries3Result;
}
else{
$data['recId'] = $id;
$result = $client->GetDelivery2($data)->GetDelivery2Result;
}
return $result;
}
public function send($to,$from,$text,$isflash=false)
{
$client = new \SoapClient($this->sendUrl);
$data =
[
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to
];
$result;
if(is_array($to)){
$result = $client->SendSimpleSMS($data)->SendSimpleSMSResult;
}
else{
$result = $client->SendSimpleSMS2($data)->SendSimpleSMS2Result;
}
return $result;
}
public function send2($to,$from,$text,$isflash=false,$udh="")
{
$client = new \SoapClient($this->sendUrl);
$to = is_array($to) ? $to : array($to);
$recId = array();
$status = 0x0;
$result = $client->SendSms([
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to,
'udh' =>$udh,
'recId' => &$recId,
'status' => &$status
]
);
return $result;
}
public function sendWithDomain($to,$from,$text,$isflash,$domain)
{
//P roblem
$client = new \SoapClient($this->sendUrl);
$result = $client->SendWithDomain([
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to,
'domainName' => $domain
]
)->SendWithDomainResult;
return $result;
}
public function getMessages($location,$index,$count,$from='')
{
$client = new \SoapClient($this->sendUrl);
$result = $client->getMessages([
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from
]
)->getMessagesResult;
return $result;
}
public function getMessagesStr($location,$index,$count,$from='')
{
$client = new \SoapClient($this->receiveUrl);
$result = $client->GetMessageStr([
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from
]
)->GetMessageStrResult;
return $result;
}
public function getMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo)
{
$client = new \SoapClient($this->receiveUrl);
$result = $client->GetMessagesByDate([
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from,
'dateTo' => $dateTo,
'dateFrom' => $dateFrom
]
)->GetMessagesByDateResult;
return $result;
}
public function getMessagesReceptions($msgId,$fromRows)
{
$client = new \SoapClient($this->receiveUrl);
$result = $client->GetMessagesReceptions([
'username' => $this->username,
'password' => $this->password,
'msgId' => $msgId,
'fromRows' =>$fromRows
]
)->GetMessagesReceptionsResult;
return $result;
}
public function getUsersMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo)
{
$client = new \SoapClient($this->receiveUrl);
$result = $client->GetUsersMessagesByDate([
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from,
'dateTo' => $dateTo,
'dateFrom' => $dateFrom
]
)->GetUsersMessagesByDateResult;
return $result;
}
public function remove($msgIds)
{
$client = new \SoapClient($this->receiveUrl);
$result = $client->RemoveMessages2([
'username' => $this->username,
'password' => $this->password,
'msgIds' => $msgIds
]
)->RemoveMessages2Result;
return $result;
}
public function getPrice($irancell,$mtn,$from,$text)
{
$client = new \SoapClient($this->sendUrl);
$result = $client->GetSmsPrice([
'username' => $this->username,
'password' => $this->password,
'irancellCount' => $irancell,
'mtnCount'=> $mtn,
'text' => $text,
'from' => $from
]
)->GetSmsPriceResult;
return $result;
}
public function getInboxCount($isRead=false)
{
$client = new \SoapClient($this->sendUrl);
$result = $client->GetInboxCount([
'username' => $this->username,
'password' => $this->password,
'isRead' => $isRead,
]
)->GetInboxCountResult;
return $result;
}
public function sendWithSpeech($to,$from,$text,$speech)
{
$client = new \SoapClient($this->voiceUrl);
$result = $client->SendSMSWithSpeechText([
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'to' => $to,
'smsBody' => $text,
'speechBody' => $speech
]
)->SendSMSWithSpeechTextResult;
return $result;
}
public function sendWithSpeechSchduleDate($to,$from,$text,$speech,$scheduleDate)
{
$client = new \SoapClient($this->voiceUrl);
$result = $client->SendSMSWithSpeechTextBySchduleDate([
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'to' => $to,
'smsBody' => $text,
'speechBody' => $speech,
'scheduleDate'=> $scheduleDate
]
)->SendSMSWithSpeechTextBySchduleDateResult;
return $result;
}
public function getSendWithSpeech($recId)
{
$client = new \SoapClient($this->voiceUrl);
$result = $client->GetSendSMSWithSpeechTextStatus([
'username' => $this->username,
'password' => $this->password,
'recId'=>$recId
]
);
return $result;
}
public function getMultiDelivery($recId)
{
$client = new \SoapClient($this->sendUrl);
$result = $client->GetMultiDelivery2([
'username' => $this->username,
'password' => $this->password,
'recId' => $recId,
]
)->GetMultiDelivery2Result;
return $result;
}
public function sendMultipleSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period)
{
$client = new \SoapClient($this->scheduleUrl);
$result = $client->AddMultipleSchedule([
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from'=>$from,
'text'=>$text,
'isflash'=>$isflash,
'scheduleDateTime'=>$scheduleDateTime,
'period' => $period
]
)->AddMultipleScheduleResult;
return $result;
}
public function sendSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period)
{
$client = new \SoapClient($this->scheduleUrl);
$result = $client->AddSchedule([
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from'=>$from,
'text'=>$text,
'isflash'=>$isflash,
'scheduleDateTime'=>$scheduleDateTime,
'period' => $period
]
)->AddScheduleResult;
return $result;
}
public function getScheduleStatus($schId)
{
$client = new \SoapClient($this->scheduleUrl);
$result = $client->GetScheduleStatus([
'username' => $this->username,
'password' => $this->password,
'scheduleId'=>$schId
]
)->GetScheduleStatusResult;
return $result;
}
public function removeSchedule($schId)
{
$client = new \SoapClient($this->scheduleUrl);
$result = $client->RemoveSchedule([
'username' => $this->username,
'password' => $this->password,
'scheduleId'=>$schId
]
)->RemoveScheduleResult;
return $result;
}
public function addUsance($to,$from,$text,$isflash,$scheduleStartDateTime,$repeatAfterDays,$scheduleEndDateTime)
{
$client = new \SoapClient($this->scheduleUrl);
$result = $client->AddUsance([
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from'=>$from,
'text'=>$text,
'isflash'=>$isflash,
'scheduleStartDateTime'=>$scheduleStartDateTime,
'repeatAfterDays' => $repeatAfterDays,
'scheduleEndDateTime'=>$scheduleEndDateTime
]
)->AddUsanceResult;
return $result;
}
}

View File

@@ -0,0 +1,549 @@
<?php
namespace Melipayamak;
class SmsSoapAsync extends BaseSms
{
const PATH = "http://api.payamak-panel.com/post/%s.asmx?wsdl";
protected $username;
protected $password;
protected $sendUrl;
protected $receiveUrl;
protected $voiceUrl;
protected $scheduleUrl;
protected $queue;
public function __construct($username,$password)
{
parent::__construct($username,$password);
ini_set("soap.wsdl_cache_enabled", "0");
$this->sendUrl = $this->getPath(self::PATH,'send');
$this->receiveUrl = $this->getPath(self::PATH,'receive');
$this->voiceUrl = $this->getPath(self::PATH,'Voice');
$this->scheduleUrl = $this->getPath(self::PATH,'Schedule');
$this->queue = array();
}
public function execute(){
$endpoint = $this->queue[0];
$method = '';
$requestIds = [];
$parseResultFn = function ($method, $res) {
if (isset($res->{$method . 'Result'})) {
return $res->{$method . 'Result'};
}
return $res;
};
$options = [
'connection_timeout' => 40,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_BOTH,
'encoding' => 'UTF-8',
'resFn' => $parseResultFn,
];
$client = new \Soap\ParallelSoapClient($endpoint, $options);
$client->setMulti(true);
$responses = [];
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value)){
//$value is wsdl url && differs
if(strlen($value) > 33 && $endpoint != $value) {
//run prior tasks if we can change endpoint
// array_push($responses, $client->run());
//init new client
//unfortunately there's no way to change wsdl url during running, followings don't work!
// $client = new \Soap\ParallelSoapClient($value, $options);
// $client->__setLocation($value);
}
//$value is method name
else $method = $value;
}
else {
$requestIds[] = $client->{$method}($value);
}
}
$responses = $client->run();
// array_push($responses, $client->run());
//calling multiple endpoints causes $responses to be multidimensional array
// $results = $this->flatten($responses);
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
/** handle the exception here */
print 'SoapFault: ' . $response->faultcode . ' - ' . $response->getMessage() . "\n";
} else {
if (!is_string($response)) {
$response = json_encode($response, JSON_UNESCAPED_SLASHES);
}
print 'Response is : ' . $response . "\n";
}
}
//clean queue
$this->queue = array();
}
function flatten(array $array) {
$return = array();
array_walk_recursive($array, function($a) use (&$return) { $return[] = $a; });
return $return;
}
public function getCredit()
{
$data = [
'username' => $this->username,
'password' => $this->password
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'getCredit');
array_push($this->queue, $data);
}
public function isDelivered($id)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'recId' => $id
];
array_push($this->queue, $this->sendUrl);
if(is_array($id))
array_push($this->queue, 'GetDeliveries3');
else array_push($this->queue, 'GetDelivery2');
array_push($this->queue, $data);
}
public function send($to,$from,$text,$isflash=false)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to
];
array_push($this->queue, $this->sendUrl);
if(is_array($to))
array_push($this->queue, 'SendSimpleSMS');
else array_push($this->queue, 'SendSimpleSMS2');
array_push($this->queue, $data);
}
public function send2($to,$from,$text,$isflash=false,$udh="")
{
$to = is_array($to) ? $to : array($to);
$recId = array();
$status = 0x0;
$data = [
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to,
'udh' =>$udh,
'recId' => &$recId,
'status' => &$status
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'SendSms');
array_push($this->queue, $data);
}
public function sendWithDomain($to,$from,$text,$isflash,$domain)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'text'=> $text,
'isflash' => $isflash,
'to' => $to,
'domainName' => $domain
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'SendWithDomain');
array_push($this->queue, $data);
}
public function getMessages($location,$index,$count,$from='')
{
$data = [
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'getMessages');
array_push($this->queue, $data);
}
public function getMessagesStr($location,$index,$count,$from='')
{
$data = [
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index' => $index,
'count' => $count,
'from' => $from
];
array_push($this->queue, $this->receiveUrl);
array_push($this->queue, 'GetMessageStr');
array_push($this->queue, $data);
}
public function getMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from,
'dateTo' => $dateTo,
'dateFrom' => $dateFrom
];
array_push($this->queue, $this->receiveUrl);
array_push($this->queue, 'GetMessagesByDate');
array_push($this->queue, $data);
}
public function getMessagesReceptions($msgId,$fromRows)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'msgId' => $msgId,
'fromRows' =>$fromRows
];
array_push($this->queue, $this->receiveUrl);
array_push($this->queue, 'GetMessagesReceptions');
array_push($this->queue, $data);
}
public function getUsersMessagesByDate($location,$index,$count,$from,$dateFrom,$dateTo)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'location' => $location,
'index'=> $index,
'count' => $count,
'from' => $from,
'dateTo' => $dateTo,
'dateFrom' => $dateFrom
];
array_push($this->queue, $this->receiveUrl);
array_push($this->queue, 'GetUsersMessagesByDate');
array_push($this->queue, $data);
}
public function remove($msgIds)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'msgIds' => $msgIds
];
array_push($this->queue, $this->receiveUrl);
array_push($this->queue, 'RemoveMessages2');
array_push($this->queue, $data);
}
public function getPrice($irancell,$mtn,$from,$text)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'irancellCount' => $irancell,
'mtnCount'=> $mtn,
'text' => $text,
'from' => $from
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'GetSmsPrice');
array_push($this->queue, $data);
}
public function getInboxCount($isRead=false)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'isRead' => $isRead,
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'GetInboxCount');
array_push($this->queue, $data);
}
public function sendWithSpeech($to,$from,$text,$speech)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'to' => $to,
'smsBody' => $text,
'speechBody' => $speech
];
array_push($this->queue, $this->voiceUrl);
array_push($this->queue, 'SendSMSWithSpeechText');
array_push($this->queue, $data);
}
public function sendWithSpeechSchduleDate($to,$from,$text,$speech,$scheduleDate)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'from' => $from,
'to' => $to,
'smsBody' => $text,
'speechBody' => $speech,
'scheduleDate'=> $scheduleDate
];
array_push($this->queue, $this->voiceUrl);
array_push($this->queue, 'SendSMSWithSpeechTextBySchduleDate');
array_push($this->queue, $data);
}
public function getSendWithSpeech($recId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'recId'=>$recId
];
array_push($this->queue, $this->voiceUrl);
array_push($this->queue, 'GetSendSMSWithSpeechTextStatus');
array_push($this->queue, $data);
}
public function getMultiDelivery($recId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'recId' => $recId,
];
array_push($this->queue, $this->sendUrl);
array_push($this->queue, 'GetMultiDelivery2');
array_push($this->queue, $data);
}
public function sendMultipleSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from'=>$from,
'text'=>$text,
'isflash'=>$isflash,
'scheduleDateTime'=>$scheduleDateTime,
'period' => $period
];
array_push($this->queue, $this->scheduleUrl);
array_push($this->queue, 'AddMultipleSchedule');
array_push($this->queue, $data);
}
public function sendSchedule($to,$from,$text,$isflash,$scheduleDateTime,$period)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from' => $from,
'text' => $text,
'isflash' => $isflash,
'scheduleDateTime' => $scheduleDateTime,
'period' => $period
];
array_push($this->queue, $this->scheduleUrl);
array_push($this->queue, 'AddSchedule');
array_push($this->queue, $data);
}
public function getScheduleStatus($schId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'scheduleId'=>$schId
];
array_push($this->queue, $this->scheduleUrl);
array_push($this->queue, 'GetScheduleStatus');
array_push($this->queue, $data);
}
public function removeSchedule($schId)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'scheduleId'=>$schId
];
array_push($this->queue, $this->scheduleUrl);
array_push($this->queue, 'RemoveSchedule');
array_push($this->queue, $data);
}
public function addUsance($to,$from,$text,$isflash,$scheduleStartDateTime,$repeatAfterDays,$scheduleEndDateTime)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'to' => $to,
'from'=>$from,
'text'=>$text,
'isflash'=>$isflash,
'scheduleStartDateTime'=>$scheduleStartDateTime,
'repeatAfterDays' => $repeatAfterDays,
'scheduleEndDateTime'=>$scheduleEndDateTime
];
array_push($this->queue, $this->scheduleUrl);
array_push($this->queue, 'AddUsance');
array_push($this->queue, $data);
}
}

135
vendor/melipayamak/php/src/Ticket.php vendored Normal file
View File

@@ -0,0 +1,135 @@
<?php
namespace Melipayamak;
class Ticket
{
protected $username;
protected $password;
protected $client;
const PATH = 'http://api.payamak-panel.com/post/Tickets.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->client = new \SoapClient(self::PATH);
}
public function add($title,$content,$aws=true)
{
$result = $this->client->AddTicket([
'username' => $this->username,
'password' => $this->password,
'title'=>$title,
'content' =>$content,
'alertWithSms'=> $aws
]
)->AddTicketResult;
return $result;
}
public function getReceived($ticketOwner,$ticketType,$keyword)
{
$result = $this->client->GetReceivedTickets([
'username' => $this->username,
'password' => $this->password,
'ticketOwner'=>$ticketOwner,
'ticketType' =>$ticketType,
'keyword'=> $keyword
]
)->GetReceivedTicketsResult;
return $result;
}
public function getReceivedCount($ticketType)
{
$result = $this->client->GetReceivedTicketsCount([
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
]
)->GetReceivedTicketsCountResult;
return $result;
}
public function getSent($ticketOwner,$ticketType,$keyword)
{
$result = $this->client->GetSentTickets([
'username' => $this->username,
'password' => $this->password,
'ticketOwner'=>$ticketOwner,
'ticketType' =>$ticketType,
'keyword'=> $keyword
]
)->GetSentTicketsResult;
return $result;
}
public function getSentCount($ticketType)
{
$result = $this->client->GetSentTicketsCount([
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
]
)->GetSentTicketsCountResult;
return $result;
}
public function response($ticketId,$type,$content,$alertWithSms=true)
{
$result = $this->client->ResponseTicket([
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
'type'=> $type,
'content'=> $content,
'alertWithSms'=> $alertWithSms
]
)->ResponseTicketResult;
return $result;
}
}

View File

@@ -0,0 +1,192 @@
<?php
namespace Melipayamak;
class TicketAsync
{
protected $username;
protected $password;
protected $queue;
const PATH = 'http://api.payamak-panel.com/post/Tickets.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->queue = array();
}
public function execute(){
$method = '';
$requestIds = [];
$parseResultFn = function ($method, $res) {
if (isset($res->{$method . 'Result'})) {
return $res->{$method . 'Result'};
}
return $res;
};
$options = [
'connection_timeout' => 40,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_BOTH,
'encoding' => 'UTF-8',
'resFn' => $parseResultFn,
];
$client = new \Soap\ParallelSoapClient(self::PATH, $options);
$client->setMulti(true);
$responses = [];
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value))
$method = $value;
else $requestIds[] = $client->{$method}($value);
}
$responses = $client->run();
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
/** handle the exception here */
print 'SoapFault: ' . $response->faultcode . ' - ' . $response->getMessage() . "\n";
} else {
if (!is_string($response)) {
$response = json_encode($response, JSON_UNESCAPED_SLASHES);
}
print 'Response is : ' . $response . "\n";
}
}
//clean queue
$this->queue = array();
}
public function add($title,$content,$aws=true)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'title'=>$title,
'content' =>$content,
'alertWithSms'=> $aws
];
array_push($this->queue, 'AddTicket');
array_push($this->queue, $data);
}
public function getReceived($ticketOwner,$ticketType,$keyword)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'ticketOwner'=>$ticketOwner,
'ticketType' =>$ticketType,
'keyword'=> $keyword
];
array_push($this->queue, 'GetReceivedTickets');
array_push($this->queue, $data);
}
public function getReceivedCount($ticketType)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
];
array_push($this->queue, 'GetReceivedTicketsCount');
array_push($this->queue, $data);
}
public function getSent($ticketOwner,$ticketType,$keyword)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'ticketOwner'=>$ticketOwner,
'ticketType' =>$ticketType,
'keyword'=> $keyword
];
array_push($this->queue, 'GetSentTickets');
array_push($this->queue, $data);
}
public function getSentCount($ticketType)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
];
array_push($this->queue, 'GetSentTicketsCount');
array_push($this->queue, $data);
}
public function response($ticketId,$type,$content,$alertWithSms=true)
{
$data = [
'username' => $this->username,
'password' => $this->password,
'ticketType' =>$ticketType,
'type'=> $type,
'content'=> $content,
'alertWithSms'=> $alertWithSms
];
array_push($this->queue, 'ResponseTicket');
array_push($this->queue, $data);
}
}

276
vendor/melipayamak/php/src/Users.php vendored Normal file
View File

@@ -0,0 +1,276 @@
<?php
namespace Melipayamak;
class Users
{
protected $username;
protected $password;
protected $client;
const PATH = 'http://api.payamak-panel.com/post/users.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->client = new \SoapClient(self::PATH);
}
public function addPayment($options)
{
$result = $this->client->AddPayment($options+[
'username'=> $this->username,
'password' => $this->password
])->AddPaymentResult;
return $result;
}
public function add($options)
{
$result = $this->client->AddUser($options+[
'username'=> $this->username,
'password' => $this->password
])->AddUserResult;
return $result;
}
public function addComplete($options)
{
$result = $this->client->AddUserComplete($options+[
'username'=> $this->username,
'password' => $this->password
])->AddUserCompleteResult;
return $result;
}
public function addWithLocation($options)
{
$result = $this->client->AddUserWithLocation($options+[
'username'=> $this->username,
'password' => $this->password
])->AddUserWithLocationResult;
return $result;
}
public function authenticate()
{
$result = $this->client->AuthenticateUser([
'username'=> $this->username,
'password' => $this->password
])->AuthenticateUserResult;
return $result;
}
public function changeCredit($amount,$description,$targetUsername,$GetTax)
{
$result = $this->client->ChangeUserCredit([
'username'=> $this->username,
'password' => $this->password,
'amount'=> $amount,
'description' => $description,
'targetUsername' => $targetUsername,
'GetTax' => $GetTax
])->ChangeUserCreditResult;
return $result;
}
public function forgotPassword($mobileNumber,$emailAddress,$targetUsername)
{
$result = $this->client->ForgotPassword([
'username'=> $this->username,
'password' => $this->password,
'mobileNumber'=> $mobileNumber,
'emailAddress'=> $emailAddress,
'targetUsername'=> $targetUsername
])->ForgotPasswordResult;
return $result;
}
public function getBasePrice($targetUsername)
{
$result = $this->client->GetUserBasePrice([
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
])->GetUserBasePriceResult;
return $result;
}
public function remove($targetUsername)
{
$result = $this->client->RemoveUser([
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
])->RemoveUserResult;
return $result;
}
public function getCredit($targetUsername)
{
$result = $this->client->GetUserCredit([
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
])->GetUserCreditResult;
return $result;
}
public function getDetails($targetUsername)
{
$result = $this->client->GetUserDetails([
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
])->GetUserDetailsResult;
return $result;
}
public function getNumbers()
{
$result = $this->client->GetUserNumbers([
'username'=> $this->username,
'password' => $this->password
])->GetUserNumbersResult;
return $result;
}
public function getProvinces()
{
$result = $this->client->GetProvinces([
'username'=> $this->username,
'password' => $this->password
])->GetProvincesResult;
return $result;
}
public function getCities($provinceId)
{
$result = $this->client->GetCities([
'username'=> $this->username,
'password' => $this->password,
'provinceId'=> $provinceId
])->GetCitiesResult;
return $result;
}
public function getExpireDate()
{
$result = $this->client->GetExpireDate([
'username'=> $this->username,
'password' => $this->password
])->GetExpireDateResult;
return $result;
}
public function getTransactions($targetUsername,$creditType,$dateFrom,$dateTo,$keyword)
{
$result = $this->client->GetUserTransactions([
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername,
'keyword'=> $keyword,
'creditType'=> $creditType,
'dateFrom'=> $dateFrom,
'dateTo'=> $dateTo
])->GetUserTransactionsResult;
return $result;
}
public function get()
{
$result = $this->client->GetUsers([
'username'=> $this->username,
'password' => $this->password
])->GetUsersResult;
return $result;
}
public function hasFilter($text)
{
$result = $this->client->HasFilter([
'username'=> $this->username,
'password' => $this->password,
'text'=> $text
])->HasFilterResult;
return $result;
}
}

View File

@@ -0,0 +1,353 @@
<?php
namespace Melipayamak;
class UsersAsync
{
protected $username;
protected $password;
protected $queue;
const PATH = 'http://api.payamak-panel.com/post/users.asmx?wsdl';
public function __construct($username,$password)
{
if (is_null($username)||is_null($password)) {
die('username/password is empty');
exit;
}
ini_set("soap.wsdl_cache_enabled", "0");
$this->username = $username;
$this->password = $password;
$this->queue = array();
}
public function execute(){
$method = '';
$requestIds = [];
$parseResultFn = function ($method, $res) {
if (isset($res->{$method . 'Result'})) {
return $res->{$method . 'Result'};
}
return $res;
};
$options = [
'connection_timeout' => 40,
'trace' => true,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_BOTH,
'encoding' => 'UTF-8',
'resFn' => $parseResultFn,
];
$client = new \Soap\ParallelSoapClient(self::PATH, $options);
$client->setMulti(true);
$responses = [];
foreach ($this->queue as $key => $value) {
# code...
if(!is_array($value))
$method = $value;
else $requestIds[] = $client->{$method}($value);
}
$responses = $client->run();
foreach ($responses as $id => $response) {
if ($response instanceof SoapFault) {
/** handle the exception here */
print 'SoapFault: ' . $response->faultcode . ' - ' . $response->getMessage() . "\n";
} else {
if (!is_string($response)) {
$response = json_encode($response, JSON_UNESCAPED_SLASHES);
}
print 'Response is : ' . $response . "\n";
}
}
//clean queue
$this->queue = array();
}
public function addPayment($options)
{
$data = $options + [
'username' => $this->username,
'password' => $this->password
];
array_push($this->queue, 'AddPayment');
array_push($this->queue, $data);
}
public function add($options)
{
$data = $options + [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'AddUser');
array_push($this->queue, $data);
}
public function addComplete($options)
{
$data = $options + [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'AddUserComplete');
array_push($this->queue, $data);
}
public function addWithLocation($options)
{
$data = $options + [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'AddUserWithLocation');
array_push($this->queue, $data);
}
public function authenticate()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'AuthenticateUser');
array_push($this->queue, $data);
}
public function changeCredit($amount,$description,$targetUsername,$GetTax)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'amount'=> $amount,
'description' => $description,
'targetUsername' => $targetUsername,
'GetTax' => $GetTax
];
array_push($this->queue, 'ChangeUserCredit');
array_push($this->queue, $data);
}
public function forgotPassword($mobileNumber,$emailAddress,$targetUsername)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'mobileNumber'=> $mobileNumber,
'emailAddress'=> $emailAddress,
'targetUsername'=> $targetUsername
];
array_push($this->queue, 'ForgotPassword');
array_push($this->queue, $data);
}
public function getBasePrice($targetUsername)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
];
array_push($this->queue, 'GetUserBasePrice');
array_push($this->queue, $data);
}
public function remove($targetUsername)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
];
array_push($this->queue, 'RemoveUser');
array_push($this->queue, $data);
}
public function getCredit($targetUsername)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
];
array_push($this->queue, 'GetUserCredit');
array_push($this->queue, $data);
}
public function getDetails($targetUsername)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername
];
array_push($this->queue, 'GetUserDetails');
array_push($this->queue, $data);
}
public function getNumbers()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'GetUserNumbers');
array_push($this->queue, $data);
}
public function getProvinces()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'GetProvinces');
array_push($this->queue, $data);
}
public function getCities($provinceId)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'provinceId'=> $provinceId
];
array_push($this->queue, 'GetCities');
array_push($this->queue, $data);
}
public function getExpireDate()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'GetExpireDate');
array_push($this->queue, $data);
}
public function getTransactions($targetUsername,$creditType,$dateFrom,$dateTo,$keyword)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'targetUsername'=> $targetUsername,
'keyword'=> $keyword,
'creditType'=> $creditType,
'dateFrom'=> $dateFrom,
'dateTo'=> $dateTo
];
array_push($this->queue, 'GetUserTransactions');
array_push($this->queue, $data);
}
public function get()
{
$data = [
'username'=> $this->username,
'password' => $this->password
];
array_push($this->queue, 'GetUsers');
array_push($this->queue, $data);
}
public function hasFilter($text)
{
$data = [
'username'=> $this->username,
'password' => $this->password,
'text'=> $text
];
array_push($this->queue, 'HasFilter');
array_push($this->queue, $data);
}
}