Icepay_AutoCapture - Version 1.0.1

Version Notes

- Fixed AutoCapture not being triggered when shipping is done through the Magento API.

Download this release

Release Info

Developer ICEPAY
Extension Icepay_AutoCapture
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Icepay/AutoCapture/Helper/Data.php CHANGED
@@ -16,7 +16,7 @@
16
  */
17
  class Icepay_AutoCapture_Helper_Data extends Mage_Core_Helper_Abstract {
18
 
19
- private $_version = '1.0.0';
20
  private $_minAdvancedVersion = '1.1.7';
21
 
22
  public function getCompatiblityVersion() {
16
  */
17
  class Icepay_AutoCapture_Helper_Data extends Mage_Core_Helper_Abstract {
18
 
19
+ private $_version = '1.0.1';
20
  private $_minAdvancedVersion = '1.1.7';
21
 
22
  public function getCompatiblityVersion() {
app/code/community/Icepay/AutoCapture/Model/Observer.php CHANGED
@@ -17,16 +17,21 @@
17
  class Icepay_AutoCapture_Model_Observer {
18
 
19
  public function sales_order_save_after(Varien_Event_Observer $observer) {
20
- // Check if event is being triggered from the sales_order_shipment controller
21
- if (Mage::app()->getFrontController()->getRequest()->getControllerName() != 'sales_order_shipment')
 
 
 
22
  return;
23
 
24
- $order = $observer->getEvent()->getOrder();
25
 
26
  // Check if ICEPAY order
27
  if (!Mage::Helper('icepay_autocapture')->isIcepayOrder($order->getIncrementId()))
28
  return;
29
 
 
 
30
  $iceCoreModel = Mage::getModel('icecore/mysql4_iceCore');
31
  $ic_order = $iceCoreModel->loadPaymentByID($order->getIncrementId());
32
 
17
  class Icepay_AutoCapture_Model_Observer {
18
 
19
  public function sales_order_save_after(Varien_Event_Observer $observer) {
20
+ $order = $observer->getEvent()->getOrder();
21
+
22
+ $apiRunning = Mage::getSingleton('api/server')->getAdapter() != null;
23
+
24
+ if (!$apiRunning && Mage::app()->getFrontController()->getRequest()->getControllerName() != 'sales_order_shipment')
25
  return;
26
 
27
+ Mage::Helper('icecore')->log('[AutoCapture] 1');
28
 
29
  // Check if ICEPAY order
30
  if (!Mage::Helper('icepay_autocapture')->isIcepayOrder($order->getIncrementId()))
31
  return;
32
 
33
+ Mage::Helper('icecore')->log('AutoCapture] 2');
34
+
35
  $iceCoreModel = Mage::getModel('icecore/mysql4_iceCore');
36
  $ic_order = $iceCoreModel->loadPaymentByID($order->getIncrementId());
37
 
app/code/community/Icepay/AutoCapture/Model/Webservice.php CHANGED
@@ -19,7 +19,7 @@ class Icepay_AutoCapture_Model_Webservice {
19
  private $_client;
20
  private $_merchantID;
21
  private $_secretCode;
22
- private $_url = 'https://connect.icepay.com/webservice/APCapture.svc?wsdl';
23
 
24
  public function init($merchantID, $secretCode) {
25
  $this->_merchantID = (int) $merchantID;
19
  private $_client;
20
  private $_merchantID;
21
  private $_secretCode;
22
+ private $_url = 'https://connect.icepay.com/webservice2/APCapture.svc?wsdl';
23
 
24
  public function init($merchantID, $secretCode) {
25
  $this->_merchantID = (int) $merchantID;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Icepay_AutoCapture</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>Commercial</license>
7
  <channel>community</channel>
@@ -11,11 +11,11 @@ www.icepay.com</summary>
11
  <description>Captures Afterpay transactions upon shipping.&#xD;
12
  &#xD;
13
  Requires ICEPAY Advanced.</description>
14
- <notes>Initial release</notes>
15
  <authors><author><name>ICEPAY</name><user>ICEPAY_PSP</user><email>it@icepay.com</email></author><author><name>Wouter van Tilburg</name><user>wvantilburg</user><email>wouter@icepay.eu</email></author></authors>
16
- <date>2013-05-22</date>
17
- <time>09:02:56</time>
18
- <contents><target name="magecommunity"><dir name="Icepay"><dir name="AutoCapture"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Grid"><file name="Moduleinfo.php" hash="fdc55156394912cfb6b0cc9ffe291c0b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="644f4d929055516a26318e13877ffb4f"/></dir><dir name="Model"><file name="Observer.php" hash="7f25f2130389e643fb1da8f51a1ff9e1"/><file name="Settings.php" hash="853c0f07b95090000d0becf50bb0256a"/><file name="Webservice.php" hash="dca2c932b00541ffe22b66e50cbfc1ba"/></dir><dir name="etc"><file name="config.xml" hash="e4ddbd4cb87825f612302492e8f83824"/><file name="system.xml" hash="ae6d6173b53715f443267cac98f26244"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Icepay_AutoCapture.xml" hash="4639ada113edc2b2ed5596ec40cb184b"/></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Icepay_AutoCapture.csv" hash="c0a4b03f36b10f43b2ab2f7399fd9653"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="icepayautocapture"><file name="module_information.phtml" hash="5994ac5b0012297064e23d976b667928"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Icepay_IceAdvanced</name><channel>community</channel><min>1.1.7</min><max>9.0.0</max></package><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Icepay_AutoCapture</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>Commercial</license>
7
  <channel>community</channel>
11
  <description>Captures Afterpay transactions upon shipping.&#xD;
12
  &#xD;
13
  Requires ICEPAY Advanced.</description>
14
+ <notes>- Fixed AutoCapture not being triggered when shipping is done through the Magento API.</notes>
15
  <authors><author><name>ICEPAY</name><user>ICEPAY_PSP</user><email>it@icepay.com</email></author><author><name>Wouter van Tilburg</name><user>wvantilburg</user><email>wouter@icepay.eu</email></author></authors>
16
+ <date>2013-07-26</date>
17
+ <time>12:28:50</time>
18
+ <contents><target name="magecommunity"><dir name="Icepay"><dir name="AutoCapture"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Grid"><file name="Moduleinfo.php" hash="fdc55156394912cfb6b0cc9ffe291c0b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2944c3b9625d07a4876b972cffa1ea21"/></dir><dir name="Model"><file name="Observer.php" hash="7e528862f8feee123d752dd417dc4458"/><file name="Settings.php" hash="853c0f07b95090000d0becf50bb0256a"/><file name="Webservice.php" hash="94eb0658d9c3a40482058b5a662390f5"/></dir><dir name="etc"><file name="config.xml" hash="e4ddbd4cb87825f612302492e8f83824"/><file name="system.xml" hash="ae6d6173b53715f443267cac98f26244"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Icepay_AutoCapture.xml" hash="4639ada113edc2b2ed5596ec40cb184b"/></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Icepay_AutoCapture.csv" hash="c0a4b03f36b10f43b2ab2f7399fd9653"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="icepayautocapture"><file name="module_information.phtml" hash="5994ac5b0012297064e23d976b667928"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Icepay_IceAdvanced</name><channel>community</channel><min>1.1.7</min><max>9.0.0</max></package><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
21
  </package>