定制 ajowi/sendy-fulfilment 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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

Latest Version on Packagist Software License Build Status Total Downloads

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 coordinates
  • Confirm an order: Facilitates confirmation of an order after getting a quotation from the price request endpoint, using the pricing UUIDs
  • Fetch an order: View the items in an order waypoint(s) or path of a given order
  • Cancel 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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固