Skip to main content
added 106 characters in body
Source Link
yaronish
  • 808
  • 5
  • 4

"Request does not match any route." appears because of incorrect path of webapi.xml.

You must move it to etc/webapi.xml.

Also your file Model/ShetabService.php contains errors.:

  • class ShetabService, not interface
  • typo in __construct function name(last t missed)

Here is fixed one:

namespace Amaj\ShetabPayment\Model;

class ShetabService implements \Amaj\ShetabPayment\Api\ShetabServiceInterface
{
    private $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }


    /** Returns Transaction Reference ID
     *
     * @param int $quoteId
     * @return string|null
     */
    public function getTransRefId($quoteId)
    {
        $this->_logger->info('getTransRefId is called: ' . $quoteId);
        $result = array(
            'transRefId' => 50
        );
        return json_encode($result);
    }
}

"Request does not match any route." appears because of incorrect path of webapi.xml.

You must move it to etc/webapi.xml.

Also your file Model/ShetabService.php contains errors. Here is fixed one:

namespace Amaj\ShetabPayment\Model;

class ShetabService implements \Amaj\ShetabPayment\Api\ShetabServiceInterface
{
    private $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }


    /** Returns Transaction Reference ID
     *
     * @param int $quoteId
     * @return string|null
     */
    public function getTransRefId($quoteId)
    {
        $this->_logger->info('getTransRefId is called: ' . $quoteId);
        $result = array(
            'transRefId' => 50
        );
        return json_encode($result);
    }
}

"Request does not match any route." appears because of incorrect path of webapi.xml.

You must move it to etc/webapi.xml.

Also your file Model/ShetabService.php contains errors:

  • class ShetabService, not interface
  • typo in __construct function name(last t missed)

Here is fixed one:

namespace Amaj\ShetabPayment\Model;

class ShetabService implements \Amaj\ShetabPayment\Api\ShetabServiceInterface
{
    private $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }


    /** Returns Transaction Reference ID
     *
     * @param int $quoteId
     * @return string|null
     */
    public function getTransRefId($quoteId)
    {
        $this->_logger->info('getTransRefId is called: ' . $quoteId);
        $result = array(
            'transRefId' => 50
        );
        return json_encode($result);
    }
}
Source Link
yaronish
  • 808
  • 5
  • 4

"Request does not match any route." appears because of incorrect path of webapi.xml.

You must move it to etc/webapi.xml.

Also your file Model/ShetabService.php contains errors. Here is fixed one:

namespace Amaj\ShetabPayment\Model;

class ShetabService implements \Amaj\ShetabPayment\Api\ShetabServiceInterface
{
    private $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }


    /** Returns Transaction Reference ID
     *
     * @param int $quoteId
     * @return string|null
     */
    public function getTransRefId($quoteId)
    {
        $this->_logger->info('getTransRefId is called: ' . $quoteId);
        $result = array(
            'transRefId' => 50
        );
        return json_encode($result);
    }
}