Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMika committed Feb 15, 2017
2 parents cfd89ef + 3701fe6 commit acd17fd
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/samples/masterpricertravelboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ Simple flight, request published fares, unifares and corporate unifares (with a
FareMasterPricerTbSearch::FLIGHTOPT_UNIFARES,
FareMasterPricerTbSearch::FLIGHTOPT_CORPORATE_UNIFARES,
],
'corporateCodesUnifares' => ['123456']
'corporateCodesUnifares' => ['123456'],
'corporateQualifier' => FareMasterPricerTbSearch::CORPORATE_QUALIFIER_UNIFARE
]);
Expand Down
14 changes: 14 additions & 0 deletions src/Amadeus/Client/RequestOptions/FareMasterPricerTbSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class FareMasterPricerTbSearch extends Base
const FLIGHTOPT_NO_SLICE_AND_DICE = "NSD";
const FLIGHTOPT_DISPLAY_MIN_MAX_STAY = "MST";

const CORPORATE_QUALIFIER_AMADEUS_NEGO = "RC";
const CORPORATE_QUALIFIER_UNIFARE = "RW";

/**
* Major cabin
*/
Expand Down Expand Up @@ -141,6 +144,17 @@ class FareMasterPricerTbSearch extends Base
*/
public $corporateCodesUnifares = [];

/**
* Corporate qualifier for returning Corporate Unifares
*
* In combination with fareType self::FARETYPE::CORPORATE_UNIFARES
*
* self::CORPORATE_QUALIFIER_*
*
* @var string
*/
public $corporateQualifier;

/**
* The currency to convert to.
*
Expand Down
8 changes: 7 additions & 1 deletion src/Amadeus/Client/Struct/Fare/MasterPricer/CorporateId.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
*/
class CorporateId
{
const CORPORATE_QUALIFIER_AMADEUS_NEGO = "RC";
const CORPORATE_QUALIFIER_UNIFARE = "RW";

/**
* self::CORPORATE_QUALIFIER_*
*
* @var string
*/
public $corporateQualifier;
Expand All @@ -44,8 +49,9 @@ class CorporateId
*
* @param string[] $identity
*/
public function __construct($identity)
public function __construct($identity, $corporateQualifier)
{
$this->identity = $identity;
$this->corporateQualifier = $corporateQualifier;
}
}
5 changes: 3 additions & 2 deletions src/Amadeus/Client/Struct/Fare/MasterPricer/FareOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class FareOptions
* @param bool $tickPreCheck Do Ticketability pre-check?
* @param string|null $currency Override Currency conversion
* @param \Amadeus\Client\RequestOptions\Fare\MPFeeId[]|null $flightOptions List of FeeIds
* @param string|null Corporate qualifier for Corporate Unifares
*/
public function __construct(array $flightOptions, array $corpCodesUniFares, $tickPreCheck, $currency, $feeIds)
public function __construct(array $flightOptions, array $corpCodesUniFares, $tickPreCheck, $currency, $feeIds, $corporateQualifier)
{
if ($tickPreCheck === true) {
$this->addPriceType(PricingTicketing::PRICETYPE_TICKETABILITY_PRECHECK);
Expand All @@ -75,7 +76,7 @@ public function __construct(array $flightOptions, array $corpCodesUniFares, $tic

if ($flightOption === PricingTicketing::PRICETYPE_CORPORATE_UNIFARES) {
$this->corporate = new Corporate();
$this->corporate->corporateId[] = new CorporateId($corpCodesUniFares);
$this->corporate->corporateId[] = new CorporateId($corpCodesUniFares, $corporateQualifier);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ protected function loadOptions($options)
$options->corporateCodesUnifares,
$options->doTicketabilityPreCheck,
$options->currencyOverride,
$options->feeIds
$options->feeIds,
$options->corporateQualifier
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ public function testCanMakeMessageWithPublishedUnifaresCorporateUnifares()
FareMasterPricerTbSearch::FLIGHTOPT_UNIFARES,
FareMasterPricerTbSearch::FLIGHTOPT_CORPORATE_UNIFARES,
],
'corporateCodesUnifares' => ['123456']
'corporateCodesUnifares' => ['123456'],
'corporateQualifier' => FareMasterPricerTbSearch::CORPORATE_QUALIFIER_UNIFARE
]);

$message = new MasterPricerTravelBoardSearch($opt);
Expand All @@ -680,6 +681,7 @@ public function testCanMakeMessageWithPublishedUnifaresCorporateUnifares()
$message->fareOptions->pricingTickInfo->pricingTicketing->priceType
);
$this->assertEquals('123456', $message->fareOptions->corporate->corporateId[0]->identity[0]);
$this->assertEquals(FareMasterPricerTbSearch::CORPORATE_QUALIFIER_UNIFARE, $message->fareOptions->corporate->corporateId[0]->corporateQualifier);
}

public function testCanMakeMessageWithPriceToBeat()
Expand Down

0 comments on commit acd17fd

Please sign in to comment.