承接 santosdave/travelport 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

santosdave/travelport

Composer 安装命令:

composer require santosdave/travelport

包简介

PHP client library for Travelport SOAP API

README 文档

README

Latest Version on Packagist

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 santosdave/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 Santosdave\Travelport;
use Santosdave\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="Santosdave\Travelport\TravelportServiceProvider"

Then insert your credentials in the config\travelport.php file.

Then you can execute requests with a code like this:

use Santosdave\Travelport;
use Santosdave\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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-26