payzoffpayzoff MemberComments: 3 Received thanks: 0 Member since: January 9 edited May 10

Hi, I am trying to implement a test button as refs here

Hallo, ich versuche hier einen Testknopf als Referenz zu implementieren
Here is my service file
Hier ist meine Servicedatei


<?xml version="1.0" ?>

<container xmlns="";

        <service id="mytest_payment.mytest_payment_controllers_backend_mytest_payment_services" class="MytestPayment\Controllers\Backend\MytestPaymentServices">
            <argument type="service" id="http_client"/>
            <argument type="service" id="MytestPayment.logger" />
            <tag name="shopware.controller" module="backend" controller="MytestPayment\Controllers\Backend\MytestPaymentServices"/>






namespace MytestPayment\Controllers\Backend;

use Monolog\Logger;
use Shopware\Components\HttpClient\HttpClientInterface;
use Shopware\Components\HttpClient\RequestException;
use Symfony\Component\HttpFoundation\Response;

 class MytestPaymentServices extends \Shopware_Controllers_Backend_ExtJs
    private const EXTERNAL_API_BASE_URL = '';
     * @var HttpClientInterface
    private $client;

     * @var Logger
    private $logger;

    public function __construct(HttpClientInterface $client, Logger $logger)
        $this->client = $client;
        $this->logger = $logger;


    public function testAction()
        try {
            $response = $this->client->get(self::EXTERNAL_API_BASE_URL);

            if ((int) $response->getStatusCode() === Response::HTTP_OK) {
                $this->View()->assign('response', 'Success!');
            } else {
                $this->View()->assign('response', 'Oh no! Something went wrong :(');
        } catch (RequestException $exception) {

            $this->View()->assign('response', $exception->getMessage());

but I get the following error

aber ich bekomme folgenden Fehler

Class Shopware_Controllers_Backend_MytestPaymentServices does not exist in engine/Library/Enlight/Hook/ProxyFactory.php on line 164

What do I do wrong?

Was mache ich falsch?

1 Answer

  • ShyimShyim MemberComments: 1181 Received thanks: 481 Member since: May 2015

    Place your Controller in Controller/Backend/XXXX.php

    Controllers name conflicting the other controller autoload

    Accepted Answer
  • Accepted Answer
Sign In or Register to comment.