Version Notes
- Fixed quote re-order issue after cancelling payment
- Fixed compatibility with OneStepCheckout
Download this release
Release Info
Developer | Cardgate BV |
Extension | Cardgate_Cgp |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- app/code/local/Cardgate/Cgp/Model/Gateway/Abstract.php +0 -2
- app/code/local/Cardgate/Cgp/Model/Observer.php +11 -0
- app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/Quote.php +0 -2
- app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/TaxTotal.php +0 -1
- app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/Total.php +19 -1
- app/code/local/Cardgate/Cgp/controllers/StandardController.php +8 -0
- app/code/local/Cardgate/Cgp/etc/config.xml +19 -4
- app/etc/modules/{Cardgate_Cgp.xml → ZzCardgate_Cgp.xml} +0 -0
- package.xml +6 -5
app/code/local/Cardgate/Cgp/Model/Gateway/Abstract.php
CHANGED
@@ -431,8 +431,6 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
431 |
}
|
432 |
|
433 |
$s_arr['cartitems'] = serialize( $cartitems );
|
434 |
-
|
435 |
-
//var_dump($order->getPayment()->getAdditionalInformation(), $cartitems); die();
|
436 |
break;
|
437 |
|
438 |
// Klarna
|
431 |
}
|
432 |
|
433 |
$s_arr['cartitems'] = serialize( $cartitems );
|
|
|
|
|
434 |
break;
|
435 |
|
436 |
// Klarna
|
app/code/local/Cardgate/Cgp/Model/Observer.php
CHANGED
@@ -9,9 +9,20 @@
|
|
9 |
class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
10 |
{
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
public function salesQuoteCollectTotalsAfter ( Varien_Event_Observer $observer )
|
13 |
{
|
14 |
$quote = $observer->getEvent()->getQuote();
|
|
|
|
|
|
|
|
|
|
|
15 |
$quote->setInvoiceFee( 0 );
|
16 |
$quote->setBaseInvoiceFee( 0 );
|
17 |
$quote->setInvoiceFeeExcludedVat( 0 );
|
9 |
class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
10 |
{
|
11 |
|
12 |
+
public function initFromOrderSessionQuoteInitialized ( Varien_Event_Observer $observer )
|
13 |
+
{
|
14 |
+
$quote = $observer->getEvent()->getSessionQuote()->getQuote();
|
15 |
+
self::addInvoiceFeeToQuote( $quote );
|
16 |
+
}
|
17 |
+
|
18 |
public function salesQuoteCollectTotalsAfter ( Varien_Event_Observer $observer )
|
19 |
{
|
20 |
$quote = $observer->getEvent()->getQuote();
|
21 |
+
self::addInvoiceFeeToQuote( $quote );
|
22 |
+
}
|
23 |
+
|
24 |
+
protected static function addInvoiceFeeToQuote( $quote )
|
25 |
+
{
|
26 |
$quote->setInvoiceFee( 0 );
|
27 |
$quote->setBaseInvoiceFee( 0 );
|
28 |
$quote->setInvoiceFeeExcludedVat( 0 );
|
app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/Quote.php
CHANGED
@@ -14,8 +14,6 @@ class Cardgate_Cgp_Model_Paymentfee_Quote_Quote extends Mage_Sales_Model_Quote
|
|
14 |
{
|
15 |
$totals = parent::getTotals();
|
16 |
|
17 |
-
|
18 |
-
|
19 |
unset( $totals['cgp_tax'] );
|
20 |
$totalsIndex = array_keys( $totals );
|
21 |
if ( array_search( 'cgp_fee', $totalsIndex ) === false ) {
|
14 |
{
|
15 |
$totals = parent::getTotals();
|
16 |
|
|
|
|
|
17 |
unset( $totals['cgp_tax'] );
|
18 |
$totalsIndex = array_keys( $totals );
|
19 |
if ( array_search( 'cgp_fee', $totalsIndex ) === false ) {
|
app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/TaxTotal.php
CHANGED
@@ -20,7 +20,6 @@ class Cardgate_Cgp_Model_Paymentfee_Quote_TaxTotal extends Mage_Sales_Model_Quot
|
|
20 |
public function collect ( Mage_Sales_Model_Quote_Address $address )
|
21 |
{
|
22 |
$quote = $address->getQuote();
|
23 |
-
|
24 |
if ( ! is_a( $quote, 'Cardgate_Cgp_Model_Paymentfee_Quote_Quote' ) ) {
|
25 |
throw new Exception( 'Plugin clash detected. ' . get_class( $quote ) );
|
26 |
}
|
20 |
public function collect ( Mage_Sales_Model_Quote_Address $address )
|
21 |
{
|
22 |
$quote = $address->getQuote();
|
|
|
23 |
if ( ! is_a( $quote, 'Cardgate_Cgp_Model_Paymentfee_Quote_Quote' ) ) {
|
24 |
throw new Exception( 'Plugin clash detected. ' . get_class( $quote ) );
|
25 |
}
|
app/code/local/Cardgate/Cgp/Model/Paymentfee/Quote/Total.php
CHANGED
@@ -9,10 +9,26 @@
|
|
9 |
class Cardgate_Cgp_Model_Paymentfee_Quote_Total extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
10 |
{
|
11 |
|
|
|
|
|
|
|
12 |
protected $address;
|
13 |
|
|
|
|
|
|
|
14 |
protected $paymentMethod;
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
/**
|
17 |
* Collect the order total
|
18 |
*
|
@@ -23,6 +39,7 @@ class Cardgate_Cgp_Model_Paymentfee_Quote_Total extends Mage_Sales_Model_Quote_A
|
|
23 |
*/
|
24 |
public function collect ( Mage_Sales_Model_Quote_Address $address )
|
25 |
{
|
|
|
26 |
if ( $address->getAddressType() != "shipping" ) {
|
27 |
return $this;
|
28 |
}
|
@@ -46,7 +63,7 @@ class Cardgate_Cgp_Model_Paymentfee_Quote_Total extends Mage_Sales_Model_Quote_A
|
|
46 |
return $this;
|
47 |
}
|
48 |
|
49 |
-
if ( $this->payment->
|
50 |
$this->paymentMethod = $this->payment->getMethodInstance();
|
51 |
if ( substr( $this->paymentMethod->getCode(), 0, 3 ) == 'cgp' ) {
|
52 |
$this->_initInvoiceFee();
|
@@ -104,6 +121,7 @@ class Cardgate_Cgp_Model_Paymentfee_Quote_Total extends Mage_Sales_Model_Quote_A
|
|
104 |
*/
|
105 |
public function fetch ( Mage_Sales_Model_Quote_Address $address )
|
106 |
{
|
|
|
107 |
if ( $address->getAddressType() != "shipping" ) {
|
108 |
return $this;
|
109 |
}
|
9 |
class Cardgate_Cgp_Model_Paymentfee_Quote_Total extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
10 |
{
|
11 |
|
12 |
+
/**
|
13 |
+
* @var Mage_Sales_Model_Quote
|
14 |
+
*/
|
15 |
protected $address;
|
16 |
|
17 |
+
/**
|
18 |
+
* @var Mage_Sales_Model_Quote
|
19 |
+
*/
|
20 |
protected $paymentMethod;
|
21 |
|
22 |
+
/**
|
23 |
+
* @var Mage_Sales_Model_Quote_Payment
|
24 |
+
*/
|
25 |
+
protected $payment;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Mage_Sales_Model_Quote
|
29 |
+
*/
|
30 |
+
protected $quote;
|
31 |
+
|
32 |
/**
|
33 |
* Collect the order total
|
34 |
*
|
39 |
*/
|
40 |
public function collect ( Mage_Sales_Model_Quote_Address $address )
|
41 |
{
|
42 |
+
|
43 |
if ( $address->getAddressType() != "shipping" ) {
|
44 |
return $this;
|
45 |
}
|
63 |
return $this;
|
64 |
}
|
65 |
|
66 |
+
if ( is_a( $this->payment->getMethodInstance(),'Cardgate_Cgp_Model_Gateway_Abstract' ) ) {
|
67 |
$this->paymentMethod = $this->payment->getMethodInstance();
|
68 |
if ( substr( $this->paymentMethod->getCode(), 0, 3 ) == 'cgp' ) {
|
69 |
$this->_initInvoiceFee();
|
121 |
*/
|
122 |
public function fetch ( Mage_Sales_Model_Quote_Address $address )
|
123 |
{
|
124 |
+
|
125 |
if ( $address->getAddressType() != "shipping" ) {
|
126 |
return $this;
|
127 |
}
|
app/code/local/Cardgate/Cgp/controllers/StandardController.php
CHANGED
@@ -123,6 +123,10 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
123 |
|
124 |
if ( $quote->getId() ) {
|
125 |
$quote->setIsActive( true );
|
|
|
|
|
|
|
|
|
126 |
$quote->save();
|
127 |
}
|
128 |
|
@@ -186,6 +190,10 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
186 |
} else {
|
187 |
if ( $quote->getId() ) {
|
188 |
$quote->setIsActive( true );
|
|
|
|
|
|
|
|
|
189 |
$quote->save();
|
190 |
}
|
191 |
}
|
123 |
|
124 |
if ( $quote->getId() ) {
|
125 |
$quote->setIsActive( true );
|
126 |
+
if ($quote->getReservedOrderId()) {
|
127 |
+
$quote->setOrigOrderId( $quote->getReservedOrderId() );
|
128 |
+
$quote->setReservedOrderId();
|
129 |
+
}
|
130 |
$quote->save();
|
131 |
}
|
132 |
|
190 |
} else {
|
191 |
if ( $quote->getId() ) {
|
192 |
$quote->setIsActive( true );
|
193 |
+
if ($quote->getReservedOrderId()) {
|
194 |
+
$quote->setOrigOrderId( $quote->getReservedOrderId() );
|
195 |
+
$quote->setReservedOrderId();
|
196 |
+
}
|
197 |
$quote->save();
|
198 |
}
|
199 |
}
|
app/code/local/Cardgate/Cgp/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Cardgate_Cgp>
|
13 |
-
<version>1.1.
|
14 |
</Cardgate_Cgp>
|
15 |
</modules>
|
16 |
|
@@ -69,12 +69,14 @@
|
|
69 |
<order_creditmemo>
|
70 |
<totals>
|
71 |
<cgp_total>
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
</cgp_total>
|
76 |
</totals>
|
77 |
</order_creditmemo>
|
|
|
|
|
78 |
<order_invoice>
|
79 |
<totals>
|
80 |
<cgp_total>
|
@@ -83,6 +85,7 @@
|
|
83 |
</totals>
|
84 |
</order_invoice>
|
85 |
</sales>
|
|
|
86 |
<pdf>
|
87 |
<totals>
|
88 |
<invoice_fee translate="title">
|
@@ -149,6 +152,18 @@
|
|
149 |
</global>
|
150 |
|
151 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
<acl>
|
153 |
<resources>
|
154 |
<admin>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Cardgate_Cgp>
|
13 |
+
<version>1.1.2</version>
|
14 |
</Cardgate_Cgp>
|
15 |
</modules>
|
16 |
|
69 |
<order_creditmemo>
|
70 |
<totals>
|
71 |
<cgp_total>
|
72 |
+
<class>cgp/paymentfee_creditmemo_total</class>
|
73 |
+
<after>subtotal,discount,shipping,tax</after>
|
74 |
+
<before>cost_total,grand_total</before>
|
75 |
</cgp_total>
|
76 |
</totals>
|
77 |
</order_creditmemo>
|
78 |
+
|
79 |
+
|
80 |
<order_invoice>
|
81 |
<totals>
|
82 |
<cgp_total>
|
85 |
</totals>
|
86 |
</order_invoice>
|
87 |
</sales>
|
88 |
+
|
89 |
<pdf>
|
90 |
<totals>
|
91 |
<invoice_fee translate="title">
|
152 |
</global>
|
153 |
|
154 |
<adminhtml>
|
155 |
+
<events>
|
156 |
+
<create_order_session_quote_initialized>
|
157 |
+
<observers>
|
158 |
+
<cgp>
|
159 |
+
<type>singleton</type>
|
160 |
+
<class>cgp/observer</class>
|
161 |
+
<method>initFromOrderSessionQuoteInitialized</method>
|
162 |
+
</cgp>
|
163 |
+
</observers>
|
164 |
+
</create_order_session_quote_initialized>
|
165 |
+
</events>
|
166 |
+
|
167 |
<acl>
|
168 |
<resources>
|
169 |
<admin>
|
app/etc/modules/{Cardgate_Cgp.xml → ZzCardgate_Cgp.xml}
RENAMED
File without changes
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardgate_Cgp</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Card Gate Payment Module</summary>
|
10 |
<description>Card Gate is a Payment Service Provider from the Netherlands. We offer various payment methods against competitive rates.</description>
|
11 |
-
<notes>- Fixed
|
|
|
12 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
13 |
-
<date>2015-10-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="cardgate_cgp.css" hash="bebfc13fca1b36867c17864ae70fdabd"/><dir name="images"><dir name="cardgate"><file name="cardgate_cgp.png" hash="b97b15baba0b27042733c8ea4b4fb6bc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Cardgate_Cgp.csv" hash="fd663613a760fa0f253c30aadca0b16b"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardgate_Cgp</name>
|
4 |
+
<version>1.1.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Card Gate Payment Module</summary>
|
10 |
<description>Card Gate is a Payment Service Provider from the Netherlands. We offer various payment methods against competitive rates.</description>
|
11 |
+
<notes>- Fixed quote re-order issue after cancelling payment
|
12 |
+
- Fixed compatibility with OneStepCheckout</notes>
|
13 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
14 |
+
<date>2015-10-21</date>
|
15 |
+
<time>15:21:30</time>
|
16 |
+
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="cardgate_cgp.css" hash="bebfc13fca1b36867c17864ae70fdabd"/><dir name="images"><dir name="cardgate"><file name="cardgate_cgp.png" hash="b97b15baba0b27042733c8ea4b4fb6bc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Cardgate_Cgp.csv" hash="fd663613a760fa0f253c30aadca0b16b"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ZzCardgate_Cgp.xml" hash="c7a72af045f4b737b50cc6c360d4300d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cardgate"><dir name="cgp"><dir name="checkout"><file name="fee.phtml" hash="79362bab3963195ad6727d077fe87b11"/></dir><dir name="form"><file name="banktransfer.phtml" hash="ff7a2a827a7b7a5ed9bcb5d484c30c68"/><file name="ideal.phtml" hash="42fdfee86ba3a098f5f73e9240332581"/><file name="klarna.phtml" hash="e2876171abf8e94d7b77a47ce9279561"/><file name="klarnaaccount.phtml" hash="419f88941703c8562369844bb6a1d692"/></dir><file name="redirect.phtml" hash="ecb2b0a854cd6358adeba535f8889046"/></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardgate"><dir name="Cgp"><dir name="Block"><dir name="Form"><file name="Banktransfer.php" hash="be49e1b58910ee33b329badaa9fc85ce"/><file name="Ideal.php" hash="1d199462951145674bf1d180fd9b5c69"/><file name="Klarna.php" hash="c66cbcc135151dcc4337d22fc0552a46"/><file name="Klarnaaccount.php" hash="77e35328922bfb232f93896b77367c1e"/></dir><dir name="Paymentfee"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="7f4fb8293923e064ecbd77451c52afd9"/></dir></dir></dir><dir name="Checkout"><file name="Fee.php" hash="07e72679dc8ddd5f7e2db9e24bb76aa6"/></dir><dir name="Creditmemo"><file name="Totals.php" hash="87021e3b682c1abf1ae95e173730023a"/></dir><dir name="Invoice"><dir name="Totals"><file name="Fee.php" hash="40c399761dccfd494d7cfb439447c5e3"/></dir></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="0cde857c2b7f33cdb5927143a98f0958"/></dir></dir></dir><file name="Redirect.php" hash="2f854d58133eebad7f128a08d799f7ef"/></dir><dir name="Helper"><file name="Data.php" hash="ed47b3c61a5e701e1683a7717c6b8ef1"/><file name="Paymentfee.php" hash="6ae85c5606efc68ecd188c3513826f3a"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Languages.php" hash="fb24871559fa1ce2613438ad5613a196"/><file name="Modes.php" hash="678a822a7f0c0665fc696c44937825be"/></dir></dir></dir></dir><file name="Base.php" hash="143117456b375ecc92a95b7dd1af6443"/><dir name="Gateway"><file name="Abstract.php" hash="7086219c89d6b57c878a6d99861f49b5"/><file name="Americanexpress.php" hash="705926d7a69fb889f54185743f4cac9f"/><file name="Banktransfer.php" hash="d4d5712ab327c418ee2d949e49faee01"/><file name="Cartebancaire.php" hash="451bff78fa26e4bae883d0c18ca1f844"/><file name="Cartebleue.php" hash="b7974f8f8e655daaf50a899d15cc15fd"/><file name="Default.php" hash="dd934ee60d32000773f26be805d46925"/><file name="Directdebit.php" hash="7890209183bab5f47edcca60a19cd007"/><file name="Giropay.php" hash="ea35629ddfd08cd341128af6d95c8911"/><file name="Ideal.php" hash="1b5b6318c3e544659f465fdbc463fa51"/><file name="Klarna.php" hash="901891d606ea469296e75251fc7abe14"/><file name="Klarnaaccount.php" hash="4d85440b0df2df05ec001c6a5d7416dd"/><file name="Maestro.php" hash="c29f0bd00282c992017a2487d12d8bda"/><file name="Mastercard.php" hash="3febe4f0ee3cc630cd959e8ce086d2ee"/><file name="Mistercash.php" hash="d618b6ab14ffa5d9810cf65232b6d2a3"/><file name="Paypal.php" hash="ad4600fdc877a84a6a4f8647ae2587df"/><file name="Przelewy24.php" hash="f49bfa8354fa2bce2add3221a04843cf"/><file name="Sofortbanking.php" hash="544531b74c8fd34e7ccd48a32210d81f"/><file name="Visa.php" hash="50cbf582c2b5192923d290fcbec35870"/><file name="Vpay.php" hash="acf7d286f343b4e663a55a8540bf45d2"/><file name="Webmoney.php" hash="72a36f0854db4c02e0477208b47faccf"/></dir><file name="Observer.php" hash="72363edbe183cfa833e276f0e3cda200"/><dir name="Paymentfee"><dir name="Creditmemo"><file name="Total.php" hash="5191056c5dae3862c2a468acd3e5cbac"/></dir><dir name="Invoice"><dir name="Pdf"><file name="Total.php" hash="314df1d94874fcb856af2e0be4019782"/></dir><file name="Tax.php" hash="dc485fa37d31e13e20f578cb58075486"/><file name="Total.php" hash="f26e4dc51d0e510eb1c2c65750dec92b"/></dir><dir name="Quote"><file name="Quote.php" hash="d09d4d5c4b55770b0a50f80f0a5fa643"/><file name="TaxTotal.php" hash="a1f53b6ed1988364aa396b3bd7afa1e0"/><file name="Total.php" hash="95febaa23124a4732b0855b04318e245"/></dir></dir></dir><dir name="controllers"><file name="StandardController.php" hash="793d913a16fc5a6ad56f6c4f306af793"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f14dc99c26f44cc53b4a5974dd9cdd2d"/><file name="config.xml" hash="820c3941e6be94fa8d3aca50496da99b"/><file name="system.xml" hash="ef3e29a64439383f4c2a009f6a46af65"/></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|