Skip to content

Commit

Permalink
MWSOrdersPHPClientLibrary-2013-09-01
Browse files Browse the repository at this point in the history
  • Loading branch information
pjw345 committed May 20, 2019
1 parent c51389f commit b5768a2
Show file tree
Hide file tree
Showing 41 changed files with 900 additions and 164 deletions.
47 changes: 25 additions & 22 deletions src/MarketplaceWebServiceOrders/Client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
* Copyright 2009-2017 Amazon Services. All Rights Reserved.
* Copyright 2009-2018 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
*
* You may not use this file except in compliance with the License.
Expand All @@ -13,14 +13,14 @@
* @category Amazon
* @package Marketplace Web Service Orders
* @version 2013-09-01
* Library Version: 2017-02-22
* Generated: Thu Mar 02 12:41:08 UTC 2017
* Library Version: 2018-10-31
* Generated: Mon Oct 22 22:40:38 UTC 2018
*/

/**
* @see MarketplaceWebServiceOrders_Interface
*/
require_once(dirname(__FILE__) . '/Interface.php');
require_once (dirname(__FILE__) . '/Interface.php');

/**
* MarketplaceWebServiceOrders_Client is an implementation of MarketplaceWebServiceOrders
Expand All @@ -30,7 +30,7 @@ class MarketplaceWebServiceOrders_Client implements MarketplaceWebServiceOrders_
{

const SERVICE_VERSION = '2013-09-01';
const MWS_CLIENT_VERSION = '2017-02-22';
const MWS_CLIENT_VERSION = '2018-10-31';

/** @var string */
private $_awsAccessKeyId = null;
Expand Down Expand Up @@ -65,14 +65,14 @@ class MarketplaceWebServiceOrders_Client implements MarketplaceWebServiceOrders_
public function getOrder($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetOrderRequest)) {
require_once(dirname(__FILE__) . '/Model/GetOrderRequest.php');
require_once (dirname(__FILE__) . '/Model/GetOrderRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetOrderRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'GetOrder';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/GetOrderResponse.php');
require_once (dirname(__FILE__) . '/Model/GetOrderResponse.php');
$response = MarketplaceWebServiceOrders_Model_GetOrderResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -114,14 +114,14 @@ private function _convertGetOrder($request) {
public function getServiceStatus($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_GetServiceStatusRequest)) {
require_once(dirname(__FILE__) . '/Model/GetServiceStatusRequest.php');
require_once (dirname(__FILE__) . '/Model/GetServiceStatusRequest.php');
$request = new MarketplaceWebServiceOrders_Model_GetServiceStatusRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'GetServiceStatus';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/GetServiceStatusResponse.php');
require_once (dirname(__FILE__) . '/Model/GetServiceStatusResponse.php');
$response = MarketplaceWebServiceOrders_Model_GetServiceStatusResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -160,14 +160,14 @@ private function _convertGetServiceStatus($request) {
public function listOrderItems($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrderItemsRequest)) {
require_once(dirname(__FILE__) . '/Model/ListOrderItemsRequest.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsRequest.php');
$request = new MarketplaceWebServiceOrders_Model_ListOrderItemsRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'ListOrderItems';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/ListOrderItemsResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsResponse.php');
$response = MarketplaceWebServiceOrders_Model_ListOrderItemsResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -210,14 +210,14 @@ private function _convertListOrderItems($request) {
public function listOrderItemsByNextToken($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenRequest)) {
require_once(dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenRequest.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenRequest.php');
$request = new MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'ListOrderItemsByNextToken';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenResponse.php');
$response = MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -258,14 +258,14 @@ private function _convertListOrderItemsByNextToken($request) {
public function listOrders($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrdersRequest)) {
require_once(dirname(__FILE__) . '/Model/ListOrdersRequest.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersRequest.php');
$request = new MarketplaceWebServiceOrders_Model_ListOrdersRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'ListOrders';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/ListOrdersResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersResponse.php');
$response = MarketplaceWebServiceOrders_Model_ListOrdersResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -321,6 +321,9 @@ private function _convertListOrders($request) {
if ($request->isSetTFMShipmentStatus()) {
$parameters['TFMShipmentStatus'] = $request->getTFMShipmentStatus();
}
if ($request->isSetEasyShipShipmentStatus()) {
$parameters['EasyShipShipmentStatus'] = $request->getEasyShipShipmentStatus();
}

return $parameters;
}
Expand All @@ -341,14 +344,14 @@ private function _convertListOrders($request) {
public function listOrdersByNextToken($request)
{
if (!($request instanceof MarketplaceWebServiceOrders_Model_ListOrdersByNextTokenRequest)) {
require_once(dirname(__FILE__) . '/Model/ListOrdersByNextTokenRequest.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersByNextTokenRequest.php');
$request = new MarketplaceWebServiceOrders_Model_ListOrdersByNextTokenRequest($request);
}
$parameters = $request->toQueryParameterArray();
$parameters['Action'] = 'ListOrdersByNextToken';
$httpResponse = $this->_invoke($parameters);

require_once(dirname(__FILE__) . '/Model/ListOrdersByNextTokenResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersByNextTokenResponse.php');
$response = MarketplaceWebServiceOrders_Model_ListOrdersByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
Expand Down Expand Up @@ -541,7 +544,7 @@ private function _invoke(array $parameters)
{
try {
if (empty($this->_config['ServiceURL'])) {
require_once(dirname(__FILE__) . '/Exception.php');
require_once (dirname(__FILE__) . '/Exception.php');
throw new MarketplaceWebServiceOrders_Exception(
array ('ErrorCode' => 'InvalidServiceURL',
'Message' => "Missing serviceUrl configuration value. You may obtain a list of valid MWS URLs by consulting the MWS Developer's Guide, or reviewing the sample code published along side this library."));
Expand All @@ -564,7 +567,7 @@ private function _invoke(array $parameters)
} catch (MarketplaceWebServiceOrders_Exception $se) {
throw $se;
} catch (Exception $t) {
require_once(dirname(__FILE__) . '/Exception.php');
require_once (dirname(__FILE__) . '/Exception.php');
throw new MarketplaceWebServiceOrders_Exception(array('Exception' => $t, 'Message' => $t->getMessage()));
}
}
Expand All @@ -591,7 +594,7 @@ private function _reportAnyErrors($responseBody, $status, $responseHeaderMetadat
$exProps["Message"] = "Internal Error";
}

require_once(dirname(__FILE__) . '/Exception.php');
require_once (dirname(__FILE__) . '/Exception.php');
return new MarketplaceWebServiceOrders_Exception($exProps);
}

Expand Down Expand Up @@ -656,7 +659,7 @@ private function _httpPost(array $parameters)
$response = curl_exec($ch);

if($response === false) {
require_once(dirname(__FILE__) . '/Exception.php');
require_once (dirname(__FILE__) . '/Exception.php');
$exProps["Message"] = curl_error($ch);
$exProps["ErrorType"] = "HTTP";
curl_close($ch);
Expand Down Expand Up @@ -708,7 +711,7 @@ private function _extractHeadersAndBody($response){

//If the body is null here then we were unable to parse the response and will throw an exception
if($body == null){
require_once(dirname(__FILE__) . '/Exception.php');
require_once (dirname(__FILE__) . '/Exception.php');
$exProps["Message"] = "Failed to parse valid HTTP response (" . $response . ")";
$exProps["ErrorType"] = "HTTP";
throw new MarketplaceWebServiceOrders_Exception($exProps);
Expand Down
6 changes: 3 additions & 3 deletions src/MarketplaceWebServiceOrders/Exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
* Copyright 2009-2017 Amazon Services. All Rights Reserved.
* Copyright 2009-2018 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
*
* You may not use this file except in compliance with the License.
Expand All @@ -13,8 +13,8 @@
* @category Amazon
* @package Marketplace Web Service Orders
* @version 2013-09-01
* Library Version: 2017-02-22
* Generated: Thu Mar 02 12:41:08 UTC 2017
* Library Version: 2018-10-31
* Generated: Mon Oct 22 22:40:38 UTC 2018
*/


Expand Down
6 changes: 3 additions & 3 deletions src/MarketplaceWebServiceOrders/Interface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
* Copyright 2009-2017 Amazon Services. All Rights Reserved.
* Copyright 2009-2018 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
*
* You may not use this file except in compliance with the License.
Expand All @@ -13,8 +13,8 @@
* @category Amazon
* @package Marketplace Web Service Orders
* @version 2013-09-01
* Library Version: 2017-02-22
* Generated: Thu Mar 02 12:41:08 UTC 2017
* Library Version: 2018-10-31
* Generated: Mon Oct 22 22:40:38 UTC 2018
*/

interface MarketplaceWebServiceOrders_Interface
Expand Down
20 changes: 10 additions & 10 deletions src/MarketplaceWebServiceOrders/Mock.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*******************************************************************************
* Copyright 2009-2017 Amazon Services. All Rights Reserved.
* Copyright 2009-2018 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
*
* You may not use this file except in compliance with the License.
Expand All @@ -13,14 +13,14 @@
* @category Amazon
* @package Marketplace Web Service Orders
* @version 2013-09-01
* Library Version: 2017-02-22
* Generated: Thu Mar 02 12:41:08 UTC 2017
* Library Version: 2018-10-31
* Generated: Mon Oct 22 22:40:38 UTC 2018
*/

/**
* @see MarketplaceWebServiceOrders_Interface
*/
require_once(dirname(__FILE__) . '/Interface.php');
require_once (dirname(__FILE__) . '/Interface.php');

class MarketplaceWebServiceOrders_Mock implements MarketplaceWebServiceOrders_Interface
{
Expand All @@ -38,7 +38,7 @@ class MarketplaceWebServiceOrders_Mock implements MarketplaceWebServiceOrders_In
*/
public function getOrder($request)
{
require_once(dirname(__FILE__) . '/Model/GetOrderResponse.php');
require_once (dirname(__FILE__) . '/Model/GetOrderResponse.php');
return MarketplaceWebServiceOrders_Model_GetOrderResponse::fromXML($this->_invoke('GetOrder'));
}

Expand All @@ -55,7 +55,7 @@ public function getOrder($request)
*/
public function getServiceStatus($request)
{
require_once(dirname(__FILE__) . '/Model/GetServiceStatusResponse.php');
require_once (dirname(__FILE__) . '/Model/GetServiceStatusResponse.php');
return MarketplaceWebServiceOrders_Model_GetServiceStatusResponse::fromXML($this->_invoke('GetServiceStatus'));
}

Expand All @@ -72,7 +72,7 @@ public function getServiceStatus($request)
*/
public function listOrderItems($request)
{
require_once(dirname(__FILE__) . '/Model/ListOrderItemsResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsResponse.php');
return MarketplaceWebServiceOrders_Model_ListOrderItemsResponse::fromXML($this->_invoke('ListOrderItems'));
}

Expand All @@ -90,7 +90,7 @@ public function listOrderItems($request)
*/
public function listOrderItemsByNextToken($request)
{
require_once(dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrderItemsByNextTokenResponse.php');
return MarketplaceWebServiceOrders_Model_ListOrderItemsByNextTokenResponse::fromXML($this->_invoke('ListOrderItemsByNextToken'));
}

Expand All @@ -106,7 +106,7 @@ public function listOrderItemsByNextToken($request)
*/
public function listOrders($request)
{
require_once(dirname(__FILE__) . '/Model/ListOrdersResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersResponse.php');
return MarketplaceWebServiceOrders_Model_ListOrdersResponse::fromXML($this->_invoke('ListOrders'));
}

Expand All @@ -124,7 +124,7 @@ public function listOrders($request)
*/
public function listOrdersByNextToken($request)
{
require_once(dirname(__FILE__) . '/Model/ListOrdersByNextTokenResponse.php');
require_once (dirname(__FILE__) . '/Model/ListOrdersByNextTokenResponse.php');
return MarketplaceWebServiceOrders_Model_ListOrdersByNextTokenResponse::fromXML($this->_invoke('ListOrdersByNextToken'));
}

Expand Down
5 changes: 5 additions & 0 deletions src/MarketplaceWebServiceOrders/Mock/GetOrderResponse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
<County>String</County>
<District>String</District>
<StateOrRegion>String</StateOrRegion>
<Municipality>String</Municipality>
<PostalCode>String</PostalCode>
<CountryCode>String</CountryCode>
<Phone>String</Phone>
<AddressType>String</AddressType>
</ShippingAddress>
<OrderTotal>
<CurrencyCode>String</CurrencyCode>
Expand Down Expand Up @@ -61,6 +63,7 @@
<ShipmentServiceLevelCategory>String</ShipmentServiceLevelCategory>
<ShippedByAmazonTFM>true</ShippedByAmazonTFM>
<TFMShipmentStatus>String</TFMShipmentStatus>
<EasyShipShipmentStatus>String</EasyShipShipmentStatus>
<CbaDisplayableShippingLabel>String</CbaDisplayableShippingLabel>
<OrderType>String</OrderType>
<EarliestShipDate>1969-07-21T02:56:03Z</EarliestShipDate>
Expand All @@ -73,6 +76,8 @@
<IsPremiumOrder>true</IsPremiumOrder>
<ReplacedOrderId>String</ReplacedOrderId>
<IsReplacementOrder>true</IsReplacementOrder>
<PromiseResponseDueDate>1969-07-21T02:56:03Z</PromiseResponseDueDate>
<IsEstimatedShipDateSet>true</IsEstimatedShipDateSet>
</Order>
</Orders>
</GetOrderResult>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<Title>String</Title>
<QuantityOrdered>1</QuantityOrdered>
<QuantityShipped>1</QuantityShipped>
<ProductInfo>
<NumberOfItems>1</NumberOfItems>
</ProductInfo>
<PointsGranted>
<PointsNumber>1</PointsNumber>
<PointsMonetaryValue>
Expand Down Expand Up @@ -46,10 +49,18 @@
<CurrencyCode>String</CurrencyCode>
<Amount>String</Amount>
</ShippingDiscount>
<ShippingDiscountTax>
<CurrencyCode>String</CurrencyCode>
<Amount>String</Amount>
</ShippingDiscountTax>
<PromotionDiscount>
<CurrencyCode>String</CurrencyCode>
<Amount>String</Amount>
</PromotionDiscount>
<PromotionDiscountTax>
<CurrencyCode>String</CurrencyCode>
<Amount>String</Amount>
</PromotionDiscountTax>
<PromotionIds>
<PromotionId>String</PromotionId>
</PromotionIds>
Expand All @@ -61,6 +72,7 @@
<CurrencyCode>String</CurrencyCode>
<Amount>String</Amount>
</CODFeeDiscount>
<IsGift>true</IsGift>
<GiftMessageText>String</GiftMessageText>
<GiftWrapLevel>String</GiftWrapLevel>
<InvoiceData>
Expand All @@ -78,6 +90,12 @@
<BuyerCustomizedInfo>
<CustomizedURL>String</CustomizedURL>
</BuyerCustomizedInfo>
<TaxCollection>
<Model>String</Model>
<ResponsibleParty>String</ResponsibleParty>
</TaxCollection>
<SerialNumberRequired>true</SerialNumberRequired>
<IsTransparency>true</IsTransparency>
</OrderItem>
</OrderItems>
</ListOrderItemsByNextTokenResult>
Expand Down
Loading

0 comments on commit b5768a2

Please sign in to comment.