gtx/magento2-webservice

Sample Magento 2 module for GTX webservice authorization.

1.0.2 2024-04-26 21:52 UTC

This package is not auto-updated.

Last update: 2024-04-26 22:15:16 UTC


README

Sample Magento2 plugin for GTX webservice authorization.

Configuration

For NTLM authentication setup go to Stores -> Configuration -> Topex -> Webservice

Usage

<?php

use Gtx\Webservice\Model\File as WebserviceFile;

class MediaGalleryProcessorPlugin
{

    /**
     * @var WebserviceFile
     */
    private WebserviceFile $webserviceFile;

    /**
     * @param WebserviceFile $webserviceFile
     */
    public function __construct(
        WebserviceFile $webserviceFile
    ) {
        $this->webserviceFile = $webserviceFile;
    }

    /**
     * @param string $url
     * @return string
     */
    public function getImageContent(string $url): string
    {
        return $this->webserviceFile->fetch($url);
    }

}