hedii/colissimo-api
Composer 安装命令:
composer require hedii/colissimo-api
包简介
A php package to track Colissimo (La Poste) parcels
README 文档
README
colissimo-api
A php package to track Colissimo (La Poste) parcels
Requirements
- PHP >=8.0
- Curl PHP Extension
- Json PHP Extension
Installation
composer require hedii/colissimo-api
Usage
require 'vendor/autoload.php'; $colissimo = new \Hedii\ColissimoApi\ColissimoApi(); try { $result = $colissimo->get('your_colissimo_id_here'); } catch (\Hedii\ColissimoApi\ColissimoApiException $e) { // ... }
The result is an array of data provided by api.laposte.fr:
array(4) {
["lang"]=>
string(5) "fr_FR"
["scope"]=>
string(8) "timeline"
["shipment"]=>
array(13) {
["idShip"]=>
string(13) "6H002911xxxxx"
["notifAvailable"]=>
bool(true)
["holder"]=>
int(4)
["product"]=>
string(9) "colissimo"
["isFinal"]=>
bool(true)
["deliveryDate"]=>
string(25) "2019-04-05T14:28:00+02:00"
["entryDate"]=>
string(25) "2019-04-04T21:22:52+02:00"
["timeline"]=>
array(5) {
[0]=>
array(6) {
["shortLabel"]=>
string(30) "Votre colis est pris en charge"
["id"]=>
int(1)
["date"]=>
string(25) "2019-04-04T21:22:52+02:00"
["country"]=>
string(0) ""
["status"]=>
bool(true)
["type"]=>
int(1)
}
[1]=>
array(6) {
["shortLabel"]=>
string(17) "Il est en chemin."
["longLabel"]=>
string(0) ""
["id"]=>
int(2)
["country"]=>
string(0) ""
["status"]=>
bool(true)
["type"]=>
int(1)
}
[2]=>
array(5) {
["shortLabel"]=>
string(11) "Il arrive !"
["id"]=>
int(3)
["country"]=>
string(0) ""
["status"]=>
bool(true)
["type"]=>
int(1)
}
[3]=>
array(6) {
["shortLabel"]=>
string(51) "Votre colis vous attend dans votre point de retrait"
["longLabel"]=>
string(0) ""
["id"]=>
int(4)
["country"]=>
string(0) ""
["status"]=>
bool(true)
["type"]=>
int(1)
}
[4]=>
array(7) {
["shortLabel"]=>
string(27) "Votre colis a été retiré"
["longLabel"]=>
string(0) ""
["id"]=>
int(5)
["date"]=>
string(25) "2019-04-05T14:28:00+02:00"
["country"]=>
string(0) ""
["status"]=>
bool(true)
["type"]=>
int(1)
}
}
["event"]=>
array(5) {
[0]=>
array(4) {
["order"]=>
int(100)
["status"]=>
string(6) "LIVCFM"
["label"]=>
string(23) "Votre colis est livré."
["date"]=>
string(25) "2019-04-05T14:28:00+02:00"
}
[1]=>
array(4) {
["order"]=>
int(99)
["status"]=>
string(6) "AARBPR"
["label"]=>
string(195) "Votre colis est disponible dans votre point de retrait pendant un délai de 10 jours ouvrables. Ne tardez pas à aller le chercher ! Il vous sera remis sur présentation d'une pièce d'identité."
["date"]=>
string(25) "2019-04-05T12:07:00+02:00"
}
[2]=>
array(4) {
["order"]=>
int(98)
["status"]=>
string(6) "PRELIV"
["label"]=>
string(116) "Votre colis est dans le site de livraison qui dessert votre adresse. Nous le préparons pour le mettre en livraison."
["date"]=>
string(25) "2019-04-05T09:27:28+02:00"
}
[3]=>
array(4) {
["order"]=>
int(97)
["status"]=>
string(6) "PCHTRI"
["label"]=>
string(110) "Votre colis est en transit sur nos plateformes logistiques pour vous être livré le plus rapidement possible."
["date"]=>
string(25) "2019-04-04T21:22:52+02:00"
}
[4]=>
array(4) {
["order"]=>
int(96)
["status"]=>
string(6) "PCHMQT"
["label"]=>
string(200) "Votre Colissimo va bientôt nous être confié ! Il est en train d’être préparé chez votre expéditeur. Si vous avez des questions, vous pouvez contacter votre expéditeur ou son service clients."
["date"]=>
string(25) "2019-04-04T16:46:30+02:00"
}
}
["contextData"]=>
array(6) {
["isParcelBack"]=>
bool(false)
["removalPoint"]=>
array(4) {
["idPoint"]=>
string(6) "319220"
["type"]=>
string(3) "A2P"
["name"]=>
string(19) "TOULOUSE ROQUELAINE"
["isDiffPoint"]=>
bool(false)
}
["deliveryChoice"]=>
array(6) {
["deliveryChoice"]=>
int(0)
["accola"]=>
int(0)
["thirdParty"]=>
int(0)
["safePlace"]=>
int(0)
["BALCS"]=>
int(0)
["extensionBP"]=>
int(0)
}
["recipient"]=>
array(8) {
["name"]=>
string(14) "M. JOHN DOE"
["companyName"]=>
string(0) ""
["adr2"]=>
string(23) "12 RUE DU PONT"
["adr3"]=>
string(0) ""
["adr4"]=>
string(0) ""
["adr5"]=>
string(0) ""
["zipCode"]=>
string(5) "31000"
["city"]=>
string(8) "TOULOUSE"
}
["originCountry"]=>
string(2) "FR"
["arrivalCountry"]=>
string(2) "FR"
}
["estimDate"]=>
string(25) "2019-04-05T02:00:00+02:00"
["estimHourMin"]=>
string(25) "2019-04-08T18:00:36+02:00"
["estimHourMax"]=>
string(25) "2019-04-08T18:00:36+02:00"
}
["returnCode"]=>
int(200)
}
Testing
Update the id in phpunit.xml file and run:
composer test
License
colissimo-api is released under the MIT Licence. See the bundled LICENSE file for details.
hedii/colissimo-api 适用场景与选型建议
hedii/colissimo-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.71k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2015 年 07 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「colissimo」 「colissimoapi」 「hedii」 「la poste」 「laposte」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hedii/colissimo-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hedii/colissimo-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hedii/colissimo-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Api Client to connect to colissimo Services
A plugin to add Coliship/Colissimo into BitBag SyliusShippingExportPlugin.
A php package to track Colissimo (La Poste) parcels
This bundle provides a wrapper for the lexik/ws-colissimo library
A library for consuming the SOAP WSColiPosteLetterService, WSPointRetraitService and WSColiPosteLetterReturnService
统计信息
- 总下载量: 1.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 22
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-04