Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some PAY functions #368

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions docs/list-of-supported-messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ This is the list of messages that are at least partially supported at this time:
- SalesReports_DisplayQueryReport
- SalesReports_DisplayDailyOrSummarizedReport
- SalesReports_DisplayNetRemitReport
- PAY_ListVirtualCards
- PAY_GetVirtualCardDetails
- PAY_GenerateVirtualCard (partially)
- PAY_DeleteVirtualCard
- Travel_OfferPrice
- Travel_OrderCreate
- Travel_OrderRetrieve
Expand Down
68 changes: 68 additions & 0 deletions src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,74 @@ public function travelOrderCancel(RequestOptions\TravelOrderCancelOptions $optio
return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* PAY_GetVirtualCardDetails
*
* @param RequestOptions\PayGetVirtualCardDetailsOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
* @throws Client\InvalidMessageException
* @throws Client\RequestCreator\MessageVersionUnsupportedException
* @throws Exception
*/
public function payGetVirtualCardDetails(RequestOptions\PayGetVirtualCardDetailsOptions $options, $messageOptions = [])
{
$msgName = 'PAY_GetVirtualCardDetails';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* PAY_ListVirtualCards
*
* @param RequestOptions\PayListVirtualCardsOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
* @throws Client\InvalidMessageException
* @throws Client\RequestCreator\MessageVersionUnsupportedException
* @throws Exception
*/
public function payListVirtualCards(RequestOptions\PayListVirtualCardsOptions $options, $messageOptions = [])
{
$msgName = 'PAY_ListVirtualCards';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* PAY_GenerateVirtualCard
*
* @param RequestOptions\PayGenerateVirtualCardOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
* @throws Client\InvalidMessageException
* @throws Client\RequestCreator\MessageVersionUnsupportedException
* @throws Exception
*/
public function payGenerateVirtualCard(RequestOptions\PayGenerateVirtualCardOptions $options, $messageOptions = [])
{
$msgName = 'PAY_GenerateVirtualCard';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* PAY_DeleteVirtualCard
*
* @param RequestOptions\PayDeleteVirtualCardOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
* @throws Client\InvalidMessageException
* @throws Client\RequestCreator\MessageVersionUnsupportedException
* @throws Exception
*/
public function payDeleteVirtualCard(RequestOptions\PayDeleteVirtualCardOptions $options, $messageOptions = [])
{
$msgName = 'PAY_DeleteVirtualCard';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* Call a message with the given parameters
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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\RequestCreator\Converter\PAY;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\PayDeleteVirtualCardOptions;
use Amadeus\Client\Struct;

/**
* DeleteVirtualCardConv
*
* @package Amadeus\Client\RequestCreator\Converter\PAY
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class DeleteVirtualCardConv extends BaseConverter
{
/**
* @param PayDeleteVirtualCardOptions $requestOptions
* @param int|string $version
* @return Struct\Pay\DeleteVirtualCard
*/
public function convert($requestOptions, $version)
{
return new Struct\Pay\DeleteVirtualCard($requestOptions, $version);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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\RequestCreator\Converter\PAY;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\PayGenerateVirtualCardOptions;
use Amadeus\Client\Struct;

/**
* GenerateVirtualCardConv
*
* @package Amadeus\Client\RequestCreator\Converter\PAY
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class GenerateVirtualCardConv extends BaseConverter
{
/**
* @param PayGenerateVirtualCardOptions $requestOptions
* @param int|string $version
* @return Struct\Pay\GenerateVirtualCard
*/
public function convert($requestOptions, $version)
{
return new Struct\Pay\GenerateVirtualCard($requestOptions, $version);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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\RequestCreator\Converter\PAY;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\PayGetVirtualCardDetailsOptions;
use Amadeus\Client\Struct;

/**
* GetVirtualCardDetailsConv
*
* @package Amadeus\Client\RequestCreator\Converter\PAY
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class GetVirtualCardDetailsConv extends BaseConverter
{
/**
* @param PayGetVirtualCardDetailsOptions $requestOptions
* @param int|string $version
* @return Struct\Pay\GetVirtualCardDetails
*/
public function convert($requestOptions, $version)
{
return new Struct\Pay\GetVirtualCardDetails($requestOptions, $version);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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\RequestCreator\Converter\PAY;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\PayListVirtualCardsOptions;
use Amadeus\Client\Struct;

/**
* ListVirtualCardsConv
*
* @package Amadeus\Client\RequestCreator\Converter\PAY
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class ListVirtualCardsConv extends BaseConverter
{
/**
* @param PayListVirtualCardsOptions $requestOptions
* @param int|string $version
* @return Struct\Pay\ListVirtualCards
*/
public function convert($requestOptions, $version)
{
return new Struct\Pay\ListVirtualCards($requestOptions, $version);
}
}
44 changes: 44 additions & 0 deletions src/Amadeus/Client/RequestOptions/Pay/AmountRange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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\Pay;

use Amadeus\Client\LoadParamsFromArray;

/**
* AmountRange
*
* @package Amadeus\Client\RequestOptions\Pay
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class AmountRange extends LoadParamsFromArray
{
/**
* @var integer
*/
public $min;

/**
* @var integer
*/
public $max;
}
49 changes: 49 additions & 0 deletions src/Amadeus/Client/RequestOptions/Pay/Period.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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\Pay;

use Amadeus\Client\LoadParamsFromArray;

/**
* Period
*
* @package Amadeus\Client\RequestOptions\Pay
* @author Konstantin Bogomolov <bog.konstantin@gmail.com>
*/
class Period extends LoadParamsFromArray
{
/**
* YYYY-MM-DD or YYYY-MM-DD-hh:mm:ss
*
* @var string
*/
public $start;

/**
* YYYY-MM-DD or YYYY-MM-DD-hh:mm:ss
*
* @var string
*/
public $end;
}
Loading