From 924d6640e2739df8d9bb4bfe62bc80830e1bafeb Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Fri, 1 Jul 2022 09:42:28 +0200 Subject: [PATCH] update to current API --- .../Application/Controller/StartController.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Modules/Application/Controller/StartController.php b/src/Modules/Application/Controller/StartController.php index 43790bd..cb89f10 100644 --- a/src/Modules/Application/Controller/StartController.php +++ b/src/Modules/Application/Controller/StartController.php @@ -17,32 +17,30 @@ namespace D3\Linkmobility4OXID\Modules\Application\Controller; use D3\LinkmobilityClient\Client; use D3\LinkmobilityClient\Request\RequestInterface; -use D3\LinkmobilityClient\SMS\Request; use D3\LinkmobilityClient\SMS\RequestFactory; -use D3\LinkmobilityClient\SMS\TextRequest; use D3\LinkmobilityClient\ValueObject\Recipient; use D3\LinkmobilityClient\ValueObject\Sender; -use D3\LinkmobilityClient\ValueObject\SmsMessage; use OxidEsales\Eshop\Core\Registry; class StartController extends StartController_parent { public function render() { - //$message = "testMessagetestMessagetestMessagetestMessagetestMessagetestMessage"; - $message = "test\tMessage\ttest\tMessage"; + $message = "testMessagetestMessagetestMessagetestMessagetestMessagetestMessage"; + //$message = "test\tMessage\ttest\tMessage"; $lmClient = oxNew(Client::class, trim(Registry::getConfig()->getConfigParam('d3linkmobility_apitoken'))); - $request = oxNew(RequestFactory::class, $message)->getRequest(); + $lmClient->setLogger(Registry::getLogger()); + $request = oxNew(RequestFactory::class, $message, $lmClient)->getSmsRequest(); $request->setTestMode( (bool) Registry::getConfig()->getConfigParam( 'd3linkmobility_debug')) ->setMethod(RequestInterface::METHOD_POST) ->setSenderAddress(oxNew(Sender::class, '017621164371', 'DE')) ->setSenderAddressType(RequestInterface::SENDERADDRESSTYPE_INTERNATIONAL); $request->getRecipientsList() - ->add(oxNew(Recipient::class, '+49(0)176-21164371', 'DE')) - ->add(oxNew(Recipient::class, '+49176 21164372', 'DE')) - ->add(oxNew(Recipient::class, '03721268090', 'DE')) - ->add(oxNew(Recipient::class, '0049176abc21164373', 'DE')); + ->add(oxNew(Recipient::class, '+49(0)176-21164371', 'DE')) + ->add(oxNew(Recipient::class, '+49176 21164372', 'DE')) + ->add(oxNew(Recipient::class, '03721268090', 'DE')) + ->add(oxNew(Recipient::class, '0049176abc21164373', 'DE')); try { $response = $lmClient->request( $request ); } catch (\Exception $e) {