Skip to content

Engazan/mrp-ks-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MRP K/S - laravel

FEATURES

  • encryption (aes-256-ctr)

INSTALL

composer require engazan/mrp-ks-laravel

run php artisan vendor:publish look for Engazan\MrpKs\MrpKsServiceProvider

Config .env

MRP_KS_URI=192.168.0.166
MRP_KS_PORT=120
MRP_KS_USERNAME=MRPDBA
MRP_KS_PASSWORD=MRPDBA
MRP_KS_ENCRYPTION_KEY=
  • if MRP_KS_ENCRYPTION_KEY is provided all request are sent as ENCRYPTED, also you need DECRYPT response XML

USAGE

use Engazan\MrpKs\MrpKs;
use Engazan\MrpKs\MrpKsResponse;

$productFilter = [
    'malObraz' => 'T',
    'velObraz' => 'F',
    'SKKAR.CISLO' => '500..510',
];

// products
$response = MrpKs::EXPEO0($productFilter);
$response = MrpKs::EXPEO1($productFilter);

// addresses
$response = MrpKs::ADREO0();

// prices (default filter "cenovaSkupina" is set to "1")
$response = MrpKs::CENEO0();

// CHAINED calls
$mrpKs = new MrpKs();
$response = $mrpKs->setCommand('EXPEO0')
                    ->setFilters($productFilter)
                    ->sendRequest();
               
// DECRYPT response (needed only if MRP_KS_ENCRYPTION_KEY is filled) 
if (config('mrp-ks.encryption')) {
    $decryptedResponse = MrpKsResponse::decryptEncryptedResponse($response);
}

About

Laravel wrapper package for the MRP K/S API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages