Signifyd_Connect - Version 3.11.0

Version Notes

Supports all versions of Magento

Download this release

Release Info

Developer Magento Core Team
Extension Signifyd_Connect
Version 3.11.0
Comparing to
See all releases


Code changes from version 3.10.1 to 3.11.0

app/code/community/Signifyd/Connect/Helper/Data.php CHANGED
@@ -369,6 +369,38 @@ class Signifyd_Connect_Helper_Data extends Mage_Core_Helper_Abstract
369
  return Mage::getStoreConfig('signifyd_connect/settings/key');
370
  }
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  public function buildAndSendOrderToSignifyd($order, $forceSend = false)
373
  {
374
  if ($order && $order->getId()) {
@@ -507,7 +539,8 @@ class Signifyd_Connect_Helper_Data extends Mage_Core_Helper_Abstract
507
  public function request($url, $data=null, $auth=null, $contenttype="application/x-www-form-urlencoded", $accept=null)
508
  {
509
  if (Mage::getStoreConfig('signifyd_connect/log/request')) {
510
- Mage::log("Request:\nURL: $url \nAuth: $auth\nData: $data", null, 'signifyd_connect.log');
 
511
  }
512
 
513
  $curl = curl_init();
369
  return Mage::getStoreConfig('signifyd_connect/settings/key');
370
  }
371
 
372
+ public function bulkSend($controller)
373
+ {
374
+ try {
375
+ $orderIds = $controller->getRequest()->getParam('order_ids');
376
+ if(is_string($orderIds))
377
+ {
378
+ $orderIds = array_map('intval', explode(',', $orderIds));
379
+ }
380
+ if (!is_array($orderIds)) {
381
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select order(s)'));
382
+ } else {
383
+ $collection = Mage::getModel('sales/order')->getCollection()
384
+ ->addFieldToSelect('*')
385
+ ->addFieldToFilter('entity_id', array('in' => $orderIds));
386
+
387
+ foreach ($collection as $order) {
388
+ $result = $this->buildAndSendOrderToSignifyd($order, /*forceSend*/ true);
389
+ if($result == "sent") {
390
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Successfully sent order ' . $order->getIncrementId() . '.'));
391
+ } else if ($result == "exists") {
392
+ Mage::getSingleton('adminhtml/session')->addWarning(Mage::helper('adminhtml')->__('Order ' . $order->getIncrementId() . ' has already been sent to Signifyd.'));
393
+ } else {
394
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Order ' . $order->getIncrementId() . ' failed to send. See log for details.'));
395
+ }
396
+ }
397
+ }
398
+ } catch(Exception $ex) {
399
+ Mage::log($ex->__toString(), null, 'signifyd_connect.log');
400
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Send failed. See log for details'));
401
+ }
402
+ }
403
+
404
  public function buildAndSendOrderToSignifyd($order, $forceSend = false)
405
  {
406
  if ($order && $order->getId()) {
539
  public function request($url, $data=null, $auth=null, $contenttype="application/x-www-form-urlencoded", $accept=null)
540
  {
541
  if (Mage::getStoreConfig('signifyd_connect/log/request')) {
542
+ $authMask = preg_replace ( "/\S/", "*", $auth, strlen($auth) - 4 );
543
+ Mage::log("Request:\nURL: $url \nAuth: $authMask\nData: $data", null, 'signifyd_connect.log');
544
  }
545
 
546
  $curl = curl_init();
app/code/community/Signifyd/Connect/Model/Observer.php CHANGED
@@ -198,10 +198,14 @@ class Signifyd_Connect_Model_Observer extends Varien_Object
198
  if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
199
  && $block->getRequest()->getControllerName() == 'sales_order')
200
  {
 
 
 
 
201
  $block->setFormFieldName('increment_id');
202
  $block->addItem('signifyd_connect', array(
203
  'label' => 'Send order(s) to Signifyd',
204
- 'url' => Mage::helper("adminhtml")->getUrl('signifyd/adminhtml_signifyd/send'),
205
  ));
206
  }
207
  }
198
  if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
199
  && $block->getRequest()->getControllerName() == 'sales_order')
200
  {
201
+ $url = Mage::helper("adminhtml")->getUrl('signifyd_connect/adminhtml_signifyd/send');
202
+ if(Mage::getStoreConfig('signifyd_connect/advanced/use_unsecure_requests')){
203
+ $url = Mage::getUrl('signifyd/connect/send');
204
+ }
205
  $block->setFormFieldName('increment_id');
206
  $block->addItem('signifyd_connect', array(
207
  'label' => 'Send order(s) to Signifyd',
208
+ 'url' => $url,
209
  ));
210
  }
211
  }
app/code/community/Signifyd/Connect/controllers/Adminhtml/SignifydController.php CHANGED
@@ -21,30 +21,7 @@ class Signifyd_Connect_Adminhtml_SignifydController extends Mage_Adminhtml_Contr
21
 
22
  public function sendAction()
23
  {
24
- try {
25
- $orderIds = $this->getRequest()->getParam('order_ids');
26
- if (!is_array($orderIds)) {
27
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select order(s)'));
28
- } else {
29
- $collection = Mage::getModel('sales/order')->getCollection()
30
- ->addFieldToSelect('*')
31
- ->addFieldToFilter('entity_id', array('in' => $orderIds));
32
-
33
- foreach ($collection as $order) {
34
- $result = Mage::helper('signifyd_connect')->buildAndSendOrderToSignifyd($order, /*forceSend*/ true);
35
- if($result == "sent") {
36
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Successfully sent order ' . $order->getIncrementId() . '.'));
37
- } else if ($result == "exists") {
38
- Mage::getSingleton('adminhtml/session')->addWarning(Mage::helper('adminhtml')->__('Order ' . $order->getIncrementId() . ' has already been sent to Signifyd.'));
39
- } else {
40
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Order ' . $order->getIncrementId() . ' failed to send. See log for details.'));
41
- }
42
- }
43
- }
44
- } catch(Exception $ex) {
45
- Mage::log($ex->__toString(), null, 'signifyd_connect.log');
46
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Send failed. See log for details'));
47
- }
48
  $this->_redirectReferer();
49
  }
50
  }
21
 
22
  public function sendAction()
23
  {
24
+ Mage::helper('signifyd_connect')->bulkSend($this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  $this->_redirectReferer();
26
  }
27
  }
app/code/community/Signifyd/Connect/controllers/ConnectController.php CHANGED
@@ -482,6 +482,24 @@ class Signifyd_Connect_ConnectController extends Mage_Core_Controller_Front_Acti
482
 
483
  }
484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  public function apiAction()
486
  {
487
  if (!$this->enabled()) {
@@ -559,4 +577,4 @@ class Signifyd_Connect_ConnectController extends Mage_Core_Controller_Front_Acti
559
  $this->complete();
560
  }
561
 
562
- }
482
 
483
  }
484
 
485
+ public function sendAction()
486
+ {
487
+ try {
488
+ // This request handles the send action only if we are using an unsecured
489
+ // connection. Otherwise, it does nothing
490
+ if (!Mage::getStoreConfig('signifyd_connect/settings/enabled') ||
491
+ !Mage::getStoreConfig('signifyd_connect/advanced/use_unsecure_requests')
492
+ ) {
493
+ Mage::log("Attempting to access send endpoint from frontend when it is currently disabled.", null, 'signifyd_connect.log');
494
+ return;
495
+ }
496
+ Mage::helper('signifyd_connect')->bulkSend($this);
497
+ } catch (Exception $e) {
498
+ Mage::log('Exception while sending: ' . $e->__toString(), null, 'signifyd_connect.log');
499
+ }
500
+ $this->_redirectReferer();
501
+ }
502
+
503
  public function apiAction()
504
  {
505
  if (!$this->enabled()) {
577
  $this->complete();
578
  }
579
 
580
+ }
app/code/community/Signifyd/Connect/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Signifyd_Connect>
6
- <version>3.10.1</version>
7
  </Signifyd_Connect>
8
  </modules>
9
  <global>
3
  <config>
4
  <modules>
5
  <Signifyd_Connect>
6
+ <version>3.11.0</version>
7
  </Signifyd_Connect>
8
  </modules>
9
  <global>
app/code/community/Signifyd/Connect/etc/system.xml CHANGED
@@ -156,6 +156,16 @@
156
  <comment><![CDATA[Send email notification to customers after invoicing orders]]></comment>
157
  <depends><invoice_orders>1</invoice_orders></depends>
158
  </invoice_orders_notify>
 
 
 
 
 
 
 
 
 
 
159
  </fields>
160
  </advanced>
161
  <log translate="label">
156
  <comment><![CDATA[Send email notification to customers after invoicing orders]]></comment>
157
  <depends><invoice_orders>1</invoice_orders></depends>
158
  </invoice_orders_notify>
