trixpua/shipping 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trixpua/shipping

Composer 安装命令:

composer require trixpua/shipping

包简介

Shipping is a set of classes optimized to get shipping quotes and tracking information from some Brazilian shipping companies

README 文档

README

Source Code PHP from Packagist Latest Version Software License Build Quality Score Total Downloads

Shipping is a set of classes optimized to get shipping quotes and tracking information from some Brazilian shipping companies.

Shipping é um conjunto de classes otimizadas para obter cotações de envio e informações de rastreamento de algumas empresas de transporte brasileiras.

Shipping Companies (Empresas de transporte)

  • TNT Mercúrio (Quote and Tracking - last occurrence)
  • Jamef Encomendas Urgentes (Quote and Tracking)
  • Correios (Quote and Tracking)
  • Tam Cargo (Quote) - Tam Cargo don't provide a official webservice to quote, so this class is unstable and not recommended to production implementation (Tam Cargo não fornece um webservice oficial para cotação, portanto essa classe é instável e não é recomendada para implementação em produção)
  • Expresso São Miguel (Quote) - Expresso São Miguel don't provide a official webservice to quote, so this class is unstable and not recommended to production implementation (Expresso São Miguel não fornece um webservice oficial para cotação, portanto essa classe é instável e não é recomendada para implementação em produção)

Installation

Shipping is available via Composer:

"Trixpua/shipping": "^2.0"

or run

composer require Trixpua/shipping

Documentation

For details on how to use the shipping, see a example folder in the component directory. In it you will have an example of use for each class. Shipping with minimum parameters works like this:

Para mais detalhes sobre como usar o shipping, veja a pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. Shipping com o mínimo de parâmetros funciona assim:

Quote with TNT

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Tnt\Quote\Tnt;
use Trixpua\Shipping\ShippingInfo;

$tnt = new Tnt('YOUR-ZIP-CODE', 'yourlogin@email.com', 'yourPassword', 'YOUR-DIVISION-CODE', 'YOUR-TAX-SITUATION', 'YOUR-TAX-ID', 'YOUR-STATE-REGISTRATION-NUMBER');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$tnt->setData($shippingInfo);

$tnt->makeRequest();

$return = $tnt->getResult();

Quote with Jamef

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Jamef\Quote\Jamef;
use Trixpua\Shipping\ShippingInfo;

$jamef = new Jamef('yourUser', 'YOUR-TAX-ID', 'YOUR STATE', 'YOUR CITY NAME', 'YOUR-QUOTE-BRANCH');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$jamef->setData($shippingInfo);

$jamef->makeRequest();

$return = $jamef->getResult();

Quote with Correios

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Correios\Quote\Correios;
use Trixpua\Shipping\ShippingInfo;

$correios = new Correios('YOUR-ZIP-CODE', 'YOUR-LOGIN', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$correios->setData($shippingInfo);

$correios->makeRequest();

$return = $correios->getResult();

Quote with Tam Cargo

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\ShippingInfo;
use Trixpua\Shipping\TamCargo\Quote\TamCargo;

$tam = new TamCargo('YOUR-ZIP-CODE', 'yourlogin@email.com', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$tam->setData($shippingInfo);

$tam->makeRequest();

$return = $tam->getResult();

Quote with Expresso São Miguel

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\ExpressoSaoMiguel\Quote\ExpressoSaoMiguel;
use Trixpua\Shipping\ShippingInfo;

$expressoSaoMiguel = new ExpressoSaoMiguel('YOUR-ZIP-CODE','yourUser', 'yourPassword');

$shippingInfo = new ShippingInfo('DESTINY-ZIP-CODE', 'WEIGHT', 'COMMODITY-VALUE', 'VOLUME');
$expressoSaoMiguel->setData($shippingInfo);

$expressoSaoMiguel->makeRequest();

$return = $expressoSaoMiguel->getResult();

Track with TNT

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Tnt\Tracking\Tnt;

$tnt = new Tnt('yourlogin@email.com', 'YOUR-TAX-ID');

$tnt->setData('INVOICE-NUMBER');

$tnt->makeRequest();

$return = $tnt->getResult();

Track with Jamef

<?php
require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Jamef\Tracking\Jamef;

$jamef = new Jamef('yourUsername', 'yourPassword', '00.000.000.0000-00');

$jamef->setData('INVOICE-NUMBER');

$jamef->makeRequest();

$return = $jamef->getResult();

Track with Correios

require __DIR__ . "/vendor/autoload.php";

use Trixpua\Shipping\Correios\Tracking\Correios;

$correios = new Correios();

$correios->setData(['TRACKING-NUMBERS']);

$correios->makeRequest();

$return = $correios->getResult();

Contributing

Please see CONTRIBUTING for details.

Support

Security: If you discover any security related issues, please open an issue.

Se você descobrir algum problema relacionado à segurança, por favor abra uma issue.

Thank you

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 72
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固