1. Go to this page and download the library: Download engazan/mrp-ks-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
engazan / mrp-ks-laravel example snippets
artisan vendor:publish
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);
}
use Engazan\MrpKs\MrpKs;
use Engazan\MrpKs\MrpKsResponse;
// 1) Build your MRPKSData XML payload
$xmlPayload = <<<'XML'
<MRPKSData version="2.0" countryCode="SK" currencyCode="EUR">
<CustomBlock>
<Foo>Bar</Foo>
</CustomBlock>
</MRPKSData>
XML;
// 2) Send it with a POST-only command (e.g. IMPFV0)
$response = (new MrpKs())
->setCommand('IMPFV0')
->sendPostRequest($xmlPayload);
// 3) Inspect HTTP status and raw envelope
$status = $response->original['statusCode']; // e.g. 200
$envelope = $response->original['data']; // the <mrpEnvelope>…</mrpEnvelope> XML
// 4) If encryption is enabled, decrypt + parse
$plainXml = MrpKsResponse::decryptEncryptedResponse($envelope);
$doc = new \SimpleXMLElement($plainXml);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.