pass-qa/delivery 问题修复 & 功能扩展

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

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

pass-qa/delivery

Composer 安装命令:

composer require pass-qa/delivery

包简介

Pass delivery service API library

README 文档

README

Social Card of Pass Delivery API

Pass Delivery: Api package library

About API

See the integration page for description of pass delivery api.

Documentation

See the documentation for pass delivery api documentation.

Installation

composer require pass-qa/delivery

Optional:

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

'providers' => [
    // ...
    pass-qa\delivery\src\providers\PassDeliveryApiServiceProvider::class,
];

Publish files

You should publish the config/passdelivery.php config file with:

php artisan vendor:publish --provider="PassQa\Delivery\Providers\PassDeliveryApiServiceProvider"

After that, you should put your api_key in config file, also you can set test_mode to true for development or false for production.

Usage Instructions

First Step

You must generate a token. See this page to learn how to create a token.

create new object

use PassQa\Delivery\PassOrder;

$order = new PassOrder()

calculate order price before create order

Request a quote to receive your exact delivery fee for an order by using the origin address and destination addresses.

This endpoint retrieves calculation information in the format of for a pair of {latitude, longitude} coordinates.

$priceData = [
        "pickup" =>[
            "lat" =>"25.275047",
            "long" => "51.535141"
        ],
        "dropoffs" => [
            [
                "lat" =>"25.277007", 
                "long" => "51.530034"
            ],
                 [
                "lat" =>"25.277005", 
                "long" => "51.530039"
                 ],
                 [
                "lat" =>"25.277001", 
                "long" => "51.530030"
                 ]
        ]
    ];

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->Price($priceData);

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::Price($priceData);

create an order

Once you calculated the price of your order, you can use this endpoint in order to create a new order.

$orderData = [
        "addresses"=> [
            "pickup" =>[
                "lat"=> "25.275047",
                "long"=> "51.535141",
                "name"=> "majva",
                "phone"=> "+97466661234",
                "address"=> "this street",
                "description"=> "it is a sample description"
            ],
            "dropoffs" => [
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "that street",
                    "description"=> "it is a sample description"
                ],
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "other street",
                    "description"=> "it is a sample description"
                ],
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "another street",
                    "description"=> "it is a sample description"
                ]
            ]
        ]
    ];

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->Create($orderData);

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::Create($orderData);

tracking driver of your order

Once you successfully have created an order, you will be able to watch the Pass driver on a live map.

The driver's location and order status will be change as the driver is moving.

The 'order id' is available in the create API response

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->Tracking('order id');

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::Tracking('order id');

get order detail

Call the following endpoint in order to get the order details.

The order details include:

  1. Pickup and Dropoff details including description
  2. Driver details including name, phone number, avatar and vehicle information
  3. Order price and payment details
  4. Order statuses
  5. Share URL. A tool which you can use to share a link with your clients to view the live driver status.

The 'order id' is available in the create API response

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->Detail('order id');

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::Detail('order id');

cancel an order

You can cancel any order before courier arrival (before the pickup status)

The 'order id' is available in the create API response

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->Cancel('order id');

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::Cancel('order id');

list of orders

List of all submitted orders by your tokens

use object

use PassQa\Delivery\PassOrder;

$order = new PassOrder();

$response = $order->List();

or use facade

use PassQa\Delivery\Facades\PassOrder;

$response = PassOrder::List();

Security

If you discover any security-related issues, please email security@pass.qa instead of using the issue tracker.

Credits

License

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

pass-qa/delivery 适用场景与选型建议

pass-qa/delivery 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 pass-qa/delivery 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 pass-qa/delivery 我们能提供哪些服务?
定制开发 / 二次开发

基于 pass-qa/delivery 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-27