516d64d10be1014787d64354e79112aa - Version 1.0.0.0

Version Notes

==== 1.0.0.0 ====
* Implemented JSON endpoint to export data from Magento to Lumiary

Download this release

Release Info

Developer Carrington Williams
Extension 516d64d10be1014787d64354e79112aa
Version 1.0.0.0
Comparing to
See all releases


Version 1.0.0.0

Files changed (20) hide show
  1. app/code/community/Redstage/LumiaryEndpoint/Block/Adminhtml/System/Config/Form/Button.php +59 -0
  2. app/code/community/Redstage/LumiaryEndpoint/Helper/Data.php +38 -0
  3. app/code/community/Redstage/LumiaryEndpoint/Helper/Logger.php +18 -0
  4. app/code/community/Redstage/LumiaryEndpoint/Model/Data/Abstract.php +43 -0
  5. app/code/community/Redstage/LumiaryEndpoint/Model/Data/Table/Abstract.php +109 -0
  6. app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data.php +38 -0
  7. app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data/Translator.php +6 -0
  8. app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data/Translator/Magento.php +461 -0
  9. app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Exporter.php +39 -0
  10. app/code/community/Redstage/LumiaryEndpoint/Model/Operation/Status.php +26 -0
  11. app/code/community/Redstage/LumiaryEndpoint/Model/Operation/Timer.php +58 -0
  12. app/code/community/Redstage/LumiaryEndpoint/controllers/Adminhtml/Lumiary/TokenController.php +10 -0
  13. app/code/community/Redstage/LumiaryEndpoint/controllers/OrderController.php +27 -0
  14. app/code/community/Redstage/LumiaryEndpoint/etc/adminhtml.xml +22 -0
  15. app/code/community/Redstage/LumiaryEndpoint/etc/config.xml +78 -0
  16. app/code/community/Redstage/LumiaryEndpoint/etc/system.xml +78 -0
  17. app/code/community/Redstage/LumiaryEndpoint/sql/lumiaryendpoint_setup/install-1.0.0.0.php +8 -0
  18. app/design/adminhtml/default/default/template/lumiaryendpoint/system/config/button.phtml +18 -0
  19. app/etc/modules/Redstage_LumiaryEndpoint.xml +12 -0
  20. package.xml +20 -0
