Phoenix_Worldpay - Version 1.2.4

Version Notes

- fixed issue with shopping card reload on cancelation (Magento 1.4.1)

Download this release

Release Info

Developer Magento Core Team
Extension Phoenix_Worldpay
Version 1.2.4
Comparing to
See all releases


Code changes from version 1.2.3 to 1.2.4

app/code/community/Phoenix/Worldpay/Block/Info.php CHANGED
@@ -17,7 +17,6 @@
17
  * @copyright Copyright (c) 2008 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
  */
19
 
20
-
21
  class Phoenix_Worldpay_Block_Info extends Mage_Payment_Block_Info
22
  {
23
  protected function _construct()
@@ -25,7 +24,7 @@ class Phoenix_Worldpay_Block_Info extends Mage_Payment_Block_Info
25
  parent::_construct();
26
  $this->setTemplate('worldpay/info.phtml');
27
  }
28
-
29
  public function getMethodCode()
30
  {
31
  return $this->getInfo()->getMethodInstance()->getCode();
17
  * @copyright Copyright (c) 2008 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
  */
19
 
 
20
  class Phoenix_Worldpay_Block_Info extends Mage_Payment_Block_Info
21
  {
22
  protected function _construct()
24
  parent::_construct();
25
  $this->setTemplate('worldpay/info.phtml');
26
  }
27
+
28
  public function getMethodCode()
29
  {
30
  return $this->getInfo()->getMethodInstance()->getCode();
app/code/community/Phoenix/Worldpay/Helper/Data.php CHANGED
@@ -14,10 +14,16 @@
14
  *
15
  * @category Phoenix
16
  * @package Phoenix_Worldpay
17
- * @copyright Copyright (c) 2008 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
  */
19
 
20
  class Phoenix_Worldpay_Helper_Data extends Mage_Payment_Helper_Data
21
  {
22
-
 
 
 
 
 
 
23
  }
14
  *
15
  * @category Phoenix
16
  * @package Phoenix_Worldpay
17
+ * @copyright Copyright (c) 2010 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
  */
19
 
20
  class Phoenix_Worldpay_Helper_Data extends Mage_Payment_Helper_Data
21
  {
22
+ public function getPendingPaymentStatus()
23
+ {
24
+ if (version_compare(Mage::getVersion(), '1.4.0', '<')) {
25
+ return Mage_Sales_Model_Order::STATE_HOLDED;
26
+ }
27
+ return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
28
+ }
29
  }
app/code/community/Phoenix/Worldpay/controllers/ProcessingController.php CHANGED
@@ -19,12 +19,10 @@
19
 
20
  class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_Action
21
  {
22
- protected $_redirectBlockType = 'worldpay/processing';
23
  protected $_successBlockType = 'worldpay/success';
24
  protected $_failureBlockType = 'worldpay/failure';
25
  protected $_cancelBlockType = 'worldpay/cancel';
26
 
27
-
28
  protected $_order = NULL;
29
  protected $_paymentInst = NULL;
30
 
@@ -40,7 +38,7 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
40
  }
41
 
42
  /**
43
- * when customer select Worldpay payment method
44
  */
45
  public function redirectAction()
46
  {
@@ -49,21 +47,34 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
49
 
50
  $order = Mage::getModel('sales/order');
51
  $order->loadByIncrementId($session->getLastRealOrderId());
52
- $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_HOLDED, Mage::helper('worldpay')->__('Customer was redirected to Worldpay.'));
53
- $order->save();
 
 
 
 
 
 
 
 
54
 
55
- $session->setWorldpayQuoteId($session->getQuoteId());
56
- $session->setWorldpayRealOrderId($session->getLastRealOrderId());
57
- $session->getQuote()->setIsActive(false)->save();
58
- $session->clear();
 
 
 
59
 
60
  $this->loadLayout();
61
  $this->renderLayout();
 
62
  } catch (Mage_Core_Exception $e) {
63
  $this->_getCheckout()->addError($e->getMessage());
64
  } catch(Exception $e) {
65
  Mage::logException($e);
66
  }
 
67
  }
