webidentity/laravel-gls-printing-service
Composer 安装命令:
composer require webidentity/laravel-gls-printing-service
包简介
GLS printing labels service for Laravel framework.
README 文档
README
Step 1: Install package
Add the package in your composer.json by executing the command.
composer require webidentity/laravel-gls-printing-service
Step 2: Configuration
First initialise the config file by running this command:
php artisan vendor:publish
With this command, initialize the configuration and modify the created file, located under config/gls-printing-service.php.
Configuration
return [ 'logger' => Webidentity\GLSPrintingService\BaseLogger::class, 'log-http-communication' => true, 'credentials' => [ 'username' => '...', 'password' => '...', 'senderid' => '...', ], 'printer_templates' => [ 'A6' => 'A6 format, blank label', 'A6_PP' => 'A6 format, preprinted label', 'A6_ONA4' => 'A6 format, printed on A4', 'A4_2x2' => 'A4 format, 4 labels on layout 2x2', 'A4_4x1' => 'A4 format, 4 labels on layout 4x1', ], 'url' => 'SK', 'soap_urls' => [ 'HU' => 'https://online.gls-hungary.com/webservices/soap_server.php?wsdl', 'SK' => 'http://online.gls-slovakia.sk/webservices/soap_server.php?wsdl', 'CZ' => 'http://online.gls-czech.com/webservices/soap_server.php?wsdl', 'RO' => 'http://online.gls-romania.ro/webservices/soap_server.php?wsdl', 'SI' => 'http://connect.gls-slovenia.com/webservices/soap_server.php?wsdl', 'HR' => 'http://online.gls-croatia.com/webservices/soap_server.php?wsdl', ] ];
Examples
U may call any endpoint against GLS api provided in wsdl file. You need pass array args which key is parameter name with values.
GLSPrintingService::printlabel([ 'parameter_name' => 'value' ]);
Print Label
$data = array_merge(config('gls-printing-service.credentials'), [ 'sender_name' => '...', 'sender_address' => '...', 'sender_city' => '...', 'sender_zipcode' => '...', 'sender_country' => '...', 'sender_contact' => '...', 'sender_phone' => '...', 'sender_email' => '...', 'consig_name' => '...', 'consig_address' => '...', 'consig_city' => '...', 'consig_zipcode' => '...', 'consig_country' => '...', 'consig_contact' => '...', 'consig_phone' => '...', 'consig_email' => '...', 'pcount' => 1, 'pickupdate' => '...', 'content' => '', 'clientref' => '', 'codamount' => '', 'codref' => '', 'services' => [], 'printertemplate' => 'A4_2x2', 'printit' => true, ], ['timestamp' => GLSPrintingService::getTimestamp()] ); $data['hash'] = GLSPrintingService::getglshash($data); $response = GLSPrintingService::printlabel($data) //pdfdata echo base64_decode($response->pdfdata)
Delete Label
GLSPrintingService::deletelabels(array_merge( config('gls-printing-service.credentials'), ['pclids' => $pclids] ));
Log Http Communication
There is enabled logging (request and response) by default. U may follow these logs by executing the command
tail -f storage/logs/laravel.log
Todos
- XML serializer for endpoints which needs to work with xml
webidentity/laravel-gls-printing-service 适用场景与选型建议
webidentity/laravel-gls-printing-service 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 733 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 webidentity/laravel-gls-printing-service 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webidentity/laravel-gls-printing-service 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 733
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-12-16