Iridiumcorp_Tpg - Version 1.10.3

Version Notes

Added statuses

Download this release

Release Info

Developer Magento Core Team
Extension Iridiumcorp_Tpg
Version 1.10.3
Comparing to
See all releases


Code changes from version 1.10.2 to 1.10.3

app/code/local/Iridiumcorp/Sales/Model/Order/Payment.php CHANGED
@@ -66,10 +66,11 @@ class Iridiumcorp_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payme
66
  }
67
  else if($order->getIsThreeDSecurePending())
68
  {
 
69
  $orderState = 'pending_payment';
70
  $orderStatus = 'irc_pending_threed_secure';
 
71
  $orderIsNotified = false;
72
- $order->setCustomerNote(Mage::helper('tpg')->__('Pending 3D Secure Authentication.'));
73
  }
74
  else if($order->getIsHostedPaymentPending())
75
  {
@@ -77,7 +78,7 @@ class Iridiumcorp_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payme
77
  $orderState = 'pending_payment';
78
  $orderStatus = 'irc_pending_hosted_payment';
79
  $orderIsNotified = false;
80
- $order->setCustomerNote(Mage::helper('tpg')->__('Pending Hosted Payment.'));
81
  }
82
  else
83
  {
@@ -89,7 +90,12 @@ class Iridiumcorp_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payme
89
  }
90
 
91
  $isCustomerNotified = (null !== $orderIsNotified) ? $orderIsNotified : $order->getCustomerNoteNotify();
92
- $message = $order->getCustomerNote();
 
 
 
 
 
93
 
94
  // add message if order was put into review during authorization or capture
95
  if ($order->getState() == Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW)
66
  }
67
  else if($order->getIsThreeDSecurePending())
68
  {
69
+ $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
70
  $orderState = 'pending_payment';
71
  $orderStatus = 'irc_pending_threed_secure';
72
+ $message = '3D Secure authentication need to be completed';
73
  $orderIsNotified = false;
 
74
  }
75
  else if($order->getIsHostedPaymentPending())
76
  {
78
  $orderState = 'pending_payment';
79
  $orderStatus = 'irc_pending_hosted_payment';
80
  $orderIsNotified = false;
81
+ $message = 'Hosted Payment need to be completed';
82
  }
83
  else
84
  {
90
  }
91
 
92
  $isCustomerNotified = (null !== $orderIsNotified) ? $orderIsNotified : $order->getCustomerNoteNotify();
93
+ //$message = $order->getCustomerNote();
94
+ if(!$order->getIsThreeDSecurePending() &&
95
+ !$order->getIsHostedPaymentPending())
96
+ {
97
+ $message = $order->getCustomerNote();
98
+ }
99
 
100
  // add message if order was put into review during authorization or capture
101
  if ($order->getState() == Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW)
app/code/local/Iridiumcorp/Sales/etc/config.xml CHANGED
@@ -19,6 +19,9 @@
19
  <sales>
20
  <order>
21
  <statuses>
 
 
 
22
  <irc_pending_threed_secure translate="label">
23
  <label>Iridiumcorp - Pending 3D Secure</label>
24
  </irc_pending_threed_secure>
19
  <sales>
20
  <order>
21
  <statuses>
22
+ <irc_paid translate="label">
23
+ <label>Iridiumcorp - Successful Payment</label>
24
+ </irc_paid>
25
  <irc_pending_threed_secure translate="label">
26
  <label>Iridiumcorp - Pending 3D Secure</label>
27
  </irc_pending_threed_secure>
app/code/local/Iridiumcorp/Tpg/controllers/PaymentController.php CHANGED
@@ -144,7 +144,7 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
144
  }
145
 
146
  $this->_subtractOrderedItemsFromStock($order);
147
- $this->_updateInvoices($order);
148
 
149
  if($szPaymentProcessorResponse != '')
150
  {
@@ -256,7 +256,7 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
256
  }
257
 
258
  $this->_subtractOrderedItemsFromStock($order);
259
- $this->_updateInvoices($order);
260
 
261
  if($szPaymentProcessorResponse != '')
