filippo-toso/travelport
Composer 安装命令:
composer require filippo-toso/travelport
包简介
PHP client library for Travelport SOAP API
README 文档
README
With this library you can call the Travelport SOAP methods in a object oriented way.
Installation
You can install the package via composer:
composer require filippo-toso/travelport
Usage
If you don't have the required credentials you can register for a trial on this page: https://developer.travelport.com/web/developer/contact-us?type=UAPI
Here is a pure PHP example:
use FilippoToso\Travelport; use FilippoToso\Travelport\System; // Create the API client $travelport = new Travelport\Travelport( 'Universal API/uAPI123456789', // Travelport User ID 'ABCDEFGHILMNOQRSTUVZ', // Travelport Password 'P1234567', // Travelport Target Branch Travelport\Endpoints::REGION_EMEA, // Region false // Set to false to use pre-production endpoints ); // Create a Time request on the System service $request = (new System\TimeReq()) ->setBillingPointOfSaleInfo(new System\BillingPointOfSaleInfo('UAPI')); // Don't know what this is, but it's required to complete a call :( // Execute the request $response = $travelport->execute($request); printf('The current system time is %s', $response->getSystemTime()); // Create a Ping request on the System service $request = (new System\PingReq()) ->setPayload('Hello World!') ->setBillingPointOfSaleInfo(new System\BillingPointOfSaleInfo('UAPI')); // Don't know what this is, but it's required to complete a call :( // Execute the request $response = $travelport->execute($request); printf('Travelport pinged back: %s', $response->getPayload());
This library supports almost all the requests and responses available. They can be executed in the same way:
- Create the response object
- Execute the request
- Use the methods in the answer to get the information you need
You can browser the library source code to understand which methods are available. Usually the request object names end with "Req" and the corrisponding responses end with "Rsp" (ie. System\TimeReq and System\TimeRsp).
Laravel support
You can also use this library in your Laravel applications.
The first step whould be to publish the configuration file:
php artisan vendor:publish --tag=config --provider="FilippoToso\Travelport\TravelportServiceProvider"
Then insert your credentials in the config\travelport.php file.
Then you can execute requests with a code like this:
use FilippoToso\Travelport; use FilippoToso\Travelport\System; // Create a Time request on the System service $request = (new System\TimeReq()) ->setBillingPointOfSaleInfo(new System\BillingPointOfSaleInfo('UAPI')); // Don't know what this is, but it's required to complete a call :( // Execute the request $response = Travelport::execute($request); printf('The current system time is %s', $response->getSystemTime()); // Create a Ping request on the System service $request = (new System\PingReq()) ->setPayload('Hello World!') ->setBillingPointOfSaleInfo(new System\BillingPointOfSaleInfo('UAPI')); // Don't know what this is, but it's required to complete a call :( // Execute the request $response = Travelport::execute($request); printf('Travelport pinged back: %s', $response->getPayload());
Schema version
The current version of this library supports the 19.2 schema version. I hope to keep it updated at least once a year.
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email filippo@toso.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
filippo-toso/travelport 适用场景与选型建议
filippo-toso/travelport 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 511 次下载、GitHub Stars 达 11, 最近一次更新时间为 2019 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 filippo-toso/travelport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 filippo-toso/travelport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 511
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-05