CommandManagerInterface.php 1.15 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Payment\Gateway\Command;

use Magento\Framework\Exception\NotFoundException;
use Magento\Payment\Gateway\CommandInterface;
use Magento\Payment\Model\InfoInterface;

/**
 * Interface CommandManagerInterface
 * @api
 * @since 100.1.0
 */
interface CommandManagerInterface extends CommandPoolInterface
{
    /**
     * Executes command by code
     *
     * @param string $commandCode
     * @param InfoInterface|null $payment
     * @param array $arguments
     * @return ResultInterface|null
     * @throws NotFoundException
     * @throws CommandException
     *
     * @since 100.1.0
     */
    public function executeByCode($commandCode, InfoInterface $payment = null, array $arguments = []);

    /**
     * Executes command
     *
     * @param CommandInterface $command
     * @param InfoInterface|null $payment
     * @param array $arguments
     * @return ResultInterface|null
     * @throws CommandException
     * @since 100.1.0
     */
    public function execute(CommandInterface $command, InfoInterface $payment = null, array $arguments = []);
}