262
  {
@@ -276,13 +276,14 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
276
  $model = Mage::getModel('tpg/direct');
277
  $checkout = Mage::getSingleton('checkout/type_onepage');
278
  $szOrderID = $this->getRequest()->getPost('OrderID');
 
279
 
280
  try
281
  {
282
  // finish off the transaction: if StatusCode = 0 create an order otherwise do nothing
283
  $checkout->saveOrderAfterRedirectedPaymentAction(true,
284
  $this->getRequest()->getPost('StatusCode'),
285
- $this->getRequest()->getPost('Message'),
286
  $this->getRequest()->getPost('PreviousStatusCode'),
287
  $this->getRequest()->getPost('PreviousMessage'),
288
  $this->getRequest()->getPost('OrderID'));
@@ -318,7 +319,7 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
318
  {
319
  Mage::getSingleton('checkout/session')->clear();
320
  $this->_subtractOrderedItemsFromStock($order);
321
- $this->_updateInvoices($order);
322
  }
323
 
324
  $this->getResponse()->setBody('StatusCode=0');
@@ -467,7 +468,7 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
467
  }
468
 
469
  $this->_subtractOrderedItemsFromStock($order);
470
- $this->_updateInvoices($order);
471
 
472
  Mage::getSingleton('core/session')->addSuccess('Payment Processor Response: '.$szMessage);
473
  $this->_redirect('checkout/onepage/success', array('_secure' => true));
@@ -688,7 +689,7 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
688
  }
689
 
690
  $this->_subtractOrderedItemsFromStock($order);
691
- $this->_updateInvoices($order);
692
 
693
  if($szPaymentProcessorResponse != '')
694
  {
@@ -802,12 +803,19 @@ class Iridiumcorp_Tpg_PaymentController extends Mage_Core_Controller_Front_Actio
802
  *
803
  * @param unknown_type $order
804
  */
805
- private function _updateInvoices($order)
806
  {
807
  $invoices = $order->getInvoiceCollection();
 
 
808
  foreach ($invoices as $invoice)
809
  {
810
  $invoice->pay()->save();
811
  }
 
 
 
 
 
812
  }
813
  }
144
  }
145
 
146
  $this->_subtractOrderedItemsFromStock($order);
147
+ $this->_updateInvoices($order, $szPaymentProcessorResponse);
148
 
149
  if($szPaymentProcessorResponse != '')
150
  {
256
  }
257
 
258
  $this->_subtractOrderedItemsFromStock($order);
259
+ $this->_updateInvoices($order, $szPaymentProcessorResponse);
260
 
261
  if($szPaymentProcessorResponse != '')
262
  {
276
  $model = Mage::getModel('tpg/direct');
277
  $checkout = Mage::getSingleton('checkout/type_onepage');
278
  $szOrderID = $this->getRequest()->getPost('OrderID');
279
+ $szMessage = $this->getRequest()->getPost('Message');
280
 
281
  try
282
  {
283
  // finish off the transaction: if StatusCode = 0 create an order otherwise do nothing
284
  $checkout->saveOrderAfterRedirectedPaymentAction(true,
285
  $this->getRequest()->getPost('StatusCode'),
286
+ $szMessage,
287
  $this->getRequest()->getPost('PreviousStatusCode'),
288
  $this->getRequest()->getPost('PreviousMessage'),
289
  $this->getRequest()->getPost('OrderID'));
319
  {
320
  Mage::getSingleton('checkout/session')->clear();
321
  $this->_subtractOrderedItemsFromStock($order);
322
+ $this->_updateInvoices($order, $szMessage);
323
  }
324
 
325
  $this->getResponse()->setBody('StatusCode=0');
468
  }
469
 
470
  $this->_subtractOrderedItemsFromStock($order);
471
+ $this->_updateInvoices($order, $szMessage);
472
 
473
  Mage::getSingleton('core/session')->addSuccess('Payment Processor Response: '.$szMessage);
474
  $this->_redirect('checkout/onepage/success', array('_secure' => true));
689
  }
690
 
691
  $this->_subtractOrderedItemsFromStock($order);
692
+ $this->_updateInvoices($order, $szPaymentProcessorResponse);
693
 
694
  if($szPaymentProcessorResponse != '')
695
  {
803
  *
804
  * @param unknown_type $order
805
  */
806
+ private function _updateInvoices($order, $message)
807
  {
808
  $invoices = $order->getInvoiceCollection();
809
+ $status = Mage_Sales_Model_Order::STATE_PROCESSING;
810
+
811
  foreach ($invoices as $invoice)
812
  {
813
  $invoice->pay()->save();
814
  }
815
+
816
+ // add a comment to the order comments
817
+ //$order->addStatusToHistory($status, $message, false);
818
+ $order->setState($orderState, 'irc_paid', $message, false);
819
+ $order->save();
820
  }
821
  }
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iridiumcorp_Tpg</name>
4
- <version>1.10.2</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Iridiumcorp Payment Extension</summary>
10
  <description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by Iridium.</description>