159
+ <use_unsecure_requests>
160
+ <label>Use Unsecure Requests</label>
161
+ <frontend_type>select</frontend_type>
162
+ <source_model>adminhtml/system_config_source_yesno</source_model>
163
+ <sort_order>100</sort_order>
164
+ <show_in_default>1</show_in_default>
165
+ <show_in_website>1</show_in_website>
166
+ <show_in_store>1</show_in_store>
167
+ <comment><![CDATA[For backend actions (such as bulk-send from the order grid), use the frontend controller instead of the secure backend controller. This is intended to work around some potential issues. Use only when necessary, and set it back once the actions are completed]]></comment>
168
+ </use_unsecure_requests>
169
  </fields>
170
  </advanced>
171
  <log translate="label">
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Signifyd_Connect</name>
4
- <version>3.10.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Supports all versions of Magento</description>
11
  <notes>Supports all versions of Magento</notes>
12
  <authors><author><name>signifyd</name><user>auto-converted</user><email>manelis@signifyd.com</email></author></authors>
13
- <date>2015-08-28</date>
14
- <time>15:22:39</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Signifyd_Connect.xml" hash="bcd998a24567eba8a20423c40fba2adf"/></dir></target><target name="magecommunity"><dir name="Signifyd"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="52843fc84cdb65214bb3469b6390bee5"/></dir><file name="Order.php" hash="e49f869c0aa5fb3ab6b70fb5752049ac"/></dir></dir><file name="Renderer.php" hash="5564e9c6926afbbdade26a6fe746948a"/></dir><dir name="Helper"><file name="Data.php" hash="ac617c88706180a7a0ac9654efd60989"/></dir><dir name="Model"><dir name="Resource"><dir name="Case"><file name="Collection.php" hash="b7dac9979a0c81db56294d1548570fc2"/></dir><file name="Case.php" hash="60d14407c9c90148aad543ce6868f343"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Options"><file name="Negative.php" hash="098488fbb0ea84945fdd1e1fe8449b4b"/><file name="Positive.php" hash="80b4cdd2bae6e2a2f3a273fa49d32331"/></dir></dir></dir></dir><file name="Case.php" hash="2a28a63f02df1b9103b89a562c0abe1b"/><file name="Cron.php" hash="51665978bd2bcf67b493f2a2b450d1b8"/><file name="Link.php" hash="ecaf4c403a586b4b5c8b67c77f6ac433"/><file name="Observer.php" hash="945028f753281d32c37d4a48f0e79a36"/><file name="Setup.php" hash="e803ffb4b86c7d8ec1d149e665d65877"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SignifydController.php" hash="2907e9b358cde41aef4ea598b3782ee5"/></dir><file name="ConnectController.php" hash="4b1a3b7557e1de259e5e4df9df20e866"/></dir><dir name="etc"><file name="adminhtml.xml" hash="894bd3f5ac76e9f602ab6ab592648b03"/><file name="config.xml" hash="d90e84d0a349eeccbdf02f25d7ef2b1b"/><file name="system.xml" hash="c42b2db859506998618701c980c6245f"/></dir><dir name="sql"><dir name="signifyd_connect_setup"><file name="mysql4-install-3.1.1.php" hash="7fb2ccaf8352eea26e626ace6de53d80"/><file name="mysql4-install-3.3.0.php" hash="f61d0c018b28ae04d8d14b38556d18ad"/><file name="mysql4-install-3.4.0.php" hash="109cc5ca60974d0c4755dcb0f5ade3e7"/><file name="mysql4-install-3.4.5.php" hash="401b92235c0e534c941a64c60d24b851"/><file name="mysql4-install-3.7.0.php" hash="48a9d427944a4e63a000343ab329f517"/><file name="mysql4-install-3.8.0.php" hash="0fb3583eb4481c21b84ea674abc200f0"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="9e36c608afd6e30e3052334e085eeff4"/><file name="mysql4-upgrade-3.2.1-3.2.2.php" hash="efcc5d46a41e549e508a693f1e77bf44"/><file name="mysql4-upgrade-3.2.2-3.2.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.2.3-3.3.0.php" hash="94b907c2cacde5fb9831408ce9a06190"/><file name="mysql4-upgrade-3.3.0-3.4.0.php" hash="6eb18705081483bb8d9c14adcdefd095"/><file name="mysql4-upgrade-3.4.0-3.4.1.php" hash="79f2064f1fa20d646e66aa3e7912d2a0"/><file name="mysql4-upgrade-3.4.1-3.4.2.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.2-3.4.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.3-3.4.4.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.4-3.4.5.php" hash="5b7507d6bb97bf44d27b7a89c56924bb"/><file name="mysql4-upgrade-3.4.5-3.4.6.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.6-3.4.7.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.7-3.4.8.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.8-3.5.0.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.0-3.5.1.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.1-3.5.2.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.2-3.5.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.3-3.6.0.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.6.0-3.7.0.php" hash="1456a6d0ddf091be9c87b3bbc91263ba"/><file name="mysql4-upgrade-3.7.0-3.8.0.php" hash="e6fc207541cacc5079e8ea8e4d55f356"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Signifyd_Connect</name>
4
+ <version>3.11.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
10
  <description>Supports all versions of Magento</description>
