Oro_Api - Version 1.0.0

Version Notes

OroCRM Bridge extension adds a couple of improvements to Magento SOAP API v2 in order to expose more shopping cart and customer data.

Download this release

Release Info

Developer Oro, Inc
Extension Oro_Api
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Oro/Api/Helper/Data.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Helper_Data
19
+ extends Mage_Api_Helper_Data
20
+ {
21
+ /**
22
+ * Parse filters and format them to be applicable for collection filtration
23
+ *
24
+ * @param null|object|array $filters
25
+ * @param array $fieldsMap Map of field names in format: array('field_name_in_filter' => 'field_name_in_db')
26
+ * @return array
27
+ */
28
+ public function parseFilters($filters, $fieldsMap = null)
29
+ {
30
+ // if filters are used in SOAP they must be represented in array format to be used for collection filtration
31
+ if (is_object($filters)) {
32
+ $parsedFilters = array();
33
+ // parse simple filter
34
+ if (isset($filters->filter) && is_array($filters->filter)) {
35
+ foreach ($filters->filter as $field => $value) {
36
+ if (is_object($value) && isset($value->key) && isset($value->value)) {
37
+ $parsedFilters[$value->key] = $value->value;
38
+ } else {
39
+ $parsedFilters[$field] = $value;
40
+ }
41
+ }
42
+ }
43
+ // parse complex filter
44
+ if (isset($filters->complex_filter) && is_array($filters->complex_filter)) {
45
+ $parsedFilters += $this->_parseComplexFilter($filters->complex_filter);
46
+ }
47
+
48
+ $filters = $parsedFilters;
49
+ }
50
+ // make sure that method result is always array
51
+ if (!is_array($filters)) {
52
+ $filters = array();
53
+ }
54
+ // apply fields mapping
55
+ if (isset($fieldsMap) && is_array($fieldsMap)) {
56
+ foreach ($filters as $field => $value) {
57
+ if (isset($fieldsMap[$field])) {
58
+ unset($filters[$field]);
59
+ $field = $fieldsMap[$field];
60
+ $filters[$field] = $value;
61
+ }
62
+ }
63
+ }
64
+ return $filters;
65
+ }
66
+
67
+ /**
68
+ * Parses complex filter, which may contain several nodes, e.g. when user want to fetch orders which were updated
69
+ * between two dates.
70
+ *
71
+ * @param array $complexFilter
72
+ * @return array
73
+ */
74
+ protected function _parseComplexFilter($complexFilter)
75
+ {
76
+ $parsedFilters = array();
77
+
78
+ foreach ($complexFilter as $filter) {
79
+ if (!isset($filter->key) || !isset($filter->value)) {
80
+ continue;
81
+ }
82
+
83
+ list($fieldName, $condition) = array($filter->key, $filter->value);
84
+ $conditionName = $condition->key;
85
+ $conditionValue = $condition->value;
86
+ $this->formatFilterConditionValue($conditionName, $conditionValue);
87
+
88
+ if (array_key_exists($fieldName, $parsedFilters)) {
89
+ $parsedFilters[$fieldName] += array($conditionName => $conditionValue);
90
+ } else {
91
+ $parsedFilters[$fieldName] = array($conditionName => $conditionValue);
92
+ }
93
+ }
94
+
95
+ return $parsedFilters;
96
+ }
97
+
98
+ /**
99
+ * Convert condition value from the string into the array
100
+ * for the condition operators that require value to be an array.
101
+ * Condition value is changed by reference
102
+ *
103
+ * @param string $conditionOperator
104
+ * @param string $conditionValue
105
+ */
106
+ public function formatFilterConditionValue($conditionOperator, &$conditionValue)
107
+ {
108
+ if (is_string($conditionOperator) && in_array($conditionOperator, array('in', 'nin', 'finset'))
109
+ && is_string($conditionValue)
110
+ ) {
111
+ $delimiter = ',';
112
+ $conditionValue = explode($delimiter, $conditionValue);
113
+ }
114
+ }
115
+ }
app/code/community/Oro/Api/Model/Catalog/Product/Api/V2.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Catalog_Product_Api_V2
19
+ extends Mage_Catalog_Model_Product_Api_V2
20
+ {
21
+ /**
22
+ * Retrieve list of products with basic info (id, sku, type, set, name)
23
+ *
24
+ * @param null|object|array $filters
25
+ * @param string|int $store
26
+ * @return array
27
+ */
28
+ public function items($filters = null, $store = null)
29
+ {
30
+ /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
31
+ $collection = Mage::getModel('catalog/product')->getCollection();
32
+ $collection->addStoreFilter($this->_getStoreId($store));
33
+ $collection->addAttributeToSelect(array('name', 'price', 'special_price'));
34
+
35
+ /** @var $apiHelper Mage_Api_Helper_Data */
36
+ $apiHelper = Mage::helper('oro_api');
37
+ $filters = $apiHelper->parseFilters($filters, $this->_filtersMap);
38
+ try {
39
+ foreach ($filters as $field => $value) {
40
+ $collection->addFieldToFilter($field, $value);
41
+ }
42
+ } catch (Mage_Core_Exception $e) {
43
+ $this->_fault('filters_invalid', $e->getMessage());
44
+ }
45
+ $result = array();
46
+ foreach ($collection as $product) {
47
+ $result[] = array(
48
+ 'product_id' => $product->getId(),
49
+ 'sku' => $product->getSku(),
50
+ 'name' => $product->getName(),
51
+ 'set' => $product->getAttributeSetId(),
52
+ 'type' => $product->getTypeId(),
53
+ 'category_ids' => $product->getCategoryIds(),
54
+ 'website_ids' => $product->getWebsiteIds(),
55
+ 'price' => $product->getPrice(),
56
+ 'special_price' => $product->getSpecialPrice(),
57
+ );
58
+ }
59
+ return $result;
60
+ }
61
+ }
app/code/community/Oro/Api/Model/Newsletter/Subscriber/Api.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Newsletter_Subscriber_Api
19
+ extends Mage_Checkout_Model_Api_Resource
20
+ {
21
+ public function items($filters)
22
+ {
23
+ /** @var Mage_Newsletter_Model_Resource_Subscriber_Collection $collection */
24
+ $collection = Mage::getResourceModel('newsletter/subscriber_collection');
25
+ /** @var $apiHelper Mage_Api_Helper_Data */
26
+ $apiHelper = Mage::helper('oro_api');
27
+ $filters = $apiHelper->parseFilters($filters);
28
+ try {
29
+ foreach ($filters as $field => $value) {
30
+ $collection->addFieldToFilter($field, $value);
31
+ }
32
+ } catch (Mage_Core_Exception $e) {
33
+ $this->_fault('filters_invalid', $e->getMessage());
34
+ }
35
+
36
+ $arr = $collection->toArray();
37
+
38
+ return $arr['items'];
39
+ }
40
+ }
app/code/community/Oro/Api/Model/Newsletter/Subscriber/Api/V2.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Newsletter_Subscriber_Api_V2
19
+ extends Oro_Api_Model_Newsletter_Subscriber_Api
20
+ {
21
+
22
+ }
app/code/community/Oro/Api/Model/Ping.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Ping extends Mage_Api_Model_Resource_Abstract
19
+ {
20
+ const VERSION = '1.0.0';
21
+ /**
22
+ * @return array
23
+ */
24
+ public function ping()
25
+ {
26
+ return array(
27
+ 'version' => self::VERSION,
28
+ 'mage_version' => Mage::getVersion(),
29
+ );
30
+ }
31
+ }
app/code/community/Oro/Api/Model/Ping/V2.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Ping_V2 extends Oro_Api_Model_Ping
19
+ {
20
+ }
app/code/community/Oro/Api/Model/Report/Product/Viewed/Api.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Report_Product_Viewed_Api
19
+ extends Mage_Checkout_Model_Api_Resource
20
+ {
21
+ /**
22
+ * @param array|object $filters
23
+ * @return array
24
+ */
25
+ public function items($filters)
26
+ {
27
+ /** @var Oro_Api_Model_Resource_Reports_Product_Index_Viewed_Collection $collection */
28
+ $collection = Mage::getResourceModel('oro_api/reports_product_index_viewed_collection');
29
+ $collection->addIndexFilter();
30
+ /** @var $apiHelper Mage_Api_Helper_Data */
31
+ $apiHelper = Mage::helper('oro_api');
32
+ $filters = $apiHelper->parseFilters($filters);
33
+ try {
34
+ foreach ($filters as $field => $value) {
35
+ $collection->addFieldToFilter($field, $value);
36
+ }
37
+ } catch (Mage_Core_Exception $e) {
38
+ $this->_fault('filters_invalid', $e->getMessage());
39
+ }
40
+
41
+ return $collection->load()->toArray();
42
+ }
43
+ }
app/code/community/Oro/Api/Model/Report/Product/Viewed/Api/V2.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Report_Product_Viewed_Api_V2
19
+ extends Oro_Api_Model_Report_Product_Viewed_Api
20
+ {
21
+
22
+ }
app/code/community/Oro/Api/Model/Resource/Reports/Product/Index/Viewed/Collection.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Resource_Reports_Product_Index_Viewed_Collection
19
+ extends Mage_Reports_Model_Resource_Product_Index_Viewed_Collection
20
+ {
21
+ protected function _joinIdxTable()
22
+ {
23
+ if (!$this->getFlag('is_idx_table_joined')) {
24
+ $this->joinTable(
25
+ array('idx_table' => $this->_getTableName()),
26
+ 'product_id=entity_id',
27
+ '*',
28
+ $this->_getWhereCondition()
29
+ );
30
+ $this->setFlag('is_idx_table_joined', true);
31
+ }
32
+ return $this;
33
+ }
34
+
35
+ /**
36
+ * Retrieve Where Condition to Index table
37
+ *
38
+ * @return array
39
+ */
40
+ protected function _getWhereCondition()
41
+ {
42
+
43
+ return array();
44
+ }
45
+ }
app/code/community/Oro/Api/Model/Sales/Quote/Api.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Sales_Quote_Api
19
+ extends Mage_Checkout_Model_Api_Resource
20
+ {
21
+ /**
22
+ * @param array|object $filters
23
+ * @param array $pager
24
+ * @return array
25
+ */
26
+ public function items($filters, $pager)
27
+ {
28
+ /** @var Mage_Sales_Model_Resource_Quote_Collection $quoteCollection */
29
+ $quoteCollection = Mage::getResourceModel('sales/quote_collection');
30
+
31
+ /** @var $apiHelper Mage_Api_Helper_Data */
32
+ $apiHelper = Mage::helper('oro_api');
33
+
34
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['quote']);
35
+ try {
36
+ foreach ($filters as $field => $value) {
37
+ $quoteCollection->addFieldToFilter($field, $value);
38
+ }
39
+ } catch (Mage_Core_Exception $e) {
40
+ $this->_fault('filters_invalid', $e->getMessage());
41
+ }
42
+
43
+ if ($pager->pageSize && $pager->page) {
44
+ $quoteCollection->setCurPage($pager->page);
45
+ $quoteCollection->setPageSize($pager->pageSize);
46
+
47
+ if ($quoteCollection->getCurPage() != $pager->page) {
48
+ // there's no such page, so no results for it
49
+ return array();
50
+ }
51
+ }
52
+
53
+ $resultArray = array();
54
+ foreach ($quoteCollection as $quote) {
55
+ $resultArray[] = array_merge($quote->__toArray(), $this->info($quote));
56
+ }
57
+
58
+ return $resultArray;
59
+ }
60
+
61
+ /**
62
+ * Retrieve full information about quote
63
+ *
64
+ * @param $quote
65
+ * @return array
66
+ */
67
+ protected function info($quote)
68
+ {
69
+ if ($quote->getGiftMessageId() > 0) {
70
+ $quote->setGiftMessage(
71
+ Mage::getSingleton('giftmessage/message')->load($quote->getGiftMessageId())->getMessage()
72
+ );
73
+ }
74
+
75
+ $result = $this->_getAttributes($quote, 'quote');
76
+ $result['shipping_address'] = $this->_getAttributes($quote->getShippingAddress(), 'quote_address');
77
+ $result['billing_address'] = $this->_getAttributes($quote->getBillingAddress(), 'quote_address');
78
+ $result['items'] = array();
79
+
80
+ foreach ($quote->getAllItems() as $item) {
81
+ if ($item->getGiftMessageId() > 0) {
82
+ $item->setGiftMessage(
83
+ Mage::getSingleton('giftmessage/message')->load($item->getGiftMessageId())->getMessage()
84
+ );
85
+ }
86
+
87
+ $result['items'][] = $this->_getAttributes($item, 'quote_item');
88
+ }
89
+
90
+ $result['payment'] = $this->_getAttributes($quote->getPayment(), 'quote_payment');
91
+
92
+ return $result;
93
+ }
94
+ }
app/code/community/Oro/Api/Model/Sales/Quote/Api/V2.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Sales_Quote_Api_V2
19
+ extends Oro_Api_Model_Sales_Quote_Api
20
+ {
21
+
22
+ }
app/code/community/Oro/Api/Model/Wishlist/Api.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Wishlist_Api
19
+ extends Mage_Checkout_Model_Api_Resource
20
+ {
21
+ /**
22
+ * @param array|object $filters
23
+ * @return array
24
+ */
25
+ public function items($filters)
26
+ {
27
+ /** @var Mage_Wishlist_Model_Resource_Wishlist_Collection $collection */
28
+ $collection = Mage::getResourceModel('wishlist/wishlist_collection');
29
+ /** @var $apiHelper Mage_Api_Helper_Data */
30
+ $apiHelper = Mage::helper('oro_api');
31
+ $filters = $apiHelper->parseFilters($filters);
32
+ try {
33
+ foreach ($filters as $field => $value) {
34
+ $collection->addFieldToFilter($field, $value);
35
+ }
36
+ } catch (Mage_Core_Exception $e) {
37
+ $this->_fault('filters_invalid', $e->getMessage());
38
+ }
39
+
40
+ $arr = $collection->toArray();
41
+
42
+ return $arr['items'];
43
+ }
44
+ }
app/code/community/Oro/Api/Model/Wishlist/Api/V2.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Wishlist_Api_V2
19
+ extends Oro_Api_Model_Wishlist_Api
20
+ {
21
+
22
+ }
app/code/community/Oro/Api/Model/Wishlist/Item/Api.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Wishlist_Item_Api
19
+ extends Mage_Checkout_Model_Api_Resource
20
+ {
21
+ /**
22
+ * @param array|object $filters
23
+ * @return array
24
+ */
25
+ public function items($filters)
26
+ {
27
+ /** @var Mage_Wishlist_Model_Resource_Item_Collection $collection */
28
+ $collection = Mage::getResourceModel('wishlist/item_collection');
29
+ /** @var $apiHelper Mage_Api_Helper_Data */
30
+ $apiHelper = Mage::helper('oro_api');
31
+ $filters = $apiHelper->parseFilters($filters);
32
+ try {
33
+ foreach ($filters as $field => $value) {
34
+ $collection->addFieldToFilter($field, $value);
35
+ }
36
+ } catch (Mage_Core_Exception $e) {
37
+ $this->_fault('filters_invalid', $e->getMessage());
38
+ }
39
+
40
+ $arr = $collection->toArray();
41
+
42
+ return $arr['items'];
43
+ }
44
+ }
app/code/community/Oro/Api/Model/Wishlist/Item/Api/V2.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Oro Inc.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
9
+ * If you did not receive a copy of the license and are unable to
10
+ * obtain it through the world-wide-web, please send an email
11
+ * to license@magecore.com so we can send you a copy immediately
12
+ *
13
+ * @category Oro
14
+ * @package Api
15
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ class Oro_Api_Model_Wishlist_Item_Api_V2
19
+ extends Oro_Api_Model_Wishlist_Item_Api
20
+ {
21
+
22
+ }
app/code/community/Oro/Api/etc/api.xml ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Oro Inc.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magecore.com so we can send you a copy immediately
13
+ *
14
+ * @category Oro
15
+ * @package Api
16
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <api>
22
+ <resources>
23
+ <oro translate="title" module="oro_api">
24
+ <model>oro_api/ping</model>
25
+ <title>Oro extension ping</title>
26
+ <acl>oro_ping</acl>
27
+ <methods>
28
+ <ping translate="title" module="oro_api">
29
+ <title>Ping mage instance in order to check if extension available</title>
30
+ <method>ping</method>
31
+ <acl>oro_ping</acl>
32
+ </ping>
33
+ </methods>
34
+ </oro>
35
+ <sales_quote translate="title" module="oro_api">
36
+ <model>oro_api/sales_quote_api</model>
37
+ <title>Quote Information</title>
38
+ <acl>sales/quote</acl>
39
+ <methods>
40
+ <list translate="title" module="oro_api">
41
+ <title>Get quote list by filters</title>
42
+ <method>items</method>
43
+ <acl>sales/quote/info</acl>
44
+ </list>
45
+ </methods>
46
+ </sales_quote>
47
+ <wishlist translate="title" module="oro_api">
48
+ <model>oro_api/wishlist_api</model>
49
+ <title>Wishlist</title>
50
+ <acl>wishlist</acl>
51
+ <methods>
52
+ <list translate="title" module="oro_api">
53
+ <title>Get wishlist collection by filters</title>
54
+ <method>items</method>
55
+ <acl>wishlist/info</acl>
56
+ </list>
57
+ </methods>
58
+ </wishlist>
59
+ <wishlist_item translate="title" module="oro_api">
60
+ <model>oro_api/wishlist_item_api</model>
61
+ <title>Wishlist Item</title>
62
+ <acl>wishlist_item</acl>
63
+ <methods>
64
+ <list translate="title" module="oro_api">
65
+ <title>Get wishlist item collection by filters</title>
66
+ <method>items</method>
67
+ <acl>wishlist_item/info</acl>
68
+ </list>
69
+ </methods>
70
+ </wishlist_item>
71
+ <report_product_viewed translate="title" module="oro_api">
72
+ <model>oro_api/report_product_viewed_api</model>
73
+ <title>Report Product Viewed</title>
74
+ <acl>report_product_viewed</acl>
75
+ <methods>
76
+ <list translate="title" module="oro_api">
77
+ <title>Viewed product collection by filters</title>
78
+ <method>items</method>
79
+ <acl>report_product_viewed/info</acl>
80
+ </list>
81
+ </methods>
82
+ </report_product_viewed>
83
+ <newsletter_subscriber translate="title" module="oro_api">
84
+ <model>oro_api/newsletter_subscriber_api</model>
85
+ <title>Newsletter Subscriber</title>
86
+ <acl>newsletter_subscriber</acl>
87
+ <methods>
88
+ <list translate="title" module="oro_api">
89
+ <title>Subscribers collection</title>
90
+ <method>items</method>
91
+ <acl>newsletter_subscriber/info</acl>
92
+ </list>
93
+ </methods>
94
+ </newsletter_subscriber>
95
+ </resources>
96
+ <rest>
97
+ <mapping>
98
+ <sales_quote_list>
99
+ <get><method>list</method></get>
100
+ </sales_quote_list>
101
+ <wishlist_list>
102
+ <get><method>list</method></get>
103
+ </wishlist_list>
104
+ <wishlist_item_list>
105
+ <get><method>list</method></get>
106
+ </wishlist_item_list>
107
+ <report_product_viewed>
108
+ <get><method>list</method></get>
109
+ </report_product_viewed>
110
+ <newsletter_subscriber>
111
+ <get><method>list</method></get>
112
+ </newsletter_subscriber>
113
+ <oro_ping>
114
+ <get><method>ping</method></get>
115
+ </oro_ping>
116
+ </mapping>
117
+ </rest>
118
+ <acl>
119
+ <resources>
120
+ <oro_ping>
121
+ <info translate="title" module="oro_api">
122
+ <title>Oro ping</title>
123
+ </info>
124
+ </oro_ping>
125
+ <sales>
126
+ <quote>
127
+ <info translate="title" module="oro_api">
128
+ <title>Quote info</title>
129
+ </info>
130
+ </quote>
131
+ </sales>
132
+ <wishlist>
133
+ <info translate="title" module="oro_api">
134
+ <title>Wishlist info</title>
135
+ </info>
136
+ </wishlist>
137
+ <wishlist_item>
138
+ <info translate="title" module="oro_api">
139
+ <title>Wishlist Item info</title>
140
+ </info>
141
+ </wishlist_item>
142
+ <report_product_viewed>
143
+ <info translate="title" module="oro_api">
144
+ <title>Report Product Viewed</title>
145
+ </info>
146
+ </report_product_viewed>
147
+ <newsletter_subscriber>
148
+ <info translate="title" module="oro_api">
149
+ <title>Newsletter Subscriber</title>
150
+ </info>
151
+ </newsletter_subscriber>
152
+ </resources>
153
+ </acl>
154
+ <v2>
155
+ <resources_function_prefix>
156
+ <oro>oro</oro>
157
+ <sales_quote>salesQuote</sales_quote>
158
+ <wishlist>wishlist</wishlist>
159
+ <wishlist_item>wishlistItem</wishlist_item>
160
+ <report_product_viewed>reportProductViewed</report_product_viewed>
161
+ <newsletter_subscriber>newsletterSubscriber</newsletter_subscriber>
162
+ </resources_function_prefix>
163
+ </v2>
164
+ </api>
165
+ </config>
app/code/community/Oro/Api/etc/config.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Oro Inc.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magecore.com so we can send you a copy immediately
13
+ *
14
+ * @category Oro
15
+ * @package Api
16
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Oro_Api>
23
+ <version>1.0.0</version>
24
+ </Oro_Api>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <oro_api>
29
+ <class>Oro_Api_Model</class>
30
+ <resourceModel>oro_api_resource</resourceModel>
31
+ </oro_api>
32
+ <oro_api_resource>
33
+ <class>Oro_Api_Model_Resource</class>
34
+ </oro_api_resource>
35
+ <catalog>
36
+ <rewrite>
37
+ <product_api_v2>Oro_Api_Model_Catalog_Product_Api_V2</product_api_v2>
38
+ </rewrite>
39
+ </catalog>
40
+ </models>
41
+ <helpers>
42
+ <oro_api>
43
+ <class>Oro_Api_Helper</class>
44
+ </oro_api>
45
+ </helpers>
46
+ <resources>
47
+ <oro_api_setup>
48
+ <setup>
49
+ <module>Oro_Api</module>
50
+ </setup>
51
+ </oro_api_setup>
52
+ </resources>
53
+ </global>
54
+ </config>
app/code/community/Oro/Api/etc/wsdl.xml ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Oro Inc.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magecore.com so we can send you a copy immediately
13
+ *
14
+ * @category Oro
15
+ * @package Api
16
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
21
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
22
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
23
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
24
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
25
+ <types>
26
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
27
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
28
+ <!-- Fix for magento 1.6.x -->
29
+ <complexType name="associativeMultiArray">
30
+ <complexContent>
31
+ <restriction base="soapenc:Array">
32
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:associativeMultiEntity[]" />
33
+ </restriction>
34
+ </complexContent>
35
+ </complexType>
36
+ <!-- // Fix for magento 1.6.x -->
37
+ <complexType name="pager">
38
+ <all>
39
+ <element name="page" type="xsd:string" minOccurs="0" />
40
+ <element name="pageSize" type="xsd:string" minOccurs="0" />
41
+ </all>
42
+ </complexType>
43
+ <complexType name="salesQuoteEntity">
44
+ <all>
45
+ <element name="entity_id" type="xsd:string" minOccurs="0" />
46
+ <element name="store_id" type="xsd:string" minOccurs="0" />
47
+ <element name="created_at" type="xsd:string" minOccurs="0" />
48
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
49
+ <element name="converted_at" type="xsd:string" minOccurs="0" />
50
+ <element name="is_active" type="xsd:string" minOccurs="0" />
51
+ <element name="is_virtual" type="xsd:string" minOccurs="0" />
52
+ <element name="is_multi_shipping" type="xsd:string" minOccurs="0" />
53
+ <element name="items_count" type="xsd:string" minOccurs="0" />
54
+ <element name="items_qty" type="xsd:string" minOccurs="0" />
55
+ <element name="orig_order_id" type="xsd:string" minOccurs="0" />
56
+ <element name="store_to_base_rate" type="xsd:string" minOccurs="0" />
57
+ <element name="store_to_quote_rate" type="xsd:string" minOccurs="0" />
58
+ <element name="base_currency_code" type="xsd:string" minOccurs="0" />
59
+ <element name="store_currency_code" type="xsd:string" minOccurs="0" />
60
+ <element name="quote_currency_code" type="xsd:string" minOccurs="0" />
61
+ <element name="grand_total" type="xsd:string" minOccurs="0" />
62
+ <element name="base_grand_total" type="xsd:string" minOccurs="0" />
63
+ <element name="checkout_method" type="xsd:string" minOccurs="0" />
64
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
65
+ <element name="customer_tax_class_id" type="xsd:string" minOccurs="0" />
66
+ <element name="customer_group_id" type="xsd:string" minOccurs="0" />
67
+ <element name="customer_email" type="xsd:string" minOccurs="0" />
68
+ <element name="customer_prefix" type="xsd:string" minOccurs="0" />
69
+ <element name="customer_firstname" type="xsd:string" minOccurs="0" />
70
+ <element name="customer_middlename" type="xsd:string" minOccurs="0" />
71
+ <element name="customer_lastname" type="xsd:string" minOccurs="0" />
72
+ <element name="customer_suffix" type="xsd:string" minOccurs="0" />
73
+ <element name="customer_dob" type="xsd:string" minOccurs="0" />
74
+ <element name="customer_note" type="xsd:string" minOccurs="0" />
75
+ <element name="customer_note_notify" type="xsd:string" minOccurs="0" />
76
+ <element name="customer_is_guest" type="xsd:string" minOccurs="0" />
77
+ <element name="remote_ip" type="xsd:string" minOccurs="0" />
78
+ <element name="applied_rule_ids" type="xsd:string" minOccurs="0" />
79
+ <element name="reserved_order_id" type="xsd:string" minOccurs="0" />
80
+ <element name="password_hash" type="xsd:string" minOccurs="0" />
81
+ <element name="coupon_code" type="xsd:string" minOccurs="0" />
82
+ <element name="global_currency_code" type="xsd:string" minOccurs="0" />
83
+ <element name="base_to_global_rate" type="xsd:string" minOccurs="0" />
84
+ <element name="base_to_quote_rate" type="xsd:string" minOccurs="0" />
85
+ <element name="customer_taxvat" type="xsd:string" minOccurs="0" />
86
+ <element name="customer_gender" type="xsd:string" minOccurs="0" />
87
+ <element name="subtotal" type="xsd:string" minOccurs="0" />
88
+ <element name="base_subtotal" type="xsd:string" minOccurs="0" />
89
+ <element name="subtotal_with_discount" type="xsd:string" minOccurs="0" />
90
+ <element name="base_subtotal_with_discount" type="xsd:string" minOccurs="0" />
91
+ <element name="is_changed" type="xsd:string" minOccurs="0" />
92
+ <element name="trigger_recollect" type="xsd:string" minOccurs="0" />
93
+ <element name="ext_shipping_info" type="xsd:string" minOccurs="0" />
94
+ <element name="gift_message_id" type="xsd:string" minOccurs="0" />
95
+ <element name="is_persistent" type="xsd:string" minOccurs="0" />
96
+
97
+ <element name="shipping_address" type="typens:shoppingCartAddressEntity" minOccurs="0"/>
98
+ <element name="billing_address" type="typens:shoppingCartAddressEntity" minOccurs="0"/>
99
+ <element name="items" type="typens:shoppingCartItemEntityArray" minOccurs="0"/>
100
+ <element name="payment" type="typens:shoppingCartPaymentEntity" minOccurs="0"/>
101
+ </all>
102
+ </complexType>
103
+ <complexType name="salesQuoteEntityArray">
104
+ <complexContent>
105
+ <restriction base="soapenc:Array">
106
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:salesQuoteEntity[]" />
107
+ </restriction>
108
+ </complexContent>
109
+ </complexType>
110
+ <complexType name="wishlistEntity">
111
+ <all>
112
+ <element name="wishlist_id" type="xsd:string" minOccurs="0" />
113
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
114
+ <element name="shared" type="xsd:string" minOccurs="0" />
115
+ <element name="sharing_code" type="xsd:string" minOccurs="0" />
116
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
117
+ </all>
118
+ </complexType>
119
+ <complexType name="wishlistEntityArray">
120
+ <complexContent>
121
+ <restriction base="soapenc:Array">
122
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:wishlistEntity[]" />
123
+ </restriction>
124
+ </complexContent>
125
+ </complexType>
126
+ <complexType name="wishlistItemEntity">
127
+ <all>
128
+ <element name="wishlist_item_id" type="xsd:string" minOccurs="0" />
129
+ <element name="wishlist_id" type="xsd:string" minOccurs="0" />
130
+ <element name="product_id" type="xsd:string" minOccurs="0" />
131
+ <element name="store_id" type="xsd:string" minOccurs="0" />
132
+ <element name="added_at" type="xsd:string" minOccurs="0" />
133
+ <element name="description" type="xsd:string" minOccurs="0" />
134
+ <element name="qty" type="xsd:string" minOccurs="0" />
135
+ </all>
136
+ </complexType>
137
+ <complexType name="wishlistItemEntityArray">
138
+ <complexContent>
139
+ <restriction base="soapenc:Array">
140
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:wishlistItemEntity[]" />
141
+ </restriction>
142
+ </complexContent>
143
+ </complexType>
144
+ <!-- Report Product Viewed -->
145
+ <complexType name="reportProductViewedEntity">
146
+ <all>
147
+ <element name="index_id" type="xsd:string" minOccurs="0" />
148
+ <element name="visitor_id" type="xsd:string" minOccurs="0" />
149
+ <element name="product_id" type="xsd:string" minOccurs="0" />
150
+ <element name="sku" type="xsd:string" minOccurs="0" />
151
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
152
+ <element name="added_at" type="xsd:string" minOccurs="0" />
153
+ <element name="store_id" type="xsd:string" minOccurs="0" />
154
+ </all>
155
+ </complexType>
156
+ <complexType name="reportProductViewedEntityArray">
157
+ <complexContent>
158
+ <restriction base="soapenc:Array">
159
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:reportProductViewedEntity[]" />
160
+ </restriction>
161
+ </complexContent>
162
+ </complexType>
163
+ <!-- Report Product Viewed -->
164
+ <!-- Newsletters Subscriber -->
165
+ <complexType name="newsletterSubscriberEntity">
166
+ <all>
167
+ <element name="subscriber_id" type="xsd:string" minOccurs="0" />
168
+ <element name="store_id" type="xsd:string" minOccurs="0" />
169
+ <element name="change_status_at" type="xsd:string" minOccurs="0" />
170
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
171
+ <element name="subscriber_email" type="xsd:string" minOccurs="0" />
172
+ <element name="subscriber_status" type="xsd:string" minOccurs="0" />
173
+ <element name="subscriber_confirm_code" type="xsd:string" minOccurs="0" />
174
+ </all>
175
+ </complexType>
176
+ <complexType name="newsletterSubscriberEntityArray">
177
+ <complexContent>
178
+ <restriction base="soapenc:Array">
179
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:newsletterSubscriberEntity[]" />
180
+ </restriction>
181
+ </complexContent>
182
+ </complexType>
183
+ <!-- Newsletters Subscriber -->
184
+ <complexType name="catalogProductEntity">
185
+ <all>
186
+ <element name="price" type="xsd:string"/>
187
+ <element name="special_price" type="xsd:string"/>
188
+ </all>
189
+ </complexType>
190
+ <complexType name="oroPingResponse">
191
+ <all>
192
+ <element name="version" type="xsd:string" minOccurs="0" />
193
+ <element name="mage_version" type="xsd:string" minOccurs="0" />
194
+ <element name="mage_edition" type="xsd:string" minOccurs="0" />
195
+ </all>
196
+ </complexType>
197
+ </schema>
198
+ </types>
199
+ <portType name="{{var wsdl.handler}}PortType">
200
+ <operation name="oroPing">
201
+ <documentation>Get basic presence info</documentation>
202
+ <input message="typens:oroPingRequest"/>
203
+ <output message="typens:oroPingResponse"/>
204
+ </operation>
205
+ <operation name="salesQuoteList">
206
+ <documentation>Get quote data list</documentation>
207
+ <input message="typens:salesQuoteListRequest"/>
208
+ <output message="typens:salesQuoteListResponse"/>
209
+ </operation>
210
+ <operation name="wishlistList">
211
+ <documentation>Get wishlist collection</documentation>
212
+ <input message="typens:wishlistListRequest"/>
213
+ <output message="typens:wishlistListResponse"/>
214
+ </operation>
215
+ <operation name="wishlistItemList">
216
+ <documentation>Get wishlist item collection</documentation>
217
+ <input message="typens:wishlistItemListRequest"/>
218
+ <output message="typens:wishlistItemListResponse"/>
219
+ </operation>
220
+ <operation name="reportProductViewedList">
221
+ <documentation>Get wishlist item collection</documentation>
222
+ <input message="typens:reportProductViewedListRequest"/>
223
+ <output message="typens:reportProductViewedListResponse"/>
224
+ </operation>
225
+ <operation name="newsletterSubscriberList">
226
+ <documentation>Newsletter subscriber collection</documentation>
227
+ <input message="typens:newsletterSubscriberListRequest"/>
228
+ <output message="typens:newsletterSubscriberListResponse"/>
229
+ </operation>
230
+ </portType>
231
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
232
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
233
+ <operation name="oroPing">
234
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
235
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
236
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
237
+ </operation>
238
+ <operation name="salesQuoteList">
239
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
240
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
241
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
242
+ </operation>
243
+ <operation name="wishlistList">
244
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
245
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
246
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
247
+ </operation>
248
+ <operation name="wishlistItemList">
249
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
250
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
251
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
252
+ </operation>
253
+ <operation name="reportProductViewedList">
254
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
255
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
256
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
257
+ </operation>
258
+ <operation name="newsletterSubscriberList">
259
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
260
+ <input><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
261
+ <output><soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
262
+ </operation>
263
+ </binding>
264
+ <message name="oroPingRequest">
265
+ <part name="sessionId" type="xsd:string" />
266
+ </message>
267
+ <message name="oroPingResponse">
268
+ <part name="result" type="typens:oroPingResponse" />
269
+ </message>
270
+ <message name="salesQuoteListRequest">
271
+ <part name="sessionId" type="xsd:string" />
272
+ <part name="filters" type="typens:filters" />
273
+ <part name="pager" type="typens:pager" />
274
+ </message>
275
+ <message name="salesQuoteListResponse">
276
+ <part name="result" type="typens:salesQuoteEntityArray" />
277
+ </message>
278
+ <message name="wishlistListRequest">
279
+ <part name="sessionId" type="xsd:string" />
280
+ <part name="filters" type="typens:filters" />
281
+ </message>
282
+ <message name="wishlistListResponse">
283
+ <part name="result" type="typens:wishlistEntityArray" />
284
+ </message>
285
+ <message name="wishlistItemListRequest">
286
+ <part name="sessionId" type="xsd:string" />
287
+ <part name="filters" type="typens:filters" />
288
+ </message>
289
+ <message name="wishlistItemListResponse">
290
+ <part name="result" type="typens:wishlistItemEntityArray" />
291
+ </message>
292
+ <!-- Report Product Viewed -->
293
+ <message name="reportProductViewedListRequest">
294
+ <part name="sessionId" type="xsd:string" />
295
+ <part name="filters" type="typens:filters" />
296
+ </message>
297
+ <message name="reportProductViewedListResponse">
298
+ <part name="result" type="typens:reportProductViewedEntityArray" />
299
+ </message>
300
+ <!-- Report Product Viewed -->
301
+ <!-- Newsletters Subscriber -->
302
+ <message name="newsletterSubscriberListRequest">
303
+ <part name="sessionId" type="xsd:string" />
304
+ <part name="filters" type="typens:filters" />
305
+ </message>
306
+ <message name="newsletterSubscriberListResponse">
307
+ <part name="result" type="typens:newsletterSubscriberEntityArray" />
308
+ </message>
309
+ <!-- Newsletters Subscriber -->
310
+ </definitions>
311
+
app/etc/modules/Oro_Api.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * MageCore
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is published at http://opensource.org/licenses/osl-3.0.php.
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magecore.com so we can send you a copy immediately
13
+ *
14
+ * @category Oro
15
+ * @package Api
16
+ * @copyright Copyright 2013 Oro Inc. (http://www.orocrm.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Oro_Api>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ </Oro_Api>
26
+ </modules>
27
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Oro_Api</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>OroCRM Bridge</summary>
10
+ <description>OroCRM Bridge extension adds a couple of improvements to Magento SOAP API v2 in order to expose more shopping cart and customer data.</description>
11
+ <notes>OroCRM Bridge extension adds a couple of improvements to Magento SOAP API v2 in order to expose more shopping cart and customer data.</notes>
12
+ <authors><author><name>Oro, Inc</name><user>orocrm</user><email>info@orocrm.com</email></author></authors>
13
+ <date>2013-12-30</date>
14
+ <time>17:32:01</time>
15
+ <contents><target name="magecommunity"><dir name="Oro"><dir name="Api"><dir name="Helper"><file name="Data.php" hash="86bf163bfa26bdfc7f5df3789344015f"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="9fe5e65e1b189ba6a9fed25fe8d858d6"/></dir></dir></dir><dir name="Newsletter"><dir name="Subscriber"><dir name="Api"><file name="V2.php" hash="7b18db294f86ccf841a95aa7b7e656af"/></dir><file name="Api.php" hash="a49473afaca6c5bbbb82f58f41ff1650"/></dir></dir><dir name="Ping"><file name="V2.php" hash="0fa10110ecb67d32079c5530a979c55a"/></dir><file name="Ping.php" hash="7bc278ebedf1a2e0589cf3d184af770c"/><dir name="Report"><dir name="Product"><dir name="Viewed"><dir name="Api"><file name="V2.php" hash="c8481504cefd028a17cc4a6555182ad0"/></dir><file name="Api.php" hash="fe175f2aab97cafa47574f1da2e169a3"/></dir></dir></dir><dir name="Resource"><dir name="Reports"><dir name="Product"><dir name="Index"><dir name="Viewed"><file name="Collection.php" hash="0fe404e11c517f8f1a8e0edda2770e0e"/></dir></dir></dir></dir></dir><dir name="Sales"><dir name="Quote"><dir name="Api"><file name="V2.php" hash="4e8ba0ed7757110c4eae1d239b2adf76"/></dir><file name="Api.php" hash="42d8a1f43b69e0c46af1819d36dc7820"/></dir></dir><dir name="Wishlist"><dir name="Api"><file name="V2.php" hash="f0ac63e1cf9440ed0e4ca72eb93834f2"/></dir><file name="Api.php" hash="3ebfc3b7841c265921ea05d63f8ba5a9"/><dir name="Item"><dir name="Api"><file name="V2.php" hash="43a919dae8dd432e211878a39ba3f4a2"/></dir><file name="Api.php" hash="8d5d856ea533b9b122c96d0bef32861b"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="1514a0875ab4ac9001cbc040aa7ff0e4"/><file name="config.xml" hash="1ef451d7021168b8773c93945316f3eb"/><file name="wsdl.xml" hash="3eca94fe49f6b0357aaab5444a333ac2"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Oro_Api.xml" hash="80735cd2721dd06241fc16cd761e999d"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.13</min><max>5.5.0</max></php></required></dependencies>
18
+ </package>