68
 
69
  /**
@@ -97,10 +108,9 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
97
  {
98
  try {
99
  $session = $this->_getCheckout();
100
- $quoteId = $session->getWorldpayQuoteId();
101
  $session->unsWorldpayRealOrderId();
102
- $session->setQuoteId($quoteId);
103
- $session->setLastSuccessQuoteId($quoteId);
104
  $this->_redirect('checkout/onepage/success');
105
  return;
106
  } catch (Mage_Core_Exception $e) {
@@ -116,8 +126,16 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
116
  */
117
  public function cancelAction()
118
  {
119
- $this->_getCheckout()->setQuoteId($this->_getCheckout()->getWorldpayQuoteId());
120
- $this->_getCheckout()->addError(Mage::helper('worldpay')->__('Payment was canceled'));
 
 
 
 
 
 
 
 
121
  $this->_redirect('checkout/cart');
122
  }
123
 
@@ -191,6 +209,7 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
191
  Mage::throwException('Transaction currency doesn\'t match.');
192
 
193
  // save transaction ID and AVS info
 
194
  $this->_order->getPayment()->setLastTransId($request['transId']);
195
  $this->_order->getPayment()->setCcAvsStatus($request['AVS']);
196
 
@@ -199,7 +218,10 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
199
  if ($this->_order->canInvoice()) {
200
  $invoice = $this->_order->prepareInvoice();
201
  $invoice->register()->capture();
202
- $this->_order->addRelatedObject($invoice);
 
 
 
203
  }
204
  $this->_order->addStatusToHistory($this->_paymentInst->getConfigData('order_status'), Mage::helper('worldpay')->__('authorize: Customer returned successfully'));
205
  break;
@@ -237,4 +259,9 @@ class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_A
237
  ->toHtml()
238
  );
239
  }
 
 
 
 
 
240
  }
19
 
20
  class Phoenix_Worldpay_ProcessingController extends Mage_Core_Controller_Front_Action
21
  {
 
22
  protected $_successBlockType = 'worldpay/success';
23
  protected $_failureBlockType = 'worldpay/failure';
24
  protected $_cancelBlockType = 'worldpay/cancel';
25
 
 
26
  protected $_order = NULL;
27
  protected $_paymentInst = NULL;
28
 
38
  }
39
 
40
  /**
41
+ * when customer selects Worldpay payment method
42
  */
43
  public function redirectAction()
44
  {
47
 
48
  $order = Mage::getModel('sales/order');
49
  $order->loadByIncrementId($session->getLastRealOrderId());
50
+ if (!$order->getId()) {
51
+ Mage::throwException('No order for processing found');
52
+ }
53
+ if ($order->getState() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
54
+ $order->setState(
55
+ Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
56
+ $this->_getPendingPaymentStatus(),
57
+ Mage::helper('worldpay')->__('Customer was redirected to Worldpay.')
58
+ )->save();
59
+ }
60
 
61
+ if ($session->getQuoteId() && $session->getLastSuccessQuoteId()) {
62
+ $session->setWorldpayQuoteId($session->getQuoteId());
63
+ $session->setWorldpaySuccessQuoteId($session->getLastSuccessQuoteId());
64
+ $session->setWorldpayRealOrderId($session->getLastRealOrderId());
65
+ $session->getQuote()->setIsActive(false)->save();
66
+ $session->clear();
67
+ }
68
 
69
  $this->loadLayout();
70
  $this->renderLayout();
71
+ return;
72
  } catch (Mage_Core_Exception $e) {
73
  $this->_getCheckout()->addError($e->getMessage());
74
  } catch(Exception $e) {
75
  Mage::logException($e);
76
  }
77
+ $this->_redirect('checkout/cart');
78
  }
79
 
80
  /**
108
  {
109
  try {
110
  $session = $this->_getCheckout();
 
111
  $session->unsWorldpayRealOrderId();
112
+ $session->setQuoteId($session->getWorldpayQuoteId(true));
113
+ $session->setLastSuccessQuoteId($session->getWorldpaySuccessQuoteId(true));
114
  $this->_redirect('checkout/onepage/success');
115
  return;
116
  } catch (Mage_Core_Exception $e) {
126
  */
