66 lines
1.6 KiB
PHP
66 lines
1.6 KiB
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* This Software is the property of Data Development and is protected
|
||
|
* by copyright law - it is NOT Freeware.
|
||
|
* Any unauthorized use of this software without a valid license
|
||
|
* is a violation of the license agreement and will be prosecuted by
|
||
|
* civil and criminal law.
|
||
|
* http://www.shopmodule.com
|
||
|
*
|
||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||
|
* @link http://www.oxidmodule.com
|
||
|
*/
|
||
|
|
||
|
namespace D3\Linkmobility4OXID\Application\Model;
|
||
|
|
||
|
use Assert\Assert;
|
||
|
use OxidEsales\Eshop\Core\Registry;
|
||
|
|
||
|
class Configuration
|
||
|
{
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getApiToken(): string
|
||
|
{
|
||
|
$token = trim(Registry::getConfig()->getConfigParam('d3linkmobility_apitoken'));
|
||
|
|
||
|
Assert::that($token)->string()->notEmpty();
|
||
|
|
||
|
return $token;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return bool
|
||
|
*/
|
||
|
public function getTestMode(): bool
|
||
|
{
|
||
|
return (bool) Registry::getConfig()->getConfigParam( 'd3linkmobility_debug');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getSmsSenderNumber(): string
|
||
|
{
|
||
|
$number = trim(Registry::getConfig()->getConfigParam('d3linkmobility_smsSenderNumber'));
|
||
|
|
||
|
Assert::that($number)->string()->notEmpty();
|
||
|
|
||
|
return $number;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getSmsSenderCountry(): string
|
||
|
{
|
||
|
$country = trim(Registry::getConfig()->getConfigParam('d3linkmobility_smsSenderCountry'));
|
||
|
|
||
|
Assert::that($country)->string()->length(2);
|
||
|
|
||
|
return strtoupper($country);
|
||
|
}
|
||
|
}
|