KlarnaConfigPlugin.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * This file is part of the Klarna Kp module
  4. *
  5. * (c) Klarna AB
  6. *
  7. * For the full copyright and license information, please view the NOTICE
  8. * and LICENSE files that were distributed with this source code.
  9. */
  10. namespace Klarna\Kp\Plugin\Helper;
  11. use Klarna\Core\Api\VersionInterface;
  12. use Klarna\Core\Helper\KlarnaConfig;
  13. use Klarna\Kp\Model\Payment\Kp;
  14. /**
  15. * Class KlarnaConfigPlugin
  16. *
  17. * @package Klarna\Kp\Plugin\Helper
  18. */
  19. class KlarnaConfigPlugin
  20. {
  21. /**
  22. * @param KlarnaConfig $subject
  23. * @param string $result
  24. * @param VersionInterface $versionConfig
  25. * @param string $methodCode
  26. * @return string
  27. * @SuppressWarnings(PMD.UnusedFormalParameter)
  28. */
  29. public function afterGetOmBuilderType(
  30. KlarnaConfig $subject,
  31. $result,
  32. VersionInterface $versionConfig,
  33. $methodCode = 'klarna_kp'
  34. ) {
  35. if ($methodCode !== 'klarna_kco') {
  36. return \Klarna\Kp\Model\Api\Builder\Kasper::class;
  37. }
  38. return $result;
  39. }
  40. }