Skip to content

Commit 48e4ed8

Browse files
committed
Partially implemented "getOrderHistory" and "getCrossUpSell" methods (NEXWAY-1)
1 parent 7ae88ca commit 48e4ed8

File tree

15 files changed

+358
-12
lines changed

15 files changed

+358
-12
lines changed

src/Audith/Providers/Nexway/Data.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ abstract class Data
1010
'getCategoriesCategoryResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\CatalogApi\getCategories'),
1111
'getCategoriesSubCategoryResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\CatalogApi\getCategories\subcategory'),
1212
'getOperatingSystemsOsResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\CatalogApi\getOperatingSystems'),
13+
'getStockStatusResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\getStockStatus'),
1314
'getStockStatusproductStatusResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\getStockStatus\productStatus'),
15+
'getCrossUpSellResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\getCrossUpSell'),
16+
'getCrossUpSellProductReturnResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\getCrossUpSell\productsReturn'),
1417
'createResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\create'),
1518
'createOrderLineResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\create\orderLines'),
1619
'createLineItemResponseType' => array('nameSpace' => '\Audith\Providers\Nexway\Data\Response\OrderApi\create\orderLines\lineItems'),
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Request\CustomerApi;
3+
4+
/**
5+
* @author Shahriyar Imanov <[email protected]>
6+
*/
7+
class getOrderHistory extends \Audith\Providers\Nexway\Data\Request\CustomerApi
8+
{
9+
/**
10+
* @var string
11+
*/
12+
public $partnerId;
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Request\OrderApi;
3+
4+
/**
5+
* @author Shahriyar Imanov <[email protected]>
6+
*/
7+
class getCrossUpSell extends \Audith\Providers\Nexway\Data\Request\OrderApi
8+
{
9+
/**
10+
* @var getCrossUpSell\getCrossUpSellProductType[]
11+
*/
12+
public $products = array();
13+
14+
/**
15+
* Language list (use ISO 3166-1-alpha-2)
16+
*
17+
* @var string
18+
* @usage This method accepts one language or list of language comma separated.
19+
* Example: 'FR,EN,ES,IT,PT' or 'FR'
20+
*/
21+
public $language = "EN";
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Request\OrderApi\getCrossUpSell;
3+
4+
use Audith\Providers\Nexway\Data\Request\OrderApi\getCrossUpSell;
5+
6+
/**
7+
* @author Shahriyar Imanov <[email protected]>
8+
*/
9+
class getCrossUpSellProductType extends \Audith\Providers\Nexway\Data\Request\OrderApi
10+
{
11+
/**
12+
* @var integer
13+
*/
14+
public $productRef;
15+
16+
/**
17+
* @var integer
18+
*/
19+
public $quantity;
20+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Response\CustomerApi;
3+
4+
use Audith\Providers\Nexway\Data\Response\CustomerApi;
5+
6+
/**
7+
* @author Shahriyar Imanov <[email protected]>
8+
*/
9+
class getOrderHistory extends \Audith\Providers\Nexway\Data\Response\CustomerApi
10+
{
11+
/**
12+
* @var array
13+
*/
14+
public static $exceptionCodeMapping = array(
15+
1000 => "InternalErrorException",
16+
1010 => "PartnerNotFoundException"
17+
);
18+
19+
/**
20+
* @var string
21+
*/
22+
public $partnerId;
23+
24+
/**
25+
* @var string
26+
*/
27+
public $email;
28+
29+
/**
30+
* @var getOrderHistory\ordersHistory[]
31+
*/
32+
public $ordersHistory = array();
33+
34+
/**
35+
* @var integer
36+
*/
37+
public $responseCode;
38+
39+
/**
40+
* @var string
41+
*/
42+
public $responseMessage;
43+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Response\CustomerApi\getOrderHistory;
3+
4+
/**
5+
* @author Shahriyar Imanov <[email protected]>
6+
*/
7+
class ordersHistory extends \Audith\Providers\Nexway\Data
8+
{
9+
/**
10+
* @var string
11+
*/
12+
public $partnerOrderNumber;
13+
14+
/**
15+
* @var integer
16+
*/
17+
public $orderNumber;
18+
19+
/**
20+
* @var string
21+
*/
22+
public $statusCode;
23+
24+
/**
25+
* @var string
26+
*/
27+
public $statusDescription;
28+
29+
/**
30+
* @var string
31+
*/
32+
public $dateOrder;
33+
34+
/**
35+
* @var string
36+
*/
37+
public $dateInvoice;
38+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Response\OrderApi;
3+
4+
/**
5+
* @author Shahriyar Imanov <[email protected]>
6+
*/
7+
class getCrossUpSell extends \Audith\Providers\Nexway\Data\Response\OrderApi
8+
{
9+
/**
10+
* @var array
11+
* @see http://wsdocs.nexway.com/APIGuide/index.html?url=responsecodetype1.html
12+
*/
13+
public static $exceptionCodeMapping = array(
14+
100 => "ProductListIsMissingException",
15+
110 => "ProductRefIsMissingException",
16+
111 => "ProductRefIsInvalidException",
17+
120 => "QuantityIsMissingException",
18+
121 => "QuantityIsNotValidException",
19+
130 => "LanguageIsMissingException",
20+
131 => "LanguageIsNotValidException",
21+
1000 => "InternalErrorException",
22+
1010 => "ProductReferenceDoesntExistException"
23+
);
24+
25+
/**
26+
* @var getCrossUpSell\productsReturn[]
27+
*/
28+
public $productsReturn = array();
29+
30+
/**
31+
* @var integer
32+
*/
33+
public $responseCode;
34+
35+
/**
36+
* @var string
37+
*/
38+
public $responseMessage;
39+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
namespace Audith\Providers\Nexway\Data\Response\OrderApi\getCrossUpSell;
3+
4+
/**
5+
* @author Shahriyar Imanov <[email protected]>
6+
*/
7+
class productsReturn extends \Audith\Providers\Nexway\Data
8+
{
9+
/**
10+
* @var integer
11+
*/
12+
public $ref;
13+
14+
/**
15+
* @var string
16+
*/
17+
public $type;
18+
19+
/**
20+
* @var string
21+
*/
22+
public $name;
23+
24+
/**
25+
* @var float
26+
*/
27+
public $amountDutyFree;
28+
29+
/**
30+
* @var string
31+
*/
32+
public $currency;
33+
34+
/**
35+
* @var string
36+
*/
37+
public $shortDescription;
38+
39+
/**
40+
* @var string
41+
*/
42+
public $language;
43+
44+
/**
45+
* @var string
46+
*/
47+
public $imageSmall;
48+
}

src/Audith/Providers/Nexway/Data/Response/OrderApi/getStockStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class getStockStatus extends \Audith\Providers\Nexway\Data\Response\OrderApi
1717
);
1818

1919
/**
20-
* @var integer
20+
* @var getStockStatus\productStatus[]
2121
*/
2222
public $productStatus;
2323

src/Audith/Providers/Nexway/Exception.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Exception extends \Exception
1515

1616
public function __construct($msg, $code = null)
1717
{
18-
$msg = "Provider/Nexway: " . $msg;
1918
parent::__construct($msg, $code);
2019
}
2120
}

0 commit comments

Comments
 (0)