ajowi/sendy-fulfilment
最新稳定版本:v1.4.0
Composer 安装命令:
composer require ajowi/sendy-fulfilment
包简介
This package allows you to connect to the Sendy API to manage shipping fulfilment orders
README 文档
README
This package makes it easy to integrate Sendy Fulfillment Service API Sendy Fulfillment into your php applications.
Contents
Requirements
- Sign up for a Sendy Fulfillment account
- Generate your API token in settings
Installation
You can install the package via composer:
composer require ajowi/sendy-fulfilment
Setting up the Sendy Fulfillment service
On Laravel add your Sendy API Token and Endpoint URL to your config/services.php:
// config/services.php ... 'sendy' => [ 'token' => env('SENDY_TOKEN'), 'endpoint_url' => env('SENDY_ENDPOINT_URL'), ], ...
Usage
Example request for an order's price quotations that return available pricing tiers given pickup and delivery coordinates
use Ajowi\SendyFulfillment\PriceRequest; $data = new array( 'ecommerce_order' => 'ODR-0000', 'recepient' => [ 'name' => 'David Ajowi', 'email' => 'ajowi@daniche.co.ke', 'phone' => '+254 712345678' ], 'locations' => [ [ 'type' => 'PICKUP', 'waypoint_id' => 'd67dbff1-4d57-4266-9c39-481c2d9c76eq', 'lat' => -1.597429319708498, 'long' => -1.597429319708498, 'name' => 'Destination' ], [ 'type' => 'DELIVERY', 'waypoint_id' => 'd67dbff1-4d57-4266-9c39-481c2d9c76eq', 'lat' => -1.597429319708498, 'long' => -1.597429319708498, 'name' => 'Destination' ] ] ); /** * ----------- * IMPORTANT * ----------- * If you are not using Laravel, pass the API token/key and Endpoint URL to the constructor like so * * $priceRequest = new PriceRequest('SENDY_API_TOKEN', 'ENDPOINT_URL'); * */ $priceRequest = new PriceRequest(); $priceRequest->initialize($data); // Do a price request try { $response = $priceRequest->send(); $data = $response->getData(); echo "Response data : " . print_r($data, true) . "\n"; if ($response->isSuccessful()) { echo "Request was successful!\n"; } } catch (\Exception $e) { echo "Message : " . $e->getMessage() . "\n"; }
Available Operations
Price request: Requests for an order's price quotations and returns available pricing tiers given pickup and delivery coordinatesConfirm an order: Facilitates confirmation of an order after getting a quotation from the price request endpoint, using the pricing UUIDsFetch an order: View the items in an order waypoint(s) or path of a given orderCancel an order: Facilitates cancellation of orders.Track an order: Get details about an order which include tracking details, status, rider details et al.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-16