Skip to content

Commit

Permalink
Add support for Form of Payment override in Fare_* pricing messages a…
Browse files Browse the repository at this point in the history
…nd Service_IntegratedPricing message. Also support for Frequent Flyer override in Service_IntegratedPricing. (issue #72)
  • Loading branch information
DerMika committed May 10, 2017
1 parent 84b8388 commit db89dde
Show file tree
Hide file tree
Showing 22 changed files with 924 additions and 378 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Release 1.4.0 (UNRELEASED)
* Added support for ``Fare_PricePNRWithBookingClass`` errors in message version 7.3 format (https://github.com/amabnl/amadeus-ws-client/issues/57).
* Added support for ``Fare_PricePNRWithBookingClass`` errors in message version 7.3 format (https://github.com/amabnl/amadeus-ws-client/issues/57)
* Added support for Seat Request elements in in ``PNR_AddMultiElements`` (https://github.com/amabnl/amadeus-ws-client/issues/64/)
* Added support for Credit Card Holder name when adding FP elements with ``PNR_AddMultiElements`` (https://github.com/amabnl/amadeus-ws-client/issues/69)
* Added the possibility to disable the automatic addition of an RF element on each ``PNR_AddMultiElements`` call (https://github.com/amabnl/amadeus-ws-client/issues/68)
* Added support for Form Of Payment overrides in all ``Fare_`` Pricing messages and in ``Service_IntegratedPricing`` (https://github.com/amabnl/amadeus-ws-client/issues/72)
* Added support for Frequent Flyer override in ``Service_IntegratedPricing``
* Implemented ``DocRefund_InitRefund`` (https://github.com/amabnl/amadeus-ws-client/issues/56)
* Implemented ``DocRefund_UpdateRefund`` (https://github.com/amabnl/amadeus-ws-client/issues/56)
* Implemented ``Fare_GetFareRules`` (https://github.com/amabnl/amadeus-ws-client/issues/63)
Expand Down
41 changes: 41 additions & 0 deletions docs/samples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,47 @@ Assign an account code to a passenger:
])
);
Form of Payment:

.. code-block:: php
use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions;
use Amadeus\Client\RequestOptions\Service\FormOfPayment;
$pricingResponse = $client->serviceIntegratedPricing(
new ServiceIntegratedPricingOptions([
'formOfPayment' => [
new FormOfPayment([
'type' => FormOfPayment::TYPE_CREDIT_CARD,
'amount' => 10,
'creditCardNumber' => '400000'
]),
new FormOfPayment([
'type' => FormOfPayment::TYPE_CASH
]),
]
])
);
Frequent Flyer:

.. code-block:: php
use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions;
use Amadeus\Client\RequestOptions\Service\FrequentFlyer;
$pricingResponse = $client->serviceIntegratedPricing(
new ServiceIntegratedPricingOptions([
'frequentFlyers' => [
new FrequentFlyer([
'company' => '6X',
'number' => '1234567891011',
'tierLevel' => 'SILVER',
'priorityCode' => '1'
])
]
])
);
***
FOP
Expand Down
88 changes: 86 additions & 2 deletions docs/samples/pricepnr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Fare_PricePNRWithBookingClass examples
======================================

.. contents::

No options
==========

Price a PNR with no specific options: This option is used when no specific pricing option is requested.

.. code-block:: php
Expand All @@ -12,6 +17,10 @@ Price a PNR with no specific options: This option is used when no specific prici
new FarePricePnrWithBookingClassOptions()
);
List of all available fares (example of using override options)
===============================================================

List of Fares: This option is used to request a list of available fares.

.. code-block:: php
Expand All @@ -26,6 +35,9 @@ List of Fares: This option is used to request a list of available fares.
])
);
Lowest fare
===========

Lowest fare: Return only the lowest fare:

.. code-block:: php
Expand All @@ -40,6 +52,9 @@ Lowest fare: Return only the lowest fare:
])
);
Fare type overrides
===================

Fare types: Take into account Published Fares, Unifares, Negotiated fares:

.. code-block:: php
Expand All @@ -56,6 +71,10 @@ Fare types: Take into account Published Fares, Unifares, Negotiated fares:
])
);
OB Fees
=======

Price a PNR with OB fees:

**Example:** for passenger 1, include fee "FC1" with an amount of 10 USD and exempt from fee "T01".
Expand Down Expand Up @@ -87,6 +106,10 @@ Price a PNR with OB fees:
])
);
Corporate negotiated fares
==========================

Price with corporate negotiated fare '012345':

.. code-block:: php
Expand All @@ -112,6 +135,10 @@ Price with corporate unifares '012345' and 'AMADEUS':
);
Passenger PTC / Discount code
=============================

Price with Passenger PTC / Discount codes

**Example:** use cumulative discount codes YTH, AD20 and MIL for passenger 1 on segment 4.
Expand All @@ -137,6 +164,10 @@ Price with Passenger PTC / Discount codes
])
);
Point of Sale override
======================

Override Point of Sale to LON:

.. code-block:: php
Expand All @@ -149,6 +180,10 @@ Override Point of Sale to LON:
])
);
Point of Ticketing override
===========================

Override Point of Ticketing to PAR:

.. code-block:: php
Expand All @@ -162,6 +197,9 @@ Override Point of Ticketing to PAR:
);
Ticket type (electronic / paper ticket)
=======================================

Specify ticket type "Electronic Ticket":

*Other possible values are:*
Expand All @@ -180,6 +218,9 @@ Specify ticket type "Electronic Ticket":
);
Add taxes
=========

Add specific taxes:

**Example:**
Expand Down Expand Up @@ -209,6 +250,10 @@ Add specific taxes:
])
);
Exempt taxes
============

Exempt from specific taxes. This option is used to exempt the passenger from one, several or all taxes.

**Example:** exemption of tax ZVGO
Expand All @@ -230,6 +275,9 @@ Exempt from specific taxes. This option is used to exempt the passenger from one
);
Passenger, Segment or TST selection
===================================

Passenger/Segment/TST selection: This option is used to price only part of a PNR.

**Example:** price infant number 1, non-infant number 2 and passenger 3 for segment 1
Expand Down Expand Up @@ -262,7 +310,11 @@ Passenger/Segment/TST selection: This option is used to price only part of a PNR
])
);
Past Date Pricing: This option is used to target fares that were applicable on a given date.
Past date pricing
=================

This option is used to target fares that were applicable on a given date.

**Example:** pricing using fare that was applicable on 27JUN2012.

Expand All @@ -280,7 +332,11 @@ Past Date Pricing: This option is used to target fares that were applicable on a
])
);
Award Pricing: This option is used to price an itinerary applying an award program for a given carrier.
Award pricing
=============

This option is used to price an itinerary applying an award program for a given carrier.

*Note: The award option must be combined with the corporate option.*

Expand All @@ -301,3 +357,31 @@ Award Pricing: This option is used to price an itinerary applying an award progr
])
);
Form of Payment override
========================

This option is used to specify the form of payment information to use.

**Example:** Use a form of payment Credit Card with bin range 400000 for an amount of 10 and the remaining on a FOP Cash.

.. code-block:: php
use Amadeus\Client\RequestOptions\FarePricePnrWithBookingClassOptions;
user Amadeus\Client\RequestOptions\Fare\PricePnr\FormOfPayment;
$pricingResponse = $client->farePricePnrWithBookingClass(
new FarePricePnrWithBookingClassOptions([
'formOfPayment' => [
new FormOfPayment([
'type' => FormOfPayment::TYPE_CREDIT_CARD,
'amount' => 10,
'creditCardNumber' => '400000'
]),
new FormOfPayment([
'type' => FormOfPayment::TYPE_CASH
]),
]
])
);
62 changes: 62 additions & 0 deletions src/Amadeus/Client/RequestOptions/Fare/PricePnr/FormOfPayment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Fare\PricePnr;

use Amadeus\Client\LoadParamsFromArray;

/**
* Form of Payment pricing override options
*
* @package Amadeus\Client\RequestOptions\Fare\PricePnr
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class FormOfPayment extends LoadParamsFromArray
{
const TYPE_ON_BEHALF_OF_AGENT = "AGT";
const TYPE_CASH = "CA";
const TYPE_CREDIT_CARD = "CC";
const TYPE_CHECK = "CK";
const TYPE_GOVERNMENT_TRANSPORTATION_REQUEST = "GR";
const TYPE_MISCELLANEOUS = "MS";
const TYPE_NON_REFUNDABLE = "NR";
const TYPE_PREPAID_TICKET_ADVICE = "PT";
const TYPE_SINGLE_GOVERNMENT_TRANSPORTATION_REQUEST = "SGR";
const TYPE_UNITED_NATIONS_TRANSPORTATION_REQUEST = "UN";

/**
* self::TYPE_*
*
* @var string
*/
public $type;

/**
* @var int|float
*/
public $amount;

/**
* @var string
*/
public $creditCardNumber;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

use Amadeus\Client\RequestOptions\Fare\PricePnr\AwardPricing;
use Amadeus\Client\RequestOptions\Fare\PricePnr\ExemptTax;
use Amadeus\Client\RequestOptions\Fare\PricePnr\FareBasis;
use Amadeus\Client\RequestOptions\Fare\PricePnr\FormOfPayment;
use Amadeus\Client\RequestOptions\Fare\PricePnr\ObFee;
use Amadeus\Client\RequestOptions\Fare\PricePnr\PaxSegRef;
use Amadeus\Client\RequestOptions\Fare\PricePnr\Tax;

Expand All @@ -46,6 +49,7 @@ class FarePricePnrWithBookingClassOptions extends Base
const OVERRIDE_RETURN_LOWEST_AVAILABLE = 'RLA';
const OVERRIDE_RETURN_ALL = 'RLI';
const OVERRIDE_PTC_ONLY = 'PTC';
const OVERRIDE_FORM_OF_PAYMENT = 'FOP';

const PRICING_LOGIC_IATA = "IATA";
const PRICING_LOGIC_ATAF = "ATAF";
Expand Down Expand Up @@ -161,14 +165,14 @@ class FarePricePnrWithBookingClassOptions extends Base
/**
* Provide a fare basis to price with
*
* @var Fare\PricePnr\FareBasis[]
* @var FareBasis[]
*/
public $pricingsFareBasis = [];

/**
* Add up to 3 OBFees and/or to exempt up to 3 OBFees
*
* @var Fare\PricePnr\ObFee[]
* @var ObFee[]
*/
public $obFees = [];

Expand Down Expand Up @@ -248,6 +252,13 @@ class FarePricePnrWithBookingClassOptions extends Base
*/
public $pastDatePricing;

/**
* Form of Payment override (max. 3)
*
* @var FormOfPayment[]
*/
public $formOfPayment = [];

/**
* Passenger, Segment or TST references to partially price the PNR
*
Expand Down
Loading

0 comments on commit db89dde

Please sign in to comment.