CommandManagerInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Gateway\Command;
  7. use Magento\Framework\Exception\NotFoundException;
  8. use Magento\Payment\Gateway\CommandInterface;
  9. use Magento\Payment\Model\InfoInterface;
  10. /**
  11. * Interface CommandManagerInterface
  12. * @api
  13. * @since 100.1.0
  14. */
  15. interface CommandManagerInterface extends CommandPoolInterface
  16. {
  17. /**
  18. * Executes command by code
  19. *
  20. * @param string $commandCode
  21. * @param InfoInterface|null $payment
  22. * @param array $arguments
  23. * @return ResultInterface|null
  24. * @throws NotFoundException
  25. * @throws CommandException
  26. *
  27. * @since 100.1.0
  28. */
  29. public function executeByCode($commandCode, InfoInterface $payment = null, array $arguments = []);
  30. /**
  31. * Executes command
  32. *
  33. * @param CommandInterface $command
  34. * @param InfoInterface|null $payment
  35. * @param array $arguments
  36. * @return ResultInterface|null
  37. * @throws CommandException
  38. * @since 100.1.0
  39. */
  40. public function execute(CommandInterface $command, InfoInterface $payment = null, array $arguments = []);
  41. }