Version Notes
Download this release
Release Info
| Developer | Codisto |
| Extension | codistoconnect |
| Version | 1.90.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.90.5 to 1.90.6
- app/code/community/Codisto/Sync/Controller/Router.php +7 -5
- app/code/community/Codisto/Sync/Helper/Data.php +39 -17
- app/code/community/Codisto/Sync/controllers/IndexController.php +7 -5
- app/code/community/Codisto/Sync/data/codisto_setup/{data-install-1.90.5.php → data-install-1.90.6.php} +0 -0
- app/code/community/Codisto/Sync/etc/config.xml +1 -1
- app/code/community/Codisto/Sync/sql/codisto_setup/{mysql4-install-1.90.5.php → mysql4-install-1.90.6.php} +0 -0
- package.xml +1 -1
app/code/community/Codisto/Sync/Controller/Router.php
CHANGED
|
@@ -193,8 +193,9 @@ class Codisto_Sync_Controller_Router extends Mage_Core_Controller_Varien_Router_
|
|
| 193 |
}
|
| 194 |
else
|
| 195 |
{
|
| 196 |
-
$response->setBody('<!DOCTYPE html><html><head></head><body><h1>Unable to Register</h1><p>Sorry, we
|
| 197 |
-
|
|
|
|
| 198 |
}
|
| 199 |
|
| 200 |
return true;
|
|
@@ -203,8 +204,9 @@ class Codisto_Sync_Controller_Router extends Mage_Core_Controller_Varien_Router_
|
|
| 203 |
|
| 204 |
if($MerchantID == null)
|
| 205 |
{
|
| 206 |
-
$response->setBody('<!DOCTYPE html><html><head></head><body><h1>Unable to Register</h1><p>Sorry, we
|
| 207 |
-
|
|
|
|
| 208 |
|
| 209 |
return true;
|
| 210 |
}
|
|
@@ -300,7 +302,7 @@ class Codisto_Sync_Controller_Router extends Mage_Core_Controller_Varien_Router_
|
|
| 300 |
return true;
|
| 301 |
}
|
| 302 |
|
| 303 |
-
$remotePath = preg_replace('/^\/codisto\/\/?|key\/[a-zA-z0-9]
|
| 304 |
if($MerchantID)
|
| 305 |
{
|
| 306 |
$remoteUrl = 'https://ui.codisto.com/' . $MerchantID . '/' . $remotePath;
|
| 193 |
}
|
| 194 |
else
|
| 195 |
{
|
| 196 |
+
$response->setBody('<!DOCTYPE html><html><head></head><body><h1>Unable to Register</h1><p>Sorry, we are currently unable to register your Codisto account.
|
| 197 |
+
In most cases, this is due to your server configuration being unable to make outbound communication to the Codisto servers.</p>
|
| 198 |
+
<p>This is usually easily fixed - please contact <a href="mailto:support@codisto.com">support@codisto.com</a> and our team will help to resolve the issue</p></body></html>');
|
| 199 |
}
|
| 200 |
|
| 201 |
return true;
|
| 204 |
|
| 205 |
if($MerchantID == null)
|
| 206 |
{
|
| 207 |
+
$response->setBody('<!DOCTYPE html><html><head></head><body><h1>Unable to Register</h1><p>Sorry, we are currently unable to register your Codisto account.
|
| 208 |
+
In most cases, this is due to your server configuration being unable to make outbound communication to the Codisto servers.</p>
|
| 209 |
+
<p>This is usually easily fixed - please contact <a href="mailto:support@codisto.com">support@codisto.com</a> and our team will help to resolve the issue</p></body></html>');
|
| 210 |
|
| 211 |
return true;
|
| 212 |
}
|
| 302 |
return true;
|
| 303 |
}
|
| 304 |
|
| 305 |
+
$remotePath = preg_replace('/^\/codisto\/\/?|key\/[a-zA-z0-9]*\/?/', '', $path);
|
| 306 |
if($MerchantID)
|
| 307 |
{
|
| 308 |
$remoteUrl = 'https://ui.codisto.com/' . $MerchantID . '/' . $remotePath;
|
app/code/community/Codisto/Sync/Helper/Data.php
CHANGED
|
@@ -143,31 +143,53 @@ class Codisto_Sync_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 143 |
public function createMerchantwithLock()
|
| 144 |
{
|
| 145 |
$createMerchant = false;
|
|
|
|
| 146 |
$lockFile = Mage::getBaseDir('var') . '/codisto-lock';
|
| 147 |
|
| 148 |
-
$
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
|
| 159 |
-
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
-
|
| 166 |
-
$lockDb->exec('INSERT INTO Lock (id) VALUES('. microtime(true) .')');
|
| 167 |
}
|
| 168 |
|
| 169 |
-
$lockDb->exec('COMMIT TRANSACTION');
|
| 170 |
-
$lockDb = null;
|
| 171 |
return $createMerchant;
|
| 172 |
}
|
| 173 |
|
| 143 |
public function createMerchantwithLock()
|
| 144 |
{
|
| 145 |
$createMerchant = false;
|
| 146 |
+
|
| 147 |
$lockFile = Mage::getBaseDir('var') . '/codisto-lock';
|
| 148 |
|
| 149 |
+
for($retry = 0;;$retry++)
|
| 150 |
+
{
|
| 151 |
+
try
|
| 152 |
+
{
|
| 153 |
+
$lockDb = new PDO('sqlite:' . $lockFile);
|
| 154 |
+
$lockDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
| 155 |
+
$lockDb->setAttribute(PDO::ATTR_TIMEOUT, 1);
|
| 156 |
+
$lockDb->exec('BEGIN EXCLUSIVE TRANSACTION');
|
| 157 |
+
$lockDb->exec('CREATE TABLE IF NOT EXISTS Lock (id real NOT NULL)');
|
| 158 |
|
| 159 |
+
$lockQuery = $lockDb->query('SELECT id FROM Lock UNION SELECT 0 WHERE NOT EXISTS(SELECT 1 FROM Lock)');
|
| 160 |
+
$lockQuery->execute();
|
| 161 |
+
$lockRow = $lockQuery->fetch();
|
| 162 |
+
$timeStamp = $lockRow['id'];
|
| 163 |
|
| 164 |
+
$lockQuery->closeCursor();
|
| 165 |
|
| 166 |
+
if($timeStamp + 5000000 < microtime(true))
|
| 167 |
+
{
|
| 168 |
+
$createMerchant = true;
|
| 169 |
+
|
| 170 |
+
$lockDb->exec('DELETE FROM Lock');
|
| 171 |
+
$lockDb->exec('INSERT INTO Lock (id) VALUES('. microtime(true) .')');
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
$lockDb->exec('COMMIT TRANSACTION');
|
| 175 |
+
$lockDb = null;
|
| 176 |
+
}
|
| 177 |
+
catch(Exception $e)
|
| 178 |
+
{
|
| 179 |
+
if($retry > 3)
|
| 180 |
+
{
|
| 181 |
+
throw $e;
|
| 182 |
+
break;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
@unlink($lockFile);
|
| 186 |
+
sleep(1);
|
| 187 |
+
continue;
|
| 188 |
+
}
|
| 189 |
|
| 190 |
+
break;
|
|
|
|
| 191 |
}
|
| 192 |
|
|
|
|
|
|
|
| 193 |
return $createMerchant;
|
| 194 |
}
|
| 195 |
|
app/code/community/Codisto/Sync/controllers/IndexController.php
CHANGED
|
@@ -229,7 +229,7 @@ class Codisto_Sync_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 229 |
$shippingRequest->setPackageWeight($totalweight);
|
| 230 |
$shippingRequest->setPackageQty($itemqty);
|
| 231 |
$shippingRequest->setPackagePhysicalValue($total);
|
| 232 |
-
$shippingRequest->setFreeMethodWeight(
|
| 233 |
$shippingRequest->setStoreId($store->getId());
|
| 234 |
$shippingRequest->setWebsiteId($store->getWebsiteId());
|
| 235 |
$shippingRequest->setFreeShipping(0);
|
|
@@ -892,6 +892,9 @@ class Codisto_Sync_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 892 |
|
| 893 |
if($invoice->getTotalQty())
|
| 894 |
{
|
|
|
|
|
|
|
|
|
|
| 895 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 896 |
$invoice->register();
|
| 897 |
}
|
|
@@ -907,8 +910,6 @@ class Codisto_Sync_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 907 |
$order->setTaxInvoiced($ordertaxtotal);
|
| 908 |
$order->setTotalInvoiced($ordertotal);
|
| 909 |
$order->save();
|
| 910 |
-
|
| 911 |
-
Mage::dispatchEvent('sales_order_payment_pay', array('payment' => $payment, 'invoice' => $invoice));
|
| 912 |
}
|
| 913 |
|
| 914 |
$response = $this->getResponse();
|
|
@@ -1449,6 +1450,9 @@ class Codisto_Sync_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 1449 |
|
| 1450 |
if($invoice->getTotalQty())
|
| 1451 |
{
|
|
|
|
|
|
|
|
|
|
| 1452 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 1453 |
$invoice->register();
|
| 1454 |
}
|
|
@@ -1464,8 +1468,6 @@ class Codisto_Sync_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 1464 |
$order->setTaxInvoiced($ordertaxtotal);
|
| 1465 |
$order->setTotalInvoiced($ordertotal);
|
| 1466 |
$order->save();
|
| 1467 |
-
|
| 1468 |
-
Mage::dispatchEvent('sales_order_payment_pay', array('payment' => $payment, 'invoice' => $invoice));
|
| 1469 |
}
|
| 1470 |
}
|
| 1471 |
|
| 229 |
$shippingRequest->setPackageWeight($totalweight);
|
| 230 |
$shippingRequest->setPackageQty($itemqty);
|
| 231 |
$shippingRequest->setPackagePhysicalValue($total);
|
| 232 |
+
$shippingRequest->setFreeMethodWeight($totalweight);
|
| 233 |
$shippingRequest->setStoreId($store->getId());
|
| 234 |
$shippingRequest->setWebsiteId($store->getWebsiteId());
|
| 235 |
$shippingRequest->setFreeShipping(0);
|
| 892 |
|
| 893 |
if($invoice->getTotalQty())
|
| 894 |
{
|
| 895 |
+
$payment->setBaseAmountPaid(0.0);
|
| 896 |
+
$payment->setAmountPaid(0.0);
|
| 897 |
+
|
| 898 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 899 |
$invoice->register();
|
| 900 |
}
|
| 910 |
$order->setTaxInvoiced($ordertaxtotal);
|
| 911 |
$order->setTotalInvoiced($ordertotal);
|
| 912 |
$order->save();
|
|
|
|
|
|
|
| 913 |
}
|
| 914 |
|
| 915 |
$response = $this->getResponse();
|
| 1450 |
|
| 1451 |
if($invoice->getTotalQty())
|
| 1452 |
{
|
| 1453 |
+
$payment->setBaseAmountPaid(0.0);
|
| 1454 |
+
$payment->setAmountPaid(0.0);
|
| 1455 |
+
|
| 1456 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 1457 |
$invoice->register();
|
| 1458 |
}
|
| 1468 |
$order->setTaxInvoiced($ordertaxtotal);
|
| 1469 |
$order->setTotalInvoiced($ordertotal);
|
| 1470 |
$order->save();
|
|
|
|
|
|
|
| 1471 |
}
|
| 1472 |
}
|
| 1473 |
|
app/code/community/Codisto/Sync/data/codisto_setup/{data-install-1.90.5.php → data-install-1.90.6.php}
RENAMED
|
File without changes
|
app/code/community/Codisto/Sync/etc/config.xml
CHANGED
|
@@ -23,7 +23,7 @@
|
|
| 23 |
<config>
|
| 24 |
<modules>
|
| 25 |
<Codisto_Sync>
|
| 26 |
-
<version>1.90.
|
| 27 |
<depends>
|
| 28 |
<Mage_Payment/>
|
| 29 |
</depends>
|
| 23 |
<config>
|
| 24 |
<modules>
|
| 25 |
<Codisto_Sync>
|
| 26 |
+
<version>1.90.6</version>
|
| 27 |
<depends>
|
| 28 |
<Mage_Payment/>
|
| 29 |
</depends>
|
app/code/community/Codisto/Sync/sql/codisto_setup/{mysql4-install-1.90.5.php → mysql4-install-1.90.6.php}
RENAMED
|
File without changes
|
package.xml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
-
<package><name>codistoconnect</name><version>1.90.
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
+
<package><name>codistoconnect</name><version>1.90.6</version><stability>stable</stability><license>OSL-3.0</license><channel>community</channel><extends></extends><summary>Fastest, Easiest eBay listing</summary><description>CodistoConnect enables you to list on eBay in the simplest way possible with maximum performance</description><notes></notes><authors><author><name>Codisto</name><user>Codisto</user><email>hello@codisto.com</email></author></authors><date>2016-07-20</date><time>16:40:45</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="design"><dir name="ebay"><file name="README" hash="8a3f3351f68ccde9f161cdbe3960392f"/></dir></dir><dir name="code"><dir name="community"><dir name="Codisto"><dir name="Sync"><dir name="Helper"><file name="CmsContent.php" hash="f00b4523d681c60c660089d0de0f2e03"/><file name="Data.php" hash="f5ec3f0f14a47311f6df1aeff5469078"/><file name="Signal.php" hash="b624f962056ceffae9c3160ed3e5655e"/></dir><dir name="controllers"><file name="CodistoController.php" hash="4992c5f9d6d2f7422f409f0321b0e455"/><file name="IndexController.php" hash="b1948b8cbb26745566c817983571346d"/><file name="SyncController.php" hash="dffd761724da815f9e29620b475e2c08"/></dir><dir name="Controller"><file name="Router.php" hash="6e5ab9b0012590acf986459b5acec54c"/></dir><dir name="Test"><file name="README" hash="8299e52f9198536ff5fd3fb42f4a29d8"/><dir name="Config"><file name="AdminHtml.php" hash="6ee6404e52ed6376ad41b7556f265c32"/><file name="Config.php" hash="2e9023fcbab484d03936394934f44f13"/><dir name="Config"><dir name="expectations"><file name="testCodistoCoreConfig.yaml" hash="4a4e07f62981139ff6eb8a63420cbf0d"/></dir></dir></dir><dir name="Controllers"><file name="CodistoController.php" hash="a2be4faeac73ff1847c0d7dc4fbdc0e0"/><file name="IndexController.php" hash="f7252fae8d2f7b67397ae56524db49d1"/><file name="SyncController.php" hash="33436e4935631488073765d723a82ff7"/></dir><dir name="Controller"><file name="Router.php" hash="8afc0dca269dd0977ff6b3ac6802d0ee"/></dir><dir name="Model"><file name="Paymentmethod.php" hash="862365909073ffbba057f6f152933826"/><file name="Sync.php" hash="10a38bbb62260208a8b1529e762b7b75"/></dir></dir><dir name="sql"><dir name="codisto_setup"><file name="mysql4-install-1.90.6.php" hash="6d07d4e22ae5d907df1f4389c3a829d4"/></dir></dir><dir name="data"><dir name="codisto_setup"><file name="data-install-1.90.6.php" hash="a42cf5f15b68ac92d4c207bed8472c7d"/></dir></dir><dir name="Block"><file name="PaymentInfo.php" hash="7aa15fed37766d20d9d5a7d707aff80d"/></dir><dir name="Ebaypayment"><dir name="Model"><file name="Paymentmethod.php" hash="480787461a5b952a739f20a752bffb5d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4ef592c4047f610b6943758fa4fd43a6"/><file name="config.xml" hash="1b7dfc2d0b410bb025bc18d670c5882a"/></dir><dir name="Model"><file name="Observer.php" hash="8b309ae85f2bf696e97ff6777c1d64f2"/><file name="Sync.php" hash="3aae1f063d1c8be658a798828b8d20bc"/><dir name="Indexer"><file name="Ebay.php" hash="556b1aabc7c3202f31a2e6c250e7d590"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="6a6664ea18d93bcdd0f45530caa56244"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Codisto_Sync.xml" hash="a791bc2a9302d085eb29edf77421f525"/></dir></dir></dir></target></contents></package>
|
