s25 / prices-importer
简化了将价格导入S25价格服务的流程
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: 2024-09-29 10:12:40 UTC
README
先决条件
导入器需要一个外部PSR7兼容的HTTP客户端,例如Guzzle。
示例
$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 }