linkmobility4oxid/src/Application/Model/RequestFactory.php

39 lines
1.2 KiB
PHP
Raw Normal View History

2022-07-04 09:13:36 +02:00
<?php
/**
2022-07-13 13:21:52 +02:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
2022-07-04 09:13:36 +02:00
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2022-07-13 13:21:52 +02:00
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
2022-07-04 09:13:36 +02:00
*/
2022-07-13 13:21:52 +02:00
declare(strict_types=1);
2022-07-04 16:33:49 +02:00
namespace D3\Linkmobility4OXID\Application\Model;
2022-07-04 09:13:36 +02:00
use D3\LinkmobilityClient\Request\RequestInterface;
use D3\LinkmobilityClient\SMS\SmsRequestInterface;
use D3\LinkmobilityClient\ValueObject\Sender;
class RequestFactory extends \D3\LinkmobilityClient\SMS\RequestFactory
{
public function getSmsRequest(): SmsRequestInterface
{
2022-07-13 13:23:48 +02:00
$configuration = oxNew(Configuration::class);
2022-07-04 09:13:36 +02:00
2022-07-27 09:27:59 +02:00
/** @var SmsRequestInterface $request */
2022-07-04 09:13:36 +02:00
$request = parent::getSmsRequest();
$request->setTestMode($configuration->getTestMode())
->setSenderAddress(
2022-07-13 13:23:48 +02:00
oxNew(Sender::class, $configuration->getSmsSenderNumber(), $configuration->getSmsSenderCountry())
2022-07-04 09:13:36 +02:00
)
2022-07-13 13:23:48 +02:00
->setSenderAddressType(RequestInterface::SENDERADDRESSTYPE_INTERNATIONAL);
2022-07-04 09:13:36 +02:00
return $request;
}
2022-07-13 13:23:48 +02:00
}