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
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:
66
vendor/melipayamak/php/src/MelipayamakApi.php
vendored
Normal file
66
vendor/melipayamak/php/src/MelipayamakApi.php
vendored
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user