Version Notes
Stable public release
Download this release
Release Info
Developer | Magento Core Team |
Extension | SavvyCube_Ecommerce_Analytics_Connector |
Version | 0.0.5 |
Comparing to | |
See all releases |
Code changes from version 0.0.3 to 0.0.5
- app/code/community/SavvyCube/Connector/Helper/Authorization.php +41 -23
- app/code/community/SavvyCube/Connector/Helper/Data.php +135 -19
- app/code/community/SavvyCube/Connector/Model/Api/Abstract.php +174 -45
- app/code/community/SavvyCube/Connector/Model/Api/Address.php +38 -23
- app/code/community/SavvyCube/Connector/Model/Api/Customer.php +0 -106
- app/code/community/SavvyCube/Connector/Model/Api/Invoice.php +83 -0
- app/code/community/SavvyCube/Connector/Model/Api/Invoiceitem.php +71 -0
- app/code/community/SavvyCube/Connector/Model/Api/Notification.php +44 -0
- app/code/community/SavvyCube/Connector/Model/Api/Order.php +113 -64
- app/code/community/SavvyCube/Connector/Model/Api/Ordered.php +0 -99
- app/code/community/SavvyCube/Connector/Model/Api/Orderitem.php +112 -0
- app/code/community/SavvyCube/Connector/Model/Api/Product.php +0 -140
- app/code/community/SavvyCube/Connector/Model/Api/Refund.php +83 -0
- app/code/community/SavvyCube/Connector/Model/Api/Refunditem.php +70 -0
- app/code/community/SavvyCube/Connector/Model/Api/Shipment.php +51 -0
- app/code/community/SavvyCube/Connector/Model/Api/Shipmentitem.php +52 -0
- app/code/community/SavvyCube/Connector/Model/Api/Store.php +0 -75
- app/code/community/SavvyCube/Connector/Model/Api/Transaction.php +42 -40
- app/code/community/SavvyCube/Connector/Model/Api/Version.php +10 -10
- app/code/community/SavvyCube/Connector/Model/Nonce.php +38 -24
- app/code/community/SavvyCube/Connector/controllers/ApiController.php +100 -37
- app/code/community/SavvyCube/Connector/etc/config.xml +33 -22
- app/code/community/SavvyCube/Connector/sql/wCube_setup/mysql4-upgrade-0.0.4-0.0.5.php +32 -0
- package.xml +4 -4
app/code/community/SavvyCube/Connector/Helper/Authorization.php
CHANGED
@@ -29,8 +29,12 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
29 |
*/
|
30 |
public function initConsumerKey()
|
31 |
{
|
32 |
-
$plainConsumerKey = $this->
|
33 |
-
$this->
|
|
|
|
|
|
|
|
|
34 |
return true;
|
35 |
}
|
36 |
|
@@ -39,9 +43,19 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
39 |
*
|
40 |
* @return string
|
41 |
*/
|
42 |
-
private function
|
43 |
{
|
44 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -49,7 +63,7 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
49 |
*
|
50 |
* @return string
|
51 |
*/
|
52 |
-
private function
|
53 |
{
|
54 |
return
|
55 |
Mage::getModuleDir("", 'SavvyCube_Connector') . DS .
|
@@ -67,10 +81,12 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
67 |
*/
|
68 |
public function getActivateUrl()
|
69 |
{
|
70 |
-
$url = $this->
|
71 |
. "datasources/?act=connect&type=0"
|
72 |
. "&url=" . urlencode(Mage::getBaseUrl())
|
73 |
-
. "&
|
|
|
|
|
74 |
return $url;
|
75 |
}
|
76 |
|
@@ -79,7 +95,7 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
79 |
*
|
80 |
* @return string
|
81 |
*/
|
82 |
-
private function
|
83 |
{
|
84 |
return (string) Mage::getStoreConfig('wCube/cube_crypt/consumer_endpoint');
|
85 |
}
|
@@ -87,14 +103,12 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
87 |
/**
|
88 |
* store consumer secret in configuration with encryption
|
89 |
*/
|
90 |
-
private function
|
91 |
{
|
92 |
-
Mage::getConfig()->saveConfig(
|
93 |
-
$rsaProvider = new Zend_Crypt_Rsa(array('certificatePath' => $this->
|
94 |
$encryptedKey = $rsaProvider->encrypt($key, $rsaProvider->getPublicKey(), Zend_Crypt_Rsa::BASE64);
|
95 |
-
Mage::getConfig()->saveConfig(
|
96 |
-
Mage::getConfig()->cleanCache();
|
97 |
-
Mage::app()->reinitStores();
|
98 |
}
|
99 |
|
100 |
/**
|
@@ -102,9 +116,9 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
102 |
*
|
103 |
* @return string
|
104 |
*/
|
105 |
-
private function
|
106 |
{
|
107 |
-
return (string)Mage::getStoreConfig(
|
108 |
}
|
109 |
|
110 |
/**
|
@@ -112,9 +126,9 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
112 |
*
|
113 |
* @return string
|
114 |
*/
|
115 |
-
public function
|
116 |
{
|
117 |
-
return Mage::helper('core')->decrypt((string)Mage::getStoreConfig(
|
118 |
}
|
119 |
|
120 |
/**
|
@@ -124,15 +138,17 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
124 |
*
|
125 |
* @return bool
|
126 |
*/
|
127 |
-
public function checkRequest(
|
128 |
{
|
129 |
if (isset($_SERVER['HTTP_X_WSSE'])) {
|
130 |
-
$xWsse = $this->
|
131 |
if ($xWsse) {
|
132 |
/** @var SavvyCube_Connector_Model_Nonce $nonceModel */
|
133 |
$nonceModel = Mage::getModel('wCube/nonce');
|
|
|
|
|
134 |
if ($nonceModel->checkNonce($xWsse['Nonce'], $xWsse['Created'])) {
|
135 |
-
$calculatedDigest = base64_encode((sha1($xWsse['Nonce'] . $xWsse['Created'] . $this->
|
136 |
return $calculatedDigest === $xWsse['SecretDigest'];
|
137 |
}
|
138 |
}
|
@@ -141,7 +157,7 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
141 |
}
|
142 |
|
143 |
|
144 |
-
private function
|
145 |
{
|
146 |
$wsse = '/UsernameToken Username="([^"]+)", SecretDigest="([^"]+)", Nonce="([^"]+)", Created="([^"]+)"/';
|
147 |
if (1 === preg_match($wsse, $token, $matches)) {
|
@@ -162,8 +178,10 @@ class SavvyCube_Connector_Helper_Authorization extends Mage_Core_Helper_Abstract
|
|
162 |
public function getNonceLifetime($secondsFormat = false)
|
163 |
{
|
164 |
$lifeTimeInMinutes = (string) Mage::getStoreConfig('wCube/cube_crypt/nonce_lifetime');
|
165 |
-
|
|
|
166 |
return $lifeTimeInMinutes * 60;
|
|
|
167 |
|
168 |
return $lifeTimeInMinutes;
|
169 |
}
|
29 |
*/
|
30 |
public function initConsumerKey()
|
31 |
{
|
32 |
+
$plainConsumerKey = $this->generateNewKey();
|
33 |
+
$eKey = $this->generateNewEKey();
|
34 |
+
$this->setCurrentKey($plainConsumerKey);
|
35 |
+
$this->setCurrentKey($eKey, 'e');
|
36 |
+
Mage::getConfig()->cleanCache();
|
37 |
+
Mage::app()->reinitStores();
|
38 |
return true;
|
39 |
}
|
40 |
|
43 |
*
|
44 |
* @return string
|
45 |
*/
|
46 |
+
private function generateNewKey()
|
47 |
{
|
48 |
+
return mcrypt_create_iv(self::CONSUMER_KEY_LENGTH);
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* function generates new traffic encryption key
|
53 |
+
*
|
54 |
+
* @return string
|
55 |
+
*/
|
56 |
+
private function generateNewEKey()
|
57 |
+
{
|
58 |
+
return mcrypt_create_iv(16);
|
59 |
}
|
60 |
|
61 |
/**
|
63 |
*
|
64 |
* @return string
|
65 |
*/
|
66 |
+
private function getCert()
|
67 |
{
|
68 |
return
|
69 |
Mage::getModuleDir("", 'SavvyCube_Connector') . DS .
|
81 |
*/
|
82 |
public function getActivateUrl()
|
83 |
{
|
84 |
+
$url = $this->getConsumerEndpoint()
|
85 |
. "datasources/?act=connect&type=0"
|
86 |
. "&url=" . urlencode(Mage::getBaseUrl())
|
87 |
+
. "&secure_url=" . urlencode(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, true))
|
88 |
+
. "&key=" . rawurlencode($this->getCurrentEncryptedKey())
|
89 |
+
. "&e_key=" . rawurlencode($this->getCurrentEncryptedKey('e'));
|
90 |
return $url;
|
91 |
}
|
92 |
|
95 |
*
|
96 |
* @return string
|
97 |
*/
|
98 |
+
private function getConsumerEndpoint()
|
99 |
{
|
100 |
return (string) Mage::getStoreConfig('wCube/cube_crypt/consumer_endpoint');
|
101 |
}
|
103 |
/**
|
104 |
* store consumer secret in configuration with encryption
|
105 |
*/
|
106 |
+
private function setCurrentKey($key, $type = 'consumer')
|
107 |
{
|
108 |
+
Mage::getConfig()->saveConfig("cube_crypt/{$type}_secret", Mage::helper('core')->encrypt($key));
|
109 |
+
$rsaProvider = new Zend_Crypt_Rsa(array('certificatePath' => $this->getCert()));
|
110 |
$encryptedKey = $rsaProvider->encrypt($key, $rsaProvider->getPublicKey(), Zend_Crypt_Rsa::BASE64);
|
111 |
+
Mage::getConfig()->saveConfig("cube_crypt/{$type}_encrypted", $encryptedKey);
|
|
|
|
|
112 |
}
|
113 |
|
114 |
/**
|
116 |
*
|
117 |
* @return string
|
118 |
*/
|
119 |
+
private function getCurrentEncryptedKey($type = 'consumer')
|
120 |
{
|
121 |
+
return (string)Mage::getStoreConfig("cube_crypt/{$type}_encrypted");
|
122 |
}
|
123 |
|
124 |
/**
|
126 |
*
|
127 |
* @return string
|
128 |
*/
|
129 |
+
public function getCurrentKey($type = 'consumer')
|
130 |
{
|
131 |
+
return Mage::helper('core')->decrypt((string)Mage::getStoreConfig("cube_crypt/{$type}_secret"));
|
132 |
}
|
133 |
|
134 |
/**
|
138 |
*
|
139 |
* @return bool
|
140 |
*/
|
141 |
+
public function checkRequest()
|
142 |
{
|
143 |
if (isset($_SERVER['HTTP_X_WSSE'])) {
|
144 |
+
$xWsse = $this->parseToken($_SERVER['HTTP_X_WSSE']);
|
145 |
if ($xWsse) {
|
146 |
/** @var SavvyCube_Connector_Model_Nonce $nonceModel */
|
147 |
$nonceModel = Mage::getModel('wCube/nonce');
|
148 |
+
$xWsse['Nonce'] = urldecode($xWsse['Nonce']);
|
149 |
+
$xWsse['Created'] = urldecode($xWsse['Created']);
|
150 |
if ($nonceModel->checkNonce($xWsse['Nonce'], $xWsse['Created'])) {
|
151 |
+
$calculatedDigest = base64_encode((sha1($xWsse['Nonce'] . $xWsse['Created'] . $this->getCurrentKey())));
|
152 |
return $calculatedDigest === $xWsse['SecretDigest'];
|
153 |
}
|
154 |
}
|
157 |
}
|
158 |
|
159 |
|
160 |
+
private function parseToken($token)
|
161 |
{
|
162 |
$wsse = '/UsernameToken Username="([^"]+)", SecretDigest="([^"]+)", Nonce="([^"]+)", Created="([^"]+)"/';
|
163 |
if (1 === preg_match($wsse, $token, $matches)) {
|
178 |
public function getNonceLifetime($secondsFormat = false)
|
179 |
{
|
180 |
$lifeTimeInMinutes = (string) Mage::getStoreConfig('wCube/cube_crypt/nonce_lifetime');
|
181 |
+
|
182 |
+
if ($secondsFormat) {
|
183 |
return $lifeTimeInMinutes * 60;
|
184 |
+
}
|
185 |
|
186 |
return $lifeTimeInMinutes;
|
187 |
}
|
app/code/community/SavvyCube/Connector/Helper/Data.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -19,6 +20,14 @@
|
|
19 |
*/
|
20 |
class SavvyCube_Connector_Helper_Data extends Mage_Core_Helper_Abstract
|
21 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* return module log name
|
24 |
*
|
@@ -31,14 +40,15 @@ class SavvyCube_Connector_Helper_Data extends Mage_Core_Helper_Abstract
|
|
31 |
|
32 |
public function getCurrentModuleVersion()
|
33 |
{
|
34 |
-
return (string)
|
35 |
}
|
36 |
|
37 |
public function getDesiredVersion()
|
38 |
{
|
39 |
$configVersion = Mage::getStoreConfig('wCube/module/desired');
|
40 |
-
if ($configVersion)
|
41 |
return $configVersion;
|
|
|
42 |
|
43 |
return $this->getCurrentModuleVersion();
|
44 |
}
|
@@ -55,35 +65,141 @@ class SavvyCube_Connector_Helper_Data extends Mage_Core_Helper_Abstract
|
|
55 |
return array(
|
56 |
new Varien_Object(
|
57 |
array(
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
)
|
62 |
),
|
63 |
new Varien_Object(
|
64 |
array(
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
)
|
69 |
)
|
70 |
);
|
71 |
}
|
72 |
|
73 |
-
public function addAdminNotification($title, $description
|
74 |
{
|
75 |
/** @var Mage_AdminNotification_Model_Inbox $inbox */
|
76 |
$inbox = Mage::getModel('adminNotification/inbox');
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
-
$
|
81 |
-
$inbox->parse(array(array(
|
82 |
-
'severity' => Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR,
|
83 |
-
'date_added' => $date,
|
84 |
-
'title' => $title,
|
85 |
-
'description' => $description,
|
86 |
-
'url' => $url,
|
87 |
-
)));
|
88 |
}
|
89 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
20 |
*/
|
21 |
class SavvyCube_Connector_Helper_Data extends Mage_Core_Helper_Abstract
|
22 |
{
|
23 |
+
private $dbRead;
|
24 |
+
|
25 |
+
private $resource;
|
26 |
+
|
27 |
+
private $tableName;
|
28 |
+
|
29 |
+
const AFFECTED_ORDER_CACHE_PATH = 'savvy_affected_orders';
|
30 |
+
|
31 |
/**
|
32 |
* return module log name
|
33 |
*
|
40 |
|
41 |
public function getCurrentModuleVersion()
|
42 |
{
|
43 |
+
return (string)Mage::getConfig()->getNode()->modules->SavvyCube_Connector->version;
|
44 |
}
|
45 |
|
46 |
public function getDesiredVersion()
|
47 |
{
|
48 |
$configVersion = Mage::getStoreConfig('wCube/module/desired');
|
49 |
+
if ($configVersion) {
|
50 |
return $configVersion;
|
51 |
+
}
|
52 |
|
53 |
return $this->getCurrentModuleVersion();
|
54 |
}
|
65 |
return array(
|
66 |
new Varien_Object(
|
67 |
array(
|
68 |
+
'id' => 'current_version',
|
69 |
+
'name' => 'Current Module Version',
|
70 |
+
'version' => $this->getCurrentModuleVersion()
|
71 |
)
|
72 |
),
|
73 |
new Varien_Object(
|
74 |
array(
|
75 |
+
'id' => 'desired_version',
|
76 |
+
'name' => 'Required Version',
|
77 |
+
'version' => $this->getDesiredVersion()
|
78 |
)
|
79 |
)
|
80 |
);
|
81 |
}
|
82 |
|
83 |
+
public function addAdminNotification($title, $description)
|
84 |
{
|
85 |
/** @var Mage_AdminNotification_Model_Inbox $inbox */
|
86 |
$inbox = Mage::getModel('adminNotification/inbox');
|
87 |
+
$inbox->add(
|
88 |
+
Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR,
|
89 |
+
$title,
|
90 |
+
$description
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getAffectedOrdersIds($fromDate = false, $toDate = false)
|
95 |
+
{
|
96 |
+
$affectedOrders = Mage::app()->getCache()->load(self::AFFECTED_ORDER_CACHE_PATH);
|
97 |
+
if ($affectedOrders) {
|
98 |
+
$affectedOrders = unserialize($affectedOrders);
|
99 |
+
}
|
100 |
+
if (!$affectedOrders || $affectedOrders['from_date'] != $fromDate || $affectedOrders['to_date'] != $toDate) {
|
101 |
+
$affectedOrders = array();
|
102 |
+
$affectedOrders['from_date'] = $fromDate;
|
103 |
+
$affectedOrders['to_date'] = $toDate;
|
104 |
+
$affectedOrders['ids'] = array();
|
105 |
+
$conditions = array();
|
106 |
+
$bind = array();
|
107 |
+
if ($fromDate) {
|
108 |
+
$conditions[] = "updated_at > :fromDate";
|
109 |
+
$bind[":fromDate"] = $fromDate;
|
110 |
+
}
|
111 |
+
if ($fromDate) {
|
112 |
+
$conditions[] = "updated_at <= :toDate";
|
113 |
+
$bind[":toDate"] = $toDate;
|
114 |
+
}
|
115 |
+
|
116 |
+
/** @var Mage_Core_Model_Resource $resource */
|
117 |
+
$resource = Mage::getSingleton('core/resource');
|
118 |
+
$connection = $resource->getConnection('core_read');
|
119 |
+
/** ordered */
|
120 |
+
|
121 |
+
$union = array();
|
122 |
+
$union[] = $connection->select()
|
123 |
+
->from(array('ordered' => $this->getTableName('sales_flat_order')))
|
124 |
+
->reset(Zend_Db_Select::COLUMNS)
|
125 |
+
->columns(array('order_id' => 'entity_id'));
|
126 |
+
|
127 |
+
/** invoices */
|
128 |
+
$union[] = $connection->select()
|
129 |
+
->from(array('invoices' => $this->getTableName('sales_flat_invoice')))
|
130 |
+
->reset(Zend_Db_Select::COLUMNS)
|
131 |
+
->columns(array('order_id'));
|
132 |
+
|
133 |
+
/** shipments */
|
134 |
+
$union[] = $connection->select()
|
135 |
+
->from(array('shipments' => $this->getTableName('sales_flat_shipment')))
|
136 |
+
->reset(Zend_Db_Select::COLUMNS)
|
137 |
+
->columns(array('order_id'));
|
138 |
+
|
139 |
+
/** refunds */
|
140 |
+
$union[] = $connection->select()
|
141 |
+
->from(array('refunds' => $this->getTableName('sales_flat_creditmemo')))
|
142 |
+
->reset(Zend_Db_Select::COLUMNS)
|
143 |
+
->columns(array('order_id'));
|
144 |
+
|
145 |
+
foreach ($union as $query) {
|
146 |
+
foreach ($conditions as $condition) {
|
147 |
+
$query->where($condition);
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
$affectedSql = $connection->select()->union($union);
|
152 |
+
|
153 |
+
foreach ($connection->fetchAll($affectedSql, $bind) as $row) {
|
154 |
+
if (isset($row['order_id']) && !in_array($row['order_id'], $affectedOrders)) {
|
155 |
+
$affectedOrders['ids'][] = $row['order_id'];
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
Mage::app()->getCache()->save(serialize($affectedOrders), self::AFFECTED_ORDER_CACHE_PATH);
|
160 |
+
}
|
161 |
+
|
162 |
+
return $affectedOrders['ids'];
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* get db read adapter
|
167 |
+
*
|
168 |
+
* @return Varien_Db_Adapter_Interface
|
169 |
+
*/
|
170 |
+
public function getDbRead()
|
171 |
+
{
|
172 |
+
if (!$this->dbRead) {
|
173 |
+
$this->dbRead = $this->getResource()->getConnection('core_read');
|
174 |
+
}
|
175 |
+
return $this->dbRead;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* get db resource object
|
180 |
+
*
|
181 |
+
* @return Mage_Core_Model_Resource
|
182 |
+
*/
|
183 |
+
public function getResource()
|
184 |
+
{
|
185 |
+
if (!$this->resource) {
|
186 |
+
$this->resource = Mage::getSingleton('core/resource');
|
187 |
+
}
|
188 |
+
return $this->resource;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* return table name with prefix
|
193 |
+
*
|
194 |
+
* @param string $name table name without prefix
|
195 |
+
*
|
196 |
+
* @return string
|
197 |
+
*/
|
198 |
+
public function getTableName($name)
|
199 |
+
{
|
200 |
+
if (!isset($this->tableName[$name])) {
|
201 |
+
$this->tableName[$name] = $this->getResource()->getTableName($name);
|
202 |
}
|
203 |
+
return $this->tableName[$name];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
}
|
app/code/community/SavvyCube/Connector/Model/Api/Abstract.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -17,15 +18,93 @@
|
|
17 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-
abstract class SavvyCube_Connector_Model_Api_Abstract
|
|
|
|
|
21 |
|
22 |
-
protected $
|
23 |
|
24 |
-
protected $
|
25 |
|
26 |
-
protected $
|
27 |
|
28 |
-
protected $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
/**
|
31 |
* init model and set $request array
|
@@ -41,70 +120,120 @@ abstract class SavvyCube_Connector_Model_Api_Abstract {
|
|
41 |
}
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
-
* @return
|
47 |
*/
|
48 |
-
protected function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
{
|
50 |
-
if (
|
51 |
-
$this->
|
52 |
-
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
-
*
|
57 |
*
|
58 |
-
* @
|
59 |
*/
|
60 |
-
protected function
|
61 |
{
|
62 |
-
if (
|
63 |
-
$this->
|
64 |
-
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
-
* return
|
69 |
-
*
|
70 |
-
* @param string $name table name without prefix
|
71 |
-
*
|
72 |
-
* @return string
|
73 |
*/
|
74 |
-
protected function
|
75 |
{
|
76 |
-
|
77 |
-
$this->tableName[$name] = $this->getResource()->getTableName($name);
|
78 |
-
return $this->tableName[$name];
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
-
*
|
83 |
*
|
84 |
-
* @return
|
85 |
*/
|
86 |
-
protected function
|
87 |
{
|
88 |
-
|
89 |
-
|
90 |
-
->reset(Varien_Db_Select::COLUMNS);
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
-
|
|
|
|
|
|
|
98 |
}
|
99 |
|
100 |
-
|
101 |
-
* Render where condition by current request parameters
|
102 |
-
*
|
103 |
-
* @param Varien_Db_Select $sql select object
|
104 |
-
*/
|
105 |
-
protected function renderParameters($sql)
|
106 |
{
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
18 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
+
abstract class SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
const EXISTENCE_PREFIX = 'wcube_if_exists';
|
24 |
|
25 |
+
protected $request;
|
26 |
|
27 |
+
protected $mainTable = '';
|
28 |
|
29 |
+
protected $versionColumns = array();
|
30 |
|
31 |
+
protected $parentEntity = array();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Render response
|
35 |
+
*
|
36 |
+
* @return array
|
37 |
+
*/
|
38 |
+
public function getMethod()
|
39 |
+
{
|
40 |
+
if (!empty($this->parentEntity)) {
|
41 |
+
/** @var SavvyCube_Connector_Model_Api_Abstract $parentModel */
|
42 |
+
$parentModel = Mage::getModel($this->parentEntity['model']);
|
43 |
+
$affectedParent = $parentModel->generateQuery()->columns('entity_id');
|
44 |
+
$this->applyDateLimit($affectedParent, $this->parentEntity['parent_date']);
|
45 |
+
$affectedParentIds = $this->getHelper()->getDbRead()->fetchAll(
|
46 |
+
$affectedParent,
|
47 |
+
$affectedParent->getBind(),
|
48 |
+
Zend_Db::FETCH_COLUMN
|
49 |
+
);
|
50 |
+
|
51 |
+
if (count($affectedParentIds)) {
|
52 |
+
return $this->getResult(
|
53 |
+
$this->generateQuery()
|
54 |
+
->columns($this->columnsListForGet())
|
55 |
+
->where("`main_table`.{$this->parentEntity['parent_fk']} in (?)", $affectedParentIds)
|
56 |
+
);
|
57 |
+
} else {
|
58 |
+
return array();
|
59 |
+
}
|
60 |
+
} else {
|
61 |
+
$sql = $this->generateQuery()
|
62 |
+
->columns($this->columnsListForGet());
|
63 |
+
|
64 |
+
return $this->getResult($sql, '`main_table`.updated_at');
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function generateQuery()
|
69 |
+
{
|
70 |
+
return $this->getHelper()->getDbRead()->select()
|
71 |
+
->from(array('main_table' => $this->getHelper()->getTableName($this->mainTable)))
|
72 |
+
->reset(Varien_Db_Select::COLUMNS);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @param Zend_Db_Select $query
|
77 |
+
* @param $dateColumn
|
78 |
+
*/
|
79 |
+
public function applyDateLimit($query, $dateColumn)
|
80 |
+
{
|
81 |
+
$bind = array();
|
82 |
+
|
83 |
+
$fromDate = false;
|
84 |
+
$toDate = false;
|
85 |
+
|
86 |
+
if ($this->request['from_date'] !== null) {
|
87 |
+
$fromDate = urldecode($this->request['from_date']);
|
88 |
+
}
|
89 |
+
if ($this->request['to_date'] !== null) {
|
90 |
+
$toDate = urldecode($this->request['to_date']);
|
91 |
+
}
|
92 |
+
|
93 |
+
$conditions = array();
|
94 |
+
if ($fromDate) {
|
95 |
+
$conditions[] = "{$dateColumn} > :fromDate";
|
96 |
+
$bind[":fromDate"] = $fromDate;
|
97 |
+
}
|
98 |
+
if ($fromDate) {
|
99 |
+
$conditions[] = "{$dateColumn} <= :toDate";
|
100 |
+
$bind[":toDate"] = $toDate;
|
101 |
+
}
|
102 |
+
|
103 |
+
foreach ($conditions as $condition) {
|
104 |
+
$query->where($condition);
|
105 |
+
}
|
106 |
+
$query->bind(array_merge($query->getBind(), $bind));
|
107 |
+
}
|
108 |
|
109 |
/**
|
110 |
* init model and set $request array
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
+
* init sql select with order status date filter
|
124 |
*
|
125 |
+
* @return Varien_Db_Select
|
126 |
*/
|
127 |
+
protected function getAffectedOrders()
|
128 |
+
{
|
129 |
+
$fromDate = false;
|
130 |
+
$toDate = false;
|
131 |
+
|
132 |
+
if ($this->request['from_date'] !== null) {
|
133 |
+
$fromDate = urldecode($this->request['from_date']);
|
134 |
+
}
|
135 |
+
if ($this->request['to_date'] !== null) {
|
136 |
+
$toDate = urldecode($this->request['to_date']);
|
137 |
+
}
|
138 |
+
|
139 |
+
if (!$fromDate && !$toDate) {
|
140 |
+
return true;
|
141 |
+
} else {
|
142 |
+
/** @var SavvyCube_Connector_Helper_Data $helper */
|
143 |
+
$helper = Mage::helper('wCube');
|
144 |
+
return $helper->getAffectedOrdersIds($fromDate, $toDate);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
protected function getResult($query, $dateColumn = false)
|
149 |
{
|
150 |
+
if ($dateColumn) {
|
151 |
+
$this->applyDateLimit($query, $dateColumn);
|
152 |
+
}
|
153 |
+
$this->renderParameters($query);
|
154 |
+
return $this->getHelper()->getDbRead()->fetchAll($query, $query->getBind());
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
+
* Render where condition by current request parameters
|
159 |
*
|
160 |
+
* @param Varien_Db_Select $sql select object
|
161 |
*/
|
162 |
+
protected function renderParameters($sql)
|
163 |
{
|
164 |
+
if ($this->request['count'] !== null && $this->request['offset'] !== null) {
|
165 |
+
$sql->limit($this->request['count'], $this->request['offset']);
|
166 |
+
}
|
167 |
}
|
168 |
|
169 |
/**
|
170 |
+
* @return SavvyCube_Connector_Helper_Data
|
|
|
|
|
|
|
|
|
171 |
*/
|
172 |
+
protected function getHelper()
|
173 |
{
|
174 |
+
return Mage::helper('wCube');
|
|
|
|
|
175 |
}
|
176 |
|
177 |
/**
|
178 |
+
* Return columns list for getMethod select
|
179 |
*
|
180 |
+
* @return string | array
|
181 |
*/
|
182 |
+
protected function columnsListForGet()
|
183 |
{
|
184 |
+
return '*';
|
185 |
+
}
|
|
|
186 |
|
187 |
+
public function prepareColumns($columns, $tableAlias = false)
|
188 |
+
{
|
189 |
+
$result = array();
|
190 |
+
foreach ($columns as $key => $column) {
|
191 |
+
if (is_string($key)) {
|
192 |
+
$columnAlias = $key;
|
193 |
+
}
|
194 |
+
if (isset($this->versionColumns[$column])) {
|
195 |
+
$versionInfo = $this->versionColumns[$column];
|
196 |
+
if (isset($versionInfo['check_existence']) && !$this->checkColumn($this->mainTable, $column)
|
197 |
+
|| isset($versionInfo['since']) && Mage::getVersion() < $versionInfo['since']
|
198 |
+
) {
|
199 |
+
/** skip missing columns */
|
200 |
+
continue;
|
201 |
+
} elseif (isset($versionInfo['renamed']) && Mage::getVersion() < $versionInfo['renamed']['since']) {
|
202 |
+
if (!isset($columnAlias)) {
|
203 |
+
$columnAlias = $column;
|
204 |
+
}
|
205 |
+
$column = $versionInfo['renamed']['originally'];
|
206 |
+
}
|
207 |
+
}
|
208 |
+
if (!isset($columnAlias)) {
|
209 |
+
$columnAlias = $column;
|
210 |
+
}
|
211 |
+
if ($tableAlias) {
|
212 |
+
$column = "{$tableAlias}.{$column}";
|
213 |
+
}
|
214 |
|
215 |
+
$result[$columnAlias] = $column;
|
216 |
+
unset($columnAlias);
|
217 |
+
}
|
218 |
+
return $result;
|
219 |
}
|
220 |
|
221 |
+
public function checkColumn($table, $columnName)
|
|
|
|
|
|
|
|
|
|
|
222 |
{
|
223 |
+
$result = Mage::app()->getCache()->load(self::EXISTENCE_PREFIX . $table . $columnName);
|
224 |
+
if (!$result) {
|
225 |
+
$columns = $this->getHelper()->getDbRead()->describeTable($this->mainTable);
|
226 |
+
$result = '';
|
227 |
+
foreach ($columns as $column) {
|
228 |
+
if ($column['COLUMN_NAME'] == $columnName) {
|
229 |
+
$result = $columnName;
|
230 |
+
break;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
Mage::app()->getCache()->save($result, self::EXISTENCE_PREFIX . $table . $columnName);
|
235 |
+
}
|
236 |
+
|
237 |
+
return $result == $columnName;
|
238 |
}
|
239 |
}
|
app/code/community/SavvyCube/Connector/Model/Api/Address.php
CHANGED
@@ -19,10 +19,7 @@
|
|
19 |
*/
|
20 |
class SavvyCube_Connector_Model_Api_Address extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
const ORDER_TABLE = 'sales_flat_order';
|
25 |
-
|
26 |
/**
|
27 |
* Render response on wCube/api/address get query
|
28 |
*
|
@@ -30,26 +27,21 @@ class SavvyCube_Connector_Model_Api_Address extends SavvyCube_Connector_Model_Ap
|
|
30 |
*/
|
31 |
public function getMethod()
|
32 |
{
|
33 |
-
$
|
34 |
-
->
|
35 |
-
->join(
|
36 |
-
array('main_table' => $this->getTableName(self::MAIN_TABLE)),
|
37 |
-
'st_hist.parent_id = main_table.parent_id'
|
38 |
-
)
|
39 |
->reset(Varien_Db_Select::COLUMNS)
|
40 |
-
->columns(
|
41 |
-
|
42 |
-
$this->renderParameters($subSql);
|
43 |
|
44 |
-
$
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
|
52 |
-
return $this->
|
53 |
}
|
54 |
|
55 |
/**
|
@@ -57,9 +49,32 @@ class SavvyCube_Connector_Model_Api_Address extends SavvyCube_Connector_Model_Ap
|
|
57 |
*
|
58 |
* @return string | array
|
59 |
*/
|
60 |
-
|
61 |
{
|
62 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
|
19 |
*/
|
20 |
class SavvyCube_Connector_Model_Api_Address extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
|
22 |
+
protected $mainTable = 'sales_flat_order_address';
|
|
|
|
|
|
|
23 |
/**
|
24 |
* Render response on wCube/api/address get query
|
25 |
*
|
27 |
*/
|
28 |
public function getMethod()
|
29 |
{
|
30 |
+
$sql = $this->getHelper()->getDbRead()->select()
|
31 |
+
->from(array('main_table' => $this->getHelper()->getTableName($this->mainTable)))
|
|
|
|
|
|
|
|
|
32 |
->reset(Varien_Db_Select::COLUMNS)
|
33 |
+
->columns($this->columnsListForGet());
|
|
|
|
|
34 |
|
35 |
+
$affectedOrders = $this->getAffectedOrders();
|
36 |
+
if ($affectedOrders !== true && is_array($affectedOrders)) {
|
37 |
+
if (count($affectedOrders)) {
|
38 |
+
$sql->where("`main_table`.parent_id in (?)", $affectedOrders);
|
39 |
+
} else {
|
40 |
+
return array();
|
41 |
+
}
|
42 |
+
}
|
43 |
|
44 |
+
return $this->getResult($sql);
|
45 |
}
|
46 |
|
47 |
/**
|
49 |
*
|
50 |
* @return string | array
|
51 |
*/
|
52 |
+
protected function columnsListForGet()
|
53 |
{
|
54 |
+
return $this->prepareColumns(
|
55 |
+
array(
|
56 |
+
'entity_id',
|
57 |
+
'parent_id',
|
58 |
+
'region_id',
|
59 |
+
'customer_id',
|
60 |
+
'fax',
|
61 |
+
'region',
|
62 |
+
'postcode',
|
63 |
+
'lastname',
|
64 |
+
'street',
|
65 |
+
'city',
|
66 |
+
'email',
|
67 |
+
'telephone',
|
68 |
+
'country_id',
|
69 |
+
'firstname',
|
70 |
+
'address_type',
|
71 |
+
'prefix',
|
72 |
+
'middlename',
|
73 |
+
'suffix',
|
74 |
+
'company'
|
75 |
+
),
|
76 |
+
'main_table'
|
77 |
+
);
|
78 |
}
|
79 |
|
80 |
|
app/code/community/SavvyCube/Connector/Model/Api/Customer.php
DELETED
@@ -1,106 +0,0 @@
|
|
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@savvycube.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* @category SavvyCube
|
16 |
-
* @package SavvyCube_Connector
|
17 |
-
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
-
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Customer extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
-
|
22 |
-
const MAIN_TABLE = 'customer_entity';
|
23 |
-
|
24 |
-
const ATTR_VARCHAR = 'customer_entity_varchar';
|
25 |
-
|
26 |
-
private $_attrCounter = 0;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Render response on wCube/api/customer get query
|
30 |
-
*
|
31 |
-
* @param array $this->request array of parameters
|
32 |
-
*
|
33 |
-
* @return array
|
34 |
-
*/
|
35 |
-
public function getMethod()
|
36 |
-
{
|
37 |
-
$subSql = $this->initSelectWithOrderDateFilter()
|
38 |
-
->distinct()
|
39 |
-
->join(
|
40 |
-
array('o' => $this->getTableName('sales_flat_order')),
|
41 |
-
'o.entity_id = st_hist.parent_id',
|
42 |
-
array()
|
43 |
-
)->join(
|
44 |
-
array('main_table' => $this->getTableName(self::MAIN_TABLE)),
|
45 |
-
'o.customer_id = main_table.entity_id',
|
46 |
-
array()
|
47 |
-
)
|
48 |
-
->reset(Varien_Db_Select::COLUMNS)
|
49 |
-
->columns('main_table.entity_id');
|
50 |
-
|
51 |
-
$this->renderParameters($subSql);
|
52 |
-
|
53 |
-
$sql = $this->getDbRead()->select()
|
54 |
-
->from(array('main_table' => $this->getTableName(self::MAIN_TABLE)))
|
55 |
-
->join(
|
56 |
-
array('A' => new Zend_Db_Expr("({$subSql})")),
|
57 |
-
'A.`entity_id`=main_table.`entity_id`'
|
58 |
-
)
|
59 |
-
->columns($this->_columnsListForGet());
|
60 |
-
|
61 |
-
$this->_joinEavAttribute($sql, 'firstname', 'varchar');
|
62 |
-
$this->_joinEavAttribute($sql, 'lastname', 'varchar');
|
63 |
-
$this->_joinEavAttribute($sql, 'middlename', 'varchar');
|
64 |
-
$this->_joinEavAttribute($sql, 'gender', 'int');
|
65 |
-
$this->_joinEavAttribute($sql, 'dob', 'datetime');
|
66 |
-
return $this->getDbRead()->fetchAll($sql);
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @param Varien_Db_Select $sql
|
71 |
-
* @param $attributeName
|
72 |
-
* @param $attributeType
|
73 |
-
*/
|
74 |
-
private function _joinEavAttribute($sql, $attributeName, $attributeType)
|
75 |
-
{
|
76 |
-
$attrTable = $this->getTableName("eav_attribute");
|
77 |
-
$attrTableAlias = 'attr'.$this->_attrCounter;
|
78 |
-
$attrValueTable = $this->getTableName(self::MAIN_TABLE."_{$attributeType}");
|
79 |
-
$attrValueTableAlias = 'attrv'.$this->_attrCounter;
|
80 |
-
$this->_attrCounter++;
|
81 |
-
$sql->joinLeft(array($attrTableAlias => $attrTable), "main_table.entity_type_id = {$attrTableAlias}.entity_type_id AND {$attrTableAlias}.attribute_code ='{$attributeName}'" , array())
|
82 |
-
->joinLeft(array($attrValueTableAlias => $attrValueTable), "{$attrTableAlias}.attribute_id = {$attrValueTableAlias}.attribute_id AND main_table.entity_id = {$attrValueTableAlias}.entity_id", array($attributeName => "value"));
|
83 |
-
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Return columns list for getMethod select
|
88 |
-
*
|
89 |
-
* @return string | array
|
90 |
-
*/
|
91 |
-
private function _columnsListForGet()
|
92 |
-
{
|
93 |
-
return array(
|
94 |
-
'main_table.entity_id',
|
95 |
-
'main_table.website_id',
|
96 |
-
'main_table.store_id',
|
97 |
-
'main_table.email',
|
98 |
-
'main_table.is_active',
|
99 |
-
'main_table.created_at',
|
100 |
-
'main_table.updated_at',
|
101 |
-
|
102 |
-
);
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/SavvyCube/Connector/Model/Api/Invoice.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Invoice extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_invoice';
|
24 |
+
|
25 |
+
protected $versionColumns = array(
|
26 |
+
'discount_description' => array(
|
27 |
+
'check_existence' => true
|
28 |
+
),
|
29 |
+
'base_total_refunded' => array(
|
30 |
+
'since' => '1.6.0.0'
|
31 |
+
),
|
32 |
+
'base_shipping_hidden_tax_amnt' => array(
|
33 |
+
'renamed' => array(
|
34 |
+
'since' => '1.6.0.0',
|
35 |
+
'originally' => 'base_shipping_hidden_tax_amount'
|
36 |
+
)
|
37 |
+
)
|
38 |
+
);
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Return columns list for getMethod select
|
42 |
+
*
|
43 |
+
* @return string | array
|
44 |
+
*/
|
45 |
+
protected function columnsListForGet()
|
46 |
+
{
|
47 |
+
return $this->prepareColumns(
|
48 |
+
array(
|
49 |
+
'entity_id',
|
50 |
+
'base_grand_total',
|
51 |
+
'base_tax_amount',
|
52 |
+
'store_to_order_rate',
|
53 |
+
'base_shipping_tax_amount',
|
54 |
+
'base_discount_amount',
|
55 |
+
'base_to_order_rate',
|
56 |
+
'store_to_base_rate',
|
57 |
+
'base_shipping_amount',
|
58 |
+
'total_qty',
|
59 |
+
'base_to_global_rate',
|
60 |
+
'base_subtotal',
|
61 |
+
'billing_address_id',
|
62 |
+
'is_used_for_refund',
|
63 |
+
'order_id',
|
64 |
+
'state',
|
65 |
+
'shipping_address_id',
|
66 |
+
'store_currency_code',
|
67 |
+
'transaction_id',
|
68 |
+
'order_currency_code',
|
69 |
+
'base_currency_code',
|
70 |
+
'global_currency_code',
|
71 |
+
'increment_id',
|
72 |
+
'created_at',
|
73 |
+
'updated_at',
|
74 |
+
'base_hidden_tax_amount',
|
75 |
+
'base_shipping_hidden_tax_amnt',
|
76 |
+
'base_shipping_incl_tax',
|
77 |
+
'base_total_refunded',
|
78 |
+
'discount_description',
|
79 |
+
),
|
80 |
+
'main_table'
|
81 |
+
);
|
82 |
+
}
|
83 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Invoiceitem.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Invoiceitem extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_invoice_item';
|
24 |
+
|
25 |
+
protected $versionColumns = array(
|
26 |
+
|
27 |
+
'base_weee_tax_applied_row_amnt' => array(
|
28 |
+
'renamed' => array(
|
29 |
+
'since' => '1.6.0.0',
|
30 |
+
'originally' => 'base_weee_tax_applied_row_amount'
|
31 |
+
)
|
32 |
+
)
|
33 |
+
);
|
34 |
+
|
35 |
+
protected $parentEntity = array(
|
36 |
+
'model' => 'wCube/api_invoice',
|
37 |
+
'parent_date' => 'updated_at',
|
38 |
+
'parent_fk' => 'parent_id'
|
39 |
+
);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Return columns list for getMethod select
|
43 |
+
*
|
44 |
+
* @return string | array
|
45 |
+
*/
|
46 |
+
protected function columnsListForGet()
|
47 |
+
{
|
48 |
+
return $this->prepareColumns(
|
49 |
+
array(
|
50 |
+
'entity_id',
|
51 |
+
'parent_id',
|
52 |
+
'base_price',
|
53 |
+
'base_row_total',
|
54 |
+
'base_discount_amount',
|
55 |
+
'base_tax_amount',
|
56 |
+
'base_price_incl_tax',
|
57 |
+
'qty',
|
58 |
+
'base_cost',
|
59 |
+
'base_row_total_incl_tax',
|
60 |
+
'product_id',
|
61 |
+
'order_item_id',
|
62 |
+
'base_hidden_tax_amount',
|
63 |
+
'base_weee_tax_applied_amount',
|
64 |
+
'base_weee_tax_applied_row_amnt',
|
65 |
+
'base_weee_tax_disposition',
|
66 |
+
'base_weee_tax_row_disposition',
|
67 |
+
),
|
68 |
+
'main_table'
|
69 |
+
);
|
70 |
+
}
|
71 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Notification.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Notification extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Render response on wCube/api/version get query
|
27 |
+
*
|
28 |
+
* @return array
|
29 |
+
*/
|
30 |
+
public function getMethod()
|
31 |
+
{
|
32 |
+
/** @var SavvyCube_Connector_Helper_Data $helper */
|
33 |
+
$helper = Mage::helper('wCube');
|
34 |
+
$helper->addAdminNotification(
|
35 |
+
$this->request['title'],
|
36 |
+
$this->request['description']
|
37 |
+
);
|
38 |
+
|
39 |
+
return array(
|
40 |
+
'success' => 1
|
41 |
+
);
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Order.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -17,40 +18,39 @@
|
|
17 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Order extends SavvyCube_Connector_Model_Api_Abstract
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
/**
|
27 |
-
* Render response
|
28 |
*
|
29 |
* @return array
|
30 |
*/
|
31 |
public function getMethod()
|
32 |
{
|
33 |
-
$
|
34 |
-
->
|
35 |
-
->
|
36 |
-
array('
|
37 |
-
|
38 |
-
array()
|
39 |
)
|
40 |
->reset(Varien_Db_Select::COLUMNS)
|
41 |
-
->columns(
|
42 |
|
43 |
-
$this->
|
44 |
-
|
45 |
-
$sql = $this->getDbRead()->select()
|
46 |
-
->from(array('main_table' => $this->getTableName(self::ENTITY_TABLE)))
|
47 |
-
->join(
|
48 |
-
array('A' => new Zend_Db_Expr("({$subSql})")),
|
49 |
-
'A.`entity_id`=main_table.`entity_id`'
|
50 |
-
)
|
51 |
-
->columns($this->_columnsListForGet());
|
52 |
-
|
53 |
-
return $this->getDbRead()->fetchAll($sql);
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -58,46 +58,95 @@ class SavvyCube_Connector_Model_Api_Order extends SavvyCube_Connector_Model_Api_
|
|
58 |
*
|
59 |
* @return string | array
|
60 |
*/
|
61 |
-
|
62 |
-
|
63 |
-
return
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
);
|
102 |
-
|
103 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
18 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Order extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_order';
|
24 |
|
25 |
+
protected $versionColumns = array(
|
26 |
+
'coupon_rule_name' => array(
|
27 |
+
'since' => '1.6.0.7'
|
28 |
+
),
|
29 |
+
'base_shipping_hidden_tax_amnt' => array(
|
30 |
+
'renamed' => array(
|
31 |
+
'since' => '1.6.0.7',
|
32 |
+
'originally' => 'base_shipping_hidden_tax_amount'
|
33 |
+
)
|
34 |
+
)
|
35 |
+
);
|
36 |
|
37 |
/**
|
38 |
+
* Render response
|
39 |
*
|
40 |
* @return array
|
41 |
*/
|
42 |
public function getMethod()
|
43 |
{
|
44 |
+
$sql = $this->getHelper()->getDbRead()->select()
|
45 |
+
->from(array('main_table' => $this->getHelper()->getTableName($this->mainTable)))
|
46 |
+
->joinLeft(
|
47 |
+
array('group_table' => $this->getHelper()->getTableName('customer_group')),
|
48 |
+
"group_table.customer_group_id = main_table.customer_group_id"
|
|
|
49 |
)
|
50 |
->reset(Varien_Db_Select::COLUMNS)
|
51 |
+
->columns($this->columnsListForGet());
|
52 |
|
53 |
+
return $this->getResult($sql, '`main_table`.updated_at');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
/**
|
58 |
*
|
59 |
* @return string | array
|
60 |
*/
|
61 |
+
protected function columnsListForGet()
|
62 |
+
{
|
63 |
+
return array_merge(
|
64 |
+
$this->prepareColumns(
|
65 |
+
array(
|
66 |
+
'entity_id',
|
67 |
+
'state',
|
68 |
+
'status',
|
69 |
+
'coupon_code',
|
70 |
+
'shipping_description',
|
71 |
+
'is_virtual',
|
72 |
+
'store_id',
|
73 |
+
'customer_id',
|
74 |
+
'base_discount_amount',
|
75 |
+
'base_discount_canceled',
|
76 |
+
'base_discount_invoiced',
|
77 |
+
'base_discount_refunded',
|
78 |
+
'base_grand_total',
|
79 |
+
'base_shipping_amount',
|
80 |
+
'base_shipping_canceled',
|
81 |
+
'base_shipping_invoiced',
|
82 |
+
'base_shipping_refunded',
|
83 |
+
'base_shipping_tax_amount',
|
84 |
+
'base_shipping_tax_refunded',
|
85 |
+
'base_subtotal',
|
86 |
+
'base_subtotal_canceled',
|
87 |
+
'base_subtotal_invoiced',
|
88 |
+
'base_subtotal_refunded',
|
89 |
+
'base_tax_amount',
|
90 |
+
'base_tax_canceled',
|
91 |
+
'base_tax_invoiced',
|
92 |
+
'base_tax_refunded',
|
93 |
+
'base_to_global_rate',
|
94 |
+
'base_to_order_rate',
|
95 |
+
'base_total_canceled',
|
96 |
+
'base_total_invoiced',
|
97 |
+
'base_total_invoiced_cost',
|
98 |
+
'base_total_offline_refunded',
|
99 |
+
'base_total_online_refunded',
|
100 |
+
'base_total_paid',
|
101 |
+
'base_total_qty_ordered',
|
102 |
+
'base_total_refunded',
|
103 |
+
'customer_is_guest',
|
104 |
+
'customer_note_notify',
|
105 |
+
'billing_address_id',
|
106 |
+
'customer_group_id',
|
107 |
+
'shipping_address_id',
|
108 |
+
'base_adjustment_negative',
|
109 |
+
'base_adjustment_positive',
|
110 |
+
'base_shipping_discount_amount',
|
111 |
+
'base_subtotal_incl_tax',
|
112 |
+
'base_total_due',
|
113 |
+
'weight',
|
114 |
+
'customer_dob',
|
115 |
+
'increment_id',
|
116 |
+
'applied_rule_ids',
|
117 |
+
'base_currency_code',
|
118 |
+
'customer_email',
|
119 |
+
'customer_firstname',
|
120 |
+
'customer_lastname',
|
121 |
+
'customer_middlename',
|
122 |
+
'customer_prefix',
|
123 |
+
'customer_suffix',
|
124 |
+
'customer_taxvat',
|
125 |
+
'discount_description',
|
126 |
+
'global_currency_code',
|
127 |
+
'order_currency_code',
|
128 |
+
'shipping_method',
|
129 |
+
'store_name',
|
130 |
+
'customer_note',
|
131 |
+
'created_at',
|
132 |
+
'updated_at',
|
133 |
+
'total_item_count',
|
134 |
+
'customer_gender',
|
135 |
+
'base_hidden_tax_amount',
|
136 |
+
'base_shipping_hidden_tax_amnt',
|
137 |
+
'base_hidden_tax_invoiced',
|
138 |
+
'base_hidden_tax_refunded',
|
139 |
+
'base_shipping_incl_tax',
|
140 |
+
'coupon_rule_name',
|
141 |
+
),
|
142 |
+
'main_table'
|
143 |
+
),
|
144 |
+
$this->prepareColumns(
|
145 |
+
array(
|
146 |
+
'customer_group_code'
|
147 |
+
),
|
148 |
+
'group_table'
|
149 |
+
)
|
150 |
);
|
151 |
+
}
|
152 |
}
|
app/code/community/SavvyCube/Connector/Model/Api/Ordered.php
DELETED
@@ -1,99 +0,0 @@
|
|
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@savvycube.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* @category SavvyCube
|
16 |
-
* @package SavvyCube_Connector
|
17 |
-
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
-
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Ordered extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
-
|
22 |
-
const MAIN_TABLE = 'sales_flat_order_item';
|
23 |
-
|
24 |
-
const ENTITY_TABLE = 'sales_flat_order';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Render response on wCube/api/ordered get query
|
28 |
-
*
|
29 |
-
* @return array
|
30 |
-
*/
|
31 |
-
public function getMethod()
|
32 |
-
{
|
33 |
-
$subSql = $this->initSelectWithOrderDateFilter()
|
34 |
-
->distinct()
|
35 |
-
->join(
|
36 |
-
array('main_table' => $this->getTableName(self::ENTITY_TABLE)),
|
37 |
-
'st_hist.parent_id = main_table.entity_id',
|
38 |
-
array()
|
39 |
-
)
|
40 |
-
->reset(Varien_Db_Select::COLUMNS)
|
41 |
-
->columns('main_table.entity_id');
|
42 |
-
|
43 |
-
$this->renderParameters($subSql);
|
44 |
-
|
45 |
-
$sql = $this->getDbRead()->select()
|
46 |
-
->from(array('main_table' => $this->getTableName(self::ENTITY_TABLE)))
|
47 |
-
->join(
|
48 |
-
array('A' => new Zend_Db_Expr("({$subSql})")),
|
49 |
-
'A.`entity_id`=main_table.`entity_id`'
|
50 |
-
)->join(
|
51 |
-
array('o_item' => $this->getTableName(self::MAIN_TABLE)),
|
52 |
-
'main_table.entity_id = o_item.order_id',
|
53 |
-
array()
|
54 |
-
)
|
55 |
-
->columns($this->_columnsListForGet());
|
56 |
-
|
57 |
-
return $this->getDbRead()->fetchAll($sql);
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Return columns list for getMethod select
|
62 |
-
*
|
63 |
-
* @return string | array
|
64 |
-
*/
|
65 |
-
private function _columnsListForGet()
|
66 |
-
{
|
67 |
-
return array(
|
68 |
-
'o_item.item_id',
|
69 |
-
'o_item.order_id',
|
70 |
-
'o_item.parent_item_id',
|
71 |
-
'o_item.store_id',
|
72 |
-
'o_item.created_at',
|
73 |
-
'o_item.updated_at',
|
74 |
-
'o_item.qty_backordered',
|
75 |
-
'o_item.qty_canceled',
|
76 |
-
'o_item.qty_invoiced',
|
77 |
-
'o_item.qty_ordered',
|
78 |
-
'o_item.qty_refunded',
|
79 |
-
'o_item.qty_shipped',
|
80 |
-
'o_item.price',
|
81 |
-
'o_item.base_cost',
|
82 |
-
'o_item.base_price',
|
83 |
-
'o_item.base_original_price',
|
84 |
-
'o_item.base_tax_amount',
|
85 |
-
'o_item.base_tax_invoiced',
|
86 |
-
'o_item.base_discount_amount',
|
87 |
-
'o_item.base_discount_invoiced',
|
88 |
-
'o_item.base_amount_refunded',
|
89 |
-
'o_item.base_row_total',
|
90 |
-
'o_item.base_row_invoiced',
|
91 |
-
'o_item.row_weight',
|
92 |
-
'o_item.free_shipping',
|
93 |
-
'main_table.billing_address_id',
|
94 |
-
'main_table.shipping_address_id',
|
95 |
-
'main_table.customer_id'
|
96 |
-
);
|
97 |
-
}
|
98 |
-
|
99 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/SavvyCube/Connector/Model/Api/Orderitem.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Orderitem extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_order_item';
|
24 |
+
|
25 |
+
protected $versionColumns = array(
|
26 |
+
'tax_canceled' => array(
|
27 |
+
'since' => '1.6.0.0'
|
28 |
+
),
|
29 |
+
'hidden_tax_canceled' => array(
|
30 |
+
'since' => '1.6.0.0'
|
31 |
+
),
|
32 |
+
'base_tax_refunded' => array(
|
33 |
+
'since' => '1.6.0.5'
|
34 |
+
),
|
35 |
+
'base_discount_refunded' => array(
|
36 |
+
'since' => '1.6.0.5'
|
37 |
+
),
|
38 |
+
'base_weee_tax_applied_row_amnt' => array(
|
39 |
+
'renamed' => array(
|
40 |
+
'since' => '1.6.0.0',
|
41 |
+
'originally' => 'base_weee_tax_applied_row_amount'
|
42 |
+
)
|
43 |
+
)
|
44 |
+
);
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Return columns list for getMethod select
|
48 |
+
*
|
49 |
+
* @return string | array
|
50 |
+
*/
|
51 |
+
protected function columnsListForGet()
|
52 |
+
{
|
53 |
+
return $this->prepareColumns(
|
54 |
+
array(
|
55 |
+
'entity_id' => 'item_id',
|
56 |
+
'order_id',
|
57 |
+
'parent_item_id',
|
58 |
+
'created_at',
|
59 |
+
'updated_at',
|
60 |
+
'product_id',
|
61 |
+
'product_type',
|
62 |
+
'product_options',
|
63 |
+
'weight',
|
64 |
+
'is_virtual',
|
65 |
+
'sku',
|
66 |
+
'name',
|
67 |
+
'description',
|
68 |
+
'applied_rule_ids',
|
69 |
+
'additional_data',
|
70 |
+
'free_shipping',
|
71 |
+
'is_qty_decimal',
|
72 |
+
'no_discount',
|
73 |
+
'qty_backordered',
|
74 |
+
'qty_canceled',
|
75 |
+
'qty_invoiced',
|
76 |
+
'qty_ordered',
|
77 |
+
'qty_refunded',
|
78 |
+
'qty_shipped',
|
79 |
+
'base_cost',
|
80 |
+
'base_price',
|
81 |
+
'base_original_price',
|
82 |
+
'tax_percent',
|
83 |
+
'base_tax_amount',
|
84 |
+
'base_tax_invoiced',
|
85 |
+
'discount_percent',
|
86 |
+
'base_discount_amount',
|
87 |
+
'base_discount_invoiced',
|
88 |
+
'base_amount_refunded',
|
89 |
+
'base_row_total',
|
90 |
+
'base_row_invoiced',
|
91 |
+
'row_weight',
|
92 |
+
'base_tax_before_discount',
|
93 |
+
'base_price_incl_tax',
|
94 |
+
'base_row_total_incl_tax',
|
95 |
+
'base_hidden_tax_amount',
|
96 |
+
'base_hidden_tax_invoiced',
|
97 |
+
'base_hidden_tax_refunded',
|
98 |
+
'tax_canceled',
|
99 |
+
'hidden_tax_canceled',
|
100 |
+
'base_tax_refunded',
|
101 |
+
'base_discount_refunded',
|
102 |
+
'gift_message_id',
|
103 |
+
'gift_message_available',
|
104 |
+
'base_weee_tax_applied_amount',
|
105 |
+
'base_weee_tax_applied_row_amnt',
|
106 |
+
'base_weee_tax_disposition',
|
107 |
+
'base_weee_tax_row_disposition'
|
108 |
+
),
|
109 |
+
'main_table'
|
110 |
+
);
|
111 |
+
}
|
112 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Product.php
DELETED
@@ -1,140 +0,0 @@
|
|
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@savvycube.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* @category SavvyCube
|
16 |
-
* @package SavvyCube_Connector
|
17 |
-
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
-
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Product extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
-
|
22 |
-
const MAIN_TABLE = 'sales_flat_order_item';
|
23 |
-
|
24 |
-
const ENTITY_TABLE = 'catalog_product_entity';
|
25 |
-
|
26 |
-
protected $_attrCounter = 0;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Render response on wCube/api/address get query
|
30 |
-
*
|
31 |
-
* @return array
|
32 |
-
*/
|
33 |
-
public function getMethod()
|
34 |
-
{
|
35 |
-
/** ordered items */
|
36 |
-
$subSql = $this->initSelectWithOrderDateFilter()
|
37 |
-
->distinct()
|
38 |
-
->join(
|
39 |
-
array('main_table' => $this->getTableName(self::MAIN_TABLE)),
|
40 |
-
'main_table.order_id = st_hist.parent_id',
|
41 |
-
array()
|
42 |
-
)
|
43 |
-
->reset(Varien_Db_Select::COLUMNS)
|
44 |
-
->columns('main_table.item_id');
|
45 |
-
|
46 |
-
$this->renderParameters($subSql);
|
47 |
-
|
48 |
-
$sql = $this->getDbRead()->select()
|
49 |
-
->from(array('main_table' => $this->getTableName(self::MAIN_TABLE)))
|
50 |
-
->join(
|
51 |
-
array('A' => new Zend_Db_Expr("({$subSql})")),
|
52 |
-
'A.`item_id`=main_table.`item_id`'
|
53 |
-
)->joinLeft(
|
54 |
-
array('product' => $this->getTableName(self::ENTITY_TABLE)),
|
55 |
-
'main_table.product_id = product.entity_id',
|
56 |
-
array()
|
57 |
-
)
|
58 |
-
->columns($this->_columnsListForGet());
|
59 |
-
|
60 |
-
$this->_joinEavAttribute($sql, 'msrp', 'decimal');
|
61 |
-
return $this->getDbRead()->fetchAll($sql);
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* @param Varien_Db_Select $sql
|
66 |
-
* @param $attributeName
|
67 |
-
* @param $attributeType
|
68 |
-
*/
|
69 |
-
private function _joinEavAttribute($sql, $attributeName, $attributeType)
|
70 |
-
{
|
71 |
-
$attrTable = $this->getTableName("eav_attribute");
|
72 |
-
$attrTableAlias = 'attr'.$this->_attrCounter;
|
73 |
-
$attrValueTable = $this->getTableName(self::ENTITY_TABLE."_{$attributeType}");
|
74 |
-
$attrValueTableAlias = 'attrv'.$this->_attrCounter;
|
75 |
-
$attrDefaultValueTableAlias = 'attrv0'.$this->_attrCounter;
|
76 |
-
$this->_attrCounter++;
|
77 |
-
$sql->joinLeft(
|
78 |
-
array($attrTableAlias => $attrTable),
|
79 |
-
"product.entity_type_id = {$attrTableAlias}.entity_type_id
|
80 |
-
AND {$attrTableAlias}.attribute_code ='{$attributeName}'",
|
81 |
-
array()
|
82 |
-
)
|
83 |
-
->joinLeft(
|
84 |
-
array($attrValueTableAlias => $attrValueTable),
|
85 |
-
"{$attrTableAlias}.attribute_id = {$attrValueTableAlias}.attribute_id
|
86 |
-
AND product.entity_id = {$attrValueTableAlias}.entity_id
|
87 |
-
AND main_table.store_id = {$attrValueTableAlias}.store_id",
|
88 |
-
array()
|
89 |
-
)->joinLeft(
|
90 |
-
array($attrDefaultValueTableAlias => $attrValueTable),
|
91 |
-
"{$attrTableAlias}.attribute_id = {$attrDefaultValueTableAlias}.attribute_id
|
92 |
-
AND product.entity_id = {$attrDefaultValueTableAlias}.entity_id
|
93 |
-
AND 0 = {$attrDefaultValueTableAlias}.store_id",
|
94 |
-
array()
|
95 |
-
);
|
96 |
-
|
97 |
-
$sql->columns(
|
98 |
-
array(
|
99 |
-
$attributeName => "IFNULL({$attrValueTableAlias}.value, {$attrDefaultValueTableAlias}.value)")
|
100 |
-
);
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Return columns list for getMethod select
|
105 |
-
*
|
106 |
-
* @return string | array
|
107 |
-
*/
|
108 |
-
private function _columnsListForGet()
|
109 |
-
{
|
110 |
-
return array(
|
111 |
-
'main_table.item_id',
|
112 |
-
'main_table.order_id',
|
113 |
-
'main_table.parent_item_id',
|
114 |
-
'main_table.quote_item_id',
|
115 |
-
'main_table.store_id',
|
116 |
-
'main_table.created_at',
|
117 |
-
'main_table.updated_at',
|
118 |
-
'main_table.product_id',
|
119 |
-
'main_table.product_type',
|
120 |
-
'main_table.weight',
|
121 |
-
'main_table.is_virtual',
|
122 |
-
'main_table.SKU',
|
123 |
-
'main_table.name',
|
124 |
-
'main_table.description',
|
125 |
-
'main_table.additional_data',
|
126 |
-
'main_table.is_qty_decimal',
|
127 |
-
'main_table.no_discount',
|
128 |
-
'main_table.base_cost',
|
129 |
-
'main_table.price',
|
130 |
-
'main_table.base_price',
|
131 |
-
'main_table.original_price',
|
132 |
-
'main_table.base_original_price',
|
133 |
-
'main_table.tax_percent',
|
134 |
-
'main_table.tax_amount',
|
135 |
-
'main_table.base_tax_amount',
|
136 |
-
''
|
137 |
-
);
|
138 |
-
}
|
139 |
-
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/SavvyCube/Connector/Model/Api/Refund.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Refund extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_creditmemo';
|
24 |
+
|
25 |
+
protected $versionColumns = array(
|
26 |
+
'discount_description' => array(
|
27 |
+
'check_existence' => true
|
28 |
+
),
|
29 |
+
'base_shipping_hidden_tax_amnt' => array(
|
30 |
+
'renamed' => array(
|
31 |
+
'since' => '1.6.0.0',
|
32 |
+
'originally' => 'base_shipping_hidden_tax_amount'
|
33 |
+
)
|
34 |
+
)
|
35 |
+
);
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Return columns list for getMethod select
|
39 |
+
*
|
40 |
+
* @return string | array
|
41 |
+
*/
|
42 |
+
protected function columnsListForGet()
|
43 |
+
{
|
44 |
+
return $this->prepareColumns(
|
45 |
+
array(
|
46 |
+
'entity_id',
|
47 |
+
'base_shipping_tax_amount',
|
48 |
+
'store_to_order_rate',
|
49 |
+
'base_discount_amount',
|
50 |
+
'base_to_order_rate',
|
51 |
+
'base_adjustment_negative',
|
52 |
+
'base_subtotal_incl_tax',
|
53 |
+
'base_shipping_amount',
|
54 |
+
'store_to_base_rate',
|
55 |
+
'base_to_global_rate',
|
56 |
+
'base_adjustment',
|
57 |
+
'base_subtotal',
|
58 |
+
'base_grand_total',
|
59 |
+
'base_adjustment_positive',
|
60 |
+
'base_tax_amount',
|
61 |
+
'order_id',
|
62 |
+
'creditmemo_status',
|
63 |
+
'state',
|
64 |
+
'shipping_address_id',
|
65 |
+
'billing_address_id',
|
66 |
+
'invoice_id',
|
67 |
+
'store_currency_code',
|
68 |
+
'order_currency_code',
|
69 |
+
'base_currency_code',
|
70 |
+
'global_currency_code',
|
71 |
+
'transaction_id',
|
72 |
+
'increment_id',
|
73 |
+
'created_at',
|
74 |
+
'updated_at',
|
75 |
+
'base_hidden_tax_amount',
|
76 |
+
'base_shipping_hidden_tax_amnt',
|
77 |
+
'base_shipping_incl_tax',
|
78 |
+
'discount_description',
|
79 |
+
),
|
80 |
+
'main_table'
|
81 |
+
);
|
82 |
+
}
|
83 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Refunditem.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Refunditem extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_creditmemo_item';
|
24 |
+
|
25 |
+
protected $parentEntity = array(
|
26 |
+
'model' => 'wCube/api_refund',
|
27 |
+
'parent_date' => 'updated_at',
|
28 |
+
'parent_fk' => 'parent_id'
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $versionColumns = array(
|
32 |
+
'base_weee_tax_applied_row_amnt' => array(
|
33 |
+
'renamed' => array(
|
34 |
+
'since' => '1.6.0.0',
|
35 |
+
'originally' => 'base_weee_tax_applied_row_amount'
|
36 |
+
)
|
37 |
+
)
|
38 |
+
);
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Return columns list for getMethod select
|
42 |
+
*
|
43 |
+
* @return string | array
|
44 |
+
*/
|
45 |
+
protected function columnsListForGet()
|
46 |
+
{
|
47 |
+
return $this->prepareColumns(
|
48 |
+
array(
|
49 |
+
'entity_id',
|
50 |
+
'parent_id',
|
51 |
+
'base_price',
|
52 |
+
'base_row_total',
|
53 |
+
'base_discount_amount',
|
54 |
+
'base_tax_amount',
|
55 |
+
'base_price_incl_tax',
|
56 |
+
'qty',
|
57 |
+
'base_cost',
|
58 |
+
'base_row_total_incl_tax',
|
59 |
+
'product_id',
|
60 |
+
'order_item_id',
|
61 |
+
'base_hidden_tax_amount',
|
62 |
+
'base_weee_tax_disposition',
|
63 |
+
'base_weee_tax_row_disposition',
|
64 |
+
'base_weee_tax_applied_amount',
|
65 |
+
'base_weee_tax_applied_row_amnt',
|
66 |
+
),
|
67 |
+
'main_table'
|
68 |
+
);
|
69 |
+
}
|
70 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Shipment.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Shipment extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_shipment';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Return columns list for getMethod select
|
27 |
+
*
|
28 |
+
* @return string | array
|
29 |
+
*/
|
30 |
+
protected function columnsListForGet()
|
31 |
+
{
|
32 |
+
return $this->prepareColumns(
|
33 |
+
array(
|
34 |
+
'entity_id',
|
35 |
+
'store_id',
|
36 |
+
'total_weight',
|
37 |
+
'total_qty',
|
38 |
+
'order_id',
|
39 |
+
'customer_id',
|
40 |
+
'shipping_address_id',
|
41 |
+
'billing_address_id',
|
42 |
+
'shipment_status',
|
43 |
+
'increment_id',
|
44 |
+
'created_at',
|
45 |
+
'updated_at',
|
46 |
+
'shipping_label',
|
47 |
+
),
|
48 |
+
'main_table'
|
49 |
+
);
|
50 |
+
}
|
51 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Shipmentitem.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-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@savvycube.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category SavvyCube
|
17 |
+
* @package SavvyCube_Connector
|
18 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Shipmentitem extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_flat_shipment_item';
|
24 |
+
|
25 |
+
protected $parentEntity = array(
|
26 |
+
'model' => 'wCube/api_shipment',
|
27 |
+
'parent_date' => 'updated_at',
|
28 |
+
'parent_fk' => 'parent_id'
|
29 |
+
);
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Return columns list for getMethod select
|
33 |
+
*
|
34 |
+
* @return string | array
|
35 |
+
*/
|
36 |
+
protected function columnsListForGet()
|
37 |
+
{
|
38 |
+
return $this->prepareColumns(
|
39 |
+
array(
|
40 |
+
'entity_id',
|
41 |
+
'parent_id',
|
42 |
+
'row_total',
|
43 |
+
'price',
|
44 |
+
'weight',
|
45 |
+
'qty',
|
46 |
+
'product_id',
|
47 |
+
'order_item_id',
|
48 |
+
),
|
49 |
+
'main_table'
|
50 |
+
);
|
51 |
+
}
|
52 |
+
}
|
app/code/community/SavvyCube/Connector/Model/Api/Store.php
DELETED
@@ -1,75 +0,0 @@
|
|
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@savvycube.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* @category SavvyCube
|
16 |
-
* @package SavvyCube_Connector
|
17 |
-
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
-
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Store extends SavvyCube_Connector_Model_Api_Abstract {
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Render response on wCube/api/store get query
|
24 |
-
*
|
25 |
-
* @param array $request array of parameters
|
26 |
-
*
|
27 |
-
* @return array
|
28 |
-
*/
|
29 |
-
public function getMethod()
|
30 |
-
{
|
31 |
-
/** get all stores */
|
32 |
-
$sql = $this->initSelectWithOrderDateFilter()
|
33 |
-
->distinct()
|
34 |
-
->join(
|
35 |
-
array('o' => $this->getTableName('sales_flat_order')),
|
36 |
-
'o.entity_id = st_hist.parent_id',
|
37 |
-
array()
|
38 |
-
)->join(
|
39 |
-
array('str' => $this->getTableName('core_store')),
|
40 |
-
'str.store_id = o.store_id',
|
41 |
-
array()
|
42 |
-
)->join(
|
43 |
-
array('webs' => $this->getTableName('core_website')),
|
44 |
-
'str.website_id = webs.website_id',
|
45 |
-
array(
|
46 |
-
'webs.website_id',
|
47 |
-
'website_code' => 'webs.code',
|
48 |
-
'website_name' => 'webs.name',
|
49 |
-
)
|
50 |
-
)
|
51 |
-
->reset(Varien_Db_Select::COLUMNS)
|
52 |
-
->columns($this->_columnsListForGet());
|
53 |
-
$this->renderParameters($sql);
|
54 |
-
return $this->getDbRead()->fetchAll($sql);
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Return columns list for getMethod select
|
59 |
-
*
|
60 |
-
* @return string | array
|
61 |
-
*/
|
62 |
-
private function _columnsListForGet()
|
63 |
-
{
|
64 |
-
return array(
|
65 |
-
'store_id' => 'str.store_id',
|
66 |
-
'store_code' => 'str.code',
|
67 |
-
'store_group_id' => 'str.group_id',
|
68 |
-
'store_name' => 'str.name',
|
69 |
-
'website_id' => 'webs.website_id',
|
70 |
-
'website_code' => 'webs.code',
|
71 |
-
'website_name' => 'webs.name',
|
72 |
-
);
|
73 |
-
}
|
74 |
-
|
75 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/SavvyCube/Connector/Model/Api/Transaction.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -17,38 +18,28 @@
|
|
17 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Transaction extends SavvyCube_Connector_Model_Api_Abstract
|
|
|
|
|
21 |
|
22 |
-
const MAIN_TABLE = 'sales_payment_transaction';
|
23 |
|
24 |
/**
|
25 |
-
* Render response
|
26 |
*
|
27 |
* @return array
|
28 |
*/
|
29 |
public function getMethod()
|
30 |
{
|
31 |
-
$
|
32 |
-
->
|
33 |
-
->
|
34 |
-
array('
|
35 |
-
|
36 |
-
array()
|
37 |
)
|
38 |
->reset(Varien_Db_Select::COLUMNS)
|
39 |
-
->columns(
|
40 |
-
|
41 |
-
$this->renderParameters($subSql);
|
42 |
|
43 |
-
|
44 |
-
->from(array('main_table' => $this->getTableName(self::MAIN_TABLE)))
|
45 |
-
->join(
|
46 |
-
array('A' => new Zend_Db_Expr("({$subSql})")),
|
47 |
-
'A.`transaction_id`=main_table.`transaction_id`'
|
48 |
-
)
|
49 |
-
->columns($this->_columnsListForGet());
|
50 |
-
|
51 |
-
return $this->getDbRead()->fetchAll($sql);
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -56,26 +47,37 @@ class SavvyCube_Connector_Model_Api_Transaction extends SavvyCube_Connector_Mode
|
|
56 |
*
|
57 |
* @return string | array
|
58 |
*/
|
59 |
-
|
60 |
{
|
61 |
-
return
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
);
|
69 |
}
|
70 |
-
|
71 |
-
protected function renderParameters($sql)
|
72 |
-
{
|
73 |
-
parent::renderParameters($sql);
|
74 |
-
|
75 |
-
if ($this->request['from_date'] !== null)
|
76 |
-
$sql->where('main_table.created_at > ?', urldecode($this->request['from_date']));
|
77 |
-
if ($this->request['to_date'] !== null)
|
78 |
-
$sql->where('main_table.created_at <= ?', urldecode($this->request['to_date']));
|
79 |
-
}
|
80 |
-
|
81 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
18 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Transaction extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
+
protected $mainTable = 'sales_payment_transaction';
|
24 |
|
|
|
25 |
|
26 |
/**
|
27 |
+
* Render response
|
28 |
*
|
29 |
* @return array
|
30 |
*/
|
31 |
public function getMethod()
|
32 |
{
|
33 |
+
$sql = $this->getHelper()->getDbRead()->select()
|
34 |
+
->from(array('main_table' => $this->getHelper()->getTableName($this->mainTable)))
|
35 |
+
->joinLeft(
|
36 |
+
array('payment_table' => $this->getHelper()->getTableName('sales_flat_order_payment')),
|
37 |
+
"main_table.payment_id = payment_table.entity_id"
|
|
|
38 |
)
|
39 |
->reset(Varien_Db_Select::COLUMNS)
|
40 |
+
->columns($this->columnsListForGet());
|
|
|
|
|
41 |
|
42 |
+
return $this->getResult($sql, '`main_table`.created_at');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
/**
|
47 |
*
|
48 |
* @return string | array
|
49 |
*/
|
50 |
+
protected function columnsListForGet()
|
51 |
{
|
52 |
+
return array_merge(
|
53 |
+
$this->prepareColumns(
|
54 |
+
array(
|
55 |
+
'base_shipping_captured',
|
56 |
+
'base_amount_paid',
|
57 |
+
'base_amount_authorized',
|
58 |
+
'base_amount_paid_online',
|
59 |
+
'base_amount_refunded_online',
|
60 |
+
'base_shipping_amount',
|
61 |
+
'base_amount_ordered',
|
62 |
+
'base_shipping_refunded',
|
63 |
+
'base_amount_refunded',
|
64 |
+
'base_amount_canceled',
|
65 |
+
'method',
|
66 |
+
'last_trans_id'
|
67 |
+
),
|
68 |
+
'payment_table'
|
69 |
+
),
|
70 |
+
$this->prepareColumns(
|
71 |
+
array(
|
72 |
+
'entity_id' => 'transaction_id',
|
73 |
+
'order_id',
|
74 |
+
'txn_id',
|
75 |
+
'txn_type',
|
76 |
+
'is_closed',
|
77 |
+
'created_at'
|
78 |
+
),
|
79 |
+
'main_table'
|
80 |
+
)
|
81 |
);
|
82 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
app/code/community/SavvyCube/Connector/Model/Api/Version.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -17,7 +18,8 @@
|
|
17 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
-
class SavvyCube_Connector_Model_Api_Version extends SavvyCube_Connector_Model_Api_Abstract
|
|
|
21 |
|
22 |
|
23 |
/**
|
@@ -36,17 +38,15 @@ class SavvyCube_Connector_Model_Api_Version extends SavvyCube_Connector_Model_Ap
|
|
36 |
&& $this->request['version'] != $currentVersion
|
37 |
) {
|
38 |
$helper->setDesiredVersion($this->request['version']);
|
39 |
-
$helper->addAdminNotification(
|
40 |
-
$this->request['title'],
|
41 |
-
$this->request['description'],
|
42 |
-
$this->request['url']
|
43 |
-
);
|
44 |
}
|
45 |
|
46 |
-
$
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
50 |
return array(
|
51 |
'module_version' => $currentVersion,
|
52 |
'magento_version' => Mage::getVersion(),
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
18 |
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
+
class SavvyCube_Connector_Model_Api_Version extends SavvyCube_Connector_Model_Api_Abstract
|
22 |
+
{
|
23 |
|
24 |
|
25 |
/**
|
38 |
&& $this->request['version'] != $currentVersion
|
39 |
) {
|
40 |
$helper->setDesiredVersion($this->request['version']);
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
+
$bottomDateSql = $this->getHelper()->getDbRead()->select()
|
44 |
+
->from(array('order' => $this->getHelper()->getTableName('sales_flat_order')))
|
45 |
+
->reset(Varien_Db_Select::COLUMNS)
|
46 |
+
->columns('MIN(created_at) AS bottom_date');
|
47 |
+
|
48 |
+
$bottomDate = $this->getHelper()->getDbRead()->fetchOne($bottomDateSql);
|
49 |
+
|
50 |
return array(
|
51 |
'module_version' => $currentVersion,
|
52 |
'magento_version' => Mage::getVersion(),
|
app/code/community/SavvyCube/Connector/Model/Nonce.php
CHANGED
@@ -33,7 +33,7 @@ class SavvyCube_Connector_Model_Nonce extends Varien_Object
|
|
33 |
/**
|
34 |
* @return SavvyCube_Connector_Helper_Authorization
|
35 |
*/
|
36 |
-
private function
|
37 |
{
|
38 |
return Mage::helper('wCube/authorization');
|
39 |
}
|
@@ -51,44 +51,56 @@ class SavvyCube_Connector_Model_Nonce extends Varien_Object
|
|
51 |
*
|
52 |
* @return Zend_Db_Pdo_Statement
|
53 |
*/
|
54 |
-
private function
|
55 |
{
|
56 |
-
$lifeTime = $this->
|
57 |
-
$query
|
58 |
-
return $this->
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
* store nonce
|
63 |
*
|
64 |
-
* @param string $nonce
|
65 |
*
|
66 |
* @return Zend_Db_Pdo_Statement
|
67 |
*/
|
68 |
-
private function
|
69 |
{
|
70 |
-
$query = "INSERT INTO `{$this->getTable()}` VALUES (
|
71 |
-
return $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
* check if nonce already stored in last lifeTime seconds
|
76 |
*
|
77 |
-
* @param string $nonce
|
78 |
* @param string $created nonce creation datetime in GMT format
|
79 |
*
|
80 |
* @return bool
|
81 |
*/
|
82 |
-
private function
|
83 |
{
|
84 |
$date = new DateTime($created);
|
85 |
$timeDiff = $this->getCurrentTimestamp() - $date->format('U');
|
86 |
-
if (!
|
87 |
-
$query = "SELECT * FROM `{$this->getTable()}`
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
return false;
|
91 |
-
|
92 |
}
|
93 |
return true;
|
94 |
}
|
@@ -97,41 +109,43 @@ class SavvyCube_Connector_Model_Nonce extends Varien_Object
|
|
97 |
* write date to DB
|
98 |
*
|
99 |
* @param string $query sql statement
|
|
|
100 |
*
|
101 |
* @return Zend_Db_Pdo_Statement
|
102 |
*/
|
103 |
-
private function
|
104 |
{
|
105 |
$connection = $this->getResource()->getConnection('core_write');
|
106 |
-
return $connection->query($query);
|
107 |
}
|
108 |
|
109 |
/**
|
110 |
* read data from DB
|
111 |
*
|
112 |
* @param string $query sql statement
|
|
|
113 |
*
|
114 |
* @return array
|
115 |
*/
|
116 |
-
private function
|
117 |
{
|
118 |
$connection = $this->getResource()->getConnection('core_read');
|
119 |
-
return $connection->fetchAll($query);
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
* check nonce, store it and clean old nonce
|
124 |
*
|
125 |
-
* @param string $nonce
|
126 |
* @param string $created nonce creation datetime in GMT format
|
127 |
*
|
128 |
* @return bool
|
129 |
*/
|
130 |
public function checkNonce($nonce, $created)
|
131 |
{
|
132 |
-
if (!$this->
|
133 |
-
$this->
|
134 |
-
$this->
|
135 |
return true;
|
136 |
}
|
137 |
return false;
|
33 |
/**
|
34 |
* @return SavvyCube_Connector_Helper_Authorization
|
35 |
*/
|
36 |
+
private function getAuthHelper()
|
37 |
{
|
38 |
return Mage::helper('wCube/authorization');
|
39 |
}
|
51 |
*
|
52 |
* @return Zend_Db_Pdo_Statement
|
53 |
*/
|
54 |
+
private function cleanTable()
|
55 |
{
|
56 |
+
$lifeTime = $this->getAuthHelper()->getNonceLifetime(true);
|
57 |
+
$query = "DELETE FROM `{$this->getTable()}` WHERE `created` <= " . ($this->getCurrentTimestamp() - $lifeTime);
|
58 |
+
return $this->write($query);
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
* store nonce
|
63 |
*
|
64 |
+
* @param string $nonce nonce value
|
65 |
*
|
66 |
* @return Zend_Db_Pdo_Statement
|
67 |
*/
|
68 |
+
private function storeNonce($nonce)
|
69 |
{
|
70 |
+
$query = "INSERT INTO `{$this->getTable()}` VALUES (:nonce, :current_timestamp)";
|
71 |
+
return $this->write(
|
72 |
+
$query,
|
73 |
+
array(
|
74 |
+
'nonce' => $nonce,
|
75 |
+
'current_timestamp' => $this->getCurrentTimestamp()
|
76 |
+
)
|
77 |
+
);
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
* check if nonce already stored in last lifeTime seconds
|
82 |
*
|
83 |
+
* @param string $nonce nonce value
|
84 |
* @param string $created nonce creation datetime in GMT format
|
85 |
*
|
86 |
* @return bool
|
87 |
*/
|
88 |
+
private function findDoubling($nonce, $created)
|
89 |
{
|
90 |
$date = new DateTime($created);
|
91 |
$timeDiff = $this->getCurrentTimestamp() - $date->format('U');
|
92 |
+
if (!($timeDiff > $this->getAuthHelper()->getNonceLifetime(true))) {
|
93 |
+
$query = "SELECT * FROM `{$this->getTable()}` "
|
94 |
+
. " WHERE `nonce`=:nonce AND (:current_timestamp - `created`) < :lifetime";
|
95 |
+
$bind = array(
|
96 |
+
'nonce' => $nonce,
|
97 |
+
'current_timestamp' => $this->getCurrentTimestamp(),
|
98 |
+
'lifetime' => $this->getAuthHelper()->getNonceLifetime(true),
|
99 |
+
);
|
100 |
+
$result = $this->read($query, $bind);
|
101 |
+
if (!count($result)) {
|
102 |
return false;
|
103 |
+
}
|
104 |
}
|
105 |
return true;
|
106 |
}
|
109 |
* write date to DB
|
110 |
*
|
111 |
* @param string $query sql statement
|
112 |
+
* @param array $bind
|
113 |
*
|
114 |
* @return Zend_Db_Pdo_Statement
|
115 |
*/
|
116 |
+
private function write($query, $bind = array())
|
117 |
{
|
118 |
$connection = $this->getResource()->getConnection('core_write');
|
119 |
+
return $connection->query($query, $bind);
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
* read data from DB
|
124 |
*
|
125 |
* @param string $query sql statement
|
126 |
+
* @param array $bind
|
127 |
*
|
128 |
* @return array
|
129 |
*/
|
130 |
+
private function read($query, $bind = array())
|
131 |
{
|
132 |
$connection = $this->getResource()->getConnection('core_read');
|
133 |
+
return $connection->fetchAll($query, $bind);
|
134 |
}
|
135 |
|
136 |
/**
|
137 |
* check nonce, store it and clean old nonce
|
138 |
*
|
139 |
+
* @param string $nonce nonce value
|
140 |
* @param string $created nonce creation datetime in GMT format
|
141 |
*
|
142 |
* @return bool
|
143 |
*/
|
144 |
public function checkNonce($nonce, $created)
|
145 |
{
|
146 |
+
if (!$this->findDoubling($nonce, $created)) {
|
147 |
+
$this->storeNonce($nonce);
|
148 |
+
$this->cleanTable();
|
149 |
return true;
|
150 |
}
|
151 |
return false;
|
app/code/community/SavvyCube/Connector/controllers/ApiController.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Magento
|
4 |
*
|
@@ -19,8 +20,9 @@
|
|
19 |
*/
|
20 |
class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Action
|
21 |
{
|
22 |
-
private function _authorize()
|
23 |
-
|
|
|
24 |
Mage::app()->getResponse()
|
25 |
->setHeader('HTTP/1.1', '401 Unauthorized')
|
26 |
->setBody('<h1>401 Unauthorized</h1>')
|
@@ -29,11 +31,47 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
29 |
}
|
30 |
}
|
31 |
|
32 |
-
private function formatResponse($data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
{
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
|
|
37 |
/**
|
38 |
* Authorization Helper
|
39 |
*
|
@@ -52,7 +90,7 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
52 |
$method = strtolower($this->getRequest()->getMethod()) . "Method";
|
53 |
try {
|
54 |
$parameters = $this->_getParameters();
|
55 |
-
} catch (Exception $e){
|
56 |
Mage::app()->getResponse()
|
57 |
->setHeader('HTTP/1.1', '404 Not Found')
|
58 |
->setBody($e->getMessage())
|
@@ -66,37 +104,46 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
66 |
->setBody('<h1>404: Api resource not found</h1>')
|
67 |
->sendResponse();
|
68 |
exit;
|
69 |
-
} else
|
70 |
-
|
71 |
-
->
|
72 |
-
|
73 |
-
->
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
76 |
|
77 |
-
Varien_Profiler::start(self::PROFILER_KEY.'::predispatch');
|
78 |
$this->preDispatch();
|
79 |
-
Varien_Profiler::stop(self::PROFILER_KEY.'::predispatch');
|
80 |
|
81 |
if ($this->getRequest()->isDispatched()) {
|
82 |
/**
|
83 |
* preDispatch() didn't change the action, so we can continue
|
84 |
*/
|
85 |
if (!$this->getFlag('', self::FLAG_NO_DISPATCH)) {
|
86 |
-
$_profilerKey = self::PROFILER_KEY.'::'
|
87 |
|
88 |
Varien_Profiler::start($_profilerKey);
|
89 |
$response = $apiResource->init($parameters)->$method();
|
90 |
-
$this->formatResponse($response);
|
91 |
Varien_Profiler::stop($_profilerKey);
|
92 |
|
93 |
-
Varien_Profiler::start(self::PROFILER_KEY.'::postdispatch');
|
94 |
$this->postDispatch();
|
95 |
-
Varien_Profiler::stop(self::PROFILER_KEY.'::postdispatch');
|
96 |
}
|
97 |
}
|
98 |
-
}
|
99 |
-
catch (Mage_Core_Controller_Varien_Exception $e) {
|
100 |
// set prepared flags
|
101 |
foreach ($e->getResultFlags() as $flagData) {
|
102 |
list($action, $flag, $value) = $flagData;
|
@@ -105,19 +152,19 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
105 |
// call forward, redirect or an action
|
106 |
list($method, $parameters) = $e->getResultCallback();
|
107 |
switch ($method) {
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
}
|
122 |
}
|
123 |
}
|
@@ -136,6 +183,20 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
136 |
);
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
private function _getParametersByAction($action, $method)
|
140 |
{
|
141 |
$parameters = array();
|
@@ -144,14 +205,16 @@ class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Actio
|
|
144 |
$actionNode = Mage::getConfig()->getNode("default/wCube/parameters/{$action}");
|
145 |
if ($actionNode && $actionNode->hasChildren()) {
|
146 |
$actionArray = $actionNode->asArray();
|
147 |
-
if (array_key_exists($method, $actionArray))
|
148 |
$parameters = $actionArray[$method];
|
|
|
149 |
}
|
150 |
if (is_array($parameters)) {
|
151 |
foreach ($parameters as $name => $options) {
|
152 |
-
$value = $this->getRequest()->getParam($name, isset($options['default'])
|
153 |
-
if(isset($option['required']) && $options['required'] && $value === null
|
154 |
-
throw new Exception('Missing required parameter:'
|
|
|
155 |
$result[$name] = $value;
|
156 |
}
|
157 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
20 |
*/
|
21 |
class SavvyCube_Connector_ApiController extends Mage_Core_Controller_Front_Action
|
22 |
{
|
23 |
+
private function _authorize()
|
24 |
+
{
|
25 |
+
if (!$this->getAuthHelper()->checkRequest()) {
|
26 |
Mage::app()->getResponse()
|
27 |
->setHeader('HTTP/1.1', '401 Unauthorized')
|
28 |
->setBody('<h1>401 Unauthorized</h1>')
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
private function formatResponse($data, $encrypt)
|
35 |
+
{
|
36 |
+
if ($encrypt) {
|
37 |
+
Mage::app()->getResponse()->setHeader('Content-Type', 'text/plain');
|
38 |
+
Mage::app()->getResponse()->setHeader('Content-Encoding', 'gzip');
|
39 |
+
Mage::app()->getResponse()->setBody(
|
40 |
+
$this->encrypt(Mage::helper('core')->jsonEncode($data))
|
41 |
+
);
|
42 |
+
} else {
|
43 |
+
Mage::app()->getResponse()->setHeader('Content-Type', 'application/json');
|
44 |
+
Mage::app()->getResponse()->setBody(
|
45 |
+
Mage::helper('core')->jsonEncode($data)
|
46 |
+
);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
private function encrypt($data)
|
51 |
{
|
52 |
+
$key = $this->getAuthHelper()->getCurrentKey('e');
|
53 |
+
|
54 |
+
return rtrim(
|
55 |
+
base64_encode(
|
56 |
+
mcrypt_encrypt(
|
57 |
+
MCRYPT_RIJNDAEL_128,
|
58 |
+
$key,
|
59 |
+
gzencode($data),
|
60 |
+
MCRYPT_MODE_ECB,
|
61 |
+
mcrypt_create_iv(
|
62 |
+
mcrypt_get_iv_size(
|
63 |
+
MCRYPT_RIJNDAEL_128,
|
64 |
+
MCRYPT_MODE_ECB
|
65 |
+
),
|
66 |
+
MCRYPT_RAND
|
67 |
+
)
|
68 |
+
)
|
69 |
+
),
|
70 |
+
"\0"
|
71 |
+
);
|
72 |
+
|
73 |
}
|
74 |
+
|
75 |
/**
|
76 |
* Authorization Helper
|
77 |
*
|
90 |
$method = strtolower($this->getRequest()->getMethod()) . "Method";
|
91 |
try {
|
92 |
$parameters = $this->_getParameters();
|
93 |
+
} catch (Exception $e) {
|
94 |
Mage::app()->getResponse()
|
95 |
->setHeader('HTTP/1.1', '404 Not Found')
|
96 |
->setBody($e->getMessage())
|
104 |
->setBody('<h1>404: Api resource not found</h1>')
|
105 |
->sendResponse();
|
106 |
exit;
|
107 |
+
} else {
|
108 |
+
if (($this->_isEncryptionRequired($action, $this->getRequest()->getMethod())
|
109 |
+
&& !$this->getAuthHelper()->getCurrentKey('e'))
|
110 |
+
) {
|
111 |
+
Mage::app()->getResponse()
|
112 |
+
->setHeader('HTTP/1.1', '401 Unauthorized')
|
113 |
+
->setBody('no encryption key')
|
114 |
+
->sendResponse();
|
115 |
+
exit;
|
116 |
+
} elseif (!is_callable(array($apiResource, $method))) {
|
117 |
+
Mage::app()->getResponse()
|
118 |
+
->setHeader('HTTP/1.1', '404 Not Found')
|
119 |
+
->setBody('<h1>404: method is not supported for this Api resource</h1>')
|
120 |
+
->sendResponse();
|
121 |
+
exit;
|
122 |
+
}
|
123 |
}
|
124 |
|
125 |
+
Varien_Profiler::start(self::PROFILER_KEY . '::predispatch');
|
126 |
$this->preDispatch();
|
127 |
+
Varien_Profiler::stop(self::PROFILER_KEY . '::predispatch');
|
128 |
|
129 |
if ($this->getRequest()->isDispatched()) {
|
130 |
/**
|
131 |
* preDispatch() didn't change the action, so we can continue
|
132 |
*/
|
133 |
if (!$this->getFlag('', self::FLAG_NO_DISPATCH)) {
|
134 |
+
$_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName();
|
135 |
|
136 |
Varien_Profiler::start($_profilerKey);
|
137 |
$response = $apiResource->init($parameters)->$method();
|
138 |
+
$this->formatResponse($response, $this->_isEncryptionRequired($action, $this->getRequest()->getMethod()));
|
139 |
Varien_Profiler::stop($_profilerKey);
|
140 |
|
141 |
+
Varien_Profiler::start(self::PROFILER_KEY . '::postdispatch');
|
142 |
$this->postDispatch();
|
143 |
+
Varien_Profiler::stop(self::PROFILER_KEY . '::postdispatch');
|
144 |
}
|
145 |
}
|
146 |
+
} catch (Mage_Core_Controller_Varien_Exception $e) {
|
|
|
147 |
// set prepared flags
|
148 |
foreach ($e->getResultFlags() as $flagData) {
|
149 |
list($action, $flag, $value) = $flagData;
|
152 |
// call forward, redirect or an action
|
153 |
list($method, $parameters) = $e->getResultCallback();
|
154 |
switch ($method) {
|
155 |
+
case Mage_Core_Controller_Varien_Exception::RESULT_REDIRECT:
|
156 |
+
list($path, $arguments) = $parameters;
|
157 |
+
$this->_redirect($path, $arguments);
|
158 |
+
break;
|
159 |
+
case Mage_Core_Controller_Varien_Exception::RESULT_FORWARD:
|
160 |
+
list($action, $controller, $module, $params) = $parameters;
|
161 |
+
$this->_forward($action, $controller, $module, $params);
|
162 |
+
break;
|
163 |
+
default:
|
164 |
+
$actionMethodName = $this->getActionMethodName($method);
|
165 |
+
$this->getRequest()->setActionName($method);
|
166 |
+
$this->$actionMethodName($method);
|
167 |
+
break;
|
168 |
}
|
169 |
}
|
170 |
}
|
183 |
);
|
184 |
}
|
185 |
|
186 |
+
private function _isEncryptionRequired($action, $method)
|
187 |
+
{
|
188 |
+
/** @var Varien_Simplexml_Element $doNotEncryptNode */
|
189 |
+
$doNotEncryptNode = Mage::getConfig()->getNode("default/wCube/donotencrypt");
|
190 |
+
if ($doNotEncryptNode && $doNotEncryptNode->hasChildren()) {
|
191 |
+
$doNotEncryptArray = $doNotEncryptNode->asArray();
|
192 |
+
$action = strtolower($action);
|
193 |
+
$method = strtoupper($method);
|
194 |
+
return !isset($doNotEncryptArray[$action][$method]);
|
195 |
+
}
|
196 |
+
|
197 |
+
return true;
|
198 |
+
}
|
199 |
+
|
200 |
private function _getParametersByAction($action, $method)
|
201 |
{
|
202 |
$parameters = array();
|
205 |
$actionNode = Mage::getConfig()->getNode("default/wCube/parameters/{$action}");
|
206 |
if ($actionNode && $actionNode->hasChildren()) {
|
207 |
$actionArray = $actionNode->asArray();
|
208 |
+
if (array_key_exists($method, $actionArray)) {
|
209 |
$parameters = $actionArray[$method];
|
210 |
+
}
|
211 |
}
|
212 |
if (is_array($parameters)) {
|
213 |
foreach ($parameters as $name => $options) {
|
214 |
+
$value = $this->getRequest()->getParam($name, isset($options['default']) ? $options['default'] : null);
|
215 |
+
if (isset($option['required']) && $options['required'] && $value === null) {
|
216 |
+
throw new Exception('Missing required parameter:' . $name);
|
217 |
+
}
|
218 |
$result[$name] = $value;
|
219 |
}
|
220 |
}
|
app/code/community/SavvyCube/Connector/etc/config.xml
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
<config>
|
23 |
<modules>
|
24 |
<SavvyCube_Connector>
|
25 |
-
<version>0.0.
|
26 |
</SavvyCube_Connector>
|
27 |
</modules>
|
28 |
<global>
|
@@ -100,39 +100,50 @@
|
|
100 |
<address>
|
101 |
<GET/>
|
102 |
</address>
|
103 |
-
<
|
104 |
<GET/>
|
105 |
-
</
|
106 |
-
<
|
107 |
<GET/>
|
108 |
-
</
|
109 |
-
<
|
110 |
<GET/>
|
111 |
-
</
|
112 |
-
<
|
113 |
<GET/>
|
114 |
-
</
|
115 |
-
<
|
116 |
<GET/>
|
117 |
-
</
|
118 |
-
<
|
|
|
|
|
|
|
119 |
<GET/>
|
120 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
<version>
|
122 |
<GET>
|
123 |
<version/>
|
124 |
-
<url>
|
125 |
-
<default><![CDATA[http://app.savvycube.com/]]></default>
|
126 |
-
</url>
|
127 |
-
<description>
|
128 |
-
<default><![CDATA[New Savvycube module is now available for download and update.]]></default>
|
129 |
-
</description>
|
130 |
-
<title>
|
131 |
-
<default><![CDATA[New Savvycube module]]></default>
|
132 |
-
</title>
|
133 |
</GET>
|
134 |
</version>
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
</parameters>
|
|
|
|
|
|
|
|
|
|
|
136 |
</wCube>
|
137 |
</default>
|
138 |
</config>
|
22 |
<config>
|
23 |
<modules>
|
24 |
<SavvyCube_Connector>
|
25 |
+
<version>0.0.5</version>
|
26 |
</SavvyCube_Connector>
|
27 |
</modules>
|
28 |
<global>
|
100 |
<address>
|
101 |
<GET/>
|
102 |
</address>
|
103 |
+
<order>
|
104 |
<GET/>
|
105 |
+
</order>
|
106 |
+
<orderitem>
|
107 |
<GET/>
|
108 |
+
</orderitem>
|
109 |
+
<invoice>
|
110 |
<GET/>
|
111 |
+
</invoice>
|
112 |
+
<invoiceitem>
|
113 |
<GET/>
|
114 |
+
</invoiceitem>
|
115 |
+
<refund>
|
116 |
<GET/>
|
117 |
+
</refund>
|
118 |
+
<refunditem>
|
119 |
+
<GET/>
|
120 |
+
</refunditem>
|
121 |
+
<shipment>
|
122 |
<GET/>
|
123 |
+
</shipment>
|
124 |
+
<shipmentitem>
|
125 |
+
<GET/>
|
126 |
+
</shipmentitem>
|
127 |
+
<transaction>
|
128 |
+
<GET/>
|
129 |
+
</transaction>
|
130 |
<version>
|
131 |
<GET>
|
132 |
<version/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
</GET>
|
134 |
</version>
|
135 |
+
<notification>
|
136 |
+
<GET>
|
137 |
+
<description/>
|
138 |
+
<title/>
|
139 |
+
</GET>
|
140 |
+
</notification>
|
141 |
</parameters>
|
142 |
+
<donotencrypt>
|
143 |
+
<notification>
|
144 |
+
<GET/>
|
145 |
+
</notification>
|
146 |
+
</donotencrypt>
|
147 |
</wCube>
|
148 |
</default>
|
149 |
</config>
|
app/code/community/SavvyCube/Connector/sql/wCube_setup/mysql4-upgrade-0.0.4-0.0.5.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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@savvycube.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category SavvyCube
|
16 |
+
* @package SavvyCube_Connector
|
17 |
+
* @copyright Copyright (c) 2014 SavvyCube (http://www.savvycube.com). SavvyCube is a trademark of Webtex Solutions, LLC (http://www.webtexsoftware.com).
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
22 |
+
$installer = $this;
|
23 |
+
|
24 |
+
$installer->startSetup();
|
25 |
+
|
26 |
+
$installer->getConnection()->modifyColumn(
|
27 |
+
$installer->getTable('wCube/nonce'),
|
28 |
+
'nonce',
|
29 |
+
'BLOB'
|
30 |
+
);
|
31 |
+
|
32 |
+
$installer->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SavvyCube_Ecommerce_Analytics_Connector</name>
|
4 |
-
<version>0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL v3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>SavvyCube is a simple and precise ecommerce metrics and predictive analytics. Use this extension to connect your Magento store to your SavvyCube account.</description>
|
11 |
<notes>Stable public release</notes>
|
12 |
<authors><author><name>Webtex Software</name><user>auto-converted</user><email>info@webtexsoftware.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="SavvyCube"><dir name="Connector"><dir name="Block"><dir name="Config"><file name="Activate.php" hash="6c6f49704138e9f8ad2eb3087d5ab9cf"/><file name="Version.php" hash="d33ed5f1e15aad06229a1c2beefdb3cf"/></dir></dir><dir name="Helper"><file name="Authorization.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SavvyCube_Ecommerce_Analytics_Connector</name>
|
4 |
+
<version>0.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL v3.0)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>SavvyCube is a simple and precise ecommerce metrics and predictive analytics. Use this extension to connect your Magento store to your SavvyCube account.</description>
|
11 |
<notes>Stable public release</notes>
|
12 |
<authors><author><name>Webtex Software</name><user>auto-converted</user><email>info@webtexsoftware.com</email></author></authors>
|
13 |
+
<date>2014-10-16</date>
|
14 |
+
<time>15:08:13</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="SavvyCube"><dir name="Connector"><dir name="Block"><dir name="Config"><file name="Activate.php" hash="6c6f49704138e9f8ad2eb3087d5ab9cf"/><file name="Version.php" hash="d33ed5f1e15aad06229a1c2beefdb3cf"/></dir></dir><dir name="Helper"><file name="Authorization.php" hash="90cf373542ccad1b1042e6dcbdc4de48"/><file name="Data.php" hash="5221d06ae0cc8e96c362dc521c678f86"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="af94ed0ff48528094203dd75f3c947e4"/><file name="Address.php" hash="ae28375fc0c1a2d9517d2f0e784d35a4"/><file name="Invoice.php" hash="7081d4d22a49c0435517988264e39554"/><file name="Invoiceitem.php" hash="918632b4ed4b00b47dc6c6091bc63fff"/><file name="Notification.php" hash="15431472c0b3eba58b1d29f0100fc338"/><file name="Order.php" hash="440d45dd8c8d0ca56fc4cad296f7fbda"/><file name="Orderitem.php" hash="581367c762a833d784f38bec0f52ea66"/><file name="Refund.php" hash="fd32905e72b6fdfc6592894bb46a4043"/><file name="Refunditem.php" hash="43d7f18578eb6b00fb368be64c1a82d0"/><file name="Shipment.php" hash="314352a8884447a0bb9711e36815dacc"/><file name="Shipmentitem.php" hash="c0eeda775adf8daf403f9b76a71382c3"/><file name="Transaction.php" hash="6aee9e051371e9e99e5ef85396606c84"/><file name="Version.php" hash="a8f62976f3fb5bf7db781a51a49e2a04"/></dir><file name="Nonce.php" hash="e539f97a43a1a9ff6c05617527ac5099"/></dir><dir name="cert"><file name="x509.crt" hash="17c7a49283a1df8909f9b2e068664daf"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="16814a2180e3c0f246520acfec75be6f"/></dir><file name="ApiController.php" hash="0c7663f40dfce18efad6c6a8cd23e275"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6b0ca0c3c1d3427a761373094df46039"/><file name="config.xml" hash="9617b8f257b2321c5dd6f0408ed2011f"/><file name="system.xml" hash="313c59a52430ba720ab3211229d74297"/></dir><dir name="sql"><dir name="wCube_setup"><file name="mysql4-install-0.0.1.php" hash="790e03ae38f3a37e3d61ddda9bceb8de"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="a6c950adf5d247ae35b7846d9cca3c65"/></dir></dir><file name="CHANGELOG.md" hash="7e80d461baa503d12e559b11d7254146"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SavvyCube_Connector.xml" hash="9c75d06abd6476e6e169b3fed17b08b6"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|