11
  <notes>Supports all versions of Magento</notes>
12
  <authors><author><name>signifyd</name><user>auto-converted</user><email>manelis@signifyd.com</email></author></authors>
13
+ <date>2015-09-08</date>
14
+ <time>16:36:18</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Signifyd_Connect.xml" hash="bcd998a24567eba8a20423c40fba2adf"/></dir></target><target name="magecommunity"><dir name="Signifyd"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="52843fc84cdb65214bb3469b6390bee5"/></dir><file name="Order.php" hash="e49f869c0aa5fb3ab6b70fb5752049ac"/></dir></dir><file name="Renderer.php" hash="5564e9c6926afbbdade26a6fe746948a"/></dir><dir name="Helper"><file name="Data.php" hash="3a61cd3a69b7243dd79ba1055af1b000"/></dir><dir name="Model"><dir name="Resource"><dir name="Case"><file name="Collection.php" hash="b7dac9979a0c81db56294d1548570fc2"/></dir><file name="Case.php" hash="60d14407c9c90148aad543ce6868f343"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Options"><file name="Negative.php" hash="098488fbb0ea84945fdd1e1fe8449b4b"/><file name="Positive.php" hash="80b4cdd2bae6e2a2f3a273fa49d32331"/></dir></dir></dir></dir><file name="Case.php" hash="2a28a63f02df1b9103b89a562c0abe1b"/><file name="Cron.php" hash="51665978bd2bcf67b493f2a2b450d1b8"/><file name="Link.php" hash="ecaf4c403a586b4b5c8b67c77f6ac433"/><file name="Observer.php" hash="8da78f758e8339c335b3f3475f7f9ffc"/><file name="Setup.php" hash="e803ffb4b86c7d8ec1d149e665d65877"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SignifydController.php" hash="5787eb1c3ad32d7f2fc1b909f332a50f"/></dir><file name="ConnectController.php" hash="450477e654869404abf1b503f13871e4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="894bd3f5ac76e9f602ab6ab592648b03"/><file name="config.xml" hash="033a321a1d38aaa26f4bc09a33251f9b"/><file name="system.xml" hash="f955ae3435458bc67a776e3ffef906ff"/></dir><dir name="sql"><dir name="signifyd_connect_setup"><file name="mysql4-install-3.1.1.php" hash="7fb2ccaf8352eea26e626ace6de53d80"/><file name="mysql4-install-3.3.0.php" hash="f61d0c018b28ae04d8d14b38556d18ad"/><file name="mysql4-install-3.4.0.php" hash="109cc5ca60974d0c4755dcb0f5ade3e7"/><file name="mysql4-install-3.4.5.php" hash="401b92235c0e534c941a64c60d24b851"/><file name="mysql4-install-3.7.0.php" hash="48a9d427944a4e63a000343ab329f517"/><file name="mysql4-install-3.8.0.php" hash="0fb3583eb4481c21b84ea674abc200f0"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="9e36c608afd6e30e3052334e085eeff4"/><file name="mysql4-upgrade-3.2.1-3.2.2.php" hash="efcc5d46a41e549e508a693f1e77bf44"/><file name="mysql4-upgrade-3.2.2-3.2.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.2.3-3.3.0.php" hash="94b907c2cacde5fb9831408ce9a06190"/><file name="mysql4-upgrade-3.3.0-3.4.0.php" hash="6eb18705081483bb8d9c14adcdefd095"/><file name="mysql4-upgrade-3.4.0-3.4.1.php" hash="79f2064f1fa20d646e66aa3e7912d2a0"/><file name="mysql4-upgrade-3.4.1-3.4.2.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.2-3.4.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.3-3.4.4.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.4-3.4.5.php" hash="5b7507d6bb97bf44d27b7a89c56924bb"/><file name="mysql4-upgrade-3.4.5-3.4.6.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.6-3.4.7.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.7-3.4.8.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.4.8-3.5.0.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.0-3.5.1.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.1-3.5.2.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.2-3.5.3.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.5.3-3.6.0.php" hash="3ceb86495f33475774d4fc8727254cfc"/><file name="mysql4-upgrade-3.6.0-3.7.0.php" hash="1456a6d0ddf091be9c87b3bbc91263ba"/><file name="mysql4-upgrade-3.7.0-3.8.0.php" hash="e6fc207541cacc5079e8ea8e4d55f356"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>