joaov535/shipping-calculator
Composer 安装命令:
composer require joaov535/shipping-calculator
包简介
Biblioteca para realizar a cotação com algumas transportadoras nacionais.
README 文档
README
Essa biblioteca foi criada com o intuito de centralizar cotações de frete com transportadoras.
Até o momento as transportadoras integradas são:
- Braspress
- Rodonaves
- TNT
- Excellence
- Alfa Transportes
- Atual
- Expresso Jundiaí.
<?php class Consumer { private const ALFA_TRANSPORTES_TOKEN = "xxxxxxxxxxxxxxxxxxxxxx"; private const EXPRESSO_JUNDIAI_TOKEN = "xxxxxxxxxxxxxxxxxxxxxx"; private const BRASPRESS_TOKEN = "xxxxxxxxxxxxxxxxxxxxx"; private $credentials_movvi = ["user" => 'xxxxxxxxxxxxx', "password" => 'xxxxxxxxxx']; private $credentials_rodonaves = ["user" => 'xxxxxxxx', "password" => 'xxxxxxxxxxx']; private $credentials_tnt = ["login" => "xxxxxxxxxx", "password" => "xxxxxxxxxxxx"]; private $credentials_excellence = ["login" => "xxxxxxxxxx", "password" => "xxxxxxxx", "domain" => "EXN"]; private $credentials_atual = ["login" => "xxxxxxxxxx", "password" => "xxxxxxxx", "domain" => "ACT"]; public function doRequest() { $shipping = new \shippingCalculator\ShippingCostCalculator( "0000000000000", "0000000000000", "J", // ou "F" "", "00000000", "00000000000", //CNPJ ou CPF "Isento", "J", // ou "F", "", "00000-000", "R", "Pago", 985.50, 15.8, //Kg [ [ "height" => 145 "width" => 124.6 "depth" => 124 "numBoxes" => 3 ], [ "height" => 121 "width" => 100 "depth" => 124 "numBoxes" => 1 ] ] ); $res = []; $res[] = $shipping->getBraspressShippingCost(self::BRASPRESS_TOKEN); $res[] = $shipping->getRodonavesShippingCost($this->credentials_rodonaves); $res[] = $shipping->getTntShippingCost($this->credentials_tnt); $res[] = $shipping->getMovviShippingCost($this->credentials_movvi); $res[] = $shipping->getExcellenceShippingCost($this->credentials_excellence); $res[] = $shipping->getAtualShippingCost($this->credentials_atual); $res[] = $shipping->getAlfaTransportesShippingCost(self::ALFA_TRANSPORTES_TOKEN); $res[] = $shipping->getJundiaiShippingCost(self::EXPRESSO_JUNDIAI_TOKEN); return $res; } private function toArray($data) { $arr = []; foreach ($data as $box) { $arr[] = get_object_vars($box); } return $arr; } } ?>
joaov535/shipping-calculator 适用场景与选型建议
joaov535/shipping-calculator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tnt」 「frete」 「ssw」 「cotacao」 「alfa」 「braspress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 joaov535/shipping-calculator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 joaov535/shipping-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 joaov535/shipping-calculator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Package para pesquisa de serviços de busca por cep, calculo de frete e etc, diretamente nos serviços dos Correios.
TNT ExpressConnect (API) client
Kit de desenvolvimento para uso dos serviços dos Correios.
myTNT Italy Express Connect (API) client
A PHP client for TNT Express National webservices
Biblioteca PHP para integração com a API SOAP da Total Express
统计信息
- 总下载量: 51
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-17