extremesa / aramex
将 Laravel 项目与 Aramex 集成。
0.8
2020-02-14 15:04 UTC
Requires
- php: >=7.1.0
- laravel/framework: ^6.0
This package is auto-updated.
Last update: 2024-09-15 01:40:38 UTC
README
将 Aramex 功能添加到您的 Laravel 项目中。
此仓库是对 DigitalCloud/aramex 的完整重建。
目录
安装
运行以下命令以安装此包的最新适用版本:
composer require extremesa/aramex
您可以使用以下命令发布配置文件:
php artisan vendor:publish --provider="ExtremeSa\Aramex\AramexServiceProvider" --tag="config"
您可以使用以下命令发布资源文件:
php artisan vendor:publish --provider="ExtremeSa\Aramex\AramexServiceProvider" --tag="lang"
快速开始
位置
获取国家
此方法允许用户获取世界国家列表。
Aramex::fetchCountries()->run();
获取国家
此方法允许用户获取特定国家的详细信息。
Aramex::fetchCountry()
->setCode('PS')
->run();
获取州
此方法允许用户获取特定国家(国家代码)内的所有州。
Aramex::fetchStates()
->setCountryCode('AE')
->run();
获取城市
此方法允许用户获取特定国家(国家代码)内的所有城市。并允许用户获取以特定前缀开头的城市列表。需要填写的是客户端信息和国家代码。
Aramex::fetchCities()
->setCountryCode('AE')
->run();
验证地址
此方法允许用户搜索特定地址并确保地址结构正确。
Aramex::validateAddress()
->setAddress(
(new Address()) ...
)->run();
费率
计算费率
此方法允许用户获取源/目的地运输的费率。
$source = (new Address()) ... ;
$destination = (new Address()) ...;
$details = (new ShipmentDetails()) ...;
Aramex::calculateRate()
->setOriginalAddress($source)
->setDestinationAddress($destination)
->setShipmentDetails($details)
->setPreferredCurrencyCode('USD')
->run();
运输
创建取货
此方法允许用户创建取货请求。
$source = (new Address());
$contact = (new Contact());
$pickupItem = (new PickupItem());
$pickup = (new Pickup())
->setPickupAddress($source)
->setPickupContact($contact)
->setPickupLocation('Reception')
->setPickupDate(Carbon::now()->timestamp)
->setReadyTime(Carbon::now()->timestamp)
->setLastPickupTime(Carbon::now()->addDay()->timestamp)
->setClosingTime(Carbon::now()->addDay()->timestamp)
->setStatus('Pending')
->setReference1('')
->addPickupItem($pickupItem);
$labelInfo = (new LabelInfo())
->setReportId(9201)
->setReportType('URL');
Aramex::createPickup()
->setLabelInfo($labelInfo)
->setPickup($pickup)
->run();
取消取货
此方法允许您取消取货,只要它未分配或待定细节。
Aramex::cancelPickup()
->setPickupGUID('PICKUP_GUID')
->run();
创建运输
此方法允许用户在 Aramex 系统上创建运输。
Aramex::createShipments()->run();
获取最后一批运输号码范围
此方法允许您使用特定实体和产品组查询最后预留的范围。
Aramex::getLastShipmentsNumbersRange()
->setEntity('ENTITY')
->setProductGroup('PRODUCT_GROUP')
->run();
打印标签
此方法允许用户为现有运输打印标签。
$labelInfo = (new \ExtremeSa\Aramex\API\Classes\LabelInfo())
->setReportId(9201)
->setReportType('URL');
Aramex::printLabel()
->setShipmentNumber('SHIPMENT_NO')
->setLabelInfo()
->run();
预留运输号码范围
此方法允许您预留一组运输号码。
Aramex::reserveShipmentNumberRange()->run();
安排送货
此方法允许您在指定的时间和地点(经度和纬度)安排运输的送货。
Aramex::scheduleDelivery()->run();
跟踪
跟踪取货
此方法允许用户跟踪现有取货的更新和最新状态。
Aramex::trackPickup()
->setReference('PICKUP_NO')
->setPickup('PICKUP') // any number
->run();
跟踪运输
此方法允许用户跟踪现有运输的更新和最新状态。
Aramex::trackShipments()
->setShipments(['SHIPMENT_NO'])
->run();
积分
- Ismail Ashour
- 所有贡献者