seeru/flight-sdk
Composer 安装命令:
composer require seeru/flight-sdk
包简介
PHP SDK for Seeru Travel Flight API
README 文档
README
A modern PHP 8.0+ SDK for the Seeru Travel Flight API. This SDK provides a clean, type-safe interface for searching and booking flights through the Seeru Travel platform.
Features
- Modern PHP 8.0+ features
- PSR-4 autoloading
- Strong typing
- Proper error handling
- Immutable response objects
- Support for one-way, round-trip, and multi-city searches
- Flexible search options
Installation
composer require seeru/flight-sdk
Basic Usage
use Seeru\FlightSDK\SeeruFlightSDK; use Seeru\FlightSDK\Types\SearchOptions; // Initialize the SDK $sdk = new SeeruFlightSDK('your-api-token'); // Search for one-way flights $response = $sdk->search( fromAirport: 'DEL', toAirport: 'MOW', date: '20250612', adt: 1, chd: 0, inf: 0 ); // Search with options $options = new SearchOptions( airline: 'EK,EY', // Emirates and Etihad source: 'NS,MW', // Search in GDS and NDC sources direct: true, // Only direct flights cabin: SearchOptions::CABIN_BUSINESS // Business class ); // Round-trip search with options $response = $sdk->searchRoundTrip( fromAirport: 'DEL', toAirport: 'MOW', departDate: '20250612', returnDate: '20250622', options: $options ); // Multi-city search $response = $sdk->searchMultiCity([ 'DEL-MOW-20250612', 'LED-DEL-20250622', 'DEL-DXB-20250625' ]);
Search Options
The SDK supports the following search options:
| Option | Description | Format | Default |
|---|---|---|---|
| airline | Filter by specific airlines | Comma-separated IATA codes (e.g., 'EK,EY') | null |
| source | Filter by source systems | Comma-separated 2-char codes (e.g., 'GDS,NDC') | null |
| direct | Show only direct flights | boolean | false |
| cabin | Cabin class preference | 'e' (Economy), 'p' (Premium Economy), 'b' (Business), 'f' (First) | 'e' |
Options can be provided either as a SearchOptions object or as an array:
// Using SearchOptions object $options = new SearchOptions( airline: 'EK,EY', cabin: SearchOptions::CABIN_BUSINESS ); // Using array $options = [ 'airline' => 'EK,EY', 'cabin' => 'b' ];
Route Formats
The SDK supports three search types with flexible input formats:
- One-way:
DEL-MOW-20250612 - Round-trip:
DEL-MOW-20250612:MOW-DEL-20250622 - Multi-city:
DEL-MOW-20250612:LED-DEL-20250622:DEL-DXB-20250625
Each route segment can also be provided as an array:
$routes = [ ['DEL', 'MOW', '20250612'], ['MOW', 'DEL', '20250622'] ];
Error Handling
The SDK uses custom exceptions for error handling:
use Seeru\FlightSDK\Exceptions\SeeruApiException; try { $response = $sdk->search('DEL', 'MOW', '20250612'); } catch (SeeruApiException $e) { echo "API Error: " . $e->getMessage(); echo "Status Code: " . $e->getCode(); }
Response Objects
All API responses are converted to immutable objects with type-safe properties:
SearchResponseSearchResultResponseBookingFareResponseBookingSaveResponseOrderResponse
License
MIT License
seeru/flight-sdk 适用场景与选型建议
seeru/flight-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 seeru/flight-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 seeru/flight-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-30