RevenueConduit_RevenueConduit - Version 1.0.2

Version Notes

1.0.2 Release

Download this release

Release Info

Developer Parag Jagdale
Extension RevenueConduit_RevenueConduit
Version 1.0.2
Comparing to
See all releases


Version 1.0.2

app/code/community/RevenueConduit/RevenueConduit/Helper/Data.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ ?>
23
+
24
+ <?php
25
+ class RevenueConduit_RevenueConduit_Helper_Data extends Mage_Core_Helper_Abstract{
26
+ }
app/code/community/RevenueConduit/RevenueConduit/Model/Catalog/Product/Api/V2.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ /**
23
+ * Product Soap Api V2
24
+ */
25
+
26
+ class RevenueConduit_RevenueConduit_Model_Catalog_Product_Api_V2 extends Mage_Catalog_Model_Product_Api_V2
27
+ {
28
+ /**
29
+ * Retrieve list of products with basic info (id, sku, type, set, name)
30
+ * Extended filters capability for catalogProductList
31
+ *
32
+ * @param array $filters
33
+ * @param string|int $store
34
+ * @return array
35
+ */
36
+ public function items($filters = null, $store = null)
37
+ {
38
+ $collection = Mage::getModel('catalog/product')->getCollection()
39
+ ->addStoreFilter($this->_getStoreId($store))
40
+ ->addAttributeToSelect('name');
41
+
42
+ $preparedFilters = array();
43
+ if (isset($filters->filter)) {
44
+ foreach ($filters->filter as $_filterKey => $_filterValue) {
45
+ if (is_object($_filterValue)) {
46
+ $preparedFilters[][$_filterValue->key] = $_filterValue->value;
47
+ } else {
48
+ $preparedFilters[][$_filterKey] = $_filterValue;
49
+ }
50
+ }
51
+ }
52
+ if (isset($filters->complex_filter)) {
53
+ foreach ($filters->complex_filter as $_key => $_filter) {
54
+ $_value = $_filter->value;
55
+ if(is_object($_value)) {
56
+ $preparedFilters[][$_filter->key] = array(
57
+ $_value->key => $_value->value
58
+ );
59
+ } elseif(is_array($_value)) {
60
+ $preparedFilters[][$_key] = array(
61
+ $_filter->key => $_value
62
+ );
63
+ } else {
64
+ $preparedFilters[][$_filter->key] = $_value;
65
+ }
66
+ }
67
+ }
68
+
69
+ if (!empty($preparedFilters)) {
70
+ try {
71
+ foreach ($preparedFilters as $preparedFilter) {
72
+ foreach ($preparedFilter as $field => $value) {
73
+ if (isset($this->_filtersMap[$field])) {
74
+ $field = $this->_filtersMap[$field];
75
+ }
76
+
77
+ $collection->addFieldToFilter($field, $value);
78
+ }
79
+ }
80
+ } catch (Mage_Core_Exception $e) {
81
+ $this->_fault('filters_invalid', $e->getMessage());
82
+ }
83
+ }
84
+
85
+ $result = array();
86
+
87
+ foreach ($collection as $product) {
88
+ $result[] = array(
89
+ 'product_id' => $product->getId(),
90
+ 'sku' => $product->getSku(),
91
+ 'name' => $product->getName(),
92
+ 'set' => $product->getAttributeSetId(),
93
+ 'type' => $product->getTypeId(),
94
+ 'category_ids' => $product->getCategoryIds(),
95
+ 'website_ids' => $product->getWebsiteIds()
96
+ );
97
+ }
98
+
99
+ return $result;
100
+ }
101
+
102
+ public function product_count()
103
+ {
104
+ $_products = Mage::getModel('catalog/product')->getCollection();
105
+ $_productCnt = $_products->count(); //customers count
106
+ return $_productCnt;
107
+ }
108
+
109
+ }
110
+
app/code/community/RevenueConduit/RevenueConduit/Model/Customer/Customer/Api/V2.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ /**
23
+ * Customer Soap Api V2
24
+ */
25
+ class RevenueConduit_RevenueConduit_Model_Customer_Customer_Api_V2 extends Mage_Customer_Model_Customer_Api_V2
26
+ {
27
+ /**
28
+ * Retrieve cutomers data
29
+ * Extended filters capability for customerCustomerList
30
+ *
31
+ * @param array $filters
32
+ * @return array
33
+ */
34
+ public function items($filters)
35
+ {
36
+ $collection = Mage::getModel('customer/customer')->getCollection()
37
+ ->addAttributeToSelect('*');
38
+
39
+ $preparedFilters = array();
40
+
41
+ if (isset($filters->filter)) {
42
+ foreach ($filters->filter as $_filterKey => $_filterValue) {
43
+ if (is_object($_filterValue)) {
44
+ $preparedFilters[][$_filterValue->key] = $_filterValue->value;
45
+ } else {
46
+ $preparedFilters[][$_filterKey] = $_filterValue;
47
+ }
48
+ }
49
+ }
50
+
51
+ if (isset($filters->complex_filter)) {
52
+ foreach ($filters->complex_filter as $_key => $_filter) {
53
+ $_value = $_filter->value;
54
+ if(is_object($_value)) {
55
+ $preparedFilters[][$_filter->key] = array(
56
+ $_value->key => $_value->value
57
+ );
58
+ } elseif(is_array($_value)) {
59
+ $preparedFilters[][$_key] = array(
60
+ $_filter->key => $_value
61
+ );
62
+ } else {
63
+ $preparedFilters[][$_filter->key] = $_value;
64
+ }
65
+ }
66
+ }
67
+
68
+ if (!empty($preparedFilters)) {
69
+ try {
70
+ foreach ($preparedFilters as $preparedFilter) {
71
+ foreach ($preparedFilter as $field => $value) {
72
+ if (isset($this->_mapAttributes[$field])) {
73
+ $field = $this->_mapAttributes[$field];
74
+ }
75
+
76
+ $collection->addFieldToFilter($field, $value);
77
+ }
78
+ }
79
+ } catch (Mage_Core_Exception $e) {
80
+ $this->_fault('filters_invalid', $e->getMessage());
81
+ }
82
+ }
83
+
84
+ $result = array();
85
+ foreach ($collection as $customer) {
86
+ $data = $customer->toArray();
87
+ $row = array();
88
+
89
+ foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) {
90
+ $row[$attributeAlias] = (isset($data[$attributeCode]) ? $data[$attributeCode] : null);
91
+ }
92
+
93
+ foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) {
94
+ if (isset($data[$attributeCode])) {
95
+ $row[$attributeCode] = $data[$attributeCode];
96
+ }
97
+ }
98
+
99
+ $result[] = $row;
100
+ }
101
+
102
+ return $result;
103
+ }
104
+
105
+ public function customer_count()
106
+ {
107
+ $_customers = Mage::getModel('customer/customer')->getCollection();
108
+ $_customerCnt = $_customers->count(); //customers count
109
+ return $_customerCnt;
110
+ }
111
+ }
112
+
app/code/community/RevenueConduit/RevenueConduit/Model/Observer.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+
23
+ class RevenueConduit_RevenueConduit_Model_Observer{
24
+
25
+ var $_infusionsoftConnectionInfo = array();
26
+
27
+ public function load(){
28
+ }
29
+
30
+ public function initialize($observer){
31
+
32
+ if (!($observer->getEvent()->getBlock() instanceof Mage_Adminhtml_Block_Page)) {
33
+ return;
34
+ }
35
+ return $this;
36
+ }
37
+
38
+ public function SendRequest($topic, $orderId, $customerId, $productId=0, $categoryId=0){
39
+ $affiliate = 0;
40
+ $client = new Varien_Http_Client();
41
+
42
+ $company_app_name = $this->getStoreConfig('revenueconduit_app_name');
43
+ $store_name = $this->getStoreConfig('revenueconduit_store_name');
44
+
45
+ $storeId = Mage::app()->getStore()->getStoreId();
46
+ $url = Mage::getStoreConfig('web/unsecure/base_link_url', $storeId);
47
+
48
+ $host = "https://app.revenueconduit.com/magento_incoming_requests/receive";
49
+
50
+ $parameter = array("company_app_name" => $company_app_name, "store_name" => $store_name, 'domain' => $url);
51
+
52
+ if(!empty($_COOKIE) && array_key_exists('affiliate', $_COOKIE)){
53
+ $affiliate = $_COOKIE['affiliate'];
54
+ }
55
+
56
+ $postParameters = array("topic" => $topic, "order_id" => $orderId, "customer_id" => $customerId, "product_id" => $productId, 'category_id' => $categoryId, 'referral_code_id' => $affiliate ? $affiliate : 0);
57
+
58
+ $client->setUri($host)
59
+ ->setConfig(array('timeout' => 30))
60
+ ->setParameterGet($parameter)
61
+ ->setParameterPost($postParameters)
62
+ ->setUrlEncodeBody(false)
63
+ ->setMethod(Zend_Http_Client::POST);
64
+
65
+ try {
66
+ $response = $client->request();
67
+ return $response->getBody();
68
+ } catch (Exception $e) {
69
+ Mage::log("Could not send the $topic request to RevenueConduit. Error Message: " . $e->getMessage(), null);
70
+ }
71
+ return null;
72
+ }
73
+
74
+ public function beforeSave($observer){
75
+ try{
76
+ $product = $observer->getEvent()->getProduct();
77
+ if(!$product->getID())
78
+ $product->isNewProduct = true;
79
+
80
+ }catch(Exception $ex){
81
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
82
+ }
83
+
84
+ return $this;
85
+ }
86
+ public function beforeCategorySave($observer){
87
+ try{
88
+ $category = $observer->getEvent()->getCategory();
89
+ if(!$category->getID())
90
+ $category->isNewCategory = true;
91
+
92
+ }catch(Exception $ex){
93
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
94
+ }
95
+
96
+ return $this;
97
+ }
98
+
99
+ public function beforeCustomerSave($observer){
100
+ try{
101
+ $customer = $observer->getEvent()->getCustomer();
102
+ if(!$customer->getID())
103
+ $customer->isNewCustomer = true;
104
+
105
+ }catch(Exception $ex){
106
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
107
+ }
108
+
109
+ return $this;
110
+ }
111
+ public function UpdateProduct($observer){
112
+
113
+ try{
114
+ $product = $observer->getEvent()->getProduct();
115
+ if ($product instanceof Mage_Catalog_Model_Product) {
116
+ if($product->isNewProduct)
117
+ $codeFromSite = $this->SendRequest("products/create", 0, 0, $product->getID());
118
+ else
119
+ $codeFromSite = $this->SendRequest("products/update", 0, 0, $product->getID());
120
+ }
121
+ }catch(Exception $ex){
122
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
123
+ }
124
+
125
+ return $this;
126
+ }
127
+ public function UpdateCategory($observer){
128
+
129
+ try{
130
+ $category = $observer->getEvent()->getCategory();
131
+ if ($category instanceof Mage_Catalog_Model_Category) {
132
+ if($category->isNewCategory)
133
+ $codeFromSite = $this->SendRequest("categories/create", 0, 0, 0, $category->getID());
134
+ else
135
+ $codeFromSite = $this->SendRequest("categories/update", 0, 0, 0, $category->getID());
136
+ }
137
+ }catch(Exception $ex){
138
+ Mage::log("Could not send a category update request to RevenueConduit.", null);
139
+ }
140
+
141
+ return $this;
142
+ }
143
+ public function UpdateCustomer($observer){
144
+
145
+ $customer = $observer->getEvent()->getCustomer();
146
+ if (($customer instanceof Mage_Customer_Model_Customer) && $customer->getId()) {
147
+ try{
148
+ if($customer->isNewCustomer)
149
+ $codeFromSite = $this->SendRequest("customers/create", 0, $customer->getId());
150
+ else
151
+ $codeFromSite = $this->SendRequest("customers/update", 0, $customer->getId());
152
+ }catch(Exception $ex){
153
+ Mage::log("Could not send a customer created request to RevenueConduit.", null);
154
+ }
155
+ }
156
+ return $this;
157
+ }
158
+
159
+ public function CreateContactRecord($observer){
160
+
161
+ $customer = $observer->getEvent()->getCustomer();
162
+
163
+ if (($customer instanceof Mage_Customer_Model_Customer)) {
164
+
165
+ try{
166
+ $codeFromSite = $this->SendRequest("customers/create", 0, $customer->getId());
167
+ }catch(Exception $ex){
168
+ Mage::log("Could not send a customer created request to RevenueConduit.", null);
169
+ }
170
+ }
171
+ return $this;
172
+ }
173
+
174
+ public function AssignOrderSequenceOnCheckout($observer){
175
+
176
+ $orderId = 0;
177
+ $customerId = 0;
178
+
179
+ $orderId = $observer->getOrder()->getRealOrderId();
180
+
181
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
182
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
183
+ }
184
+
185
+ try{
186
+ $codeFromSite = $this->SendRequest("orders/create", $orderId, $customerId);
187
+ }catch(Exception $ex){
188
+ Mage::log("Could not send an orders/create request to RevenueConduit. The order Id is: " . $orderId, null);
189
+ }
190
+ return $this;
191
+ }
192
+
193
+ public function OnOrderUpdate($observer){
194
+ try{
195
+ $order = $observer->getEvent()->getInvoice()->getOrder();
196
+ $codeFromSite = $this->SendRequest("orders/updated", $order->getIncrementId(), null);
197
+ }catch(Exception $ex){
198
+ Mage::log("Could not send an order created request to RevenueConduit. " . $ex->getMessage() , null);
199
+ }
200
+ return $this;
201
+ }
202
+
203
+ public function captureReferral(Varien_Event_Observer $observer)
204
+ {
205
+ // here we add the logic to capture the referring affiliate ID
206
+ $frontController = $observer->getEvent()->getFront();
207
+ if(!empty($frontController)){
208
+ $affiliateID = $frontController->getRequest()->getParam('affiliate', false);
209
+ if(!empty($affiliateID)){
210
+ setcookie("affiliate", $affiliateID, time()+3600);
211
+ }
212
+ }
213
+ }
214
+
215
+ /*
216
+ * Gets the data from the store configuration
217
+ * @param string keyName - the string which is the key that identifies the value that is requested
218
+ */
219
+ public function getStoreConfig($keyName = null, $group = "revenueconduit_revenueconduit_settings_group"){
220
+ if(!empty($keyName)){
221
+ $value = Mage::getStoreConfig("revenueconduit_revenueconduit_options/$group/" . $keyName);
222
+ if(!empty($value)){
223
+ return trim($value);
224
+ }else{
225
+ return $value;
226
+ }
227
+ }else{
228
+ return null;
229
+ }
230
+ }
231
+
232
+ public function setStoreConfig($keyName, $value){
233
+ Mage::getModel('core/config')->saveConfig('revenueconduit_revenueconduit_options/revenueconduit_revenueconduit_group/' . $keyName, $value );
234
+ }
235
+
236
+ }
app/code/community/RevenueConduit/RevenueConduit/Model/Sales/Order/Api/1.6/V2.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order API
29
+ *
30
+ * @category RevenueConduit
31
+ * @package RevenueConduit_RevenueConduit_Sales
32
+ * @author Parag Jagdale (Revenue Conduit)
33
+ */
34
+ class RevenueConduit_RevenueConduit_Model_Sales_Order_Api_V2 extends Mage_Sales_Model_Order_Api
35
+ {
36
+
37
+
38
+ public function light_items($filters = null)
39
+ {
40
+ $orders = array();
41
+
42
+ //TODO: add full name logic
43
+ $billingAliasName = 'billing_o_a';
44
+ $shippingAliasName = 'shipping_o_a';
45
+
46
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
47
+ $collection = Mage::getModel("sales/order")->getCollection();
48
+
49
+ $collection->getSelect()
50
+ ->reset(Zend_Db_Select::COLUMNS)
51
+ ->columns('increment_id')
52
+ ->columns('entity_id')
53
+ ->columns('customer_id')
54
+ ->columns('store_id')
55
+ ->columns('created_at')
56
+ ->columns('updated_at')
57
+ ->columns('status')
58
+ ->columns('state');
59
+
60
+
61
+
62
+ if (is_array($filters)) {
63
+ try {
64
+ foreach ($filters as $field => $value) {
65
+ if (isset($this->_attributesMap['order'][$field])) {
66
+ $field = $this->_attributesMap['order'][$field];
67
+ }
68
+
69
+ $collection->addFieldToFilter($field, $value);
70
+ }
71
+ } catch (Mage_Core_Exception $e) {
72
+ $this->_fault('filters_invalid', $e->getMessage());
73
+ }
74
+ }
75
+
76
+ $result = array();
77
+
78
+ foreach ($collection as $order) {
79
+ $result[] = $this->_getAttributes($order, 'order');
80
+ }
81
+
82
+ return $result;
83
+ }
84
+
85
+ /**
86
+ * Retrieve list of orders. Filtration could be applied
87
+ *
88
+ * @param null|object|array $filters
89
+ * @return array
90
+ */
91
+ public function items($filters = null)
92
+ {
93
+ $orders = array();
94
+
95
+ //TODO: add full name logic
96
+ $billingAliasName = 'billing_o_a';
97
+ $shippingAliasName = 'shipping_o_a';
98
+
99
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
100
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
101
+ $billingFirstnameField = "$billingAliasName.firstname";
102
+ $billingLastnameField = "$billingAliasName.lastname";
103
+ $shippingFirstnameField = "$shippingAliasName.firstname";
104
+ $shippingLastnameField = "$shippingAliasName.lastname";
105
+ $orderCollection->addAttributeToSelect('*')
106
+ ->addAddressFields()
107
+ ->addExpressionFieldToSelect('billing_firstname', "{{billing_firstname}}",
108
+ array('billing_firstname' => $billingFirstnameField))
109
+ ->addExpressionFieldToSelect('billing_lastname', "{{billing_lastname}}",
110
+ array('billing_lastname' => $billingLastnameField))
111
+ ->addExpressionFieldToSelect('shipping_firstname', "{{shipping_firstname}}",
112
+ array('shipping_firstname' => $shippingFirstnameField))
113
+ ->addExpressionFieldToSelect('shipping_lastname', "{{shipping_lastname}}",
114
+ array('shipping_lastname' => $shippingLastnameField))
115
+ ->addExpressionFieldToSelect('billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
116
+ array('billing_firstname' => $billingFirstnameField, 'billing_lastname' => $billingLastnameField))
117
+ ->addExpressionFieldToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
118
+ array('shipping_firstname' => $shippingFirstnameField, 'shipping_lastname' => $shippingLastnameField)
119
+ );
120
+
121
+ /** @var $apiHelper Mage_Api_Helper_Data */
122
+ $apiHelper = Mage::helper('api');
123
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['order']);
124
+ try {
125
+ foreach ($filters as $field => $value) {
126
+ $orderCollection->addFieldToFilter($field, $value);
127
+ }
128
+ } catch (Mage_Core_Exception $e) {
129
+ $this->_fault('filters_invalid', $e->getMessage());
130
+ }
131
+ foreach ($orderCollection as $order) {
132
+ $orders[] = $this->_getAttributes($order, 'order');
133
+ }
134
+ return $orders;
135
+ }
136
+
137
+ } // Class Mage_Sales_Model_Order_Api End
app/code/community/RevenueConduit/RevenueConduit/Model/Sales/Order/Api/V2.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order API
29
+ *
30
+ * @category RevenueConduit
31
+ * @package RevenueConduit_RevenueConduit_Sales
32
+ * @author Parag Jagdale (Revenue Conduit)
33
+ */
34
+ class RevenueConduit_RevenueConduit_Model_Sales_Order_Api_V2 extends Mage_Sales_Model_Order_Api
35
+ {
36
+
37
+ public function order_count()
38
+ {
39
+ $_orders = Mage::getModel('sales/order')->getCollection();
40
+ $_orderCnt = $_orders->count(); //orders count
41
+ return $_orderCnt;
42
+ }
43
+
44
+ public function light_items($filters = null)
45
+ {
46
+
47
+ $start = 0;
48
+ $count = FALSE;
49
+ foreach ($filters->complex_filter as $field => $condition) {
50
+ if($condition->key == "start"){
51
+ $start = $condition->value->value;
52
+ unset($filters->complex_filter->field);
53
+ }
54
+ if($condition->key == "count"){
55
+ $count = $condition->value->value;
56
+ unset($filters->complex_filter->field);
57
+ }
58
+ }
59
+
60
+ $orders = array();
61
+
62
+ //TODO: add full name logic
63
+ $billingAliasName = 'billing_o_a';
64
+ $shippingAliasName = 'shipping_o_a';
65
+
66
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
67
+ $orderCollection = Mage::getModel("sales/order")->getCollection()->setOrder('entity_id', 'ASC');
68
+
69
+ $orderCollection->getSelect()
70
+ ->reset(Zend_Db_Select::COLUMNS)
71
+ ->columns('increment_id')
72
+ ->columns('entity_id')
73
+ ->columns('customer_id')
74
+ ->columns('store_id')
75
+ ->columns('created_at')
76
+ ->columns('updated_at')
77
+ ->columns('status')
78
+ ->columns('state');
79
+
80
+
81
+ /** @var $apiHelper Mage_Api_Helper_Data */
82
+ $apiHelper = Mage::helper('api');
83
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['order']);
84
+ try {
85
+ foreach ($filters as $field => $value) {
86
+ if($field == 'start' || $field == 'count') continue;
87
+ $orderCollection->addFieldToFilter($field, $value);
88
+ }
89
+ } catch (Mage_Core_Exception $e) {
90
+ $this->_fault('filters_invalid', $e->getMessage());
91
+ }
92
+
93
+ foreach ($orderCollection as $order) {
94
+ if($start){
95
+ $start--;
96
+ continue;
97
+ }
98
+ $orders[] = $this->_getAttributes($order, 'order');
99
+ if($count !== FALSE && count($orders) == $count){
100
+ break;
101
+ }
102
+ }
103
+ return $orders;
104
+ }
105
+
106
+ /**
107
+ * Retrieve list of orders. Filtration could be applied
108
+ *
109
+ * @param null|object|array $filters
110
+ * @return array
111
+ */
112
+ public function items($filters = null)
113
+ {
114
+ $orders = array();
115
+
116
+ //TODO: add full name logic
117
+ $billingAliasName = 'billing_o_a';
118
+ $shippingAliasName = 'shipping_o_a';
119
+
120
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
121
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
122
+ $billingFirstnameField = "$billingAliasName.firstname";
123
+ $billingLastnameField = "$billingAliasName.lastname";
124
+ $shippingFirstnameField = "$shippingAliasName.firstname";
125
+ $shippingLastnameField = "$shippingAliasName.lastname";
126
+ $orderCollection->addAttributeToSelect('*')
127
+ ->addAddressFields()
128
+ ->addExpressionFieldToSelect('billing_firstname', "{{billing_firstname}}",
129
+ array('billing_firstname' => $billingFirstnameField))
130
+ ->addExpressionFieldToSelect('billing_lastname', "{{billing_lastname}}",
131
+ array('billing_lastname' => $billingLastnameField))
132
+ ->addExpressionFieldToSelect('shipping_firstname', "{{shipping_firstname}}",
133
+ array('shipping_firstname' => $shippingFirstnameField))
134
+ ->addExpressionFieldToSelect('shipping_lastname', "{{shipping_lastname}}",
135
+ array('shipping_lastname' => $shippingLastnameField))
136
+ ->addExpressionFieldToSelect('billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
137
+ array('billing_firstname' => $billingFirstnameField, 'billing_lastname' => $billingLastnameField))
138
+ ->addExpressionFieldToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
139
+ array('shipping_firstname' => $shippingFirstnameField, 'shipping_lastname' => $shippingLastnameField)
140
+ );
141
+
142
+ /** @var $apiHelper Mage_Api_Helper_Data */
143
+ $apiHelper = Mage::helper('api');
144
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['order']);
145
+ try {
146
+ foreach ($filters as $field => $value) {
147
+ $orderCollection->addFieldToFilter($field, $value);
148
+ }
149
+ } catch (Mage_Core_Exception $e) {
150
+ $this->_fault('filters_invalid', $e->getMessage());
151
+ }
152
+ foreach ($orderCollection as $order) {
153
+ $orders[] = $this->_getAttributes($order, 'order');
154
+ }
155
+ return $orders;
156
+ }
157
+
158
+ public function customer_count()
159
+ {
160
+ $_customers = Mage::getModel('customer/customer')->getCollection();
161
+ $_customerCnt = $_customers->count(); //customers count
162
+ return $_customerCnt;
163
+ }
164
+
165
+ public function product_count()
166
+ {
167
+ $_products = Mage::getModel('catalog/product')->getCollection();
168
+ $_productCnt = $_products->count(); //customers count
169
+ return $_productCnt;
170
+ }
171
+
172
+ public function product_category_count()
173
+ {
174
+ $_products_categories = Mage::getModel('catalog/category')->getCollection();
175
+ $_productCategoryCnt = $_products_categories->count(); //customers count
176
+ return $_productCategoryCnt;
177
+ }
178
+ public function customer_get_subscription_status($email){
179
+ $_subscribers = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
180
+
181
+ return $_subscribers->isSubscribed();
182
+ }
183
+ } // Class Mage_Sales_Model_Order_Api End
app/code/community/RevenueConduit/RevenueConduit/controllers/IndexController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ ?>
23
+
24
+ <?php
25
+ class RevenueConduit_RevenueConduitController_IndexController extends Mage_Core_Controller_Front_Action
26
+ {
27
+ public function indexAction()
28
+ {
29
+
30
+ }
31
+ }
app/code/community/RevenueConduit/RevenueConduit/etc/api.xml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category RevenueConduit
23
+ * @package RevenueConduit_Sales
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <api>
30
+ <resources>
31
+ <revenueconduit_sales translate="title" module="revenueconduit">
32
+ <title>revenueconduit</title>
33
+ <model>RevenueConduit_RevenueConduit_Model_Sales_Order_Api</model>
34
+ <acl>revenueconduit_sales/order</acl>
35
+ <methods>
36
+ <_salesOrderList translate="title" module="revenueconduit">
37
+ <title>Retrieve list of orders by filters</title>
38
+ <method>light_items</method>
39
+ <acl>revenueconduit_sales/order</acl>
40
+ </_salesOrderList>
41
+ <_salesOrderCount translate="title" module="revenueconduit">
42
+ <title>Retrieve count of orders</title>
43
+ <method>order_count</method>
44
+ <acl>revenueconduit_sales/order</acl>
45
+ </_salesOrderCount>
46
+ <_customerCustomerCount translate="title" module="revenueconduit">
47
+ <title>Retrieve count of customers</title>
48
+ <method>customer_count</method>
49
+ <acl>revenueconduit_sales/order</acl>
50
+ </_customerCustomerCount>
51
+ <_catalogProductCount translate="title" module="revenueconduit">
52
+ <title>Retrieve count of products</title>
53
+ <method>product_count</method>
54
+ <acl>revenueconduit_sales/order</acl>
55
+ </_catalogProductCount>
56
+ <_catalogCategoryCount translate="title" module="revenueconduit">
57
+ <title>Retrieve count of product categories</title>
58
+ <method>product_category_count</method>
59
+ <acl>revenueconduit_sales/order</acl>
60
+ </_catalogCategoryCount>
61
+ <_customerIsSubscribed translate="title" module="revenueconduit">
62
+ <title>Check if customer is subscribed</title>
63
+ <method>customer_get_subscription_status</method>
64
+ <acl>revenueconduit_sales/order</acl>
65
+ </_customerIsSubscribed>
66
+ </methods>
67
+ <faults module="revenueconduit"> <not_exists>
68
+ <code>100</code>
69
+ <message>Requested order not exists.</message>
70
+ </not_exists>
71
+ <filters_invalid>
72
+ <code>101</code>
73
+ <message>Invalid filters given. Details in error message.</message>
74
+ </filters_invalid>
75
+ <data_invalid>
76
+ <code>102</code>
77
+ <message>Invalid data given. Details in error message.</message>
78
+ </data_invalid>
79
+ <status_not_changed>
80
+ <code>103</code>
81
+ <message>Order status not changed. Details in error message.</message>
82
+ </status_not_changed>
83
+ </faults>
84
+ </revenueconduit_sales>
85
+ </resources>
86
+ <resources_alias>
87
+ <order>sales_order</order>
88
+ </resources_alias>
89
+ <v2>
90
+ <resources_function_prefix>
91
+ <revenueconduit_sales>RevenueConduit</revenueconduit_sales>
92
+ </resources_function_prefix>
93
+ </v2>
94
+ <acl>
95
+ <resources>
96
+ <revenueconduit_sales translate="title" module="revenueconduit">
97
+ <title>Sales</title>
98
+ <sort_order>2</sort_order>
99
+ <order translate="title" module="revenueconduit">
100
+ <title>Order</title>
101
+ <change translate="title" module="revenueconduit">
102
+ <title>Change status, add comments</title>
103
+ </change>
104
+ </order>
105
+ </revenueconduit_sales>
106
+ </resources>
107
+ </acl>
108
+ </api>
109
+ </config>
110
+
app/code/community/RevenueConduit/RevenueConduit/etc/config.xml ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <RevenueConduit_RevenueConduit>
5
+ <version>1.0.2</version>
6
+ <depends>
7
+ <Mage_Catalog />
8
+ <Mage_Customer />
9
+ </depends>
10
+ </RevenueConduit_RevenueConduit>
11
+ </modules>
12
+ <global>
13
+ <models>
14
+ <revenueconduit>
15
+ <class>RevenueConduit_RevenueConduit_Model</class>
16
+ </revenueconduit>
17
+ <catalog>
18
+ <rewrite>
19
+ <product_api_v2>RevenueConduit_RevenueConduit_Model_Catalog_Product_Api_V2</product_api_v2>
20
+ </rewrite>
21
+ </catalog>
22
+ <customer>
23
+ <rewrite>
24
+ <customer_api_v2>RevenueConduit_RevenueConduit_Model_Customer_Customer_Api_V2</customer_api_v2>
25
+ </rewrite>
26
+ </customer>
27
+ </models>
28
+ <helpers>
29
+ <revenueconduit>
30
+ <class>RevenueConduit_RevenueConduit_Helper</class>
31
+ </revenueconduit>
32
+ </helpers>
33
+ <events>
34
+ <catalog_product_save_after>
35
+ <observers>
36
+ <revenueconduit_RevenueConduit_customer_observer>
37
+ <type>singleton</type>
38
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
39
+ <method>UpdateProduct</method>
40
+ </revenueconduit_RevenueConduit_customer_observer>
41
+ </observers>
42
+ </catalog_product_save_after>
43
+ <catalog_product_save_before>
44
+ <observers>
45
+ <revenueconduit_RevenueConduit_customer_observer>
46
+ <type>singleton</type>
47
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
48
+ <method>beforeSave</method>
49
+ </revenueconduit_RevenueConduit_customer_observer>
50
+ </observers>
51
+ </catalog_product_save_before>
52
+ <catalog_category_save_before>
53
+ <observers>
54
+ <revenueconduit_RevenueConduit_customer_observer>
55
+ <type>singleton</type>
56
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
57
+ <method>beforeCategorySave</method>
58
+ </revenueconduit_RevenueConduit_customer_observer>
59
+ </observers>
60
+ </catalog_category_save_before>
61
+ <catalog_category_save_after>
62
+ <observers>
63
+ <revenueconduit_RevenueConduit_customer_observer>
64
+ <type>singleton</type>
65
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
66
+ <method>UpdateCategory</method>
67
+ </revenueconduit_RevenueConduit_customer_observer>
68
+ </observers>
69
+ </catalog_category_save_after>
70
+ <customer_save_after>
71
+ <observers>
72
+ <revenueconduit_RevenueConduit_customer_observer>
73
+ <type>singleton</type>
74
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
75
+ <method>UpdateCustomer</method>
76
+ </revenueconduit_RevenueConduit_customer_observer>
77
+ </observers>
78
+ </customer_save_after>
79
+ <catalog_product_duplicate>
80
+ <observers>
81
+ <revenueconduit_RevenueConduit_customer_observer>
82
+ <type>singleton</type>
83
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
84
+ <method>UpdateProduct</method>
85
+ </revenueconduit_RevenueConduit_customer_observer>
86
+ </observers>
87
+ </catalog_product_duplicate>
88
+ <customer_register_success>
89
+ <observers>
90
+ <revenueconduit_RevenueConduit_customer_observer>
91
+ <type>singleton</type>
92
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
93
+ <method>CreateContactRecord</method>
94
+ </revenueconduit_RevenueConduit_customer_observer>
95
+ </observers>
96
+ </customer_register_success>
97
+ <sales_order_place_after>
98
+ <observers>
99
+ <revenueconduit_RevenueConduit_customer_observer_a>
100
+ <type>singleton</type>
101
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
102
+ <method>AssignOrderSequenceOnCheckout</method>
103
+ </revenueconduit_RevenueConduit_customer_observer_a>
104
+ </observers>
105
+ </sales_order_place_after>
106
+       <sales_order_invoice_pay>
107
+ <observers>
108
+ <revenueconduit_RevenueConduit_order_saved>
109
+ <type>singleton</type>
110
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
111
+ <method>OnOrderUpdate</method>
112
+ </revenueconduit_RevenueConduit_order_saved>
113
+         </observers>
114
+       </sales_order_invoice_pay>
115
+       <controller_front_init_before>
116
+ <observers>
117
+ <revenueconduit_RevenueConduit_order_saved>
118
+ <type>singleton</type>
119
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
120
+ <method>captureReferral</method>
121
+ </revenueconduit_RevenueConduit_order_saved>
122
+         </observers>
123
+       </controller_front_init_before>
124
+ </events>
125
+ </global>
126
+ <adminhtml>
127
+ <acl>
128
+ <resources>
129
+ <admin>
130
+ <children>
131
+ <system>
132
+ <children>
133
+ <config>
134
+ <children>
135
+ <revenueconduit_revenueconduit_options>
136
+ <title>RevenueConduit Infusionsoft Settings Section</title>
137
+ </revenueconduit_revenueconduit_options>
138
+ </children>
139
+ </config>
140
+ </children>
141
+ </system>
142
+ </children>
143
+ </admin>
144
+ </resources>
145
+ </acl>
146
+ </adminhtml>
147
+ </config>
148
+ <!--
149
+ /**
150
+ * RevenueConduit
151
+ *
152
+ * NOTICE OF LICENSE
153
+ *
154
+ * This source file is subject to the EULA available
155
+ * through the world-wide-web at this URL:
156
+ * http://revenueconduit.com/magento/license
157
+ *
158
+ * MAGENTO EDITION USAGE NOTICE
159
+ *
160
+ * This package is designed for Magento COMMUNITY edition.
161
+ * =================================================================
162
+ *
163
+ * @package RevenueConduit
164
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
165
+ * @license http://revenueconduit.com/magento/license
166
+ * @terms http://revenueconduit.com/magento/terms
167
+ * @author Parag Jagdale
168
+ */
169
+ -->
app/code/community/RevenueConduit/RevenueConduit/etc/system.xml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <revenueconduittab translate="label" module="revenueconduit">
5
+ <label>Revenue Conduit</label>
6
+ <sort_order>100</sort_order>
7
+ </revenueconduittab>
8
+ </tabs>
9
+ <sections>
10
+ <revenueconduit_revenueconduit_options translate="label" module="revenueconduit">
11
+ <label>Revenue Conduit</label>
12
+ <tab>revenueconduittab</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>199</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <expanded>1</expanded>
19
+ <groups>
20
+ <revenueconduit_revenueconduit_settings_group translate="label">
21
+ <label>Revenue Conduit Settings</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+
28
+ <fields>
29
+ <revenueconduit_app_name translate="label">
30
+ <label>Revenue Conduit Application Name</label>
31
+ <comment>The app name given to your Revenue Conduit account</comment>
32
+ <frontend_type>text</frontend_type>
33
+ <sort_order>1</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ </revenueconduit_app_name>
38
+ <revenueconduit_store_name translate="label">
39
+ <label>Revenue Conduit Store Name</label>
40
+ <comment>The unique store name configured in your Revenue Conduit account</comment>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>2</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ </revenueconduit_store_name>
47
+ </fields>
48
+ </revenueconduit_revenueconduit_settings_group>
49
+ </groups>
50
+ </revenueconduit_revenueconduit_options>
51
+ </sections>
52
+ </config>
53
+ <!--
54
+ /**
55
+ * RevenueConduit
56
+ *
57
+ * NOTICE OF LICENSE
58
+ *
59
+ * This source file is subject to the EULA available
60
+ * through the world-wide-web at this URL:
61
+ * http://revenueconduit.com/magento/license
62
+ *
63
+ * MAGENTO EDITION USAGE NOTICE
64
+ *
65
+ * This package is designed for Magento COMMUNITY edition.
66
+ * =================================================================
67
+ *
68
+ * @package RevenueConduit
69
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
70
+ * @license http://revenueconduit.com/magento/license
71
+ * @terms http://revenueconduit.com/magento/terms
72
+ * @author Parag Jagdale
73
+ */
74
+ -->
app/code/community/RevenueConduit/RevenueConduit/etc/wsdl.xml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
5
+ <types>
6
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
7
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
8
+ <complexType name="RevenueConduit_salesOrderListEntity">
9
+ <all>
10
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
11
+ <element name="store_id" type="xsd:string" minOccurs="0" />
12
+ <element name="created_at" type="xsd:string" minOccurs="0" />
13
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
14
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
15
+ <element name="status" type="xsd:string" minOccurs="0" />
16
+ <element name="state" type="xsd:string" minOccurs="0" />
17
+ <element name="order_id" type="xsd:string" minOccurs="0" />
18
+ </all>
19
+ </complexType>
20
+ <complexType name="RevenueConduit_salesOrderListEntityArray">
21
+ <complexContent>
22
+ <restriction base="soapenc:Array">
23
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:RevenueConduit_salesOrderListEntity[]" />
24
+ </restriction>
25
+ </complexContent>
26
+ </complexType>
27
+ </schema>
28
+ </types>
29
+ <message name="RevenueConduit_salesOrderListRequest">
30
+ <part name="sessionId" type="xsd:string" />
31
+ <part name="filters" type="typens:filters" />
32
+ </message>
33
+ <message name="RevenueConduit_salesOrderListResponse">
34
+ <part name="result" type="typens:salesOrderListEntityArray" />
35
+ </message>
36
+ <message name="RevenueConduit_salesOrderCountRequest">
37
+ <part name="sessionId" type="xsd:string" />
38
+ <part name="filters" type="typens:filters" />
39
+ </message>
40
+ <message name="RevenueConduit_salesOrderCountResponse">
41
+ <part name="result" type="xsd:int" />
42
+ </message>
43
+ <message name="RevenueConduit_salesOrderInputEmail">
44
+ <part name="sessionId" type="xsd:string" />
45
+ <part name="filters" type="xsd:string" />
46
+ </message>
47
+ <portType name="{{var wsdl.handler}}PortType">
48
+ <operation name="RevenueConduit_salesOrderList">
49
+ <documentation>Retrieve list of orders by filters</documentation>
50
+ <input message="typens:RevenueConduit_salesOrderListRequest" />
51
+ <output message="typens:RevenueConduit_salesOrderListResponse" />
52
+ </operation>
53
+ <operation name="RevenueConduit_salesOrderCount">
54
+ <documentation>Retrieve count of orders by filters</documentation>
55
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
56
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
57
+ </operation>
58
+ <operation name="RevenueConduit_customerCustomerCount">
59
+ <documentation>Retrieve count of customers by filters</documentation>
60
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
61
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
62
+ </operation>
63
+ <operation name="RevenueConduit_catalogProductCount">
64
+ <documentation>Retrieve count of products by filters</documentation>
65
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
66
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
67
+ </operation>
68
+ <operation name="RevenueConduit_catalogCategoryCount">
69
+ <documentation>Retrieve count of Categories by filters</documentation>
70
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
71
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
72
+ </operation>
73
+ <operation name="RevenueConduit_customerIsSubscribed">
74
+ <documentation>Check if customer has subscribed to newsletters</documentation>
75
+ <input message="typens:RevenueConduit_salesOrderInputEmail" />
76
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
77
+ </operation>
78
+ </portType>
79
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
80
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
81
+ <operation name="RevenueConduit_salesOrderList">
82
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
83
+ <input>
84
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
85
+ </input>
86
+ <output>
87
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
88
+ </output>
89
+ </operation>
90
+ <operation name="RevenueConduit_salesOrderCount">
91
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
92
+ <input>
93
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
94
+ </input>
95
+ <output>
96
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
97
+ </output>
98
+ </operation>
99
+ <operation name="RevenueConduit_customerCustomerCount">
100
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
101
+ <input>
102
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
103
+ </input>
104
+ <output>
105
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
106
+ </output>
107
+ </operation>
108
+ <operation name="RevenueConduit_catalogProductCount">
109
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
110
+ <input>
111
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
112
+ </input>
113
+ <output>
114
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
115
+ </output>
116
+ </operation>
117
+ <operation name="RevenueConduit_catalogCategoryCount">
118
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
119
+ <input>
120
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
121
+ </input>
122
+ <output>
123
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
124
+ </output>
125
+ </operation>
126
+ <operation name="RevenueConduit_customerIsSubscribed">
127
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
128
+ <input>
129
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
130
+ </input>
131
+ <output>
132
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
133
+ </output>
134
+ </operation>
135
+ </binding>
136
+ <service name="{{var wsdl.name}}Service">
137
+ <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
138
+ <soap:address location="{{var wsdl.url}}" />
139
+ </port>
140
+ </service>
141
+ </definitions>
142
+
app/etc/modules/RevenueConduit_RevenueConduit.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * RevenueConduit
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA available
9
+ * through the world-wide-web at this URL:
10
+ * http://revenueconduit.com/magento/license
11
+ *
12
+ * MAGENTO EDITION USAGE NOTICE
13
+ *
14
+ * This package is designed for Magento COMMUNITY edition.
15
+ * =================================================================
16
+ *
17
+ * @package RevenueConduit
18
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
19
+ * @license http://revenueconduit.com/magento/license
20
+ * @terms http://revenueconduit.com/magento/terms
21
+ * @author Parag Jagdale
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <RevenueConduit_RevenueConduit>
27
+ <active>true</active>
28
+ <codePool>community</codePool>
29
+ </RevenueConduit_RevenueConduit>
30
+ </modules>
31
+ </config>
32
+
33
+
package.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>RevenueConduit_RevenueConduit</name>
4
+ <version>1.0.2</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Connect your Magento&#x2122; store to Infusionsoft and maximize your revenue, automatically!</summary>
10
+ <description>&lt;p&gt;&#xD;
11
+ Magento&#x2122; is great. Infusionsoft is great. Revenue Conduit makes them even better with a deep integration between your shopping cart and Infusionsoft, the all-in-one sales and marketing solution for small businesses.&#xD;
12
+ &lt;/p&gt;&#xD;
13
+ &#xD;
14
+ &lt;p&gt;&#xD;
15
+ Sign up for a 30 day FREE Trial and see what Revenue Conduit can do for you. Then benefit from a low monthly cost starting at $24.95 with no up-front fees or long-term commitments.&#xD;
16
+ &lt;/p&gt;&#xD;
17
+ &#xD;
18
+ &lt;p&gt;&#xD;
19
+ If you're not yet a customer of Infusionsoft, ask us about our eCommerce Optimized Kickstart, our turn-key package for nurturing prospects, converting customers and turning first-time customers into customers for life.&#xD;
20
+ &lt;/p&gt;&#xD;
21
+ &#xD;
22
+ &lt;h3&gt;Key Features&lt;/h3&gt;&#xD;
23
+ &#xD;
24
+ &lt;p&gt;&#xD;
25
+ &lt;strong&gt;Easy Installation!&lt;/strong&gt;&lt;br /&gt;&#xD;
26
+ Simply upload a folder to your server, enter your Infusionsoft and Magento information and let Revenue Conduit do the rest. In the short-term and long-term, this will save you time and money.&#xD;
27
+ &lt;/p&gt;&#xD;
28
+ &#xD;
29
+ &lt;p&gt;&#xD;
30
+ &lt;strong&gt;Sync Leads, Customers, Products and Orders&lt;/strong&gt;&lt;br /&gt;&#xD;
31
+ Benefit from Infusionsoft&#x2019;s amazing reporting by having all your leads, customers, products and orders synced in real time. Easily run Campaigns for leads, first time customers, repeat buyers and more!&#xD;
32
+ &lt;/p&gt;&#xD;
33
+ &#xD;
34
+ &lt;p&gt;&#xD;
35
+ &lt;strong&gt;Associate Tags with Products&lt;/strong&gt;&lt;br /&gt;&#xD;
36
+ When someone buys your product, they automatically get all the Infusionsoft Tags associated with it. Use Tags to create list segments based on customer preferences like price, category or anything else you can think of.&#xD;
37
+ &#xD;
38
+ &lt;/p&gt;&#xD;
39
+ &#xD;
40
+ &lt;p&gt;&#xD;
41
+ &lt;strong&gt;Automatically Upsell and Cross-Sell&lt;/strong&gt;&lt;br /&gt;&#xD;
42
+ Using the Tags you associate with your products, automatically upsell and cross-sell through Infusionsoft. This one simply feature will help you maximize revenue, automatically. You&#x2019;re going to love it!&#xD;
43
+ &#xD;
44
+ &lt;/p&gt;&#xD;
45
+ &#xD;
46
+ &lt;p&gt;&#xD;
47
+ &lt;strong&gt;Automatically Segment Your Customers&lt;/strong&gt;&lt;br /&gt;&#xD;
48
+ Not all customers are created equal, and different customers deserve to be treated differently. Revenue Conduit makes it easy for you to automatically segment your customers based on the last time they bought, how many times they bought and how much they have spent. This is called RFM Segmentation, and it is a truly powerful way for you to maximize your revenue.&#xD;
49
+ &#xD;
50
+ &lt;/p&gt;&#xD;
51
+ &#xD;
52
+ &lt;p&gt;&#xD;
53
+ &lt;strong&gt;FREE Infusionsoft Campaigns&lt;/strong&gt;&lt;br /&gt;&#xD;
54
+ Revenue Conduit comes with FREE Infusionsoft Campaigns that you can use right away or customize to your heart&#x2019;s content. These Campaigns are essential for you to maximize your revenue, automatically!&#xD;
55
+ &lt;/p&gt;</description>
56
+ <notes>1.0.2 Release</notes>
57
+ <authors><author><name>Parag Jagdale</name><user>RevenueConduit</user><email>parag@revenueconduit.com</email></author></authors>
58
+ <date>2014-07-10</date>
59
+ <time>15:33:04</time>
60
+ <contents><target name="magecommunity"><dir name="RevenueConduit"><dir name="RevenueConduit"><dir name="Helper"><file name="Data.php" hash="0a9af814ed12bb85b1be2b0cdff4c864"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="08cea5d6c1a35dffd185677aeec60306"/></dir></dir></dir><dir name="Customer"><dir name="Customer"><dir name="Api"><file name="V2.php" hash="fd835f965fd45b7bfccdb91b0a7bb90e"/></dir></dir></dir><file name="Observer.php" hash="d80d667226045639c3021b1d71b5ae06"/><dir name="Sales"><dir name="Order"><dir name="Api"><dir name="1.6"><file name="V2.php" hash="7158678bb9e973b72091290218cadc36"/></dir><file name="V2.php" hash="0893ed7f6fab56e3101e2528cec0d289"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="eeff576b7925beb3a10637aeb03b6de8"/></dir><dir name="etc"><file name="api.xml" hash="2f97f67ce79f587f9e5b7b7fe028693a"/><file name="config.xml" hash="9a5a3ba4f24053d18689f23cd537cb40"/><file name="system.xml" hash="78ed59ccf93c1656ed003f78482f7756"/><file name="wsdl.xml" hash="38ac019610d6f28280cb09885c8bb41c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RevenueConduit_RevenueConduit.xml" hash="8f594907ef70890af5f90fc16dd59ca7"/></dir></target></contents>
61
+ <compatible/>
62
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
63
+ </package>