Version Notes
Invoice status issue fixed for payments completed on external hosted pages
Download this release
Release Info
Developer | Magento Core Team |
Extension | Cardsave_Cardsaveonlinepayments |
Version | 1.8.4 |
Comparing to | |
See all releases |
Code changes from version 1.8.3 to 1.8.4
app/code/local/Cardsave/Cardsaveonlinepayments/controllers/PaymentController.php
CHANGED
@@ -143,8 +143,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
143 |
$order->sendNewOrderEmail();
|
144 |
}
|
145 |
|
146 |
-
// need to decrease the stock only after a succecssful payment
|
147 |
$this->_subtractOrderedItemsFromStock($order);
|
|
|
148 |
|
149 |
if($szPaymentProcessorResponse != '')
|
150 |
{
|
@@ -255,8 +255,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
255 |
$order->sendNewOrderEmail();
|
256 |
}
|
257 |
|
258 |
-
// need to decrease the stock only after a succecssful payment
|
259 |
$this->_subtractOrderedItemsFromStock($order);
|
|
|
260 |
|
261 |
if($szPaymentProcessorResponse != '')
|
262 |
{
|
@@ -317,8 +317,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
317 |
if($this->getRequest()->getPost('StatusCode') == '0')
|
318 |
{
|
319 |
Mage::getSingleton('checkout/session')->clear();
|
320 |
-
|
321 |
-
|
322 |
}
|
323 |
|
324 |
$this->getResponse()->setBody('StatusCode=0');
|
@@ -466,8 +466,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
466 |
$order->sendNewOrderEmail();
|
467 |
}
|
468 |
|
469 |
-
// need to decrease the stock only after a succecssful payment
|
470 |
$this->_subtractOrderedItemsFromStock($order);
|
|
|
471 |
|
472 |
Mage::getSingleton('core/session')->addSuccess('Payment Processor Response: '.$szMessage);
|
473 |
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
@@ -687,8 +687,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
687 |
$order->sendNewOrderEmail();
|
688 |
}
|
689 |
|
690 |
-
// need to decrease the stock only after a succecssful payment
|
691 |
$this->_subtractOrderedItemsFromStock($order);
|
|
|
692 |
|
693 |
if($szPaymentProcessorResponse != '')
|
694 |
{
|
@@ -739,7 +739,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
739 |
{
|
740 |
$nVersion = CSV_PaymentFormHelper::getVersion(Mage::getVersion());
|
741 |
$isCustomStockManagementEnabled = Mage::getModel('cardsaveonlinepayments/direct')->getConfigData('customstockmanagementenabled');
|
742 |
-
|
743 |
if($nVersion >= 1410 &&
|
744 |
$isCustomStockManagementEnabled)
|
745 |
{
|
@@ -786,4 +786,14 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
|
|
786 |
->setRedirectedpayment(null)
|
787 |
->setCardsaveonlinepaymentsOrderId(null);
|
788 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
789 |
}
|
143 |
$order->sendNewOrderEmail();
|
144 |
}
|
145 |
|
|
|
146 |
$this->_subtractOrderedItemsFromStock($order);
|
147 |
+
$this->_updateInvoices($order);
|
148 |
|
149 |
if($szPaymentProcessorResponse != '')
|
150 |
{
|
255 |
$order->sendNewOrderEmail();
|
256 |
}
|
257 |
|
|
|
258 |
$this->_subtractOrderedItemsFromStock($order);
|
259 |
+
$this->_updateInvoices($order);
|
260 |
|
261 |
if($szPaymentProcessorResponse != '')
|
262 |
{
|
317 |
if($this->getRequest()->getPost('StatusCode') == '0')
|
318 |
{
|
319 |
Mage::getSingleton('checkout/session')->clear();
|
320 |
+
$this->_subtractOrderedItemsFromStock($order);
|
321 |
+
$this->_updateInvoices($order);
|
322 |
}
|
323 |
|
324 |
$this->getResponse()->setBody('StatusCode=0');
|
466 |
$order->sendNewOrderEmail();
|
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));
|
687 |
$order->sendNewOrderEmail();
|
688 |
}
|
689 |
|
|
|
690 |
$this->_subtractOrderedItemsFromStock($order);
|
691 |
+
$this->_updateInvoices($order);
|
692 |
|
693 |
if($szPaymentProcessorResponse != '')
|
694 |
{
|
739 |
{
|
740 |
$nVersion = CSV_PaymentFormHelper::getVersion(Mage::getVersion());
|
741 |
$isCustomStockManagementEnabled = Mage::getModel('cardsaveonlinepayments/direct')->getConfigData('customstockmanagementenabled');
|
742 |
+
|
743 |
if($nVersion >= 1410 &&
|
744 |
$isCustomStockManagementEnabled)
|
745 |
{
|
786 |
->setRedirectedpayment(null)
|
787 |
->setCardsaveonlinepaymentsOrderId(null);
|
788 |
}
|
789 |
+
|
790 |
+
private function _updateInvoices($order)
|
791 |
+
{
|
792 |
+
$invoices = $order->getInvoiceCollection();
|
793 |
+
foreach ($invoices as $invoice)
|
794 |
+
{
|
795 |
+
// set the invoice state to be "Paid"
|
796 |
+
$invoice->pay()->save();
|
797 |
+
}
|
798 |
+
}
|
799 |
}
|
app/code/local/Cardsave/Sales/Model/Order/Invoice.php
CHANGED
@@ -17,4 +17,37 @@ class Cardsave_Sales_Model_Order_Invoice extends Mage_Sales_Model_Order_Invoice
|
|
17 |
}
|
18 |
return $this;
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
17 |
}
|
18 |
return $this;
|
19 |
}
|
20 |
+
|
21 |
+
public function pay()
|
22 |
+
{
|
23 |
+
if ($this->_wasPayCalled)
|
24 |
+
{
|
25 |
+
return $this;
|
26 |
+
}
|
27 |
+
|
28 |
+
if(!$this->getOrder()->getIsThreeDSecurePending() &&
|
29 |
+
!$this->getOrder()->getIsHostedPaymentPending())
|
30 |
+
{
|
31 |
+
$this->_wasPayCalled = true;
|
32 |
+
|
33 |
+
$invoiceState = self::STATE_PAID;
|
34 |
+
if ($this->getOrder()->getPayment()->hasForcedState())
|
35 |
+
{
|
36 |
+
$invoiceState = $this->getOrder()->getPayment()->getForcedState();
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->setState($invoiceState);
|
40 |
+
|
41 |
+
$this->getOrder()->getPayment()->pay($this);
|
42 |
+
$this->getOrder()->setTotalPaid(
|
43 |
+
$this->getOrder()->getTotalPaid()+$this->getGrandTotal()
|
44 |
+
);
|
45 |
+
$this->getOrder()->setBaseTotalPaid(
|
46 |
+
$this->getOrder()->getBaseTotalPaid()+$this->getBaseGrandTotal()
|
47 |
+
);
|
48 |
+
Mage::dispatchEvent('sales_order_invoice_pay', array($this->_eventObject=>$this));
|
49 |
+
}
|
50 |
+
|
51 |
+
return $this;
|
52 |
+
}
|
53 |
}
|
package.xml
CHANGED
@@ -1,20 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardsave_Cardsaveonlinepayments</name>
|
4 |
-
<version>1.8.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Cardsave Payment Extension
|
10 |
<description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by Cardsave.</description>
|
11 |
-
<notes>
|
12 |
-
Fix to manage stock properly.
|
13 |
-
Fix to update the Order status properly.</notes>
|
14 |
<authors><author><name>cardsave</name><user>auto-converted</user><email>integrationsupport@cardsaveonlinepayments.com</email></author></authors>
|
15 |
-
<date>2010-10-
|
16 |
-
<time>
|
17 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="2b0b8a72c9f4a6d2ab9f0ea020c8f2ed"/><file name="info.phtml" hash="935e10cad0632d558b2db1913cb80a2a"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="206c8703ef4d160dfc6c739c128ab47b"/><file name="info.phtml" hash="7256464904bbad66a821dea898d657a6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardsave"><dir name="Cardsaveonlinepayments"><dir name="Block"><file name="Error.php" hash="660d3cbde48910ef271df9e05130a6d7"/><file name="Form.php" hash="ea5b3817c9607a94f4685d53d0b18569"/><file name="Info.php" hash="57a4bfec1a1c769de063be2b922f4a97"/><file name="Redirect.php" hash="b5a1f7af807dc9a41ec5b9db5c74e87e"/><file name="Threedsecure.php" hash="1715396760374c5bf11cc7e86d75e6ce"/></dir><dir name="controllers"><file name="PaymentController.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies/>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardsave_Cardsaveonlinepayments</name>
|
4 |
+
<version>1.8.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Cardsave Payment Extension</summary>
|
10 |
<description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by Cardsave.</description>
|
11 |
+
<notes>Invoice status issue fixed for payments completed on external hosted pages</notes>
|
|
|
|
|
12 |
<authors><author><name>cardsave</name><user>auto-converted</user><email>integrationsupport@cardsaveonlinepayments.com</email></author></authors>
|
13 |
+
<date>2010-10-20</date>
|
14 |
+
<time>10:50:11</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="2b0b8a72c9f4a6d2ab9f0ea020c8f2ed"/><file name="info.phtml" hash="935e10cad0632d558b2db1913cb80a2a"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="206c8703ef4d160dfc6c739c128ab47b"/><file name="info.phtml" hash="7256464904bbad66a821dea898d657a6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardsave"><dir name="Cardsaveonlinepayments"><dir name="Block"><file name="Error.php" hash="660d3cbde48910ef271df9e05130a6d7"/><file name="Form.php" hash="ea5b3817c9607a94f4685d53d0b18569"/><file name="Info.php" hash="57a4bfec1a1c769de063be2b922f4a97"/><file name="Redirect.php" hash="b5a1f7af807dc9a41ec5b9db5c74e87e"/><file name="Threedsecure.php" hash="1715396760374c5bf11cc7e86d75e6ce"/></dir><dir name="controllers"><file name="PaymentController.php" hash="e8546b075a7949366be428248a3517e7"/></dir><dir name="etc"><file name="config.xml" hash="14507a95509d6366272555a05ba110c9"/><file name="system.xml" hash="4d0eab1c1a11d3e2078802499ad49f1e"/></dir><dir name="Helper"><file name="Data.php" hash="e024ec0479d1e8e7efcf4751b05194d6"/></dir><dir name="Model"><file name="Direct.php" hash="b49148a9a4647226b29575e734b912e5"/><file name="Request.php" hash="370f028086d13ae1df470e93a67dea66"/><dir name="Common"><file name="GlobalErrors.php" hash="04d277d4a763efa508bf36d29c7dc8c4"/><file name="ISOCountries.php" hash="78dc558da68ca9a6ef44898a3980ecf2"/><file name="ISOCurrencies.php" hash="a32bc47b2d9896c293ecdcbf847144f9"/><file name="PaymentFormHelper.php" hash="75d4ea669fae3eb62df24c45f83a5a60"/><dir name="ThePaymentGateway"><file name="PaymentSystem.php" hash="e4d4df170c21b7e3571b3ba1205ca979"/><file name="SOAP.php" hash="a0e5474dce51dc90ba4d37b5de3cdd84"/><file name="TPG_Common.php" hash="d86997c977cfd55b8ab577a514ab149c"/></dir></dir><dir name="Source"><file name="HashMethod.php" hash="997928579b69d21ae9eebec698c715c6"/><file name="OrderStatus.php" hash="4c44f8ba1652f20d934aa200ed4c8d00"/><file name="PaymentAction.php" hash="fa94be37c18bbb2f6301bdad1db3698d"/><file name="PaymentMode.php" hash="ea8af602bd09d54a123af64bc4b680d0"/><file name="ResultDeliveryMethod.php" hash="afb838319df715e604173d6aa143feab"/></dir></dir></dir><dir name="Checkout"><dir name="Block"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="695d628564f6e1e0c85e3821699e6b45"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="9dbd58b6b32491d65e5c7d5850aa3420"/></dir><dir name="Model"><dir name="Type"><file name="Onepage.php" hash="e3d27996d67ced85884ab3dbd9dd1199"/></dir></dir></dir><dir name="Sales"><dir name="etc"><file name="config.xml" hash="01b499b658358c8d6f608d8f01158e54"/></dir><dir name="Model"><file name="Order.php" hash="9ffa9e06b0d5d8d2d810ab50017e81fa"/><dir name="Order"><file name="Invoice.php" hash="9d826794c5b0652d2e6e5d3e315a5cc6"/><file name="Payment.php" hash="caba45b28b4e369c89deae6f81f5a8b2"/></dir><dir name="Service"><file name="Quote.php" hash="2cca459cf3338bf53501fe836b8b9f96"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="cardsave_online.jpg" hash="abb239c81edb9ae8df8cf891e914e2aa"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cardsave_All.xml" hash="e1d59fd8c4d4b5d87607f43fecf47e59"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|