Version Notes
- Added support for "waiting for payment confirmation" orderstatus
- Fixed iDeal banklist
Download this release
Release Info
Developer | Cardgate BV |
Extension | Cardgate_Cgp |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.3
- app/code/local/Cardgate/Cgp/Block/Form/Ideal.php +16 -2
- app/code/local/Cardgate/Cgp/Model/Adminhtml/System/Config/Source/Orderstatus.php +28 -0
- app/code/local/Cardgate/Cgp/Model/Base.php +3 -2
- app/code/local/Cardgate/Cgp/etc/config.xml +3 -2
- app/code/local/Cardgate/Cgp/etc/system.xml +14 -5
- package.xml +6 -6
app/code/local/Cardgate/Cgp/Block/Form/Ideal.php
CHANGED
@@ -16,15 +16,29 @@ class Cardgate_Cgp_Block_Form_Ideal extends Mage_Payment_Block_Form
|
|
16 |
'0721' => 'ING',
|
17 |
'0751' => 'SNS Bank',
|
18 |
'0001' => '------ Additional Banks ------',
|
19 |
-
'
|
|
|
20 |
'0511' => 'Triodos Bank',
|
21 |
'0761' => 'ASN Bank',
|
22 |
-
'0771' => 'SNS
|
23 |
);
|
24 |
|
25 |
protected function _construct ()
|
26 |
{
|
27 |
parent::_construct();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
$this->setTemplate( 'cardgate/cgp/form/ideal.phtml' );
|
29 |
}
|
30 |
|
16 |
'0721' => 'ING',
|
17 |
'0751' => 'SNS Bank',
|
18 |
'0001' => '------ Additional Banks ------',
|
19 |
+
'0801' => 'Knab',
|
20 |
+
'0161' => 'Van Lanschot Bankiers',
|
21 |
'0511' => 'Triodos Bank',
|
22 |
'0761' => 'ASN Bank',
|
23 |
+
'0771' => 'SNS RegioBank'
|
24 |
);
|
25 |
|
26 |
protected function _construct ()
|
27 |
{
|
28 |
parent::_construct();
|
29 |
+
|
30 |
+
$client = new Varien_Http_Client('https://gateway.cardgateplus.com/cache/idealDirectory.dat');
|
31 |
+
try{
|
32 |
+
$response = $client->request();
|
33 |
+
if ($response->isSuccessful()) {
|
34 |
+
$aBanks = unserialize( $response->getBody() );
|
35 |
+
if ( is_array( $aBanks ) ) {
|
36 |
+
$this->_banks = $aBanks;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
} catch (Exception $e) {
|
40 |
+
}
|
41 |
+
|
42 |
$this->setTemplate( 'cardgate/cgp/form/ideal.phtml' );
|
43 |
}
|
44 |
|
app/code/local/Cardgate/Cgp/Model/Adminhtml/System/Config/Source/Orderstatus.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Model_Adminhtml_System_Config_Source_Orderstatus
|
10 |
+
{
|
11 |
+
|
12 |
+
public function toOptionArray()
|
13 |
+
{
|
14 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStatuses();
|
15 |
+
$options = array();
|
16 |
+
$options[] = array(
|
17 |
+
'value' => '',
|
18 |
+
'label' => Mage::helper('adminhtml')->__('-- Please Select --')
|
19 |
+
);
|
20 |
+
foreach ($statuses as $code=>$label) {
|
21 |
+
$options[] = array(
|
22 |
+
'value' => $code,
|
23 |
+
'label' => "{$label} ({$code})"
|
24 |
+
);
|
25 |
+
}
|
26 |
+
return $options;
|
27 |
+
}
|
28 |
+
}
|
app/code/local/Cardgate/Cgp/Model/Base.php
CHANGED
@@ -251,6 +251,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object
|
|
251 |
exit();
|
252 |
}
|
253 |
|
|
|
254 |
$statusPending = $this->getConfigData( "pending_status" );
|
255 |
$statusComplete = $this->getConfigData( "complete_status" );
|
256 |
$statusFailed = $this->getConfigData( "failed_status" );
|
@@ -325,7 +326,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object
|
|
325 |
// Direct debit pending status
|
326 |
$complete = false;
|
327 |
$newState = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
328 |
-
$newStatus = $
|
329 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Transaction pending: Waiting for confirmation.' );
|
330 |
$order->sendNewOrderEmail();
|
331 |
$order->addStatusToHistory( $order->getStatus(), $statusMessage, true );
|
@@ -366,7 +367,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object
|
|
366 |
// then set product's stock data to update
|
367 |
if ( ! $stockItemId ) {
|
368 |
// FIXME: This cant work!
|
369 |
-
$stockItem->setData( 'product_id', $
|
370 |
$stockItem->setData( 'stock_id', 1 );
|
371 |
} else {
|
372 |
$stock = $stockItem->getData();
|
251 |
exit();
|
252 |
}
|
253 |
|
254 |
+
$statusWaitconf = $this->getConfigData( "waitconf_status" );
|
255 |
$statusPending = $this->getConfigData( "pending_status" );
|
256 |
$statusComplete = $this->getConfigData( "complete_status" );
|
257 |
$statusFailed = $this->getConfigData( "failed_status" );
|
326 |
// Direct debit pending status
|
327 |
$complete = false;
|
328 |
$newState = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
329 |
+
$newStatus = $statusWaitconf;
|
330 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Transaction pending: Waiting for confirmation.' );
|
331 |
$order->sendNewOrderEmail();
|
332 |
$order->addStatusToHistory( $order->getStatus(), $statusMessage, true );
|
367 |
// then set product's stock data to update
|
368 |
if ( ! $stockItemId ) {
|
369 |
// FIXME: This cant work!
|
370 |
+
$stockItem->setData( 'product_id', $_item->getProductId() );
|
371 |
$stockItem->setData( 'stock_id', 1 );
|
372 |
} else {
|
373 |
$stock = $stockItem->getData();
|
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 |
|
@@ -342,8 +342,9 @@
|
|
342 |
<lang>nl</lang>
|
343 |
<initialized_status>pending</initialized_status>
|
344 |
<complete_status>processing</complete_status>
|
|
|
345 |
<failed_status>canceled</failed_status>
|
346 |
-
<fraud_status>
|
347 |
<use_backoffice_urls>0</use_backoffice_urls>
|
348 |
<orderemail_at_payment>1</orderemail_at_payment>
|
349 |
<autocreate_invoice>1</autocreate_invoice>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Cardgate_Cgp>
|
13 |
+
<version>1.1.1</version>
|
14 |
</Cardgate_Cgp>
|
15 |
</modules>
|
16 |
|
342 |
<lang>nl</lang>
|
343 |
<initialized_status>pending</initialized_status>
|
344 |
<complete_status>processing</complete_status>
|
345 |
+
<waitconf_status>pending_payment</waitconf_status>
|
346 |
<failed_status>canceled</failed_status>
|
347 |
+
<fraud_status>fraud</fraud_status>
|
348 |
<use_backoffice_urls>0</use_backoffice_urls>
|
349 |
<orderemail_at_payment>1</orderemail_at_payment>
|
350 |
<autocreate_invoice>1</autocreate_invoice>
|
app/code/local/Cardgate/Cgp/etc/system.xml
CHANGED
@@ -136,7 +136,7 @@
|
|
136 |
<initialized_status translate="label">
|
137 |
<label>Payment in progress status</label>
|
138 |
<frontend_type>select</frontend_type>
|
139 |
-
<source_model>
|
140 |
<sort_order>130</sort_order>
|
141 |
<show_in_default>1</show_in_default>
|
142 |
<show_in_website>1</show_in_website>
|
@@ -145,16 +145,25 @@
|
|
145 |
<complete_status translate="label">
|
146 |
<label>Payment complete status</label>
|
147 |
<frontend_type>select</frontend_type>
|
148 |
-
<source_model>
|
149 |
<sort_order>140</sort_order>
|
150 |
<show_in_default>1</show_in_default>
|
151 |
<show_in_website>1</show_in_website>
|
152 |
<show_in_store>1</show_in_store>
|
153 |
-
</complete_status>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
<failed_status translate="label">
|
155 |
<label>Payment failed status</label>
|
156 |
<frontend_type>select</frontend_type>
|
157 |
-
<source_model>
|
158 |
<sort_order>150</sort_order>
|
159 |
<show_in_default>1</show_in_default>
|
160 |
<show_in_website>1</show_in_website>
|
@@ -163,7 +172,7 @@
|
|
163 |
<fraud_status translate="label">
|
164 |
<label>Payment fraud status</label>
|
165 |
<frontend_type>select</frontend_type>
|
166 |
-
<source_model>
|
167 |
<sort_order>160</sort_order>
|
168 |
<show_in_default>1</show_in_default>
|
169 |
<show_in_website>1</show_in_website>
|
136 |
<initialized_status translate="label">
|
137 |
<label>Payment in progress status</label>
|
138 |
<frontend_type>select</frontend_type>
|
139 |
+
<source_model>cgp/adminhtml_system_config_source_orderstatus</source_model>
|
140 |
<sort_order>130</sort_order>
|
141 |
<show_in_default>1</show_in_default>
|
142 |
<show_in_website>1</show_in_website>
|
145 |
<complete_status translate="label">
|
146 |
<label>Payment complete status</label>
|
147 |
<frontend_type>select</frontend_type>
|
148 |
+
<source_model>cgp/adminhtml_system_config_source_orderstatus</source_model>
|
149 |
<sort_order>140</sort_order>
|
150 |
<show_in_default>1</show_in_default>
|
151 |
<show_in_website>1</show_in_website>
|
152 |
<show_in_store>1</show_in_store>
|
153 |
+
</complete_status>
|
154 |
+
<waitconf_status translate="label">
|
155 |
+
<label>Payment waiting confirmation</label>
|
156 |
+
<frontend_type>select</frontend_type>
|
157 |
+
<source_model>cgp/adminhtml_system_config_source_orderstatus</source_model>
|
158 |
+
<sort_order>145</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>1</show_in_store>
|
162 |
+
</waitconf_status>
|
163 |
<failed_status translate="label">
|
164 |
<label>Payment failed status</label>
|
165 |
<frontend_type>select</frontend_type>
|
166 |
+
<source_model>cgp/adminhtml_system_config_source_orderstatus</source_model>
|
167 |
<sort_order>150</sort_order>
|
168 |
<show_in_default>1</show_in_default>
|
169 |
<show_in_website>1</show_in_website>
|
172 |
<fraud_status translate="label">
|
173 |
<label>Payment fraud status</label>
|
174 |
<frontend_type>select</frontend_type>
|
175 |
+
<source_model>cgp/adminhtml_system_config_source_orderstatus</source_model>
|
176 |
<sort_order>160</sort_order>
|
177 |
<show_in_default>1</show_in_default>
|
178 |
<show_in_website>1</show_in_website>
|
package.xml
CHANGED
@@ -1,19 +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>-
|
12 |
-
- Fixed
|
13 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
14 |
-
<date>2015-10-
|
15 |
-
<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="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardgate_Cgp</name>
|
4 |
+
<version>1.1.3</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>- Added support for "waiting for payment confirmation" orderstatus
|
12 |
+
- Fixed iDeal banklist</notes>
|
13 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
14 |
+
<date>2015-10-30</date>
|
15 |
+
<time>11:05:18</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="8de93bf1698f5dfcbd302d87829b88e1"/><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"/><file name="Orderstatus.php" hash="610ca9cedb01e329d821f4e407e5bfc8"/></dir></dir></dir></dir><file name="Base.php" hash="9389c28aabc80854d1bb27001f045a87"/><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="d133f420f8f837eefd18c9d793f1fcca"/><file name="system.xml" hash="42222343457cedc1ef7b3f090b817161"/></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>
|