app/code/community/Redstage/LumiaryEndpoint/Block/Adminhtml/System/Config/Form/Button.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Block_Adminhtml_System_Config_Form_Button
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
5
+ {
6
+ /*
7
+ * Set template
8
+ */
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->setTemplate('lumiaryendpoint/system/config/button.phtml');
13
+ }
14
+
15
+ /**
16
+ * Return element html
17
+ *
18
+ * @param Varien_Data_Form_Element_Abstract $element
19
+ * @return string
20
+ */
21
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
22
+ {
23
+ return $this->_toHtml();
24
+ }
25
+
26
+ /**
27
+ * Return ajax url for button
28
+ *
29
+ * @return string
30
+ */
31
+ public function getAjaxCheckUrl()
32
+ {
33
+ return Mage::helper('adminhtml')->getUrl('adminhtml/lumiary_token/generate');
34
+ }
35
+
36
+ /**
37
+ * Generate button html
38
+ *
39
+ * @return string
40
+ */
41
+ public function getButtonHtml()
42
+ {
43
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
44
+ ->setData(array(
45
+ 'id' => 'lumiaryendpoint_button',
46
+ 'label' => $this->helper('adminhtml')->__('Generate New Token'),
47
+ 'onclick' => 'javascript:check(); return false;'
48
+ ));
49
+
50
+ return $button->toHtml();
51
+ }
52
+
53
+ public function getToken()
54
+ {
55
+ return Mage::helper('lumiaryendpoint')->getToken();
56
+ }
57
+ }
58
+
59
+ ?>
app/code/community/Redstage/LumiaryEndpoint/Helper/Data.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Helper_Data
4
+ extends Mage_Core_Helper_Abstract
5
+ {
6
+ public function isEnabled()
7
+ {
8
+ return (Mage::getConfig()->getModuleConfig('Redstage_LumiaryEndpoint')->is('active', 'true')
9
+ && Mage::getStoreConfig('lumiaryendpoint/core/enabled'));
10
+ }
11
+
12
+ public function checkToken($token)
13
+ {
14
+ return ($this->getToken()) && $token === $this->getToken();
15
+ }
16
+
17
+ public function getToken()
18
+ {
19
+ return Mage::getStoreConfig('lumiaryendpoint/core/token');
20
+ }
21
+
22
+ public function generateToken($len = 8, $chars = null)
23
+ {
24
+ return strtolower(implode('-', array(
25
+ Mage::helper('core')->getRandomString($len, $chars),
26
+ Mage::helper('core')->getRandomString($len/2, $chars),
27
+ Mage::helper('core')->getRandomString($len/2, $chars),
28
+ Mage::helper('core')->getRandomString($len/2, $chars),
29
+ Mage::helper('core')->getRandomString($len + 2, $chars)
30
+ )));
31
+
32
+ }
33
+
34
+ public function log($message, $severity = null)
35
+ {
36
+ Mage::helper('luminaryendpoint/logger')->log($message, $severity);
37
+ }
38
+ }
app/code/community/Redstage/LumiaryEndpoint/Helper/Logger.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Helper_Logger
4
+ extends Mage_Core_Helper_Abstract
5
+ {
6
+ const XML_PATH_ENABLED = 'luminaryendpoint/logging/enabled';
7
+ const XML_PATH_FILE = 'luminaryendpoint/logging/file';
8
+
9
+ public function log($message, $level = null, $file = '')
10
+ {
11
+ if (!Mage::getStoreConfig(self::XML_PATH_ENABLED)) {
12
+ return;
13
+ }
14
+
15
+ $file = empty($file) ? Mage::getStoreConfig(self::XML_PATH_FILE) : $file;
16
+ Mage::log($message, $level, $file);
17
+ }
18
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Data/Abstract.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Redstage_LumiaryEndpoint_Model_Data_Abstract
4
+ extends Varien_Object
5
+ {
6
+ protected $_ignoreKeys;
7
+
8
+ public function diff(Varien_Object $b,
9
+ array $ignoreAttributes = array())
10
+ {
11
+ $diff = $this->_diff($this->getData(), $b->getData());
12
+
13
+ foreach ($ignoreAttributes as $ignoreKey) {
14
+ unset($diff[$ignoreKey]);
15
+ }
16
+
17
+ return $diff;
18
+ }
19
+
20
+ protected function _diff(array $a, array $b)
21
+ {
22
+ $diff = array();
23
+ foreach ($a as $k => $v) {
24
+ if (array_key_exists($k, $b)) {
25
+ if (is_array($v)) {
26
+ $rad = $this->_diff($v, $b[$k]);
27
+
28
+ if (count($rad)) {
29
+ $diff[$k] = $rad;
30
+ }
31
+ } else {
32
+ if ($v != $b[$k]) {
33
+ $diff[$k] = $v;
34
+ }
35
+ }
36
+ } else {
37
+ $diff[$k] = $v;
38
+ }
39
+ }
40
+
41
+ return $diff;
42
+ }
43
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Data/Table/Abstract.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Redstage_LumiaryEndpoint_Model_Data_Table_Abstract
4
+ implements Iterator, ArrayAccess
5
+ {
6
+ protected $_rows = array();
7
+ protected $_headings = array();
8
+ protected $_position = 0;
9
+
10
+ public function __construct()
11
+ {
12
+ $this->_position = 0;
13
+ }
14
+
15
+ public function setHeadings(array $headings)
16
+ {
17
+ $this->_headings = $headings;
18
+ }
19
+
20
+ public function getHeadings()
21
+ {
22
+ foreach ($this->_headings as $i=>$heading) {
23
+ if (!$heading instanceof Varien_Object) {
24
+ $this->_headings[$i] = new Varien_Object(array(
25
+ 'name' => $heading,
26
+ 'index' => $i
27
+ ));
28
+ }
29
+ }
30
+
31
+ return $this->_headings;
32
+ }
33
+
34
+ public function setRows(array $rows)
35
+ {
36
+ $this->_rows = $rows;
37
+ }
38
+
39
+ public function addRow($row)
40
+ {
41
+ $this->_rows[] = $row;
42
+ }
43
+
44
+ public function current()
45
+ {
46
+ return $this->_convertRow($this->_position);
47
+ }
48
+
49
+ public function key()
50
+ {
51
+ return $this->_position;
52
+ }
53
+
54
+ public function next()
55
+ {
56
+ ++$this->_position;
57
+ }
58
+
59
+ public function rewind()
60
+ {
61
+ $this->_position = 0;
62
+ }
63
+
64
+ public function valid()
65
+ {
66
+ return isset($this->_rows[$this->_position]);
67
+ }
68
+
69
+ public function slice($offset, $length = null)
70
+ {
71
+ $this->_rows = array_slice($this->_rows, $offset, $length);
72
+ }
73
+
74
+ public function offsetSet($offset, $value)
75
+ {
76
+ if (is_null($offset)) {
77
+ $this->_rows[] = $value;
78
+ } else {
79
+ $this->_rows[$offset] = $value;
80
+ }
81
+ }
82
+
83
+ public function offsetExists($offset)
84
+ {
85
+ return isset($this->_rows[$offset]);
86
+ }
87
+
88
+ public function offsetUnset($offset)
89
+ {
90
+ unset($this->_rows[$offset]);
91
+ }
92
+
93
+ public function offsetGet($offset)
94
+ {
95
+ return isset($this->_rows[$offset]) ? $this->_convertRow($offset) : null;
96
+ }
97
+
98
+ public function count()
99
+ {
100
+ return count($this->_rows);
101
+ }
102
+
103
+ protected function _underscore($name)
104
+ {
105
+ return str_ireplace(' ', '_', strtolower(trim($name)));
106
+ }
107
+
108
+ abstract protected function _convertRow($position);
109
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Model_Export_Order_Data
4
+ extends Redstage_LumiaryEndpoint_Model_Data_Abstract
5
+ {
6
+ public function generateXml()
7
+ {
8
+ $xml = new SimpleXMLElement("<order></order>");
9
+
10
+ $this->_arrayToXml($this->getOrder(), $xml);
11
+
12
+ $dom = new DOMDocument('1.0');
13
+ $dom->preserveWhiteSpace = false;
14
+ $dom->formatOutput = true;
15
+ $dom->loadXML($xml->asXML());
16
+
17
+ return $dom->saveXML();
18
+ }
19
+
20
+ protected function _arrayToXml($data, &$xml, $parentKey = "")
21
+ {
22
+ foreach ($data as $key => $value) {
23
+ if (is_array($value) && array_keys($value) === range(0, count($value) - 1)) {
24
+ $this->_arrayToXml($value, $xml, $key);
25
+ } elseif (is_array($value)) {
26
+ if (!is_numeric($key)) {
27
+ $subnode = $xml->addChild($key);
28
+ $this->_arrayToXml($value, $subnode, $key);
29
+ } else {
30
+ $subnode = $xml->addChild($parentKey);
31
+ $this->_arrayToXml($value, $subnode, $key);
32
+ }
33
+ } else {
34
+ $xml->addChild($key,$value);
35
+ }
36
+ }
37
+ }
38
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data/Translator.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ interface Redstage_LumiaryEndpoint_Model_Export_Order_Data_Translator
4
+ {
5
+ public function toOrderData();
6
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Data/Translator/Magento.php ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Model_Export_Order_Data_Translator_Magento
4
+ implements Redstage_LumiaryEndpoint_Model_Export_Order_Data_Translator
5
+ {
6
+ public function toOrderData()
7
+ {
8
+ $args = func_get_args();
9
+
10
+ if (!$args[0]) {
11
+ throw new RuntimeException('Invalid order id argument');
12
+ }
13
+
14
+ $orderId = $args[0];
15
+ $orderData = $this->_generateOrderData($orderId);
16
+
17
+ return $orderData;
18
+ }
19
+
20
+ protected function _generateOrderData($orderId)
21
+ {
22
+ $orderData = new Redstage_LumiaryEndpoint_Model_Export_Order_Data();
23
+ $orderData->setOrder($this->_order($orderId));
24
+
25
+ return $orderData;
26
+ }
27
+
28
+ protected function _order($orderId)
29
+ {
30
+ $order = $this->_getOrder($orderId);
31
+
32
+ $data = array(
33
+ 'created_at' => $this->_createdAt($order),
34
+ 'updated_at' => $this->_updatedAt($order),
35
+ 'currency' => $this->_currency($order),
36
+ 'status' => $this->_status($order),
37
+ 'id' => $this->_id($order),
38
+ 'subtotal_price' => $this->_subtotalPrice($order),
39
+ 'taxes_included' => $this->_taxesIncluded($order),
40
+ 'total_discounts' => $this->_totalDiscounts($order),
41
+ 'total_price' => $this->_totalPrice($order),
42
+ 'total_price_usd' => $this->_totalPriceUsd($order),
43
+ 'total_tax' => $this->_totalTax($order),
44
+ 'total_shipping' => $this->_totalShipping($order),
45
+ 'total_weight' => $this->_totalWeight($order),
46
+ 'order_number' => $this->_orderNumber($order),
47
+ 'store_id' => $this->_storeId($order),
48
+ 'line_items' => $this->_lineItems($order),
49
+ 'billing_address' => $this->_address($order->getBillingAddress()),
50
+ 'shipping_address' => $this->_address($order->getShippingAddress()),
51
+ 'payment_details' => $this->_paymentDetails($order),
52
+ 'customer' => $this->_customer($order)
53
+ );
54
+
55
+ return $data;
56
+ }
57
+
58
+ protected function _getOrder($orderId)
59
+ {
60
+ return Mage::getModel('sales/order')->load($orderId);
61
+ }
62
+
63
+ protected function _createdAt(Mage_Sales_Model_Order $order)
64
+ {
65
+ return $order->getCreatedAt();
66
+ }
67
+
68
+ protected function _updatedAt(Mage_Sales_Model_Order $order)
69
+ {
70
+ return $order->getUpdatedAt();
71
+ }
72
+
73
+ protected function _currency(Mage_Sales_Model_Order $order)
74
+ {
75
+ return $order->getOrderCurrencyCode();
76
+ }
77
+
78
+ protected function _status(Mage_Sales_Model_Order $order)
79
+ {
80
+ return $order->getStatus();
81
+ }
82
+
83
+ protected function _id(Mage_Sales_Model_Order $order)
84
+ {
85
+ return $order->getId();
86
+ }
87
+
88
+ protected function _orderNumber(Mage_Sales_Model_Order $order)
89
+ {
90
+ return $order->getIncrementId();
91
+ }
92
+
93
+ protected function _storeId(Mage_Sales_Model_Order $order)
94
+ {
95
+ return $order->getStoreId();
96
+ }
97
+
98
+ protected function _subtotalPrice(Mage_Sales_Model_Order $order)
99
+ {
100
+ return $order->getSubtotal();
101
+ }
102
+
103
+ protected function _taxesIncluded(Mage_Sales_Model_Order $order)
104
+ {
105
+ return $order->getTaxAmount()? "1" : "0";
106
+ }
107
+
108
+ protected function _totalDiscounts(Mage_Sales_Model_Order $order)
109
+ {
110
+ return $order->getDiscountAmount();
111
+ }
112
+
113
+ protected function _totalPrice(Mage_Sales_Model_Order $order)
114
+ {
115
+ return $order->getGrandTotal();
116
+ }
117
+
118
+ protected function _totalPriceUsd(Mage_Sales_Model_Order $order)
119
+ {
120
+ return $order->getBaseGrandTotal();
121
+ }
122
+
123
+ protected function _totalTax(Mage_Sales_Model_Order $order)
124
+ {
125
+ return $order->getTaxAmount();
126
+ }
127
+
128
+ protected function _totalShipping(Mage_Sales_Model_Order $order)
129
+ {
130
+ return $order->getShippingAmount();
131
+ }
132
+
133
+ protected function _totalWeight(Mage_Sales_Model_Order $order)
134
+ {
135
+ return $order->getWeight();
136
+ }
137
+
138
+ protected function _lineItems(Mage_Sales_Model_Order $order)
139
+ {
140
+ $items = array();
141
+
142
+ foreach ($order->getAllItems() as $item) {
143
+ if ($item->getParentItemId()) {
144
+ continue;
145
+ }
146
+
147
+ $items[] = $this->_item($order, $item);
148
+ }
149
+
150
+ return $items;
151
+ }
152
+
153
+ protected function _item(Mage_Sales_Model_Order $order, Mage_Sales_Model_Order_Item $item)
154
+ {
155
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getSku());
156
+
157
+ $data = array(
158
+ 'product_id' => $this->_productId($item),
159
+ 'name' => $this->_productName($item),
160
+ 'url' => $this->_productUrl($item),
161
+ 'image' => $product?$product->getImageUrl():'',
162
+ 'sku' => $this->_sku($item),
163
+ 'qty' => $item->getQtyOrdered(),
164
+ 'qty_refunded' => $item->getQtyRefunded(),
165
+ 'price' => $this->_price($item),
166
+ 'sale_expires' => $product && $product->getSpecialToDate() ? $product->getSpecialToDate() : "",
167
+ 'sale_price' => $product && $product->getSpecialPrice() ? $product->getSpecialPrice() : $this->_price($item),
168
+ 'cost' => $this->_cost($item),
169
+ 'discount_amount' => $this->_discountAmount($item),
170
+ 'amount_refunded' => $this->_amountRefunded($item),
171
+ 'row_total' => $this->_rowTotal($item),
172
+ 'source' => 'magento',
173
+ 'status' => $product?$product->getStatus():"0",
174
+ 'tags' => $this->_tags($item),
175
+ 'categories' => $this->_categories($item),
176
+ 'attributes' => $this->_attributes($item, array(
177
+ 'type_id',
178
+ 'entity_type_id',
179
+ 'entity_id',
180
+ 'old_id',
181
+ 'attribute_set_id',
182
+ 'name',
183
+ 'sku',
184
+ 'status',
185
+ 'price',
186
+ 'special_price',
187
+ 'cost',
188
+ 'url_key',
189
+ 'url_path',
190
+ 'category_ids',
191
+ 'required_options',
192
+ 'has_options',
193
+ 'image',
194
+ 'image_label',
195
+ 'small_image',
196
+ 'small_image_label',
197
+ 'thumbnail',
198
+ 'thumbnail_label',
199
+ 'media_gallery',
200
+ 'gallery',
201
+ 'custom_design',
202
+ 'custom_design_from',
203
+ 'custom_design_to',
204
+ 'custom_layout_update',
205
+ 'page_layout',
206
+ 'options_container'
207
+ ))
208
+
209
+ );
210
+
211
+ if ($item->getProductType() == 'configurable') {
212
+ $data['options'] = $this->_itemOptions($item);
213
+ $data['configurable_product_data'] = array(
214
+ 'sku' => $this->_configurableSku($item),
215
+ 'name' => $this->_configurableName($item)
216
+ );
217
+ }
218
+
219
+ return $data;
220
+ }
221
+
222
+ protected function _productId(Mage_Sales_Model_Order_Item $item)
223
+ {
224
+ return $item->getProductId();
225
+ }
226
+
227
+ protected function _sku(Mage_Sales_Model_Order_Item $item)
228
+ {
229
+ $sku = $item->getProduct()->getSku();
230
+
231
+ if ($item->getProductType() == 'configurable') {
232
+ $options = $item->getProductOptions();
233
+
234
+ $sku = $options['simple_sku'];
235
+ }
236
+
237
+ return $sku ? $sku : $item->getSku();
238
+ }
239
+
240
+ protected function _productName(Mage_Sales_Model_Order_Item $item)
241
+ {
242
+ if ($item->getProductType() == 'configurable') {
243
+ $sku = $this->_sku($item);
244
+
245
+ $product = Mage::getModel('catalog/product');
246
+ $product->load($product->getIdBySku($sku));
247
+
248
+ return $product->getName();
249
+ }
250
+
251
+ return $item->getName();
252
+ }
253
+
254
+ protected function _price(Mage_Sales_Model_Order_Item $item)
255
+ {
256
+ return $item->getPrice();
257
+ }
258
+
259
+ protected function _cost(Mage_Sales_Model_Order_Item $item)
260
+ {
261
+ return $item->getBaseCost();
262
+ }
263
+
264
+ protected function _discountAmount(Mage_Sales_Model_Order_Item $item)
265
+ {
266
+ return $item->getDiscountAmount();
267
+ }
268
+
269
+ protected function _amountRefunded(Mage_Sales_Model_Order_Item $item)
270
+ {
271
+ return $item->getAmountRefunded();
272
+ }
273
+
274
+ protected function _rowTotal(Mage_Sales_Model_Order_Item $item)
275
+ {
276
+ return $item->getRowTotal();
277
+ }
278
+
279
+ protected function _productUrl(Mage_Sales_Model_Order_Item $item)
280
+ {
281
+ if ($item->getParentItemId()) {
282
+ $item = Mage::getModel('sales/order_item')->load($item->getParentItemId());
283
+ }
284
+
285
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
286
+ return $product->getId() ? $product->getProductUrl() : Mage::app()->getStore($item->getStoreId())->getBaseUrl();
287
+ }
288
+
289
+ protected function _tags(Mage_Sales_Model_Order_Item $item)
290
+ {
291
+ if ($item->getParentItemId()) {
292
+ $item = Mage::getModel('sales/order_item')->load($item->getParentItemId());
293
+ }
294
+
295
+ $productTags = array();
296
+ $tagCollection = Mage::getModel('tag/tag')->getResourceCollection()
297
+ ->addPopularity()
298
+ ->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus())
299
+ ->addProductFilter($item->getProductId())
300
+ ->setFlag('relation', true)
301
+ ->addStoreFilter(Mage::app()->getStore()->getId())
302
+ ->setActiveFilter()
303
+ ->load();
304
+ $tags = $tagCollection->getItems();
305
+
306
+ foreach ($tags as $tag) {
307
+ $productTags[] = $tag->getName();
308
+ }
309
+
310
+ return $productTags;
311
+ }
312
+
313
+ protected function _categories(Mage_Sales_Model_Order_Item $item)
314
+ {
315
+ $product = $item->getProduct();
316
+
317
+ if (!$product || !$product->getId()) {
318
+ return array();
319
+ }
320
+
321
+ $data = array();
322
+
323
+ $categories = $product->getCategoryCollection()
324
+ ->addAttributeToSelect('name');
325
+ foreach($categories as $category) {
326
+ $data[] = array(
327
+ "id" => $category->getId(),
328
+ "name" => $category->getName()
329
+ );
330
+ }
331
+
332
+ return $data;
333
+ }
334
+
335
+ protected function _attributes(Mage_Sales_Model_Order_Item $item, array $exclude = array())
336
+ {
337
+ $product = Mage::getModel('catalog/product');
338
+
339
+ if ($item->getProductType() == 'configurable') {
340
+ $sku = $this->_sku($item);
341
+
342
+ $product->load($product->getIdBySku($sku));
343
+ } else {
344
+ $product = $item->getProduct();
345
+ }
346
+
347
+ $data = array();
348
+ $attributes = $product->getAttributes();
349
+
350
+ foreach ($attributes as $attribute) {
351
+ $key = $attribute->getAttributeCode();
352
+
353
+ if (in_array($key, $exclude)) {
354
+ continue;
355
+ }
356
+
357
+ $value = $product->getResource()->getAttribute($attribute->getAttributeCode())->getFrontend()->getValue($product);
358
+
359
+ $data[$key] = $value;
360
+
361
+ }
362
+
363
+ return $data;
364
+ }
365
+
366
+ protected function _address(Mage_Customer_Model_Address_Abstract $address)
367
+ {
368
+ if (!$address) {
369
+ return array();
370
+ }
371
+
372
+ return array(
373
+ 'address1' => $address->getStreet(1),
374
+ 'address2' => $address->getStreet(2),
375
+ 'city' => $address->getCity(),
376
+ 'company' => $address->getCompany(),
377
+ 'first_name' => $address->getFirstname(),
378
+ 'last_name' => $address->getLastname(),
379
+ 'phone' => $address->getTelephone(),
380
+ 'state' => $address->getRegion(),
381
+ 'zip' => $address->getPostcode(),
382
+ 'country_code' => $address->getCountryId(),
383
+ );
384
+ }
385
+
386
+ protected function _customer(Mage_Sales_Model_Order $order)
387
+ {
388
+ $customerId = $order->getCustomerId();
389
+
390
+ if (!$customerId) {
391
+ return array(
392
+ 'email' => $order->getCustomerEmail(),
393
+ 'first_name' => $order->getCustomerFirstname(),
394
+ 'last_name' => $order->getCustomerLastname(),
395
+ 'default_address' => $this->_address($order->getBillingAddress())
396
+ );
397
+ }
398
+
399
+ $customer = Mage::getModel('customer/customer')->load($customerId);
400
+ $group = Mage::getModel('customer/group')->load($customer->getGroupId());
401
+
402
+ $data = array(
403
+ 'id' => $customerId,
404
+ 'created_at' => $customer->getCreatedAt(),
405
+ 'email' => $customer->getEmail(),
406
+ 'first_name' => $customer->getFirstname(),
407
+ 'last_name' => $customer->getLastname(),
408
+ 'group' => $group->getCustomerGroupCode(),
409
+
410
+ );
411
+
412
+ if ($customer->getDefaultBillingAddress()) {
413
+ $data['default_address'] = $this->_address($customer->getDefaultBillingAddress());
414
+ }
415
+
416
+ return $data;
417
+ }
418
+
419
+ protected function _paymentDetails(Mage_Sales_Model_Order $order)
420
+ {
421
+ $payment = $order->getPayment();
422
+
423
+ if (!$payment->getCcExpYear()) {
424
+ return array();
425
+ }
426
+
427
+ return array(
428
+ 'credit_card_number' => $payment->getCcLast4(),
429
+ 'credit_card_company' => '',
430
+ 'credit_card_exp' => $payment->getCcExpYear() . "/" . $payment->getCcExpMonth()
431
+ );
432
+ }
433
+
434
+ protected function _itemOptions(Mage_Sales_Model_Order_Item $item)
435
+ {
436
+ $options = $item->getProductOptions();
437
+ $info = $options['attributes_info'];
438
+ $data = array();
439
+
440
+ foreach ($info as $v) {
441
+ $label = $v['label'];
442
+ $data[$label] = $v['value'];
443
+ }
444
+
445
+ return $data;
446
+ }
447
+
448
+ protected function _configurableSku(Mage_Sales_Model_Order_Item $item)
449
+ {
450
+ $product = $item->getProduct();
451
+
452
+ return $product->getSku();
453
+ }
454
+
455
+ protected function _configurableName(Mage_Sales_Model_Order_Item $item)
456
+ {
457
+ $product = $item->getProduct();
458
+
459
+ return $product->getName();
460
+ }
461
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Export/Order/Exporter.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Model_Export_Order_Exporter
4
+ {
5
+ public function prepareOrder($orderId)
6
+ {
7
+ $translator = Mage::getModel('lumiaryendpoint/export_order_data_translator_magento');
8
+ $data = $translator->toOrderData($orderId);
9
+
10
+ return $data;
11
+ }
12
+
13
+ public function exportOrders($fromDate, $toDate, $pageNumber = 1, $limit = 1)
14
+ {
15
+ /* Timer */
16
+ $timer = Mage::getModel('lumiaryendpoint/operation_timer')->start();
17
+
18
+ /* Default Parameters */
19
+ $limit = (int) $limit ? $limit : 1;
20
+ $pageNumber = (int) $pageNumber ? $pageNumber : 1;
21
+
22
+ $data = array();
23
+ $fromDate = date('Y-m-d H:i:s', strtotime($fromDate));
24
+ $toDate = date('Y-m-d H:i:s', strtotime($toDate));
25
+ $orders = Mage::getModel('sales/order')->getCollection()
26
+ ->addAttributeToFilter('updated_at', array('from'=>$fromDate, 'to'=>$toDate))
27
+ ->setPageSize($limit)
28
+ ->setCurPage($pageNumber);
29
+ //->addAttributeToFilter('status', array('eq' => Mage_Sales_Model_Order::STATE_COMPLETE));
30
+
31
+ if ($orders->getLastPageNumber() >= $pageNumber) {
32
+ foreach ($orders as $order) {
33
+ $data[] = $this->prepareOrder($order->getId())->getData();
34
+ }
35
+ }
36
+
37
+ return $data;
38
+ }
39
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Operation/Status.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Model_Operation_Status
4
+ extends Varien_Object
5
+ {
6
+ public function successful($data)
7
+ {
8
+ $this->setSuccess(true);
9
+ $this->setError(false);
10
+
11
+ foreach ($data as $k=>$v) {
12
+ $this->setData($k, $v);
13
+ }
14
+
15
+ return $this;
16
+ }
17
+
18
+ public function failed($message = "")
19
+ {
20
+ $this->setSuccess(false);
21
+ $this->setError(true);
22
+ $this->setMessage($message);
23
+
24
+ return $this;
25
+ }
26
+ }
app/code/community/Redstage/LumiaryEndpoint/Model/Operation/Timer.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Model_Operation_Timer
4
+ {
5
+ protected $_startTime;
6
+ protected $_endTime;
7
+
8
+ public function start()
9
+ {
10
+ $this->_startTime = microtime(true);
11
+
12
+ return $this;
13
+ }
14
+
15
+ public function isStarted()
16
+ {
17
+ return isset($this->_startTime);
18
+ }
19
+
20
+ public function stop($decimals = 2)
21
+ {
22
+ if(!$this->isStarted()) {
23
+ return 0;
24
+ }
25
+
26
+ $this->_endTime = microtime(true);
27
+ $time = $this->_endTime - $this->_startTime;
28
+ $this->reset();
29
+
30
+ return number_format($time, $decimals);
31
+ }
32
+
33
+ public function isStopped()
34
+ {
35
+ return isset($this->$_endTime);
36
+ }
37
+
38
+ public function lap($decimals = 2)
39
+ {
40
+ $lapTime = $this->stop($decimals);
41
+ $this->start();
42
+
43
+ return $this;
44
+ }
45
+
46
+ public function check($decimals = 2)
47
+ {
48
+ return number_format(microtime(true) - $this->_startTime, $decimals);
49
+ }
50
+
51
+ public function reset()
52
+ {
53
+ $this->_startTime = null;
54
+ $this->_endTime = null;
55
+
56
+ return $this;
57
+ }
58
+ }
app/code/community/Redstage/LumiaryEndpoint/controllers/Adminhtml/Lumiary/TokenController.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_Adminhtml_Lumiary_TokenController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ public function generateAction()
7
+ {
8
+ echo Mage::helper('lumiaryendpoint')->generateToken();
9
+ }
10
+ }
app/code/community/Redstage/LumiaryEndpoint/controllers/OrderController.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Redstage_LumiaryEndpoint_OrderController
4
+ extends Mage_Core_Controller_Front_Action
5
+ {
6
+ public function listAction()
7
+ {
8
+ $defaultParams = array("from" => null, "to" => date("Y-m-d"), "page" => 1, "limit" => 1);
9
+ $params = array_merge($defaultParams, $this->getRequest()->getParams());
10
+
11
+ if (!Mage::helper('lumiaryendpoint')->isEnabled()
12
+ || !Mage::helper('lumiaryendpoint')->checkToken($params['token'])
13
+ ) {
14
+ header("HTTP/1.1 401 Unauthorized");
15
+ exit;
16
+ }
17
+
18
+ $exporter = Mage::getModel('lumiaryendpoint/export_order_exporter');
19
+
20
+ $data = $exporter->exportOrders($params['from'], $params['to'], $params['page'], $params['limit']);
21
+
22
+ $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
23
+ $this->getResponse()->setBody(json_encode($data));
24
+ //exit;
25
+ }
26
+
27
+ }
app/code/community/Redstage/LumiaryEndpoint/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <lumiaryendpoint>
12
+ <title>Lumiary Endpoint</title>
13
+ </lumiaryendpoint>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/community/Redstage/LumiaryEndpoint/etc/config.xml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Redstage_LumiaryEndpoint>
5
+ <version>1.0.0.0</version>
6
+ </Redstage_LumiaryEndpoint>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <lumiaryendpoint>
11
+ <class>Redstage_LumiaryEndpoint_Model</class>
12
+ </lumiaryendpoint>
13
+ </models>
14
+ <resources>
15
+ <lumiaryendpoint_setup>
16
+ <setup>
17
+ <module>Redstage_LumiaryEndpoint</module>
18
+ </setup>
19
+ <connections>
20
+ <use>core_setup</use>
21
+ </connections>
22
+ </lumiaryendpoint_setup>
23
+ <lumiaryendpoint_write>
24
+ <connection>
25
+ <use>core_write</use>
26
+ </connection>
27
+ </lumiaryendpoint_write>
28
+ <lumiaryendpoint_read>
29
+ <connection>
30
+ <use>core_read</use>
31
+ </connection>
32
+ </lumiaryendpoint_read>
33
+ </resources>
34
+ <blocks>
35
+ <lumiaryendpoint>
36
+ <class>Redstage_LumiaryEndpoint_Block</class>
37
+ </lumiaryendpoint>
38
+ </blocks>
39
+ <helpers>
40
+ <lumiaryendpoint>
41
+ <class>Redstage_LumiaryEndpoint_Helper</class>
42
+ </lumiaryendpoint>
43
+ </helpers>
44
+ </global>
45
+ <frontend>
46
+ <routers>
47
+ <lumiaryendpoint>
48
+ <use>standard</use>
49
+ <args>
50
+ <module>Redstage_LumiaryEndpoint</module>
51
+ <frontName>lumiaryendpoint</frontName>
52
+ </args>
53
+ </lumiaryendpoint>
54
+ </routers>
55
+ </frontend>
56
+ <admin>
57
+ <routers>
58
+ <adminhtml>
59
+ <args>
60
+ <modules>
61
+ <lumiaryendpoint after="Mage_Adminhtml">Redstage_LumiaryEndpoint_Adminhtml</lumiaryendpoint>
62
+ </modules>
63
+ </args>
64
+ </adminhtml>
65
+ </routers>
66
+ </admin>
67
+ <default>
68
+ <lumiaryendpoint>
69
+ <core>
70
+ <enabled>0</enabled>
71
+ </core>
72
+ <logging>
73
+ <enabled>1</enabled>
74
+ <file>lumiaryendpoint.log</file>
75
+ </logging>
76
+ </lumiaryendpoint>
77
+ </default>
78
+ </config>
app/code/community/Redstage/LumiaryEndpoint/etc/system.xml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <redstage translate="label">
5
+ <label>Redstage</label>
6
+ <sort_order>150</sort_order>
7
+ </redstage>
8
+ </tabs>
9
+ <sections>
10
+ <lumiaryendpoint translate="label">
11
+ <label>Lumiary Endpoint</label>
12
+ <tab>redstage</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</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
+ <groups>
19
+ <core translate="label">
20
+ <label>Lumiary Endpoint General Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>0</show_in_website>
25
+ <show_in_store>0</show_in_store>
26
+ <fields>
27
+ <enabled translate="label comment">
28
+ <label>Enabled</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>10</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>0</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
+ </enabled>
36
+ <token translate="label comment">
37
+ <label>Endpoint Authentication Token</label>
38
+ <frontend_type>button</frontend_type>
39
+ <frontend_model>lumiaryendpoint/adminhtml_system_config_form_button</frontend_model>
40
+ <sort_order>20</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>0</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </token>
45
+ </fields>
46
+ </core>
47
+ <logging translate="label">
48
+ <label>Logging</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>100</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>0</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ <fields>
55
+ <enabled translate="label comment">
56
+ <label>Enabled</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>10</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>0</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </enabled>
64
+ <file translate="label comment">
65
+ <label>Log File Name</label>
66
+ <comment><![CDATA[File is located in {{base_dir}}/var/log]]></comment>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>20</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>0</show_in_website>
71
+ <show_in_store>0</show_in_store>
72
+ </file>
73
+ </fields>
74
+ </logging>
75
+ </groups>
76
+ </lumiaryendpoint>
77
+ </sections>
78
+ </config>
app/code/community/Redstage/LumiaryEndpoint/sql/lumiaryendpoint_setup/install-1.0.0.0.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $config = new Mage_Core_Model_Config();
6
+ $config ->saveConfig('lumiaryendpoint/core/token', Mage::helper('lumiaryendpoint')->generateToken(), 'default', 0);
7
+
8
+ $installer->endSetup();
app/design/adminhtml/default/default/template/lumiaryendpoint/system/config/button.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <input type="text" class="input-text" readonly="readonly" value="<?php echo $this->getToken() ?>" id="lumiaryendpoint_core_token" name="groups[core][fields][token][value]" />
2
+ <script type="text/javascript">
3
+ //<![CDATA[
4
+ function check() {
5
+
6
+ new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
7
+ method: 'get',
8
+ onSuccess: function(transport){
9
+ if (transport.responseText){
10
+ $('lumiaryendpoint_core_token').value = transport.responseText;
11
+ }
12
+ }
13
+ });
14
+ }
15
+ //]]>
16
+ </script>
17
+ <br /><br />
18
+ <?php echo $this->getButtonHtml() ?>
app/etc/modules/Redstage_LumiaryEndpoint.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Redstage_LumiaryEndpoint>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Sales />
9
+ </depends>
10
+ </Redstage_LumiaryEndpoint>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Redstage_LumiaryEndpoint</name>
4
+ <version>1.0.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="https://opensource.org/licenses/MIT">Massachusetts Institute of Technology License (MITL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Lumiary brings a retailer's customer data into one platform and powers intelligent segmentation for marketers.</summary>
10
+ <description>Lumiary is a CRM application that retailers use to aggregate, understand and utilize their customer information. Lumiary imports data from any source of customer interactions, including eCommerce systems (like Magento), point-of-sale systems, email, customer support, NPS, reviews, demographics and more. By aggregating and normalizing this data, Lumiary enables brands to understand their customers better and improve repeat purchase rates through segmentation.&#xD;
11
+ Our Magento extension is a simple way to export data from Magento to Lumiary. Once installed, the data export is automatic, secure and real-time, so your customer data is always safe and up-to-date.</description>
12
+ <notes>==== 1.0.0.0 ====&#xD;
13
+ * Implemented JSON endpoint to export data from Magento to Lumiary</notes>
14
+ <authors><author><name>Carrington Williams</name><user>lumiary</user><email>cw@lumiary.com</email></author></authors>
15
+ <date>2016-03-28</date>
16
+ <time>22:10:17</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="Redstage_LumiaryEndpoint.xml" hash="4f2100e5fd3b40ae5b58cd9ea5c66b9c"/></dir></target><target name="magecommunity"><dir name="Redstage"><dir name="LumiaryEndpoint"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="cb338c5aafebaefdf013975fae96be8c"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f6d65b859d5c4ea709efa24bd87b2ad0"/><file name="Logger.php" hash="ab07de8e3fadbd9ffdf916dec6a40544"/></dir><dir name="Model"><dir name="Data"><file name="Abstract.php" hash="86683bd32bc2c0a33d15f4eea88adead"/><dir name="Table"><file name="Abstract.php" hash="5ff81e3bc2f8287df5f7795b0b89d521"/></dir></dir><dir name="Export"><dir name="Order"><dir name="Data"><dir name="Translator"><file name="Magento.php" hash="a82d3064b2b265c286b97eb749ae4fa4"/></dir><file name="Translator.php" hash="bda87760fca3d1d355c8e5e74089f8c9"/></dir><file name="Data.php" hash="4e245ae305e00dcb4a6fa96f93aeffe4"/><file name="Exporter.php" hash="e7328d6c75e0ff2c9d1599ae240c3ca7"/></dir></dir><dir name="Operation"><file name="Status.php" hash="22c2768393fa3622b1b7c3f443fc64e2"/><file name="Timer.php" hash="8339670e2657d65856a440dfa7cffd4b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Lumiary"><file name="TokenController.php" hash="4572abcc6f59a0fddb6f259ad20b1d29"/></dir></dir><file name="OrderController.php" hash="b637d80da1648eee8f50aa8a52440b0f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9fb5b700881973ac6948d8c6a61a5a29"/><file name="config.xml" hash="6c3dd4b31f00df48255d838cfe6f76a9"/><file name="system.xml" hash="f74fe6db66461e4dbe76f2e63921d816"/></dir><dir name="sql"><dir name="lumiaryendpoint_setup"><file name="install-1.0.0.0.php" hash="79de18c5b9500ff5b0bcd8f89aae7bd4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="lumiaryendpoint"><dir name="system"><dir name="config"><file name="button.phtml" hash="762250e16b90fcda79354c4c01579e1c"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
20
+ </package>