mchervenkov/inout
Composer 安装命令:
composer require mchervenkov/inout
包简介
Laravel InOut API Wrapper
README 文档
README
Inout JSON API Postman documentation
Installation
You can install the package via composer:
composer require mchervenkov/inout
If you plan to use database for storing nomenclatures:
php artisan migrate
If you need to export configuration file:
php artisan vendor:publish --tag=inout-config
If you need to export migrations:
php artisan vendor:publish --tag=inout-migrations
If you need to export models:
php artisan vendor:publish --tag=inout-models
If you need to export commands:
php artisan vendor:publish --tag=inout-commands
Configuration
INOUT_ENV=test|production #default=test INOUT_API_TOKEN= #default=test-api-token INOUT_API_TEST_BASE_URI= #default=https://test-api.inout.bg/api/v1 INOUT_API_PRODUCTION_BASE_URI= #default=https://api1.inout.bg/api/v1 INOUT_COMPANY_ID= #default=0 INOUT_API_TIMEOUT= #default=5 INOUT_TEST_MODE= #default=1
Usage
Methods
// Init Inout Client $inout = new Inout(); // Awb endpoints $inout->awbDetails($awbNumber); $inout->awbStatus($awbNumber); $inout->awbPrint($awbNumber, 1); $inout->awbHistory($awbNumber); $inout->pickupAwbCreation(PickupAwbCreation); // Companies endpoints $inout->getCompanies(); // Couriers endpoints $inout->getCouriers(); $inout->getCourierOffices($courierId); // Locations endpoints $inout->getCounties($countryId); $inout->getCities(City, $countryId); $inout->getCountries(); $inout->getCitiesSuggestions($countryId, $searchString, 1); // Shipments endpoints $inout->shipmentCreation(Shipment) $inout->shipmentPrice(ShipmentPrice) // Additional services endpoints $inout->codInformation($referenceNumber) $inout->phoneCallHistory($awbNumber) $inout->waybillsHistory(WaybillsHistory)
Commands
#get counties with database (use -h to view options) php artisan inout:sync-counties #get countries with database (use -h to view options) php artisan inout:sync-countries #get cities with database (use -h to view options) php artisan inout:sync-cities #create cities map with other carriers in database (use -h to view options) php artisan inout:map-cities #get company couriers with database (use -h to view options) php artisan inout:sync-couriers #get courier offices with database (use -h to view options) php artisan inout:sync-courier-offices #get inout api status (use -h to view options) php artisan inout:api-status
Models
InoutCity InoutCompanyCourier InoutCountry InoutCounty InoutCourierOffice InoutApiStatus CarrierCityMap
Examples
$inout = new Inout(); $shipment = new \Mchervenkov\Inout\Hydrators\Shipment([ "senderId" => 333, "courierId" => 20, "waybillAvailableDate" => "2023-06-29", "serviceName" => "crossborder", "recipient": [ "name" => "Test User", //Name of recipient or company. Typically, both customer names (first name and last name) or company. "countryIsoCode" => "HU", //Two digits country ISO code. "cityId" => 20144281, //The ID of a city where the shipment needs to delivery. Obtain an ID from Cities_Web_Service_v1.0. Using cityId, cityName and zipCode can be null. "region" => "null", //The Municipality/county were the city is located. "cityName" => "Balatonszárszó", //City name. If you have your own nomenclature with а cities, you can fill in the fields cityName, zipCode and region. "zipCode" => "8624", //Zip code. "streetName" => "test street", //Name of the street, office address or office name - e.g. If you create shipment to address - Main street or Main street 10.If you want to create shipment to an office, please add a keyword "to office: " to office name or office address. "buildingNumber" => 0, //Number of the street/building - e.g. 10 "officeId" => 1297, //if the courier support PUDO delivery, you can send ID of the PUDO. Obtain the PUDO ID'\''s from "Courier_Offices_Web_Service_v1.2" "officeCode" => "1182", //if the courier support PUDO delivery, you can send COURIER_OFFICE_CODE of the PUDO. Obtain the PUDO COURIER_OFFICE_CODE'\''s from "Courier_Offices_Web_Service_v1.2" "addressText" => "additional text, address test", //Additional address information – e.g. бл.25 ет 3. or bl.25 et. 3 *NOT ALL COURIERS SUPPORT IT* "contactPerson" => "Test User", //Contact person. Usually is the same as the name of recipient. "phoneNumber" => "00889000000", //Recipient'\''s phone number - mandatory for all coureirs. "email" => "2@2.com" // Recipient'\''s email - highly recomended ], "awb": [ "shipmentType" => "pack", //pack or pallet "parcels" => 1, // Number of parcels in the shipment. *NOT ALL COURIERS SUPPORT MULTIPARCEL SERVICE* "envelopes" => 0, //Always send "0". "totalWeight" => 1.000, //Total weight of the shipment in kg. The value have to be equal to the sum of all packages. "declaredValue" => 0, //Insurance amount of the shipment. *NOT ALL COURIERS SUPPORT THE SERVICE* "bankRepayment" => 0.0, //COD amount of the shipment in local currency. You can set to 0 if the shipment doesn'\''t have a COD amount. "otherRepayment" => "additional text for repayment",//The service is no longer supported "observations" => "notes", //Additional information about the shipment/products. (notes) "openPackage" => false, //Check up the shipment before pay. "shipmentPayer" => "sender", //Always "sender" "saturdayDelivery" => false, //The service is no longer supported "referenceNumber" => "000000", //Client reference number. Important: The information in the field must be unique to avoid duplicate shipments! "products" => "test product", //The content of the shipment. e.g. product1 product2 "fragile": 1, //Marker whether the content is fragile. (fragile = 1 if the content is fragile) – Used only for BG "productsInfo" => "1111;2222;3333;4444", //Аdditional product information. "piecesInPack" => 4, //Products amount in one shipment. e.g If the shipment contain 5 products the field will be filled with 5. "packages" => [ "1": [ "dimensions" => [ "width" => 20, "height" => 20, "length" => 20 ], "weight" => 2.300 ] ] ], "returnLabel" => [ "nDaysValid" => 0 //By default is 0 (infinity). FUsed only for Greece ] ]); $response = $inout->shipmentCreation($shipment); dd($response);
Testing
Before running tests set your api credentials in inout.php config file
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mario.chervenkov@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
mchervenkov/inout 适用场景与选型建议
mchervenkov/inout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.38k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「inout」 「mchervenkov」 「InOut laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mchervenkov/inout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mchervenkov/inout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mchervenkov/inout 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Sameday API Wrapper
Laravel BNB Fixing XML Wrapper
Client library for euShipments (by InOut)
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 3.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-08