127
  public function cancelAction()
128
  {
129
+ // set quote to active
130
+ $session = $this->_getCheckout();
131
+ if ($quoteId = $session->getWorldpayQuoteId()) {
132
+ $quote = Mage::getModel('sales/quote')->load($quoteId);
133
+ if ($quote->getId()) {
134
+ $quote->setIsActive(true)->save();
135
+ $session->setQuoteId($quoteId);
136
+ }
137
+ }
138
+ $session->addError(Mage::helper('worldpay')->__('The order has been canceled.'));
139
  $this->_redirect('checkout/cart');
140
  }
141
 
209
  Mage::throwException('Transaction currency doesn\'t match.');
210
 
211
  // save transaction ID and AVS info
212
+ $this->_order->getPayment()->setTransactionId($request['transId']);
213
  $this->_order->getPayment()->setLastTransId($request['transId']);
214
  $this->_order->getPayment()->setCcAvsStatus($request['AVS']);
215
 
218
  if ($this->_order->canInvoice()) {
219
  $invoice = $this->_order->prepareInvoice();
220
  $invoice->register()->capture();
221
+ Mage::getModel('core/resource_transaction')
222
+ ->addObject($invoice)
223
+ ->addObject($invoice->getOrder())
224
+ ->save();
225
  }
226
  $this->_order->addStatusToHistory($this->_paymentInst->getConfigData('order_status'), Mage::helper('worldpay')->__('authorize: Customer returned successfully'));
227
  break;
259
  ->toHtml()
260
  );
261
  }
262
+
263
+ protected function _getPendingPaymentStatus()
264
+ {
265
+ return Mage::helper('payone')->getPendingPaymentStatus();
266
+ }
267
  }
app/code/community/Phoenix/Worldpay/etc/config.xml CHANGED
@@ -21,7 +21,7 @@
21
  <config>
22
  <modules>
23
  <Phoenix_Worldpay>
24
- <version>1.2.3</version>
25
  </Phoenix_Worldpay>
26
  </modules>
27
  <global>
21
  <config>
22
  <modules>
23
  <Phoenix_Worldpay>
24
+ <version>1.2.4</version>
25
  </Phoenix_Worldpay>
26
  </modules>
27
  <global>
app/locale/de_DE/Phoenix_Worldpay.csv CHANGED
@@ -15,5 +15,6 @@
15
  "Authorization","Autorisierung"
16
  "Preauthorization","Vorautorisierung"
17
  "Your purchase at","Ihr Einkauf bei"
18
- "Error during refunding online. Server response: %s", "Fehler während der Gutschrift-Erteilung. Server-Antwort: %s"
19
- "Worldpay transaction has been captured.", "Worldpay Transaktion wurde abgebucht."
 
15
  "Authorization","Autorisierung"
16
  "Preauthorization","Vorautorisierung"
17
  "Your purchase at","Ihr Einkauf bei"
18
+ "Error during refunding online. Server response: %s","Fehler während der Gutschrift-Erteilung. Server-Antwort: %s"
19
+ "Worldpay transaction has been captured.","Worldpay Transaktion wurde abgebucht."
20
+ "The order has been canceled.,"Der Bestellvorgang wurde abgebrochen."
app/locale/en_US/Phoenix_Worldpay.csv CHANGED
@@ -11,9 +11,10 @@
11
  "AVS status: %s","AVS status: %s"
12
  "worldpay_cc:You will be redirected to Worldpay website when you place an order.","You will be redirected to Worldpay website when you place an order to enter your credit card information."
13
  "Shopping basket","Shopping basket"
14
- "Payment has not been processed yet.", "Payment has not been processed yet."
15
  "Authorization","Authorization"
16
  "Preauthorization","Preauthorization"
17
  "Your purchase at","Your purchase at"
18
- "Error during refunding online. Server response: %s", "Error during refunding online. Server response: %s"
19
- "Worldpay transaction has been captured.", "Worldpay transaction has been captured."
 
