s25 / prices-importer
Simplifies the process of importing prices into the S25 prices service
2.2.0
2023-09-29 07:56 UTC
Requires
- php: ^8.0
- guzzlehttp/psr7: ^1.9 || ^2.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-29 01:15:54 UTC
README
Prerequisites
The Importer requires an external PSR7-compliant HTTP Client such as Guzzle.
Example
$csv = new \S25\PricesImporter\CsvFile(); $csv->add(['bransslug1', 'RAWPARTNUMBER1'], 12.3 'CUR'); $csv->add(['bransslug2', 'RAWPARTNUMBER2'], 45.6 'REN', 10); $csv->add('guid3', 78.9 'CYC'); $importer = new \S25\PricesImporter\Importer( 'http://service.url/import', new \GuzzleHttp\Client(), new \GuzzleHttpHttpFactory(), ); try { $importer->send( 'price-list-key', $csv, 'Optional source filename' ); } catch (\RuntimeException $e) { // Something went wrong }