dinja/mytnt-express-connect-italy
最新稳定版本:3.0.16
Composer 安装命令:
composer require dinja/mytnt-express-connect-italy
包简介
myTNT Italy Express Connect (API) client
README 文档
README
Client version for myTNT Italy APIs
Original upstream repository documentation
PHP client which helps developers integrate TNT EC with their application. This package supports following services:
Forked repository documentation
This package is an unofficial PHP client for myTNT Italy Express Connect APIs.
Installing
Install with composer
composer require dinja/mytnt-express-connect-italy
Usage
Shipping
- Minimal request to create shipment
use thm\tnt_ec\service\ShippingService\ShippingService; $timestamp = new \DateTime(); $timezone = new \DateTimeZone('Europe/Rome'); $timestamp->setTimezone($timezone); $shipping = new ShippingService('User ID', 'Password'); $shipping->setAccountNumber('') // will be provided by your TNT representative. ->setSenderAccId(''); // will be provided by your TNT representative. $c1 = $shipping->addConsignment()->setConReference('') ->setContype('T') ->setPaymentind('S') // who pays for shipping S-sender, R-receiver ->setItems(1) ->setTotalWeight("00001000") ->setTotalVolume(0.00) ->setPackagetype('C') ->setDivision('D') ->setCollectionDate($timestamp->format('Ymd')) ->setService('N'); // will be provided by your TNT representative. $c1->setSender()->setCompanyName('Your company') ->setAddressLine('Address 1') ->setCity('') ->setPostcode('') ->setProvince('') ->setCountry('') ->setContactDialCode('') ->setContactPhone('') ->setContactEmail(''); $c1->setReceiver()->setCompanyName('Receiver address. NOT DELIVERY!') ->setAddressLine('') ->setCity('') ->setPostcode('') ->setProvince('') ->setCountry('') ->setContactDialCode('') ->setContactPhone('') ->setContactEmail(''); $response = $shipping->send();
- Delete Shipment
use thm\tnt_ec\service\ShippingService\ShippingService; $timestamp = new \DateTime(); $timezone = new \DateTimeZone('Europe/Rome'); $timestamp->setTimezone($timezone); $shipping = new ShippingService('User ID', 'Password'); $shipping->setAccountNumber('') // will be provided by your TNT representative. ->setSenderAccId(''); // will be provided by your TNT representative. $c1 = $shipping->addConsignment()->setConAction("D") ->setConNumber('tracking_number'); // Shipment Number to delete $response = $shipping->send();
Tracking
use thm\tnt_ec\service\TrackingService\TrackingService; $ts = new TrackingService('User ID', 'Password'); $ts->setAccountNumber(''); // will be provided by your TNT representative. $response = $ts->searchByConsignment(array('tracking_number')); // Shipment Number to search
统计信息
- 总下载量: 792
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-03