定制 orhanozyalcin/sendeo-client-laravel 二次开发

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

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

orhanozyalcin/sendeo-client-laravel

最新稳定版本:v1.3.7

Composer 安装命令:

composer require orhanozyalcin/sendeo-client-laravel

包简介

A Laravel-optimized PHP client library for Sendeo API integration.

README 文档

README

A Laravel-optimized PHP client library for Sendeo API integration.
This library simplifies communication with Sendeo API, providing methods for tracking, canceling deliveries, and more.

Installation

To install this package, run the following command in your Laravel project:

composer require orhanozyalcin/sendeo-client-laravel

Configuration

This package uses Laravel's Package Discovery, so no manual configuration is required. However, ensure the following is properly set up:

Publishing the Config File

After installing the package, publish the configuration file to your Laravel project:

php artisan vendor:publish --tag=sendeo_config

Service Provider

  1. The SendeoServiceProvider is automatically registered.

Facade

  1. The Sendeo alias is automatically added for easy usage.

### Example .env Configuration

# Maybe Use For Test not Tested: 
#SENDEO_API_ID="TEST"
#SENDEO_API_PASSWORD="TesT.43e54"

# Live
SENDEO_API_ID=YourProductionApiID
SENDEO_API_PASSWORD=YourProductionApiPassword
SENDEO_API_URL=https://api.sendeo.com.tr

# Test
SENDEO_API_TEST_URL=https://api-dev.sendeo.com.tr
SENDEO_TEST_MODE=true

Usage

1. Using the Facade

You can interact with the Sendeo API using the Sendeo facade:

use Sendeo;
use SendeoClientLaravel\Models\TrackDelivery;

// Example: Track a delivery
$trackDelivery = new TrackDelivery('TRACK123456', 'REF123456');
$response = Sendeo::trackDelivery('auth-token', $trackDelivery);

dd($response);

2. Using the Service Container

Alternatively, you can resolve the SendeoClient service from the container:

use SendeoClientLaravel\Models\CancelDelivery;

$sendeoClient = app('sendeo-client');

// Example: Cancel a delivery
$cancelDelivery = new CancelDelivery('TRACK123456', 'REF123456');
$response = $sendeoClient->cancelDelivery('auth-token', $cancelDelivery);

dd($response);

Features

Supported API Methods

1. Authentication

use SendeoClientLaravel\Models\LoginAES;

$loginUser = new LoginAES('TestUserName', 'TestPassWord');
$response = Sendeo::login($loginUser);

2. Track a Delivery

use SendeoClientLaravel\Models\TrackDelivery;

$trackDelivery = new TrackDelivery('TRACK123456', 'REF123456');
$response = Sendeo::trackDelivery('auth-token', $trackDelivery);

3. Cancel a Delivery

use SendeoClientLaravel\Models\CancelDelivery;

$cancelDelivery = new CancelDelivery('TRACK123456', 'REF123456');
$response = Sendeo::cancelDelivery('auth-token', $cancelDelivery);

4. Set a Delivery

Coming Soon!

Requirements

  • PHP: ^8.0
  • Laravel: ^9.0 | ^10.0
  • Sendeo API Access

Contribution

Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Author

Orhan Özyalçın
orhanozyalcin@icloud.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-15