11
- <notes>Corrected the name of invoice status xml nodes due to the length limit on these nodes</notes>
12
  <authors><author><name>iridiumcorp</name><user>auto-converted</user><email>support@iridiumcorp.co.uk</email></author></authors>
13
- <date>2010-10-20</date>
14
- <time>13:35:59</time>
15
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="Tpg"><file name="form.phtml" hash="9b2afd627d6e9e4f9ad43b0a7153962b"/><file name="info.phtml" hash="3164afadd87c4811b5f7d0879537f10e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="Tpg"><file name="form.phtml" hash="231e39bb2821718eeaec4c1d0ee3233d"/><file name="info.phtml" hash="7d72d07f3afa018d0402219e50573439"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="iridium_corporation.jpg" hash="589faaa1b7e80b32a425175ecfc3b455"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Iridiumcorp"><dir name="Checkout"><dir name="Block"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="a10e1c19ad7bb8718dcb3adf9d3e4de0"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="aaa95b6e1d6e145940bf9ba9bbe1dc0f"/></dir><dir name="Model"><dir name="Type"><file name="Onepage.php" hash="f57d3807294d61ee997cbdfd6acce34c"/></dir></dir></dir><dir name="Sales"><dir name="etc"><file name="config.xml" hash="91dc7d69dbb2798506eedb2fd64871c9"/></dir><dir name="Model"><file name="Order.php" hash="a57c4bd661dbc322d5bd18aa2f51dd67"/><dir name="Order"><file name="Invoice.php" hash="14bd6c6a2e0b632fa669b937d0b23f78"/><file name="Payment.php" hash="c2883a14f0a2d25c9bad7cd764026378"/></dir><dir name="Service"><file name="Quote.php" hash="bf113cd154e23dd9c8df0946adf9b94f"/></dir></dir></dir><dir name="Tpg"><dir name="Block"><file name="Error.php" hash="905367210beb53a0bc68dc6033e24127"/><file name="Form.php" hash="4b1d51aa84982486f3139510c41a221a"/><file name="Info.php" hash="f88445c4880bfe14914252bc76b6fc28"/><file name="Redirect.php" hash="a91a8a8f8b5ad887ed2cdd8d52732b8b"/><file name="Threedsecure.php" hash="9cbcf7d598fe4fdb5144aa6496436176"/></dir><dir name="controllers"><file name="PaymentController.php" hash="297816bfb9d498993a489bffc7d6ecb9"/></dir><dir name="etc"><file name="config.xml" hash="3395b3323803ea1c1fdea27f919c08da"/><file name="system.xml" hash="13531b8280be72392ae8abbd47f00adf"/></dir><dir name="Helper"><file name="Data.php" hash="a72fba87e718c94d993a57199e20ca96"/></dir><dir name="Model"><file name="Direct.php" hash="5581007f591f1a6dc9b16716fc12d223"/><file name="Request.php" hash="a96e462ed3c1882048ea45f2c3a6662c"/><dir name="Common"><file name="GlobalErrors.php" hash="a9c7bab60ebfe87967c794194e1e7208"/><file name="ISOCountries.php" hash="fc63d76fbe25458ba351f114782074cb"/><file name="ISOCurrencies.php" hash="89ac1e124e89c0713ef43a0cf6dd0e2b"/><file name="PaymentFormHelper.php" hash="85721dd87049dbd6c4aef2e48453815f"/><dir name="ThePaymentGateway"><file name="PaymentSystem.php" hash="4ad38bdb85f865e967153d9f253390cd"/><file name="SOAP.php" hash="504dcb0cb7c60c134b25652881349cc3"/><file name="TPG_Common.php" hash="df1033ef855c7e0e715076a105acb84a"/></dir></dir><dir name="Source"><file name="HashMethod.php" hash="36d7fb4fc762feae459f0e67d51006f4"/><file name="OrderStatus.php" hash="95eb926db39d4afeb26784a9396f7b18"/><file name="PaymentAction.php" hash="bd8dc40852b9ff8c80c08fc01f35a988"/><file name="PaymentMode.php" hash="6849defade8a7da4cfaeff3227ae5b83"/><file name="ResultDeliveryMethod.php" hash="05f3806f2ff4bd5b1568bfb1681b2242"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iridiumcorp_All.xml" hash="f1a85eaa7631af1906f461b662519732"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iridiumcorp_Tpg</name>
4
+ <version>1.10.3</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Iridiumcorp Payment Extension</summary>
10
  <description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by Iridium.</description>
