| Total Complexity | 62 |
| Total Lines | 588 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Complex classes like ComputopFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use ComputopFactory, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 87 | class ComputopFactory extends AbstractFactory |
||
| 88 | { |
||
| 89 | /** |
||
| 90 | * @return \SprykerEco\Yves\Computop\ComputopConfigInterface |
||
| 91 | */ |
||
| 92 | public function getComputopConfig(): ComputopConfigInterface |
||
| 93 | { |
||
| 94 | return $this->getConfig(); |
||
| 95 | } |
||
| 96 | |||
| 97 | /** |
||
| 98 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPaymentHandlerInterface |
||
| 99 | */ |
||
| 100 | public function createComputopPaymentHandler(): ComputopPaymentHandlerInterface |
||
| 101 | { |
||
| 102 | return new ComputopPaymentHandler($this->getConfig()); |
||
| 103 | } |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 107 | */ |
||
| 108 | public function createCreditCardForm(): SubFormInterface |
||
| 109 | { |
||
| 110 | return new CreditCardSubForm(); |
||
| 111 | } |
||
| 112 | |||
| 113 | /** |
||
| 114 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 115 | */ |
||
| 116 | public function createPayNowForm(): SubFormInterface |
||
| 117 | { |
||
| 118 | return new PayNowSubForm(); |
||
| 119 | } |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 123 | */ |
||
| 124 | public function createPayPalForm(): SubFormInterface |
||
| 125 | { |
||
| 126 | return new PayPalSubForm(); |
||
| 127 | } |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 131 | */ |
||
| 132 | public function createSofortForm(): SubFormInterface |
||
| 133 | { |
||
| 134 | return new SofortSubForm(); |
||
| 135 | } |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 139 | */ |
||
| 140 | public function createDirectDebitForm(): SubFormInterface |
||
| 141 | { |
||
| 142 | return new DirectDebitSubForm(); |
||
| 143 | } |
||
| 144 | |||
| 145 | /** |
||
| 146 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 147 | */ |
||
| 148 | public function createPaydirektForm(): SubFormInterface |
||
| 149 | { |
||
| 150 | return new PaydirektSubForm(); |
||
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 155 | */ |
||
| 156 | public function createIdealForm(): SubFormInterface |
||
| 157 | { |
||
| 158 | return new IdealSubForm(); |
||
| 159 | } |
||
| 160 | |||
| 161 | /** |
||
| 162 | * @return \Spryker\Yves\StepEngine\Dependency\Form\SubFormInterface |
||
| 163 | */ |
||
| 164 | public function createEasyCreditForm(): SubFormInterface |
||
| 165 | { |
||
| 166 | return new EasyCreditSubForm(); |
||
| 167 | } |
||
| 168 | |||
| 169 | /** |
||
| 170 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 171 | */ |
||
| 172 | public function createCreditCardFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 173 | { |
||
| 174 | return new CreditCardFormDataProvider($this->getQuoteClient(), $this->createOrderCreditCardMapper()); |
||
| 175 | } |
||
| 176 | |||
| 177 | /** |
||
| 178 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 179 | */ |
||
| 180 | public function createPayNowFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 181 | { |
||
| 182 | return new PayNowFormDataProvider($this->getQuoteClient(), $this->createOrderPayNowMapper()); |
||
| 183 | } |
||
| 184 | |||
| 185 | /** |
||
| 186 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 187 | */ |
||
| 188 | public function createPayPalFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 189 | { |
||
| 190 | return new PayPalFormDataProvider($this->getQuoteClient(), $this->createOrderPayPalMapper()); |
||
| 191 | } |
||
| 192 | |||
| 193 | /** |
||
| 194 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 195 | */ |
||
| 196 | public function createPayPalExpressFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 197 | { |
||
| 198 | return new PayPalExpressFormDataProvider($this->getQuoteClient(), $this->createPayPalExpressMapper()); |
||
| 199 | } |
||
| 200 | |||
| 201 | /** |
||
| 202 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 203 | */ |
||
| 204 | public function createSofortFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 205 | { |
||
| 206 | return new SofortFormDataProvider($this->getQuoteClient(), $this->createOrderSofortMapper()); |
||
| 207 | } |
||
| 208 | |||
| 209 | /** |
||
| 210 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 211 | */ |
||
| 212 | public function createDirectDebitFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 213 | { |
||
| 214 | return new DirectDebitFormDataProvider($this->getQuoteClient(), $this->createOrderDirectDebitMapper()); |
||
| 215 | } |
||
| 216 | |||
| 217 | /** |
||
| 218 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 219 | */ |
||
| 220 | public function createPaydirektFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 221 | { |
||
| 222 | return new PaydirektFormDataProvider($this->getQuoteClient(), $this->createOrderPaydirektMapper()); |
||
| 223 | } |
||
| 224 | |||
| 225 | /** |
||
| 226 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 227 | */ |
||
| 228 | public function createIdealFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 229 | { |
||
| 230 | return new IdealFormDataProvider($this->getQuoteClient(), $this->createOrderIdealMapper()); |
||
| 231 | } |
||
| 232 | |||
| 233 | /** |
||
| 234 | * @return \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
||
| 235 | */ |
||
| 236 | public function createEasyCreditFormDataProvider(): StepEngineFormDataProviderInterface |
||
| 237 | { |
||
| 238 | return new EasyCreditFormDataProvider($this->getQuoteClient(), $this->createOrderEasyCreditMapper()); |
||
| 239 | } |
||
| 240 | |||
| 241 | /** |
||
| 242 | * @return \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface |
||
| 243 | */ |
||
| 244 | public function getComputopApiService(): ComputopApiServiceInterface |
||
| 245 | { |
||
| 246 | return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_COMPUTOP_API); |
||
| 247 | } |
||
| 248 | |||
| 249 | /** |
||
| 250 | * @return \Symfony\Component\HttpKernel\HttpKernelInterface |
||
| 251 | */ |
||
| 252 | public function getApplication(): HttpKernelInterface |
||
| 253 | { |
||
| 254 | return $this->getProvidedDependency(ComputopDependencyProvider::PLUGIN_APPLICATION); |
||
| 255 | } |
||
| 256 | |||
| 257 | /** |
||
| 258 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface |
||
| 259 | */ |
||
| 260 | public function getQuoteClient(): ComputopToQuoteClientInterface |
||
| 261 | { |
||
| 262 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_QUOTE); |
||
| 263 | } |
||
| 264 | |||
| 265 | /** |
||
| 266 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToShipmentClientInterface |
||
| 267 | */ |
||
| 268 | public function getShipmentClient(): ComputopToShipmentClientInterface |
||
| 269 | { |
||
| 270 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_SHIPMENT); |
||
| 271 | } |
||
| 272 | |||
| 273 | /** |
||
| 274 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCheckoutClientInterface |
||
| 275 | */ |
||
| 276 | public function getCheckoutClient(): ComputopToCheckoutClientInterface |
||
| 277 | { |
||
| 278 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CHECKOUT); |
||
| 279 | } |
||
| 280 | |||
| 281 | /** |
||
| 282 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 283 | */ |
||
| 284 | public function createCreditCardPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 285 | { |
||
| 286 | return new ComputopCreditCardPaymentHandler($this->createInitCreditCardConverter(), $this->getComputopClient()); |
||
| 287 | } |
||
| 288 | |||
| 289 | /** |
||
| 290 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 291 | */ |
||
| 292 | public function createPayNowPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 295 | } |
||
| 296 | |||
| 297 | /** |
||
| 298 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 299 | */ |
||
| 300 | public function createPayPalPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 301 | { |
||
| 302 | return new ComputopPayPalPaymentHandler($this->createInitPayPalConverter(), $this->getComputopClient()); |
||
| 303 | } |
||
| 304 | |||
| 305 | /** |
||
| 306 | * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressInitHandlerInterface |
||
| 307 | */ |
||
| 308 | public function createComputopPayPalExpressInitHandler(): ComputopPayPalExpressInitHandlerInterface |
||
| 309 | { |
||
| 310 | return new ComputopPayPalExpressInitHandler( |
||
| 311 | $this->createComputopPaymentHandler(), |
||
| 312 | $this->createInitPayPalExpressConverter(), |
||
| 313 | $this->getQuoteClient(), |
||
| 314 | $this->getComputopClient(), |
||
| 315 | $this->getShipmentClient(), |
||
| 316 | $this->createPayPalExpressToQuoteMapper() |
||
| 317 | ); |
||
| 318 | } |
||
| 319 | |||
| 320 | /** |
||
| 321 | * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressPrepareHandlerInterface |
||
| 322 | */ |
||
| 323 | public function createComputopPayPalExpressPrepareHandler(): ComputopPayPalExpressPrepareHandlerInterface |
||
| 324 | { |
||
| 325 | return new ComputopPayPalExpressPrepareHandler( |
||
| 326 | $this->getQuoteClient(), |
||
| 327 | $this->createPayPalExpressFormDataProvider(), |
||
| 328 | $this->getComputopApiClient(), |
||
| 329 | $this->getComputopApiService(), |
||
| 330 | $this->getComputopConfig() |
||
| 331 | ); |
||
| 332 | } |
||
| 333 | |||
| 334 | /** |
||
| 335 | * @return \SprykerEco\Yves\Computop\Handler\ExpressCheckout\ComputopPayPalExpressCompleteHandlerInterface |
||
| 336 | */ |
||
| 337 | public function createComputopPayPalExpressCompleteHandler(): ComputopPayPalExpressCompleteHandlerInterface |
||
| 338 | { |
||
| 339 | return new ComputopPayPalExpressCompleteHandler( |
||
| 340 | $this->getComputopApiClient(), |
||
| 341 | $this->getComputopClient() |
||
| 342 | ); |
||
| 343 | } |
||
| 344 | |||
| 345 | /** |
||
| 346 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 347 | */ |
||
| 348 | public function createDirectDebitPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 349 | { |
||
| 350 | return new ComputopDirectDebitPaymentHandler($this->createInitDirectDebitConverter(), $this->getComputopClient()); |
||
| 351 | } |
||
| 352 | |||
| 353 | /** |
||
| 354 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 355 | */ |
||
| 356 | public function createEasyCreditPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 362 | ); |
||
| 363 | } |
||
| 364 | |||
| 365 | /** |
||
| 366 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 367 | */ |
||
| 368 | public function createPaydirektPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 369 | { |
||
| 370 | return new ComputopPaydirektPaymentHandler($this->createInitPaydirektConverter(), $this->getComputopClient()); |
||
| 371 | } |
||
| 372 | |||
| 373 | /** |
||
| 374 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 375 | */ |
||
| 376 | public function createSofortPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 377 | { |
||
| 378 | return new ComputopSofortPaymentHandler($this->createInitSofortConverter(), $this->getComputopClient()); |
||
| 379 | } |
||
| 380 | |||
| 381 | /** |
||
| 382 | * @return \SprykerEco\Yves\Computop\Handler\ComputopPrePostPaymentHandlerInterface |
||
| 383 | */ |
||
| 384 | public function createIdealPaymentHandler(): ComputopPrePostPaymentHandlerInterface |
||
| 385 | { |
||
| 386 | return new ComputopIdealPaymentHandler($this->createInitIdealConverter(), $this->getComputopClient()); |
||
| 387 | } |
||
| 388 | |||
| 389 | /** |
||
| 390 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 391 | */ |
||
| 392 | public function createInitCreditCardConverter(): ConverterInterface |
||
| 395 | } |
||
| 396 | |||
| 397 | /** |
||
| 398 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 399 | */ |
||
| 400 | public function createInitPayNowConverter(): ConverterInterface |
||
| 401 | { |
||
| 402 | return new InitPayNowConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 403 | } |
||
| 404 | |||
| 405 | /** |
||
| 406 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 407 | */ |
||
| 408 | public function createInitPayPalConverter(): ConverterInterface |
||
| 409 | { |
||
| 410 | return new InitPayPalConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 411 | } |
||
| 412 | |||
| 413 | /** |
||
| 414 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 415 | */ |
||
| 416 | public function createInitPayPalExpressConverter(): ConverterInterface |
||
| 417 | { |
||
| 418 | return new InitPayPalExpressConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 419 | } |
||
| 420 | |||
| 421 | /** |
||
| 422 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 423 | */ |
||
| 424 | public function createInitDirectDebitConverter(): ConverterInterface |
||
| 425 | { |
||
| 426 | return new InitDirectDebitConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 427 | } |
||
| 428 | |||
| 429 | /** |
||
| 430 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 431 | */ |
||
| 432 | public function createInitEasyCreditConverter(): ConverterInterface |
||
| 433 | { |
||
| 434 | return new InitEasyCreditConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 435 | } |
||
| 436 | |||
| 437 | /** |
||
| 438 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 439 | */ |
||
| 440 | public function createInitPaydirektConverter(): ConverterInterface |
||
| 441 | { |
||
| 442 | return new InitPaydirektConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 443 | } |
||
| 444 | |||
| 445 | /** |
||
| 446 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 447 | */ |
||
| 448 | public function createInitSofortConverter(): ConverterInterface |
||
| 449 | { |
||
| 450 | return new InitSofortConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 451 | } |
||
| 452 | |||
| 453 | /** |
||
| 454 | * @return \SprykerEco\Yves\Computop\Converter\ConverterInterface |
||
| 455 | */ |
||
| 456 | public function createInitIdealConverter(): ConverterInterface |
||
| 457 | { |
||
| 458 | return new InitIdealConverter($this->getComputopApiService(), $this->getConfig()); |
||
| 459 | } |
||
| 460 | |||
| 461 | /** |
||
| 462 | * @return \SprykerEco\Client\Computop\ComputopClientInterface |
||
| 463 | */ |
||
| 464 | public function getComputopClient(): ComputopClientInterface |
||
| 465 | { |
||
| 466 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP); |
||
| 467 | } |
||
| 468 | |||
| 469 | /** |
||
| 470 | * @return \SprykerEco\Yves\Computop\Dependency\ComputopToStoreInterface |
||
| 471 | */ |
||
| 472 | public function getStore(): ComputopToStoreInterface |
||
| 473 | { |
||
| 474 | return $this->getProvidedDependency(ComputopDependencyProvider::STORE); |
||
| 475 | } |
||
| 476 | |||
| 477 | /** |
||
| 478 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCalculationClientInterface |
||
| 479 | */ |
||
| 480 | public function getCalculationClient(): ComputopToCalculationClientInterface |
||
| 481 | { |
||
| 482 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_CALCULATION); |
||
| 483 | } |
||
| 484 | |||
| 485 | /** |
||
| 486 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface |
||
| 487 | */ |
||
| 488 | protected function getComputopApiClient(): ComputopToComputopApiClientInterface |
||
| 489 | { |
||
| 490 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COMPUTOP_API); |
||
| 491 | } |
||
| 492 | |||
| 493 | /** |
||
| 494 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 495 | */ |
||
| 496 | public function createOrderCreditCardMapper(): MapperInterface |
||
| 497 | { |
||
| 498 | return new CreditCardMapper( |
||
| 499 | $this->getComputopApiService(), |
||
| 500 | $this->getRouter(), |
||
| 501 | $this->getStore(), |
||
| 502 | $this->getConfig(), |
||
| 503 | $this->getRequestStack()->getCurrentRequest(), |
||
|
|
|||
| 504 | $this->getUtilEncodingService(), |
||
| 505 | $this->getCountryClient() |
||
| 506 | ); |
||
| 507 | } |
||
| 508 | |||
| 509 | /** |
||
| 510 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 511 | */ |
||
| 512 | public function createOrderPayNowMapper(): MapperInterface |
||
| 513 | { |
||
| 514 | return new PayNowMapper( |
||
| 515 | $this->getComputopApiService(), |
||
| 516 | $this->getRouter(), |
||
| 517 | $this->getStore(), |
||
| 518 | $this->getConfig(), |
||
| 519 | $this->getRequestStack()->getCurrentRequest(), |
||
| 520 | $this->getUtilEncodingService(), |
||
| 521 | $this->getCountryClient() |
||
| 522 | ); |
||
| 523 | } |
||
| 524 | |||
| 525 | /** |
||
| 526 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 527 | */ |
||
| 528 | public function createOrderPayPalMapper(): MapperInterface |
||
| 529 | { |
||
| 530 | return new PayPalMapper( |
||
| 531 | $this->getComputopApiService(), |
||
| 532 | $this->getRouter(), |
||
| 533 | $this->getStore(), |
||
| 534 | $this->getConfig(), |
||
| 535 | $this->getRequestStack()->getCurrentRequest(), |
||
| 536 | $this->getUtilEncodingService(), |
||
| 537 | $this->getCountryClient() |
||
| 538 | ); |
||
| 539 | } |
||
| 540 | |||
| 541 | /** |
||
| 542 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 543 | */ |
||
| 544 | protected function createPayPalExpressMapper(): MapperInterface |
||
| 545 | { |
||
| 546 | return new PayPalExpressMapper( |
||
| 547 | $this->getComputopApiService(), |
||
| 548 | $this->getRouter(), |
||
| 549 | $this->getStore(), |
||
| 550 | $this->getConfig(), |
||
| 551 | $this->getRequestStack()->getCurrentRequest(), |
||
| 552 | $this->getUtilEncodingService(), |
||
| 553 | $this->getCountryClient() |
||
| 554 | ); |
||
| 555 | } |
||
| 556 | |||
| 557 | /** |
||
| 558 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 559 | */ |
||
| 560 | public function createOrderDirectDebitMapper(): MapperInterface |
||
| 561 | { |
||
| 562 | return new DirectDebitMapper( |
||
| 563 | $this->getComputopApiService(), |
||
| 564 | $this->getRouter(), |
||
| 565 | $this->getStore(), |
||
| 566 | $this->getConfig(), |
||
| 567 | $this->getRequestStack()->getCurrentRequest(), |
||
| 568 | $this->getUtilEncodingService(), |
||
| 569 | $this->getCountryClient() |
||
| 570 | ); |
||
| 571 | } |
||
| 572 | |||
| 573 | /** |
||
| 574 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 575 | */ |
||
| 576 | public function createOrderSofortMapper(): MapperInterface |
||
| 577 | { |
||
| 578 | return new SofortMapper( |
||
| 579 | $this->getComputopApiService(), |
||
| 580 | $this->getRouter(), |
||
| 581 | $this->getStore(), |
||
| 582 | $this->getConfig(), |
||
| 583 | $this->getRequestStack()->getCurrentRequest(), |
||
| 584 | $this->getUtilEncodingService(), |
||
| 585 | $this->getCountryClient() |
||
| 586 | ); |
||
| 587 | } |
||
| 588 | |||
| 589 | /** |
||
| 590 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 591 | */ |
||
| 592 | public function createOrderPaydirektMapper(): MapperInterface |
||
| 593 | { |
||
| 594 | return new PaydirektMapper( |
||
| 595 | $this->getComputopApiService(), |
||
| 596 | $this->getRouter(), |
||
| 597 | $this->getStore(), |
||
| 598 | $this->getConfig(), |
||
| 599 | $this->getRequestStack()->getCurrentRequest(), |
||
| 600 | $this->getUtilEncodingService(), |
||
| 601 | $this->getCountryClient() |
||
| 602 | ); |
||
| 603 | } |
||
| 604 | |||
| 605 | /** |
||
| 606 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 607 | */ |
||
| 608 | public function createOrderIdealMapper(): MapperInterface |
||
| 609 | { |
||
| 610 | return new IdealMapper( |
||
| 611 | $this->getComputopApiService(), |
||
| 612 | $this->getRouter(), |
||
| 613 | $this->getStore(), |
||
| 614 | $this->getConfig(), |
||
| 615 | $this->getRequestStack()->getCurrentRequest(), |
||
| 616 | $this->getUtilEncodingService(), |
||
| 617 | $this->getCountryClient() |
||
| 618 | ); |
||
| 619 | } |
||
| 620 | |||
| 621 | /** |
||
| 622 | * @return \SprykerEco\Yves\Computop\Mapper\Init\MapperInterface |
||
| 623 | */ |
||
| 624 | public function createOrderEasyCreditMapper(): MapperInterface |
||
| 634 | ); |
||
| 635 | } |
||
| 636 | |||
| 637 | /** |
||
| 638 | * @return \Spryker\Yves\Router\Router\RouterInterface |
||
| 639 | */ |
||
| 640 | public function getRouter(): RouterInterface |
||
| 641 | { |
||
| 642 | return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_ROUTER); |
||
| 643 | } |
||
| 644 | |||
| 645 | /** |
||
| 646 | * @return \Symfony\Component\HttpFoundation\RequestStack |
||
| 647 | */ |
||
| 648 | public function getRequestStack(): RequestStack |
||
| 651 | } |
||
| 652 | |||
| 653 | /** |
||
| 654 | * @return \SprykerEco\Yves\Computop\Dependency\Service\ComputopToUtilEncodingServiceInterface |
||
| 655 | */ |
||
| 656 | public function getUtilEncodingService(): ComputopToUtilEncodingServiceInterface |
||
| 657 | { |
||
| 658 | return $this->getProvidedDependency(ComputopDependencyProvider::SERVICE_UTIL_ENCODING); |
||
| 659 | } |
||
| 660 | |||
| 661 | /** |
||
| 662 | * @return \SprykerEco\Yves\Computop\Dependency\Client\ComputopToCountryClientInterface |
||
| 663 | */ |
||
| 664 | public function getCountryClient(): ComputopToCountryClientInterface |
||
| 665 | { |
||
| 666 | return $this->getProvidedDependency(ComputopDependencyProvider::CLIENT_COUNTRY); |
||
| 667 | } |
||
| 668 | |||
| 669 | /** |
||
| 670 | * @return \SprykerEco\Yves\Computop\Mapper\Init\PrePlace\PayPalExpressToQuoteMapperInterface |
||
| 671 | */ |
||
| 672 | protected function createPayPalExpressToQuoteMapper(): PayPalExpressToQuoteMapperInterface |
||
| 673 | { |
||
| 674 | return new PayPalExpressToQuoteMapper(); |
||
| 675 | } |
||
| 676 | } |
||
| 677 |