11
  "AVS status: %s","AVS status: %s"
12
  "worldpay_cc:You will be redirected to Worldpay website when you place an order.","You will be redirected to Worldpay website when you place an order to enter your credit card information."
13
  "Shopping basket","Shopping basket"
14
+ "Payment has not been processed yet.","Payment has not been processed yet."
15
  "Authorization","Authorization"
16
  "Preauthorization","Preauthorization"
17
  "Your purchase at","Your purchase at"
18
+ "Error during refunding online. Server response: %s","Error during refunding online. Server response: %s"
19
+ "Worldpay transaction has been captured.","Worldpay transaction has been captured."
20
+ "The order has been canceled.","The order has been canceled."
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Phoenix_Worldpay</name>
4
- <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -19,11 +19,11 @@ Notice: This extension is still beta. We recommend to test all transactions in y
19
  The extension is developed and maintained by the German Magento Silver Partner Phoenix Medien (http://www.phoenix-medien.de).
20
 
21
  The development was sponsored by liaison dangereuse (http://www.liaison-dangereuse.de).</description>
22
- <notes>- Minor fix for Magento 1.4.1</notes>
23
  <authors><author><name>Phoenix Medien</name><user>auto-converted</user><email>info@phoenix-medien.de</email></author></authors>
24
- <date>2010-07-06</date>
25
- <time>10:23:59</time>
26
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="worldpay"><dir name="pdf"><file name="info.phtml" hash="3a92c60f5c05a3e51df366cee651edd6"/></dir><file name="info.phtml" hash="d70ad71aa960ce0c6d4ec8609dadf7e3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="worldpay.xml" hash="ac4191773623ae2ad6170f363866ed43"/></dir><dir name="template"><dir name="worldpay"><file name="blank.phtml" hash="8b7d8aa0521878b2dd796acfd4d655b6"/><file name="cancel.phtml" hash="350348b8fecb9b7c2b1045d1a8edd9c7"/><file name="failure.phtml" hash="77b202de38902c9e6458218bdce07de8"/><file name="form.phtml" hash="8c7184cbaffc115349de415d12273528"/><file name="info.phtml" hash="d33c7ffde885e4953a975201562cba8e"/><file name="redirect.phtml" hash="84d38770a43262c890094c132dc2bd5c"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Phoenix_Worldpay.csv" hash="8a41fe546b9f6fb3d18c0ccf727ea082"/></dir><dir name="en_US"><file name="Phoenix_Worldpay.csv" hash="d5ff38bb74afd4e7715cfa54134fd57d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Phoenix_Worldpay.xml" hash="52b9dc5cd0d94ab43d8691438f090617"/></dir></target><target name="magecommunity"><dir name="Phoenix"><dir name="Worldpay"><dir name="Block"><file name="Cancel.php" hash="b0f213ee8e45d0b8b48a6fad48f05017"/><file name="Failure.php" hash="5add6ed9890109ba624b7a16bc0504f5"/><file name="Form.php" hash="d279b2d502e875e155101007eef7ebc5"/><file name="Info.php" hash="24bc51b1b86cd3a020982b09e8695c22"/><file name="Redirect.php" hash="ee8eb2b8cdabaf9ae0dea66fd7362777"/><file name="Success.php" hash="0c072e272d53a0b24e5157201cd65877"/></dir><dir name="controllers"><file name="ProcessingController.php" hash="d9eea1d1104e83e6499169f0d5be4fb1"/></dir><dir name="etc"><file name="config.xml" hash="fcd26ac79bd126b7c3c79cac31d8ba94"/><file name="system.xml" hash="5361e90063e729e4c01ae95a074d0fc4"/></dir><dir name="Helper"><file name="Data.php" hash="354473f472247a9dae11a1fac0cef407"/></dir><dir name="Model"><dir name="Config"><dir name="Backend"><file name="Instid.php" hash="07147ceac69c3c19593b4a24873f15cc"/></dir></dir><dir name="Source"><file name="RequestType.php" hash="795d51b4c3f04bb00cf6cca5a3180cd7"/><file name="TransactionMode.php" hash="da4cadb5df1213edc34f22b67235d374"/></dir><file name="Cc.php" hash="cf6b3bff52b5aedd85ff94cc59a0fc8e"/><file name="Config.php" hash="9098369b245a824396354e1b64cd47ab"/></dir></dir></dir></target></contents>
27
  <compatible/>
28
  <dependencies/>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Phoenix_Worldpay</name>
4
+ <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
19
  The extension is developed and maintained by the German Magento Silver Partner Phoenix Medien (http://www.phoenix-medien.de).
20
 
21
  The development was sponsored by liaison dangereuse (http://www.liaison-dangereuse.de).</description>
22
+ <notes>- fixed issue with shopping card reload on cancelation (Magento 1.4.1)</notes>
23
  <authors><author><name>Phoenix Medien</name><user>auto-converted</user><email>info@phoenix-medien.de</email></author></authors>
24
+ <date>2010-07-08</date>
25
+ <time>15:23:56</time>
26
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="worldpay"><dir name="pdf"><file name="info.phtml" hash="3a92c60f5c05a3e51df366cee651edd6"/></dir><file name="info.phtml" hash="d70ad71aa960ce0c6d4ec8609dadf7e3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="worldpay.xml" hash="ac4191773623ae2ad6170f363866ed43"/></dir><dir name="template"><dir name="worldpay"><file name="blank.phtml" hash="8b7d8aa0521878b2dd796acfd4d655b6"/><file name="cancel.phtml" hash="350348b8fecb9b7c2b1045d1a8edd9c7"/><file name="failure.phtml" hash="77b202de38902c9e6458218bdce07de8"/><file name="form.phtml" hash="8c7184cbaffc115349de415d12273528"/><file name="info.phtml" hash="d33c7ffde885e4953a975201562cba8e"/><file name="redirect.phtml" hash="84d38770a43262c890094c132dc2bd5c"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Phoenix_Worldpay.csv" hash="8fb586663ea9f3ae7022bf7e2ee81fd8"/></dir><dir name="en_US"><file name="Phoenix_Worldpay.csv" hash="9058fb3d52918ff4a1b85ae32fa87d3f"/></dir></target><target name="mageetc"><dir name="modules"><file name="Phoenix_Worldpay.xml" hash="52b9dc5cd0d94ab43d8691438f090617"/></dir></target><target name="magecommunity"><dir name="Phoenix"><dir name="Worldpay"><dir name="Block"><file name="Cancel.php" hash="b0f213ee8e45d0b8b48a6fad48f05017"/><file name="Failure.php" hash="5add6ed9890109ba624b7a16bc0504f5"/><file name="Form.php" hash="d279b2d502e875e155101007eef7ebc5"/><file name="Info.php" hash="845d37c36ea2973599324f9e294969a4"/><file name="Redirect.php" hash="ee8eb2b8cdabaf9ae0dea66fd7362777"/><file name="Success.php" hash="0c072e272d53a0b24e5157201cd65877"/></dir><dir name="controllers"><file name="ProcessingController.php" hash="575b20d29df23f75394eabfb6c007f71"/></dir><dir name="etc"><file name="config.xml" hash="280c560e1aa553e260fab16828ea8519"/><file name="system.xml" hash="5361e90063e729e4c01ae95a074d0fc4"/></dir><dir name="Helper"><file name="Data.php" hash="954555e22d7867b2eb2b698b86405d63"/></dir><dir name="Model"><dir name="Config"><dir name="Backend"><file name="Instid.php" hash="07147ceac69c3c19593b4a24873f15cc"/></dir></dir><dir name="Source"><file name="RequestType.php" hash="795d51b4c3f04bb00cf6cca5a3180cd7"/><file name="TransactionMode.php" hash="da4cadb5df1213edc34f22b67235d374"/></dir><file name="Cc.php" hash="cf6b3bff52b5aedd85ff94cc59a0fc8e"/><file name="Config.php" hash="9098369b245a824396354e1b64cd47ab"/></dir></dir></dir></target></contents>
27
  <compatible/>
28
  <dependencies/>
29
  </package>