11
+ <notes>Added statuses</notes>
12
  <authors><author><name>iridiumcorp</name><user>auto-converted</user><email>support@iridiumcorp.co.uk</email></author></authors>
13
+ <date>2010-10-29</date>
14
+ <time>15:03:39</time>
15
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="Tpg"><file name="form.phtml" hash="9b2afd627d6e9e4f9ad43b0a7153962b"/><file name="info.phtml" hash="3164afadd87c4811b5f7d0879537f10e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="Tpg"><file name="form.phtml" hash="231e39bb2821718eeaec4c1d0ee3233d"/><file name="info.phtml" hash="7d72d07f3afa018d0402219e50573439"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="iridium_corporation.jpg" hash="589faaa1b7e80b32a425175ecfc3b455"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Iridiumcorp"><dir name="Checkout"><dir name="Block"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="a10e1c19ad7bb8718dcb3adf9d3e4de0"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="aaa95b6e1d6e145940bf9ba9bbe1dc0f"/></dir><dir name="Model"><dir name="Type"><file name="Onepage.php" hash="f57d3807294d61ee997cbdfd6acce34c"/></dir></dir></dir><dir name="Sales"><dir name="etc"><file name="config.xml" hash="6e5a6db08b9bbaf959ec31a20ec5ffc2"/></dir><dir name="Model"><file name="Order.php" hash="a57c4bd661dbc322d5bd18aa2f51dd67"/><dir name="Order"><file name="Invoice.php" hash="14bd6c6a2e0b632fa669b937d0b23f78"/><file name="Payment.php" hash="c6eac0f4c3e0d7bbdd51833773d3cc15"/></dir><dir name="Service"><file name="Quote.php" hash="bf113cd154e23dd9c8df0946adf9b94f"/></dir></dir></dir><dir name="Tpg"><dir name="Block"><file name="Error.php" hash="905367210beb53a0bc68dc6033e24127"/><file name="Form.php" hash="4b1d51aa84982486f3139510c41a221a"/><file name="Info.php" hash="f88445c4880bfe14914252bc76b6fc28"/><file name="Redirect.php" hash="a91a8a8f8b5ad887ed2cdd8d52732b8b"/><file name="Threedsecure.php" hash="9cbcf7d598fe4fdb5144aa6496436176"/></dir><dir name="controllers"><file name="PaymentController.php" hash="2bcd1917dabbcd88700472451585a49e"/></dir><dir name="etc"><file name="config.xml" hash="3395b3323803ea1c1fdea27f919c08da"/><file name="system.xml" hash="13531b8280be72392ae8abbd47f00adf"/></dir><dir name="Helper"><file name="Data.php" hash="a72fba87e718c94d993a57199e20ca96"/></dir><dir name="Model"><file name="Direct.php" hash="5581007f591f1a6dc9b16716fc12d223"/><file name="Request.php" hash="a96e462ed3c1882048ea45f2c3a6662c"/><dir name="Common"><file name="GlobalErrors.php" hash="a9c7bab60ebfe87967c794194e1e7208"/><file name="ISOCountries.php" hash="fc63d76fbe25458ba351f114782074cb"/><file name="ISOCurrencies.php" hash="89ac1e124e89c0713ef43a0cf6dd0e2b"/><file name="PaymentFormHelper.php" hash="85721dd87049dbd6c4aef2e48453815f"/><dir name="ThePaymentGateway"><file name="PaymentSystem.php" hash="4ad38bdb85f865e967153d9f253390cd"/><file name="SOAP.php" hash="504dcb0cb7c60c134b25652881349cc3"/><file name="TPG_Common.php" hash="df1033ef855c7e0e715076a105acb84a"/></dir></dir><dir name="Source"><file name="HashMethod.php" hash="36d7fb4fc762feae459f0e67d51006f4"/><file name="OrderStatus.php" hash="95eb926db39d4afeb26784a9396f7b18"/><file name="PaymentAction.php" hash="bd8dc40852b9ff8c80c08fc01f35a988"/><file name="PaymentMode.php" hash="6849defade8a7da4cfaeff3227ae5b83"/><file name="ResultDeliveryMethod.php" hash="05f3806f2ff4bd5b1568bfb1681b2242"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iridiumcorp_All.xml" hash="f1a85eaa7631af1906f461b662519732"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>