Mage_Cgp - Version 1.0.0

Version Notes

1.0.0:
- implementation of the Card Gate Plus payment method.

Download this release

Release Info

Developer Paul Saparov
Extension Mage_Cgp
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (29) hide show
  1. app/code/community/Mage/Adminhtml/Model/Cgp/Config/Source/Languages.php +69 -0
  2. app/code/community/Mage/Adminhtml/Model/Cgp/Config/Source/Modes.php +33 -0
  3. app/code/community/Mage/Cgp/Block/Form/Ideal.php +76 -0
  4. app/code/community/Mage/Cgp/Block/Redirect.php +45 -0
  5. app/code/community/Mage/Cgp/Helper/Data.php +22 -0
  6. app/code/community/Mage/Cgp/Model/Base.php +288 -0
  7. app/code/community/Mage/Cgp/Model/Gateway/Abstract.php +317 -0
  8. app/code/community/Mage/Cgp/Model/Gateway/Americanexpress.php +23 -0
  9. app/code/community/Mage/Cgp/Model/Gateway/Default.php +22 -0
  10. app/code/community/Mage/Cgp/Model/Gateway/Directebanking.php +23 -0
  11. app/code/community/Mage/Cgp/Model/Gateway/Ideal.php +24 -0
  12. app/code/community/Mage/Cgp/Model/Gateway/Maestro.php +23 -0
  13. app/code/community/Mage/Cgp/Model/Gateway/Mastercard.php +23 -0
  14. app/code/community/Mage/Cgp/Model/Gateway/Mistercash.php +23 -0
  15. app/code/community/Mage/Cgp/Model/Gateway/Paypal.php +23 -0
  16. app/code/community/Mage/Cgp/Model/Gateway/Visa.php +23 -0
  17. app/code/community/Mage/Cgp/Model/Gateway/Webmoney.php +23 -0
  18. app/code/community/Mage/Cgp/controllers/StandardController.php +144 -0
  19. app/code/community/Mage/Cgp/etc/adminhtml.xml +40 -0
  20. app/code/community/Mage/Cgp/etc/config.xml +229 -0
  21. app/code/community/Mage/Cgp/etc/system.xml +664 -0
  22. app/design/adminhtml/default/default/layout/cgp.xml +8 -0
  23. app/design/frontend/base/default/template/cgp/form/ideal.phtml +26 -0
  24. app/design/frontend/base/default/template/cgp/redirect.phtml +3 -0
  25. app/etc/modules/Mage_Cgp.xml +31 -0
  26. app/locale/nl_NL/Mage_Cgp.csv +51 -0
  27. package.xml +35 -0
  28. skin/adminhtml/default/default/cgp.css +28 -0
  29. skin/adminhtml/default/default/images/cardgate_section.png +0 -0
app/code/community/Mage/Adminhtml/Model/Cgp/Config/Source/Languages.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Adminhtml_Model_Cgp_Config_Source_Languages
20
+ {
21
+ public function toOptionArray() {
22
+ return array(
23
+ array(
24
+ "value" => "nl",
25
+ "label" => Mage::helper("cgp")->__('Dutch')
26
+ ),
27
+ array(
28
+ "value" => "en",
29
+ "label" => Mage::helper("cgp")->__('English')
30
+ ),
31
+ array(
32
+ "value" => "de",
33
+ "label" => Mage::helper("cgp")->__('German')
34
+ ),
35
+ array(
36
+ "value" => "fr",
37
+ "label" => Mage::helper("cgp")->__('French')
38
+ ),
39
+ array(
40
+ "value" => "es",
41
+ "label" => Mage::helper("cgp")->__('Spanish')
42
+ ),
43
+ array(
44
+ "value" => "gr",
45
+ "label" => Mage::helper("cgp")->__('Greek')
46
+ ),
47
+ array(
48
+ "value" => "hr",
49
+ "label" => Mage::helper("cgp")->__('Croatian')
50
+ ),
51
+ array(
52
+ "value" => "it",
53
+ "label" => Mage::helper("cgp")->__('Italian')
54
+ ),
55
+ array(
56
+ "value" => "cz",
57
+ "label" => Mage::helper("cgp")->__('Czech')
58
+ ),
59
+ array(
60
+ "value" => "ru",
61
+ "label" => Mage::helper("cgp")->__('Russian')
62
+ ),
63
+ array(
64
+ "value" => "se",
65
+ "label" => Mage::helper("cgp")->__('Swedish')
66
+ ),
67
+ );
68
+ }
69
+ }
app/code/community/Mage/Adminhtml/Model/Cgp/Config/Source/Modes.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Carg Gate Plus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Adminhtml_Model_Cgp_Config_Source_Modes
20
+ {
21
+ public function toOptionArray() {
22
+ return array(
23
+ array(
24
+ "value" => "test",
25
+ "label" => Mage::helper("cgp")->__("Test Mode")
26
+ ),
27
+ array(
28
+ "value" => "live",
29
+ "label" => Mage::helper("cgp")->__("Live Mode")
30
+ ),
31
+ );
32
+ }
33
+ }
app/code/community/Mage/Cgp/Block/Form/Ideal.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Block_Form_Ideal extends Mage_Payment_Block_Form
20
+ {
21
+ protected $_banks = array(
22
+ '0021' => 'Rabobank',
23
+ '0031' => 'ABN Amro',
24
+ '0091' => 'Friesland Bank',
25
+ '0721' => 'ING',
26
+ '0751' => 'SNS Bank',
27
+ '-' => '------ Additional Banks ------',
28
+ '0161' => 'Van Lanschot Bank',
29
+ '0511' => 'Triodos Bank',
30
+ '0761' => 'ASN Bank',
31
+ '0771' => 'SNS Regio Bank',
32
+ );
33
+
34
+ protected function _construct()
35
+ {
36
+ parent::_construct();
37
+ $this->setTemplate('cgp/form/ideal.phtml');
38
+ }
39
+
40
+ /**
41
+ * Return information payment object
42
+ *
43
+ * @return Mage_Payment_Model_Info
44
+ */
45
+ public function getInfoInstance()
46
+ {
47
+ return $this->getMethod()->getInfoInstance();
48
+ }
49
+
50
+ /**
51
+ * Returns HTML options for select field with iDEAL banks
52
+ *
53
+ * @return string
54
+ */
55
+ public function getSelectField()
56
+ {
57
+ $a1 = array('' => Mage::helper('cgp')->__('--Please select--'));
58
+ $a2 = array();
59
+ foreach ($this->_banks as $id => $name) {
60
+ $a2[$id] = Mage::helper('cgp')->__($name);
61
+ }
62
+ $_code = $this->getMethodCode();
63
+
64
+ $form = new Varien_Data_Form();
65
+ $form->addField($_code.'_ideal_issuer', 'select', array(
66
+ 'name' => 'payment[additional_information][ideal_issuer_id]',
67
+ 'class' => 'input-text required-entry',
68
+ 'label' => Mage::helper('cgp')->__('Select your bank'),
69
+ 'values' => array_merge($a1, $a2),
70
+ 'required' => true,
71
+ 'disabled' => false,
72
+ ));
73
+
74
+ return $form->getHtml();
75
+ }
76
+ }
app/code/community/Mage/Cgp/Block/Redirect.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Block_Redirect extends Mage_Core_Block_Template
20
+ {
21
+
22
+ protected function _construct()
23
+ {
24
+ $this->setTemplate('cgp/redirect.phtml');
25
+ }
26
+
27
+ public function getForm()
28
+ {
29
+ $model = Mage::getModel(Mage::registry('cgp_model'));
30
+ Mage::unregister('cgp_model');
31
+
32
+ $form = new Varien_Data_Form();
33
+ $form->setAction($model->getGatewayUrl())
34
+ ->setId('cardgateplus_checkout')
35
+ ->setName('cardgateplus_checkout')
36
+ ->setMethod('POST')
37
+ ->setUseContainer(true);
38
+
39
+ foreach ($model->getCheckoutFormFields() as $field => $value) {
40
+ $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
41
+ }
42
+
43
+ return $form->getHtml();
44
+ }
45
+ }
app/code/community/Mage/Cgp/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Helper_Data extends Mage_Core_Helper_Abstract
20
+ {
21
+
22
+ }
app/code/community/Mage/Cgp/Model/Base.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Base extends Varien_Object
20
+ {
21
+ protected $_callback;
22
+ protected $_config = null;
23
+ protected $_isLocked = false;
24
+ protected $_logFileName = "cardgateplus.log";
25
+
26
+ /**
27
+ * Initialize basic cgp settings
28
+ */
29
+ public function _construct() {
30
+ $this->_config = Mage::getStoreConfig('cgp/settings');
31
+ }
32
+
33
+ /**
34
+ * Retrieve config value
35
+ *
36
+ * @param string $field
37
+ * @return mixed
38
+ */
39
+ public function getConfigData($field)
40
+ {
41
+ if (isset($this->_config[$field])) {
42
+ return $this->_config[$field];
43
+ } else {
44
+ return false;
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Set callback data
50
+ *
51
+ * @param array $data
52
+ * @return Mage_Cgp_Model_Base
53
+ */
54
+ public function setCallbackData($data)
55
+ {
56
+ $this->_callback = $data;
57
+ return $this;
58
+ }
59
+
60
+ /**
61
+ * Get callback data
62
+ *
63
+ * @param string $field
64
+ * @return string
65
+ */
66
+ public function getCallbackData($field = null)
67
+ {
68
+ if ($field === null) {
69
+ return $this->_callback;
70
+ } else {
71
+ return @$this->_callback[$field];
72
+ }
73
+ }
74
+
75
+ /**
76
+ * If the debug mode is enabled
77
+ *
78
+ * @return bool
79
+ */
80
+ public function isDebug()
81
+ {
82
+ return $this->getConfigData('debug');
83
+ }
84
+
85
+ /**
86
+ * If the test mode is enabled
87
+ *
88
+ * @return bool
89
+ */
90
+ public function isTest()
91
+ {
92
+ return $this->getConfigData('test_mode');
93
+ }
94
+
95
+ /**
96
+ * Log data into the logfile
97
+ *
98
+ * @param string $msg
99
+ * @return void
100
+ */
101
+ public function log($msg)
102
+ {
103
+ if ($this->getConfigData('debug')) {
104
+ Mage::log($msg, null, $this->_logFileName);
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Create lock file
110
+ *
111
+ * @return Mage_Cgp_Model_Base
112
+ */
113
+ public function lock()
114
+ {
115
+ $varDir = Mage::getConfig()->getVarDir('locks');
116
+ $lockFilename = $varDir . DS . $this->getCallbackData('ref') . '.lock';
117
+ $fp = @fopen($lockFilename, 'x');
118
+
119
+ if ($fp) {
120
+ $this->_isLocked = true;
121
+ $pid = getmypid();
122
+ $now = date('Y-m-d H:i:s');
123
+ fwrite($fp, "Locked by $pid at $now\n");
124
+ }
125
+
126
+ return $this;
127
+ }
128
+
129
+ /**
130
+ * Unlock file
131
+ *
132
+ * @return Mage_Cgp_Model_Base
133
+ */
134
+ public function unlock()
135
+ {
136
+ $this->_isLocked = false;
137
+ $varDir = Mage::getConfig()->getVarDir('locks');
138
+ $lockFilename = $varDir . DS . $this->getCallbackData('ref') . '.lock';
139
+ unlink($lockFilename);
140
+
141
+ return $this;
142
+ }
143
+
144
+ /**
145
+ * Create and mail invoice
146
+ *
147
+ * @param Mage_Sales_Model_Order $order
148
+ * @return boolean
149
+ */
150
+ protected function createInvoice(Mage_Sales_Model_Order $order)
151
+ {
152
+ if ($order->canInvoice() && !$order->getInvoiceCollection()->getSize()) {
153
+ $invoice = $order->prepareInvoice();
154
+ $invoice->register();
155
+ if ($invoice->canCapture()) {
156
+ $invoice->capture();
157
+ }
158
+ $invoice->save();
159
+
160
+ $transactionSave = Mage::getModel("core/resource_transaction")
161
+ ->addObject($invoice)
162
+ ->addObject($invoice->getOrder())
163
+ ->save();
164
+
165
+ $mail_invoice = $this->getConfigData("mail_invoice");
166
+ if ($mail_invoice) {
167
+ $invoice->setEmailSent(true);
168
+ $invoice->save();
169
+ $invoice->sendEmail();
170
+ }
171
+
172
+ $statusMessage = $mail_invoice ? "Invoice #%s created and send to customer." : "Invoice #%s created.";
173
+ $order->addStatusToHistory(
174
+ $order->getStatus(),
175
+ Mage::helper("cgp")->__($statusMessage, $invoice->getIncrementId(),
176
+ $mail_invoice)
177
+ );
178
+
179
+ return true;
180
+ }
181
+
182
+ return false;
183
+ }
184
+
185
+ /**
186
+ * Returns true if the amounts match
187
+ *
188
+ * @param Mage_Sales_Model_Order $order
189
+ * @return boolean
190
+ */
191
+ protected function validateAmount(Mage_Sales_Model_Order $order)
192
+ {
193
+ $amountInCents = (string)($order->getBaseGrandTotal() * 100);
194
+ $callbackAmount = (string)($this->getCallbackData('amount'));
195
+
196
+ if ($amountInCents != $callbackAmount) {
197
+ $this->log('OrderID: '. $order->getId() .' do not match amounts. Sent '. $amountInCents .', received: '. $callbackAmount);
198
+ $statusMessage = Mage::helper("cgp")->__("Hacker attempt: Order total amount does not match CardGatePlus's gross total amount!");
199
+ $order->addStatusToHistory($order->getStatus(), $statusMessage);
200
+ $order->save();
201
+ return false;
202
+ } else {
203
+ return true;
204
+ }
205
+ }
206
+
207
+ /**
208
+ * Process callback for successful transaction
209
+ *
210
+ * @return void
211
+ */
212
+ public function processCallback()
213
+ {
214
+ $id = $this->getCallbackData('ref');
215
+ $order = Mage::getModel('sales/order');
216
+ $order->loadByIncrementId($id);
217
+
218
+ // Log callback
219
+ $this->log('Callback received');
220
+ $this->log($this->getCallbackData());
221
+
222
+ // Validate amount
223
+ if (!$this->validateAmount($order)) {
224
+ exit();
225
+ }
226
+
227
+ $statusComplete = $this->getConfigData("complete_status");
228
+ $statusFailed = $this->getConfigData("failed_status");
229
+ $statusFraud = $this->getConfigData("fraud_status");
230
+ $autocreateInvoice = $this->getConfigData("autocreate_invoice");
231
+
232
+ $complete = false;
233
+ $cancel = false;
234
+ $newState = null;
235
+ $newStatus = true;
236
+ $statusMessage = '';
237
+
238
+ switch ($this->getCallbackData('status')) {
239
+ case "200":
240
+ $complete = true;
241
+ $newState = Mage_Sales_Model_Order::STATE_PROCESSING;
242
+ $newStatus = $statusComplete;
243
+ $statusMessage = Mage::helper("cgp")->__("Payment complete.");
244
+ break;
245
+ case "300":
246
+ $cancel = true;
247
+ $newState = Mage_Sales_Model_Order::STATE_CANCELED;
248
+ $newStatus = $statusFailed;
249
+ $statusMessage = Mage::helper("cgp")->__("Payment failed or canceled by user.");
250
+ break;
251
+ case "301":
252
+ $cancel = true;
253
+ $newState = Mage_Sales_Model_Order::STATE_CANCELED;
254
+ $newStatus = $statusFraud;
255
+ $statusMessage = Mage::helper("cgp")->__("Transaction failed, payment is fraud.");
256
+ break;
257
+ }
258
+
259
+ // Update only certain states
260
+ $canUpdate = false;
261
+ if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW ||
262
+ $order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT ||
263
+ $order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING ||
264
+ $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED) {
265
+ $canUpdate = true;
266
+ }
267
+
268
+ // Lock
269
+ $this->lock();
270
+
271
+ // Update the status if changed
272
+ if ($canUpdate && (($newState != $order->getState()) || ($newStatus != $order->getStatus())) ){
273
+ // Create an invoice when the payment is completed
274
+ if ($complete && $autocreateInvoice){
275
+ $this->createInvoice($order);
276
+ $this->log("Creating invoice for order ID: $id.");
277
+ }
278
+
279
+ $order->setState($newState, $newStatus, $statusMessage);
280
+ $this->log("Changing state to $newState with message $statusMessage for order ID: $id.");
281
+ }
282
+
283
+ $order->save();
284
+
285
+ // Unlock
286
+ $this->unlock();
287
+ }
288
+ }
app/code/community/Mage/Cgp/Model/Gateway/Abstract.php ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ abstract class Mage_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Method_Abstract
20
+ {
21
+ /**
22
+ * Payment Method features
23
+ *
24
+ * @var mixed
25
+ */
26
+ protected $_module = 'cgp'; // config root (cgp or payment)
27
+ protected $_code; // payment method code (used for loading settings)
28
+ protected $_model; // payment model
29
+
30
+ /**
31
+ * CardGatePlus features
32
+ *
33
+ * @var mixed
34
+ */
35
+ protected $_url = 'https://gateway.cardgateplus.com/';
36
+ protected $_supportedCurrencies = array('EUR', 'USD', 'JPY', 'BGN', 'CZK',
37
+ 'DKK', 'GBP', 'HUF', 'LTL', 'LVL',
38
+ 'PLN', 'RON', 'SEK', 'CHF', 'NOK',
39
+ 'HRK', 'RUB', 'TRY', 'AUD', 'BRL',
40
+ 'CAD', 'CNY', 'HKD', 'IDR', 'ILS',
41
+ 'INR', 'KRW', 'MXN', 'MYR', 'NZD',
42
+ 'PHP', 'SGD', 'THB', 'ZAR');
43
+
44
+ /**
45
+ * Mage_Payment_Model settings
46
+ *
47
+ * @var bool
48
+ */
49
+ protected $_isGateway = true;
50
+ protected $_canAuthorize = true;
51
+ protected $_canCapture = true;
52
+ protected $_canUseInternal = false;
53
+ protected $_canUseCheckout = true;
54
+ protected $_canUseForMultishipping = false;
55
+
56
+ /**
57
+ * Return Gateway Url
58
+ *
59
+ * @return string
60
+ */
61
+ public function getGatewayUrl()
62
+ {
63
+ return $this->_url;
64
+ }
65
+
66
+ /**
67
+ * Get plugin version to send to gateway (debugging purposes)
68
+ *
69
+ * @return string
70
+ */
71
+ public function getPluginVersion()
72
+ {
73
+ return (string) Mage::getConfig()->getNode('modules/Mage_Cgp/version');
74
+ }
75
+
76
+ /**
77
+ * Get checkout session namespace
78
+ *
79
+ * @return Mage_Checkout_Model_Session
80
+ */
81
+ public function getCheckout()
82
+ {
83
+ return Mage::getSingleton('checkout/session');
84
+ }
85
+
86
+ /**
87
+ * Get current quote
88
+ *
89
+ * @return Mage_Sales_Model_Quote
90
+ */
91
+ public function getQuote()
92
+ {
93
+ return $this->getCheckout()->getQuote();
94
+ }
95
+
96
+ /**
97
+ * Get current order
98
+ *
99
+ * @return Mage_Sales_Model_Order
100
+ */
101
+ public function getOrder()
102
+ {
103
+ $order = Mage::getModel('sales/order');
104
+ $order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
105
+ return $order;
106
+ }
107
+
108
+ /**
109
+ * Magento tries to set the order from payment/, instead of cgp/
110
+ *
111
+ * @param Mage_Sales_Model_Order $order
112
+ * @return void
113
+ */
114
+ public function setSortOrder($order)
115
+ {
116
+ $this->sort_order = $this->getConfigData('sort_order');
117
+ }
118
+
119
+ /**
120
+ * Append the current model to the URL
121
+ *
122
+ * @param string $url
123
+ * @return string
124
+ */
125
+ function getModelUrl($url)
126
+ {
127
+ if (!empty($this->_model)) {
128
+ $url .= '/model/' . $this->_model;
129
+ }
130
+ return Mage::getUrl($url, array('_secure' => true));
131
+ }
132
+
133
+ /**
134
+ * Magento will use this for payment redirection
135
+ *
136
+ * @return string
137
+ */
138
+ public function getOrderPlaceRedirectUrl()
139
+ {
140
+ return $this->getModelUrl('cgp/standard/redirect');
141
+ }
142
+
143
+ /**
144
+ * Retrieve config value for store by path
145
+ *
146
+ * @param string $path
147
+ * @param mixed $store
148
+ * @return mixed
149
+ */
150
+ public function getConfigData($field = null, $storeId = null)
151
+ {
152
+ if ($storeId === null) {
153
+ $storeId = $this->getStore();
154
+ }
155
+
156
+ $configSettings = Mage::getStoreConfig($this->_module . '/settings', $storeId);
157
+ $configGateway = Mage::getStoreConfig($this->_module .'/'. $this->_code, $storeId);
158
+ $config = array_merge($configSettings, $configGateway);
159
+
160
+ if ($field === null) {
161
+ return $config;
162
+ } else {
163
+ return @$config[$field];
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Validate if the currency code is supported by CardGatePlus
169
+ *
170
+ * @return Mage_Cgp_Model_Abstract
171
+ */
172
+ public function validate()
173
+ {
174
+ parent::validate();
175
+ $base = Mage::getSingleton('cgp/base');
176
+
177
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
178
+ if (!in_array($currency_code, $this->_supportedCurrencies)) {
179
+ $base->log('Unacceptable currency code ('. $currency_code .').');
180
+ Mage::throwException(
181
+ Mage::helper('cgp')->__('Selected currency code ') . $currency_code .
182
+ Mage::helper('cgp')->__(' is not compatible with CardGatePlus'));
183
+ }
184
+
185
+ return $this;
186
+ }
187
+
188
+
189
+ /**
190
+ * Mail order to customer
191
+ *
192
+ * @param Mage_Sales_Model_Order $order
193
+ * @return void
194
+ */
195
+ protected function mailOrder($order)
196
+ {
197
+ // Change order status
198
+ $newState = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
199
+ $newStatus = $this->getConfigData('initialized_status');
200
+ $statusMessage = Mage::helper('cgp')->__('Transaction started, waiting for payment.');
201
+ $order->setState($newState, $newStatus, $statusMessage);
202
+
203
+ // Send new order e-mail
204
+ if (!$order->getEmailSent()) {
205
+ $order->setEmailSent(true);
206
+ $order->sendNewOrderEmail();
207
+ }
208
+
209
+ $order->save();
210
+ }
211
+
212
+ /**
213
+ * Generates checkout form fields
214
+ *
215
+ * @return array
216
+ */
217
+ public function getCheckoutFormFields()
218
+ {
219
+ $base = Mage::getSingleton('cgp/base');
220
+
221
+ $order = $this->getOrder();
222
+ $customer = $order->getBillingAddress();
223
+
224
+ // Send order to customer
225
+ $this->mailOrder($order);
226
+
227
+ $s_arr = array();
228
+ switch ($this->_model) {
229
+ // Credit cards
230
+ case 'visa':
231
+ case 'mastercard':
232
+ case 'americanexpress':
233
+ case 'maestro':
234
+ $s_arr['option'] = 'creditcard';
235
+ break;
236
+
237
+ // DIRECTebanking
238
+ case 'directebanking':
239
+ $s_arr['option'] = 'directebanking';
240
+ break;
241
+
242
+ // iDEAL
243
+ case 'ideal':
244
+ $s_arr['option'] = 'ideal';
245
+ $s_arr['suboption'] = $order->getPayment()->getAdditionalInformation('ideal_issuer_id');
246
+ break;
247
+
248
+ // Mister Cash
249
+ case 'mistercash':
250
+ $s_arr['option'] = 'mistercash';
251
+ break;
252
+
253
+ // PayPal
254
+ case 'paypal':
255
+ $s_arr['option'] = 'paypal';
256
+ break;
257
+
258
+ // Webmoney
259
+ case 'webmoney':
260
+ $s_arr['option'] = 'webmoney';
261
+ break;
262
+
263
+ // Default
264
+ default:
265
+ $s_arr['option'] = '';
266
+ $s_arr['suboption'] = '';
267
+ break;
268
+ }
269
+
270
+ $currency_code = $order->getBaseCurrencyCode();
271
+
272
+ $s_arr['siteid'] = $this->getConfigData('site_id');
273
+ $s_arr['ref'] = $order->getIncrementId();
274
+ $s_arr['first_name'] = $customer->getFirstname();
275
+ $s_arr['last_name'] = $customer->getLastname();
276
+ $s_arr['email'] = $order->getCustomerEmail();
277
+ $s_arr['address'] = $customer->getStreet(1) .
278
+ ($customer->getStreet(2) ? ', '. $customer->getStreet(2) : '');
279
+ $s_arr['city'] = $customer->getCity();
280
+ $s_arr['country_code'] = $customer->getCountry();
281
+ $s_arr['postal_code'] = $customer->getPostcode();
282
+ $s_arr['phone_number'] = $customer->getTelephone();
283
+ $s_arr['state'] = $customer->getRegionCode();
284
+ $s_arr['language'] = $this->getConfigData('lang');
285
+ $s_arr['return_url'] = Mage::getUrl('cgp/standard/success/', array('_secure' => true));
286
+ $s_arr['return_url_failed'] = Mage::getUrl('cgp/standard/cancel/', array('_secure' => true));
287
+ $s_arr['shop_version'] = 'Magento '. Mage::getVersion();
288
+ $s_arr['plugin_name'] = 'Mage_Cgp';
289
+ $s_arr['plugin_version'] = $this->getPluginVersion();
290
+
291
+ if ($base->isTest()) {
292
+ $s_arr['test'] = '1';
293
+ $hash_prefix = 'TEST';
294
+ } else {
295
+ $hash_prefix = '';
296
+ }
297
+
298
+ $s_arr['amount'] = sprintf('%.0f', $order->getGrandTotal()*100);
299
+ $s_arr['description'] = str_replace('%id%',
300
+ $order->getIncrementId(),
301
+ $this->getConfigData('order_description'));
302
+ $s_arr['hash'] = md5($hash_prefix .
303
+ $this->getConfigData('site_id') .
304
+ $s_arr['amount'] .
305
+ $s_arr['ref'] .
306
+ $this->getConfigData('hash_key'));
307
+
308
+ // Logging
309
+ $base->log('Initiating a new transaction');
310
+ $base->log('Sending customer to CardGatePlus with values:');
311
+ $base->log('URL = ' . $this->getGatewayUrl());
312
+ $base->log($s_arr);
313
+
314
+ return $s_arr;
315
+ }
316
+
317
+ }
app/code/community/Mage/Cgp/Model/Gateway/Americanexpress.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Americanexpress extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_americanexpress';
22
+ protected $_model = 'americanexpress';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Default.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Default extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ // Will redirect user to splash screen
22
+ }
app/code/community/Mage/Cgp/Model/Gateway/Directebanking.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Directebanking extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_directebanking';
22
+ protected $_model = 'directebanking';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Ideal.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Ideal extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_ideal';
22
+ protected $_model = 'ideal';
23
+ protected $_formBlockType = 'cgp/form_ideal';
24
+ }
app/code/community/Mage/Cgp/Model/Gateway/Maestro.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Maestro extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_maestro';
22
+ protected $_model = 'maestro';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Mastercard.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Mastercard extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_mastercard';
22
+ protected $_model = 'mastercard';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Mistercash.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Mistercash extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_mistercash';
22
+ protected $_model = 'mistercash';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Paypal.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Paypal extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_paypal';
22
+ protected $_model = 'paypal';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Visa.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Visa extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_visa';
22
+ protected $_model = 'visa';
23
+ }
app/code/community/Mage/Cgp/Model/Gateway/Webmoney.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_Model_Gateway_Webmoney extends Mage_Cgp_Model_Gateway_Abstract
20
+ {
21
+ protected $_code = 'cgp_webmoney';
22
+ protected $_model = 'webmoney';
23
+ }
app/code/community/Mage/Cgp/controllers/StandardController.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class Mage_Cgp_StandardController extends Mage_Core_Controller_Front_Action
20
+ {
21
+ private $_gatewayModel;
22
+
23
+ /**
24
+ * Verify the callback
25
+ *
26
+ * @param array $data
27
+ * @return boolean
28
+ */
29
+ protected function validate($data)
30
+ {
31
+ $base = Mage::getSingleton('cgp/base');
32
+
33
+ $hashString = ($base->isTest() ? 'TEST' : '') .
34
+ $data['transaction_id'] .
35
+ $data['currency'] .
36
+ $data['amount'] .
37
+ $data['ref'] .
38
+ $data['status'] .
39
+ $base->getConfigData('hash_key');
40
+
41
+ if (md5($hashString) == $data['hash']) {
42
+ return true;
43
+ }
44
+
45
+ return false;
46
+ }
47
+
48
+ /**
49
+ * Check if within the URL in model param
50
+ * if not, return default gateway model
51
+ * @return string
52
+ */
53
+ protected function getGatewayModel()
54
+ {
55
+ if ($this->_gatewayModel) {
56
+ return $this->_gatewayModel;
57
+ }
58
+
59
+ $model = $this->getRequest()->getParam('model');
60
+ $model = preg_replace('/[^[[:alnum:]]]+/', '', $model);
61
+
62
+ if (!empty($model)) {
63
+ return 'gateway_' . $model;
64
+ } else {
65
+ return 'gateway_default';
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Reditect customer to the gateway using his prefered payment method
71
+ */
72
+ public function redirectAction()
73
+ {
74
+ $paymentModel = 'cgp/'. $this->getGatewayModel();
75
+ Mage::register('cgp_model', $paymentModel);
76
+
77
+ $this->loadLayout();
78
+ $block = $this->getLayout()->createBlock(
79
+ 'Mage_Cgp_Block_Redirect'
80
+ );
81
+ $this->getLayout()->getBlock('content')->append($block);
82
+ $this->renderLayout();
83
+ }
84
+
85
+ /**
86
+ * After a failed transaction a customer will be send here
87
+ */
88
+ public function cancelAction()
89
+ {
90
+ $base = Mage::getSingleton('cgp/base');
91
+ $checkout = Mage::getSingleton('checkout/session');
92
+
93
+ $order_id = $checkout->getLastRealOrderId();
94
+ $order = Mage::getSingleton('sales/order')->loadByIncrementId($order_id);
95
+ if ($order_id) {
96
+ $order->setState($base->getConfigData('order_status_failed'));
97
+ $order->cancel();
98
+ $order->save();
99
+ }
100
+
101
+ $quote = Mage::getSingleton("checkout/session")->getQuote();
102
+ if ($quote->getId()) {
103
+ $quote->setIsActive(true);
104
+ $quote->save();
105
+ }
106
+
107
+ $this->_redirect('checkout/cart');
108
+ }
109
+
110
+ /**
111
+ * After a successful transaction a customer will be send here
112
+ */
113
+ public function successAction()
114
+ {
115
+ $quote = Mage::getSingleton("checkout/session")->getQuote();
116
+ if ($quote->getId()) {
117
+ $quote->setIsActive(false);
118
+ $quote->delete();
119
+ }
120
+
121
+ $this->_redirect('checkout/onepage/success', array('_secure'=>true));
122
+ }
123
+
124
+ /**
125
+ * Control URL called by gateway
126
+ */
127
+ public function controlAction()
128
+ {
129
+ $base = Mage::getModel('cgp/base');
130
+ $data = $this->getRequest()->getPost();
131
+
132
+ // Verify callback hash
133
+ if (!$this->getRequest()->isPost() || !$this->validate($data)) {
134
+ $base->log('Callback hash validation failed!');
135
+ exit();
136
+ }
137
+
138
+ // Process callback
139
+ $base->setCallbackData($data)->processCallback();
140
+
141
+ // Display transaction_id and status
142
+ echo $data['transaction_id'].'.'.$data['status'];
143
+ }
144
+ }
app/code/community/Mage/Cgp/etc/adminhtml.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento Carg Gate Plus payment extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Cgp
15
+ * @author Paul Saparov, <saparov.p@gmail.com>
16
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <acl>
22
+ <resources>
23
+ <admin>
24
+ <children>
25
+ <system>
26
+ <children>
27
+ <config>
28
+ <children>
29
+ <cgp>
30
+ <title>CardGate+ Settings</title>
31
+ </cgp>
32
+ </children>
33
+ </config>
34
+ </children>
35
+ </system>
36
+ </children>
37
+ </admin>
38
+ </resources>
39
+ </acl>
40
+ </config>
app/code/community/Mage/Cgp/etc/config.xml ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento CardGatePlus payment extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Cgp
15
+ * @author Paul Saparov, <saparov.p@gmail.com>
16
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Mage_Cgp>
23
+ <version>0.1.0</version>
24
+ </Mage_Cgp>
25
+ </modules>
26
+
27
+ <global>
28
+ <models>
29
+ <cgp>
30
+ <class>Mage_Cgp_Model</class>
31
+ </cgp>
32
+ </models>
33
+ <resources>
34
+ <cgp_setup>
35
+ <setup>
36
+ <module>Mage_Cgp</module>
37
+ </setup>
38
+ <connection>
39
+ <use>core_setup</use>
40
+ </connection>
41
+ </cgp_setup>
42
+ <cgp_write>
43
+ <connection>
44
+ <use>core_write</use>
45
+ </connection>
46
+ </cgp_write>
47
+ <cgp_read>
48
+ <connection>
49
+ <use>core_read</use>
50
+ </connection>
51
+ </cgp_read>
52
+ </resources>
53
+ <blocks>
54
+ <cgp>
55
+ <class>Mage_Cgp_Block</class>
56
+ </cgp>
57
+ </blocks>
58
+ </global>
59
+
60
+ <adminhtml>
61
+ <translate>
62
+ <modules>
63
+ <Mage_Cgp>
64
+ <files>
65
+ <default>Mage_Cgp.csv</default>
66
+ </files>
67
+ </Mage_Cgp>
68
+ </modules>
69
+ </translate>
70
+ <layout>
71
+ <updates>
72
+ <cgp>
73
+ <file>cgp.xml</file>
74
+ </cgp>
75
+ </updates>
76
+ </layout>
77
+ <acl>
78
+ <resources>
79
+ <admin>
80
+ <children>
81
+ <system>
82
+ <children>
83
+ <config>
84
+ <children>
85
+ <cgp>
86
+ <title>CardGate+ Settings</title>
87
+ </cgp>
88
+ </children>
89
+ </config>
90
+ </children>
91
+ </system>
92
+ </children>
93
+ </admin>
94
+ </resources>
95
+ </acl>
96
+ </adminhtml>
97
+
98
+ <frontend>
99
+ <routers>
100
+ <cgp>
101
+ <use>standard</use>
102
+ <args>
103
+ <module>Mage_Cgp</module>
104
+ <frontName>cgp</frontName>
105
+ </args>
106
+ </cgp>
107
+ </routers>
108
+ <translate>
109
+ <modules>
110
+ <Mage_Cgp>
111
+ <files>
112
+ <default>Mage_Cgp.csv</default>
113
+ </files>
114
+ </Mage_Cgp>
115
+ </modules>
116
+ </translate>
117
+ </frontend>
118
+
119
+ <default>
120
+ <payment>
121
+ <cgp_visa>
122
+ <active>1</active>
123
+ <model>cgp/gateway_visa</model>
124
+ <title>CGP Visa</title>
125
+ </cgp_visa>
126
+ <cgp_mastercard>
127
+ <active>1</active>
128
+ <model>cgp/gateway_mastercard</model>
129
+ <title>CGP MasterCard</title>
130
+ </cgp_mastercard>
131
+ <cgp_americanexpress>
132
+ <active>1</active>
133
+ <model>cgp/gateway_americanexpress</model>
134
+ <title>CGP AmericanExpress</title>
135
+ </cgp_americanexpress>
136
+ <cgp_maestro>
137
+ <active>1</active>
138
+ <model>cgp/gateway_maestro</model>
139
+ <title>CGP Maestro</title>
140
+ </cgp_maestro>
141
+ <cgp_directebanking>
142
+ <active>1</active>
143
+ <model>cgp/gateway_directebanking</model>
144
+ <title>CGP DIRECTebanking</title>
145
+ </cgp_directebanking>
146
+ <cgp_ideal>
147
+ <active>1</active>
148
+ <model>cgp/gateway_ideal</model>
149
+ <title>CGP iDEAL</title>
150
+ </cgp_ideal>
151
+ <cgp_mistercash>
152
+ <active>1</active>
153
+ <model>cgp/gateway_mistercash</model>
154
+ <title>CGP MisterCash</title>
155
+ </cgp_mistercash>
156
+ <cgp_paypal>
157
+ <active>1</active>
158
+ <model>cgp/gateway_paypal</model>
159
+ <title>CGP PayPal</title>
160
+ </cgp_paypal>
161
+ <cgp_webmoney>
162
+ <active>1</active>
163
+ <model>cgp/gateway_webmoney</model>
164
+ <title>CGP Webmoney</title>
165
+ </cgp_webmoney>
166
+ </payment>
167
+
168
+ <cgp>
169
+ <settings>
170
+ <active>0</active>
171
+ <lang>nl</lang>
172
+ <initialized_status>pending</initialized_status>
173
+ <complete_status>processing</complete_status>
174
+ <failed_status>canceled</failed_status>
175
+ <fraud_status>canceled</fraud_status>
176
+ <autocreate_invoice>1</autocreate_invoice>
177
+ <mail_invoice>1</mail_invoice>
178
+ <order_description>Order %id%</order_description>
179
+ <test_mode>test</test_mode>
180
+ <debug>0</debug>
181
+ </settings>
182
+ <cgp_visa translate="title" module="cgp">
183
+ <active>0</active>
184
+ <model>cgp/gateway_visa</model>
185
+ <title>Visa</title>
186
+ </cgp_visa>
187
+ <cgp_mastercard translate="title" module="cgp">
188
+ <active>0</active>
189
+ <model>cgp/gateway_mastercard</model>
190
+ <title>MasterCard</title>
191
+ </cgp_mastercard>
192
+ <cgp_americanexpress translate="title" module="cgp">
193
+ <active>0</active>
194
+ <model>cgp/gateway_americanexpress</model>
195
+ <title>AmericanExpress</title>
196
+ </cgp_americanexpress>
197
+ <cgp_maestro translate="title" module="cgp">
198
+ <active>0</active>
199
+ <model>cgp/gateway_maestro</model>
200
+ <title>Maestro</title>
201
+ </cgp_maestro>
202
+ <cgp_directebanking translate="title" module="cgp">
203
+ <active>0</active>
204
+ <model>cgp/gateway_directebanking</model>
205
+ <title>DIRECTebanking</title>
206
+ </cgp_directebanking>
207
+ <cgp_ideal translate="title" module="cgp">
208
+ <active>0</active>
209
+ <model>cgp/gateway_ideal</model>
210
+ <title>iDEAL</title>
211
+ </cgp_ideal>
212
+ <cgp_mistercash translate="title" module="cgp">
213
+ <active>0</active>
214
+ <model>cgp/gateway_mistercash</model>
215
+ <title>MisterCash</title>
216
+ </cgp_mistercash>
217
+ <cgp_paypal translate="title" module="cgp">
218
+ <active>0</active>
219
+ <model>cgp/gateway_paypal</model>
220
+ <title>PayPal</title>
221
+ </cgp_paypal>
222
+ <cgp_webmoney translate="title" module="cgp">
223
+ <active>0</active>
224
+ <model>cgp/gateway_webmoney</model>
225
+ <title>Webmoney</title>
226
+ </cgp_webmoney>
227
+ </cgp>
228
+ </default>
229
+ </config>
app/code/community/Mage/Cgp/etc/system.xml ADDED
@@ -0,0 +1,664 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento CardGatePlus payment extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Cgp
15
+ * @author Paul Saparov, <saparov.p@gmail.com>
16
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <sections>
22
+ <cgp module="cgp">
23
+ <label>CardGatePlus</label>
24
+ <class>cardgate-section</class>
25
+ <header_css>cardgate-header</header_css>
26
+ <tab>sales</tab>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>999</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <groups>
33
+ <settings translate="comment">
34
+ <label>Settings</label>
35
+ <comment><![CDATA[<strong>Note:</strong> Don't forget to set-up in the <a href="https://merchants.cardgateplus.com/" target="_blank">Merchant Backoffice</a> a Control URL to "http://www.example.com/cgp/standard/control/".]]></comment>
36
+ <sort_order>100</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <fields>
41
+ <test_mode translate="label comment">
42
+ <label>Test/Live Mode</label>
43
+ <frontend_type>select</frontend_type>
44
+ <comment><![CDATA[Switching between test and live mode. If you don't have an account <a href='http://www.cardgate.com/' target='_blank'>sign up here.</a>]]></comment>
45
+ <source_model>adminhtml/cgp_config_source_modes</source_model>
46
+ <sort_order>20</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </test_mode>
51
+ <site_id translate="label comment">
52
+ <label>Site ID</label>
53
+ <frontend_type>text</frontend_type>
54
+ <comment><![CDATA[Fill in you site ID number. You can find your site ID number at <a href="https://merchants.cardgateplus.com/" target="_blank">merchant back-office</a>]]></comment>
55
+ <sort_order>30</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ </site_id>
60
+ <hash_key translate="label comment">
61
+ <label>Hash Key</label>
62
+ <frontend_type>text</frontend_type>
63
+ <comment><![CDATA[Fill in you secret hash key for the site. You can create your hash key code at <a href="https://merchants.cardgateplus.com/" target="_blank">merchant back-office</a>]]></comment>
64
+ <sort_order>40</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ </hash_key>
69
+ <autocreate_invoice translate="label comment">
70
+ <label>Create invoice after payment</label>
71
+ <frontend_type>select</frontend_type>
72
+ <comment>Automatically create invoices after payment.</comment>
73
+ <source_model>adminhtml/system_config_source_yesno</source_model>
74
+ <sort_order>50</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ </autocreate_invoice>
79
+ <mail_invoice translate="label">
80
+ <label>Mail invoice to customer</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_yesno</source_model>
83
+ <sort_order>60</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </mail_invoice>
88
+ <lang translate="label source_model">
89
+ <label>Gateway language</label>
90
+ <frontend_type>select</frontend_type>
91
+ <comment>Setting a default language interface of the gateway.</comment>
92
+ <source_model>adminhtml/cgp_config_source_languages</source_model>
93
+ <sort_order>70</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ </lang>
98
+ <order_description translate="label comment">
99
+ <label>Order description</label>
100
+ <frontend_type>text</frontend_type>
101
+ <comment><![CDATA[Payment description that will be shown to the customer in the gateway screen. <br />Variables: <b>%id%</b> = Order ID]]></comment>
102
+ <sort_order>80</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ </order_description>
107
+
108
+ <initialized_status translate="label">
109
+ <label>Waiting for payment status</label>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>adminhtml/system_config_source_order_status</source_model>
112
+ <sort_order>100</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </initialized_status>
117
+ <complete_status translate="label">
118
+ <label>Payment complete status</label>
119
+ <frontend_type>select</frontend_type>
120
+ <source_model>adminhtml/system_config_source_order_status</source_model>
121
+ <sort_order>110</sort_order>
122
+ <show_in_default>1</show_in_default>
123
+ <show_in_website>1</show_in_website>
124
+ <show_in_store>1</show_in_store>
125
+ </complete_status>
126
+ <failed_status translate="label">
127
+ <label>Payment failed status</label>
128
+ <frontend_type>select</frontend_type>
129
+ <source_model>adminhtml/system_config_source_order_status</source_model>
130
+ <sort_order>120</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>1</show_in_store>
134
+ </failed_status>
135
+ <fraud_status translate="label">
136
+ <label>Payment fraud status</label>
137
+ <frontend_type>select</frontend_type>
138
+ <source_model>adminhtml/system_config_source_order_status</source_model>
139
+ <sort_order>130</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>1</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ </fraud_status>
144
+
145
+ <allowspecific translate="label">
146
+ <label>Payment from applicable countries</label>
147
+ <frontend_type>allowspecific</frontend_type>
148
+ <sort_order>200</sort_order>
149
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
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
+ </allowspecific>
154
+ <specificcountry translate="label">
155
+ <label>Payment from Specific countries</label>
156
+ <frontend_type>multiselect</frontend_type>
157
+ <sort_order>210</sort_order>
158
+ <source_model>adminhtml/system_config_source_country</source_model>
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
+ </specificcountry>
163
+ <sort_order translate="label">
164
+ <label>Sort order</label>
165
+ <frontend_type>text</frontend_type>
166
+ <sort_order>220</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </sort_order>
171
+ <debug translate="label comment">
172
+ <label>Debug</label>
173
+ <frontend_type>select</frontend_type>
174
+ <comment>Will log details for debugging purposes in var/log/cardgateplus.log file.</comment>
175
+ <source_model>adminhtml/system_config_source_yesno</source_model>
176
+ <sort_order>230</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>1</show_in_store>
180
+ </debug>
181
+ </fields>
182
+ </settings>
183
+
184
+ <cgp_visa translate="label" module="cgp">
185
+ <label>Visa</label>
186
+ <sort_order>200</sort_order>
187
+ <show_in_default>1</show_in_default>
188
+ <show_in_website>1</show_in_website>
189
+ <show_in_store>1</show_in_store>
190
+ <fields>
191
+ <active translate="label">
192
+ <label>Enabled</label>
193
+ <frontend_type>select</frontend_type>
194
+ <source_model>adminhtml/system_config_source_yesno</source_model>
195
+ <sort_order>1</sort_order>
196
+ <show_in_default>1</show_in_default>
197
+ <show_in_website>1</show_in_website>
198
+ <show_in_store>1</show_in_store>
199
+ </active>
200
+ <title translate="label">
201
+ <label>Title</label>
202
+ <frontend_type>text</frontend_type>
203
+ <sort_order>10</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>1</show_in_store>
207
+ </title>
208
+ <allowspecific translate="label">
209
+ <label>Payment from applicable countries</label>
210
+ <frontend_type>allowspecific</frontend_type>
211
+ <sort_order>20</sort_order>
212
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ </allowspecific>
217
+ <specificcountry translate="label">
218
+ <label>Payment from Specific countries</label>
219
+ <frontend_type>multiselect</frontend_type>
220
+ <sort_order>30</sort_order>
221
+ <source_model>adminhtml/system_config_source_country</source_model>
222
+ <show_in_default>1</show_in_default>
223
+ <show_in_website>1</show_in_website>
224
+ <show_in_store>1</show_in_store>
225
+ </specificcountry>
226
+ <sort_order translate="label">
227
+ <label>Sort order</label>
228
+ <frontend_type>text</frontend_type>
229
+ <sort_order>100</sort_order>
230
+ <show_in_default>1</show_in_default>
231
+ <show_in_website>1</show_in_website>
232
+ <show_in_store>1</show_in_store>
233
+ </sort_order>
234
+ </fields>
235
+ </cgp_visa>
236
+
237
+ <cgp_mastercard translate="label" module="cgp">
238
+ <label>Mastercard</label>
239
+ <sort_order>210</sort_order>
240
+ <show_in_default>1</show_in_default>
241
+ <show_in_website>1</show_in_website>
242
+ <show_in_store>1</show_in_store>
243
+ <fields>
244
+ <active translate="label">
245
+ <label>Enabled</label>
246
+ <frontend_type>select</frontend_type>
247
+ <source_model>adminhtml/system_config_source_yesno</source_model>
248
+ <sort_order>1</sort_order>
249
+ <show_in_default>1</show_in_default>
250
+ <show_in_website>1</show_in_website>
251
+ <show_in_store>1</show_in_store>
252
+ </active>
253
+ <title translate="label">
254
+ <label>Title</label>
255
+ <frontend_type>text</frontend_type>
256
+ <sort_order>10</sort_order>
257
+ <show_in_default>1</show_in_default>
258
+ <show_in_website>1</show_in_website>
259
+ <show_in_store>1</show_in_store>
260
+ </title>
261
+ <allowspecific translate="label">
262
+ <label>Payment from applicable countries</label>
263
+ <frontend_type>allowspecific</frontend_type>
264
+ <sort_order>20</sort_order>
265
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
266
+ <show_in_default>1</show_in_default>
267
+ <show_in_website>1</show_in_website>
268
+ <show_in_store>1</show_in_store>
269
+ </allowspecific>
270
+ <specificcountry translate="label">
271
+ <label>Payment from Specific countries</label>
272
+ <frontend_type>multiselect</frontend_type>
273
+ <sort_order>30</sort_order>
274
+ <source_model>adminhtml/system_config_source_country</source_model>
275
+ <show_in_default>1</show_in_default>
276
+ <show_in_website>1</show_in_website>
277
+ <show_in_store>1</show_in_store>
278
+ </specificcountry>
279
+ <sort_order translate="label">
280
+ <label>Sort order</label>
281
+ <frontend_type>text</frontend_type>
282
+ <sort_order>100</sort_order>
283
+ <show_in_default>1</show_in_default>
284
+ <show_in_website>1</show_in_website>
285
+ <show_in_store>1</show_in_store>
286
+ </sort_order>
287
+ </fields>
288
+ </cgp_mastercard>
289
+
290
+ <cgp_americanexpress translate="label" module="cgp">
291
+ <label>AmericanExpress</label>
292
+ <sort_order>220</sort_order>
293
+ <show_in_default>1</show_in_default>
294
+ <show_in_website>1</show_in_website>
295
+ <show_in_store>1</show_in_store>
296
+ <fields>
297
+ <active translate="label">
298
+ <label>Enabled</label>
299
+ <frontend_type>select</frontend_type>
300
+ <source_model>adminhtml/system_config_source_yesno</source_model>
301
+ <sort_order>1</sort_order>
302
+ <show_in_default>1</show_in_default>
303
+ <show_in_website>1</show_in_website>
304
+ <show_in_store>1</show_in_store>
305
+ </active>
306
+ <title translate="label">
307
+ <label>Title</label>
308
+ <frontend_type>text</frontend_type>
309
+ <sort_order>10</sort_order>
310
+ <show_in_default>1</show_in_default>
311
+ <show_in_website>1</show_in_website>
312
+ <show_in_store>1</show_in_store>
313
+ </title>
314
+ <allowspecific translate="label">
315
+ <label>Payment from applicable countries</label>
316
+ <frontend_type>allowspecific</frontend_type>
317
+ <sort_order>20</sort_order>
318
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
319
+ <show_in_default>1</show_in_default>
320
+ <show_in_website>1</show_in_website>
321
+ <show_in_store>1</show_in_store>
322
+ </allowspecific>
323
+ <specificcountry translate="label">
324
+ <label>Payment from Specific countries</label>
325
+ <frontend_type>multiselect</frontend_type>
326
+ <sort_order>30</sort_order>
327
+ <source_model>adminhtml/system_config_source_country</source_model>
328
+ <show_in_default>1</show_in_default>
329
+ <show_in_website>1</show_in_website>
330
+ <show_in_store>1</show_in_store>
331
+ </specificcountry>
332
+ <sort_order translate="label">
333
+ <label>Sort order</label>
334
+ <frontend_type>text</frontend_type>
335
+ <sort_order>100</sort_order>
336
+ <show_in_default>1</show_in_default>
337
+ <show_in_website>1</show_in_website>
338
+ <show_in_store>1</show_in_store>
339
+ </sort_order>
340
+ </fields>
341
+ </cgp_americanexpress>
342
+
343
+ <cgp_maestro translate="label" module="cgp">
344
+ <label>Maestro</label>
345
+ <sort_order>230</sort_order>
346
+ <show_in_default>1</show_in_default>
347
+ <show_in_website>1</show_in_website>
348
+ <show_in_store>1</show_in_store>
349
+ <fields>
350
+ <active translate="label">
351
+ <label>Enabled</label>
352
+ <frontend_type>select</frontend_type>
353
+ <source_model>adminhtml/system_config_source_yesno</source_model>
354
+ <sort_order>1</sort_order>
355
+ <show_in_default>1</show_in_default>
356
+ <show_in_website>1</show_in_website>
357
+ <show_in_store>1</show_in_store>
358
+ </active>
359
+ <title translate="label">
360
+ <label>Title</label>
361
+ <frontend_type>text</frontend_type>
362
+ <sort_order>10</sort_order>
363
+ <show_in_default>1</show_in_default>
364
+ <show_in_website>1</show_in_website>
365
+ <show_in_store>1</show_in_store>
366
+ </title>
367
+ <allowspecific translate="label">
368
+ <label>Payment from applicable countries</label>
369
+ <frontend_type>allowspecific</frontend_type>
370
+ <sort_order>20</sort_order>
371
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
372
+ <show_in_default>1</show_in_default>
373
+ <show_in_website>1</show_in_website>
374
+ <show_in_store>1</show_in_store>
375
+ </allowspecific>
376
+ <specificcountry translate="label">
377
+ <label>Payment from Specific countries</label>
378
+ <frontend_type>multiselect</frontend_type>
379
+ <sort_order>30</sort_order>
380
+ <source_model>adminhtml/system_config_source_country</source_model>
381
+ <show_in_default>1</show_in_default>
382
+ <show_in_website>1</show_in_website>
383
+ <show_in_store>1</show_in_store>
384
+ </specificcountry>
385
+ <sort_order translate="label">
386
+ <label>Sort order</label>
387
+ <frontend_type>text</frontend_type>
388
+ <sort_order>100</sort_order>
389
+ <show_in_default>1</show_in_default>
390
+ <show_in_website>1</show_in_website>
391
+ <show_in_store>1</show_in_store>
392
+ </sort_order>
393
+ </fields>
394
+ </cgp_maestro>
395
+
396
+ <cgp_directebanking translate="label" module="cgp">
397
+ <label>DIRECTebanking</label>
398
+ <sort_order>235</sort_order>
399
+ <show_in_default>1</show_in_default>
400
+ <show_in_website>1</show_in_website>
401
+ <show_in_store>1</show_in_store>
402
+ <fields>
403
+ <active translate="label">
404
+ <label>Enabled</label>
405
+ <frontend_type>select</frontend_type>
406
+ <source_model>adminhtml/system_config_source_yesno</source_model>
407
+ <sort_order>1</sort_order>
408
+ <show_in_default>1</show_in_default>
409
+ <show_in_website>1</show_in_website>
410
+ <show_in_store>1</show_in_store>
411
+ </active>
412
+ <title translate="label">
413
+ <label>Title</label>
414
+ <frontend_type>text</frontend_type>
415
+ <sort_order>10</sort_order>
416
+ <show_in_default>1</show_in_default>
417
+ <show_in_website>1</show_in_website>
418
+ <show_in_store>1</show_in_store>
419
+ </title>
420
+ <allowspecific translate="label">
421
+ <label>Payment from applicable countries</label>
422
+ <frontend_type>allowspecific</frontend_type>
423
+ <sort_order>20</sort_order>
424
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
425
+ <show_in_default>1</show_in_default>
426
+ <show_in_website>1</show_in_website>
427
+ <show_in_store>1</show_in_store>
428
+ </allowspecific>
429
+ <specificcountry translate="label">
430
+ <label>Payment from Specific countries</label>
431
+ <frontend_type>multiselect</frontend_type>
432
+ <sort_order>30</sort_order>
433
+ <source_model>adminhtml/system_config_source_country</source_model>
434
+ <show_in_default>1</show_in_default>
435
+ <show_in_website>1</show_in_website>
436
+ <show_in_store>1</show_in_store>
437
+ </specificcountry>
438
+ <sort_order translate="label">
439
+ <label>Sort order</label>
440
+ <frontend_type>text</frontend_type>
441
+ <sort_order>100</sort_order>
442
+ <show_in_default>1</show_in_default>
443
+ <show_in_website>1</show_in_website>
444
+ <show_in_store>1</show_in_store>
445
+ </sort_order>
446
+ </fields>
447
+ </cgp_directebanking>
448
+
449
+ <cgp_ideal translate="label" module="cgp">
450
+ <label>iDEAL</label>
451
+ <sort_order>240</sort_order>
452
+ <show_in_default>1</show_in_default>
453
+ <show_in_website>1</show_in_website>
454
+ <show_in_store>1</show_in_store>
455
+ <fields>
456
+ <active translate="label">
457
+ <label>Enabled</label>
458
+ <frontend_type>select</frontend_type>
459
+ <source_model>adminhtml/system_config_source_yesno</source_model>
460
+ <sort_order>1</sort_order>
461
+ <show_in_default>1</show_in_default>
462
+ <show_in_website>1</show_in_website>
463
+ <show_in_store>1</show_in_store>
464
+ </active>
465
+ <title translate="label">
466
+ <label>Title</label>
467
+ <frontend_type>text</frontend_type>
468
+ <sort_order>10</sort_order>
469
+ <show_in_default>1</show_in_default>
470
+ <show_in_website>1</show_in_website>
471
+ <show_in_store>1</show_in_store>
472
+ </title>
473
+ <allowspecific translate="label">
474
+ <label>Payment from applicable countries</label>
475
+ <frontend_type>allowspecific</frontend_type>
476
+ <sort_order>20</sort_order>
477
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
478
+ <show_in_default>1</show_in_default>
479
+ <show_in_website>1</show_in_website>
480
+ <show_in_store>1</show_in_store>
481
+ </allowspecific>
482
+ <specificcountry translate="label">
483
+ <label>Payment from Specific countries</label>
484
+ <frontend_type>multiselect</frontend_type>
485
+ <sort_order>30</sort_order>
486
+ <source_model>adminhtml/system_config_source_country</source_model>
487
+ <show_in_default>1</show_in_default>
488
+ <show_in_website>1</show_in_website>
489
+ <show_in_store>1</show_in_store>
490
+ </specificcountry>
491
+ <sort_order translate="label">
492
+ <label>Sort order</label>
493
+ <frontend_type>text</frontend_type>
494
+ <sort_order>100</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>1</show_in_store>
498
+ </sort_order>
499
+ </fields>
500
+ </cgp_ideal>
501
+
502
+ <cgp_mistercash translate="label" module="cgp">
503
+ <label>MisterCash</label>
504
+ <sort_order>250</sort_order>
505
+ <show_in_default>1</show_in_default>
506
+ <show_in_website>1</show_in_website>
507
+ <show_in_store>1</show_in_store>
508
+ <fields>
509
+ <active translate="label">
510
+ <label>Enabled</label>
511
+ <frontend_type>select</frontend_type>
512
+ <source_model>adminhtml/system_config_source_yesno</source_model>
513
+ <sort_order>1</sort_order>
514
+ <show_in_default>1</show_in_default>
515
+ <show_in_website>1</show_in_website>
516
+ <show_in_store>1</show_in_store>
517
+ </active>
518
+ <title translate="label">
519
+ <label>Title</label>
520
+ <frontend_type>text</frontend_type>
521
+ <sort_order>10</sort_order>
522
+ <show_in_default>1</show_in_default>
523
+ <show_in_website>1</show_in_website>
524
+ <show_in_store>1</show_in_store>
525
+ </title>
526
+ <allowspecific translate="label">
527
+ <label>Payment from applicable countries</label>
528
+ <frontend_type>allowspecific</frontend_type>
529
+ <sort_order>20</sort_order>
530
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
531
+ <show_in_default>1</show_in_default>
532
+ <show_in_website>1</show_in_website>
533
+ <show_in_store>1</show_in_store>
534
+ </allowspecific>
535
+ <specificcountry translate="label">
536
+ <label>Payment from Specific countries</label>
537
+ <frontend_type>multiselect</frontend_type>
538
+ <sort_order>30</sort_order>
539
+ <source_model>adminhtml/system_config_source_country</source_model>
540
+ <show_in_default>1</show_in_default>
541
+ <show_in_website>1</show_in_website>
542
+ <show_in_store>1</show_in_store>
543
+ </specificcountry>
544
+ <sort_order translate="label">
545
+ <label>Sort order</label>
546
+ <frontend_type>text</frontend_type>
547
+ <sort_order>100</sort_order>
548
+ <show_in_default>1</show_in_default>
549
+ <show_in_website>1</show_in_website>
550
+ <show_in_store>1</show_in_store>
551
+ </sort_order>
552
+ </fields>
553
+ </cgp_mistercash>
554
+
555
+ <cgp_paypal translate="label" module="cgp">
556
+ <label>PayPal</label>
557
+ <sort_order>260</sort_order>
558
+ <show_in_default>1</show_in_default>
559
+ <show_in_website>1</show_in_website>
560
+ <show_in_store>1</show_in_store>
561
+ <fields>
562
+ <active translate="label">
563
+ <label>Enabled</label>
564
+ <frontend_type>select</frontend_type>
565
+ <source_model>adminhtml/system_config_source_yesno</source_model>
566
+ <sort_order>1</sort_order>
567
+ <show_in_default>1</show_in_default>
568
+ <show_in_website>1</show_in_website>
569
+ <show_in_store>1</show_in_store>
570
+ </active>
571
+ <title translate="label">
572
+ <label>Title</label>
573
+ <frontend_type>text</frontend_type>
574
+ <sort_order>10</sort_order>
575
+ <show_in_default>1</show_in_default>
576
+ <show_in_website>1</show_in_website>
577
+ <show_in_store>1</show_in_store>
578
+ </title>
579
+ <allowspecific translate="label">
580
+ <label>Payment from applicable countries</label>
581
+ <frontend_type>allowspecific</frontend_type>
582
+ <sort_order>20</sort_order>
583
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
584
+ <show_in_default>1</show_in_default>
585
+ <show_in_website>1</show_in_website>
586
+ <show_in_store>1</show_in_store>
587
+ </allowspecific>
588
+ <specificcountry translate="label">
589
+ <label>Payment from Specific countries</label>
590
+ <frontend_type>multiselect</frontend_type>
591
+ <sort_order>30</sort_order>
592
+ <source_model>adminhtml/system_config_source_country</source_model>
593
+ <show_in_default>1</show_in_default>
594
+ <show_in_website>1</show_in_website>
595
+ <show_in_store>1</show_in_store>
596
+ </specificcountry>
597
+ <sort_order translate="label">
598
+ <label>Sort order</label>
599
+ <frontend_type>text</frontend_type>
600
+ <sort_order>100</sort_order>
601
+ <show_in_default>1</show_in_default>
602
+ <show_in_website>1</show_in_website>
603
+ <show_in_store>1</show_in_store>
604
+ </sort_order>
605
+ </fields>
606
+ </cgp_paypal>
607
+
608
+ <cgp_webmoney translate="label" module="cgp">
609
+ <label>Webmoney</label>
610
+ <sort_order>270</sort_order>
611
+ <show_in_default>1</show_in_default>
612
+ <show_in_website>1</show_in_website>
613
+ <show_in_store>1</show_in_store>
614
+ <fields>
615
+ <active translate="label">
616
+ <label>Enabled</label>
617
+ <frontend_type>select</frontend_type>
618
+ <source_model>adminhtml/system_config_source_yesno</source_model>
619
+ <sort_order>1</sort_order>
620
+ <show_in_default>1</show_in_default>
621
+ <show_in_website>1</show_in_website>
622
+ <show_in_store>1</show_in_store>
623
+ </active>
624
+ <title translate="label">
625
+ <label>Title</label>
626
+ <frontend_type>text</frontend_type>
627
+ <sort_order>10</sort_order>
628
+ <show_in_default>1</show_in_default>
629
+ <show_in_website>1</show_in_website>
630
+ <show_in_store>1</show_in_store>
631
+ </title>
632
+ <allowspecific translate="label">
633
+ <label>Payment from applicable countries</label>
634
+ <frontend_type>allowspecific</frontend_type>
635
+ <sort_order>20</sort_order>
636
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
637
+ <show_in_default>1</show_in_default>
638
+ <show_in_website>1</show_in_website>
639
+ <show_in_store>1</show_in_store>
640
+ </allowspecific>
641
+ <specificcountry translate="label">
642
+ <label>Payment from Specific countries</label>
643
+ <frontend_type>multiselect</frontend_type>
644
+ <sort_order>30</sort_order>
645
+ <source_model>adminhtml/system_config_source_country</source_model>
646
+ <show_in_default>1</show_in_default>
647
+ <show_in_website>1</show_in_website>
648
+ <show_in_store>1</show_in_store>
649
+ </specificcountry>
650
+ <sort_order translate="label">
651
+ <label>Sort order</label>
652
+ <frontend_type>text</frontend_type>
653
+ <sort_order>100</sort_order>
654
+ <show_in_default>1</show_in_default>
655
+ <show_in_website>1</show_in_website>
656
+ <show_in_store>1</show_in_store>
657
+ </sort_order>
658
+ </fields>
659
+ </cgp_webmoney>
660
+
661
+ </groups>
662
+ </cgp>
663
+ </sections>
664
+ </config>
app/design/adminhtml/default/default/layout/cgp.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_system_config_edit>
4
+ <reference name="head">
5
+ <action method="addCss"><name>cgp.css</name></action>
6
+ </reference>
7
+ </adminhtml_system_config_edit>
8
+ </layout>
app/design/frontend/base/default/template/cgp/form/ideal.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento CardGatePlus payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Cgp
14
+ * @author Paul Saparov, <saparov.p@gmail.com>
15
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+ ?>
19
+ <?php $_code=$this->getMethodCode() ?>
20
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
21
+ <li>
22
+ <div class="input-box">
23
+ <?php echo $this->getSelectField(); ?>
24
+ </div>
25
+ </li>
26
+ </ul>
app/design/frontend/base/default/template/cgp/redirect.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php echo Mage::helper('cgp')->__('You will be redirected to CardGatePlus to finish your payment.'); ?>
2
+ <?php echo $this->getForm(); ?>
3
+ <script type="text/javascript">document.getElementById("cardgateplus_checkout").submit();</script>
app/etc/modules/Mage_Cgp.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Magento CardGatePlus payment extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Cgp
15
+ * @author Paul Saparov, <saparov.p@gmail.com>
16
+ * @copyright Copyright (c) 2011 CardGatePlus B.V. (http://www.cardgateplus.com)
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Mage_Cgp>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ <depends>
26
+ <Mage_Payment />
27
+ </depends>
28
+ <version>1.0.0</version>
29
+ </Mage_Cgp>
30
+ </modules>
31
+ </config>
app/locale/nl_NL/Mage_Cgp.csv ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Dutch","Nederlands"
2
+ "English","Engels"
3
+ "German","Duits"
4
+ "French","Frans"
5
+ "Spanish","Spaans"
6
+ "Greek","Grieks"
7
+ "Croatian","Kroatisch"
8
+ "Italian","Italiaans"
9
+ "Czech","Tsjechisch"
10
+ "Russian","Russisch"
11
+ "Swedish","Zweeds"
12
+ "<strong>Note:</strong> Don't forget to set-up in the <a href="https://merchants.cardgateplus.com/" target="_blank">Merchant Backoffice</a> a Control URL to "http://www.example.com/cgp/standard/control/".","<strong>Let op!</strong> Vergeet niet uw 'Control URL' op te geven in de <a href="https://merchants.cardgateplus.com/" target="_blank">Merchant Backoffice</a>."
13
+ "Test Mode","Test modus"
14
+ "Live Mode","Live modus"
15
+ "Test/Live Mode","Test/Live modus"
16
+ "Switching between test and live mode. If you don't have an account <a href='http://www.cardgate.com/' target='_blank'>sign up here</a>.","Schakelen tussen test en live modus. Als u nog geen account heeft, kunt u zich <a href='http://www.cardgate.com/r/magento/' target='_blank'>hier aanmelden</a>."
17
+ "Site ID","Site ID"
18
+ "Fill in you site ID number. You can find your site ID number at <a href=https://merchants.cardgateplus.com/" target="_blank">merchant backoffice</a>.","Vul hier uw site ID in. Dit nummer kunt u vinden in de <a href=https://merchants.cardgateplus.com/" target="_blank">merchant backoffice</a>."
19
+ "Hash Key","Codeer Sleutel"
20
+ "Fill in you secret hash key for the site. You can create your hash key code at <a href=https://merchants.cardgateplus.com/" target="_blank">merchant backoffice</a>.","Vul hier uw codeer sleutel in. Deze kunt u aanmaken in de <a href=https://merchants.cardgateplus.com/" target="_blank">merchant backoffice</a>."
21
+ "Create invoice after payment","Maak een factuur aan na betaling"
22
+ "Automatically create invoices after payment.","Maak automatisch een factuur aan na betaling."
23
+ "Mail invoice to customer","Email factuur aan klant"
24
+ "Gateway language","Taal betaalpagina"
25
+ "Setting a default language interface of the gateway.","Stel een standaard taal in voor de betaal pagina"
26
+ "Order description","Order omschrijving"
27
+ "Payment description that will be shown to the customer in the gateway screen. <br />Variables: <b>%id%</b> = Order ID","Omschrijving welke getoond wordt op de betaalpagina. <br />Variabele: <b>%id%</b> = Order ID"
28
+ "Waiting for payment status","Wacht op betaling status"
29
+ "Payment complete status","Betaling compleet status"
30
+ "Payment failed status","Betaling mislukt status"
31
+ "Payment fraud status","Fraude status"
32
+ "Payment from applicable countries","Betaling toegestaan vanuit"
33
+ "Payment from Specific countries","Betaling vanuit specifieke landen"
34
+ "Sort order","Volgorde"
35
+ "Debug","Debug"
36
+ "Will log details for debugging purposes in var/log/cardgateplus.log file.","Dit zal debug gegevens loggen in het bestand var/log/cardgateplus.log"
37
+ "Enabled","Ingeschakeld"
38
+ "Title","Titel"
39
+ "You will be redirected to Card Gate Plus to finish your payment.","U zult worden doorgelinkt naar Card Gate Plus in uw betaling af te ronden."
40
+ "Selected currency code ","Geselecteerde valuta code "
41
+ " is not compatible with Card Gate Plus"," wordt niet ondersteund door Card Gate Plus"
42
+ "Transaction started, waiting for payment.","Transactie gestart, wacht op betaling"
43
+ "--Please select--","--Maak uw keuze--"
44
+ "------ Additional Banks ------","----- Overige Banken -----"
45
+ "Select your bank","Selecteer uw bank"
46
+ "Invoice #%s created and send to customer.","Factuur #%s is aangemaakt en verzonden naar de klant."
47
+ "Invoice #%s created.","Factuur #%s is aangemaakt."
48
+ "Hacker attempt: Order total amount does not match Card Gate Plus' gross total amount!","Hack poging: Het order bedrag komt niet overeen met het bedrag verzonden naar Card Gate Plus"
49
+ "Payment complete.","Betaling afgerond."
50
+ "Payment failed or canceled by user.","Betaling mislukt of geannuleerd door de klant."
51
+ "Transaction failed, payment is fraud.","Betaling afgewezen door anti-fraude instellingen."
package.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Mage_Cgp</name>
4
+ <version>1.0.0</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 Plus Payment Module</summary>
10
+ <description>Card Gate Plus is a Payment Service Provider from the Netherlands. We offer various payment methods against competitive rates.&#xD;
11
+ &#xD;
12
+ Our Basic package offers no setup- and monthly fees.&#xD;
13
+ &#xD;
14
+ We accept the following payment methods:&#xD;
15
+ &#xD;
16
+ - iDeal (Netherlands, starting at EUR 0,48 per transaction)&#xD;
17
+ - MisterCash (Belgium)&#xD;
18
+ - DIRECTebanking (Germany, Austria, Belgium, Switzerland, UK)&#xD;
19
+ - Maestro&#xD;
20
+ - MasterCard&#xD;
21
+ - Visa&#xD;
22
+ - AmericanExpress&#xD;
23
+ - Webmoney&#xD;
24
+ - PayPal&#xD;
25
+ &#xD;
26
+ For more information about Card Gate Plus or a test account, please visit http://www.cardgate.com/</description>
27
+ <notes>1.0.0:&#xD;
28
+ - implementation of the Card Gate Plus payment method.</notes>
29
+ <authors><author><name>Paul Saparov</name><user>cardgate</user><email>info@cardgate.com</email></author></authors>
30
+ <date>2011-06-08</date>
31
+ <time>12:17:51</time>
32
+ <contents><target name="magecommunity"><dir name="Mage"><dir name="Adminhtml"><dir name="Model"><dir name="Cgp"><dir name="Config"><dir name="Source"><file name="Languages.php" hash="821536af861ebcde43ebda148361fbcb"/><file name="Modes.php" hash="0229fa85237675c6617a760624c6c5b7"/></dir></dir></dir></dir></dir><dir name="Cgp"><dir><dir name="Block"><dir name="Form"><file name="Ideal.php" hash="7299cfd4cfbfe789fbd2a67f45114fe3"/></dir><file name="Redirect.php" hash="cf683a717354dabd3374b8e98d8dccec"/></dir><dir name="Helper"><file name="Data.php" hash="7ba89d8143b52dd6d7b12a21d06ada1a"/></dir><dir name="Model"><file name="Base.php" hash="8f10ba61691ee2af27ba082f2861c6e0"/><dir name="Gateway"><file name="Abstract.php" hash="574f11e5d6b196a566a6cb75caf1a294"/><file name="Americanexpress.php" hash="97ef4d7129f67eda4fab3d370530b957"/><file name="Default.php" hash="825e7a7eedcec0ab5da6a4c91bf4d0eb"/><file name="Directebanking.php" hash="fa28a248c17b06b0b176d0a304ff2476"/><file name="Ideal.php" hash="9988133f985cc31907bf3f12a1a065df"/><file name="Maestro.php" hash="fdd0923d00271802fd3bdc4f68d6b3ba"/><file name="Mastercard.php" hash="26487c47abfea5247dc74eef799e7ec6"/><file name="Mistercash.php" hash="268a27f76303af63d03175d469ffce47"/><file name="Paypal.php" hash="a4a9688502587f0cc5a9f659e12099d8"/><file name="Visa.php" hash="5f3167a8f1fd8277a7720c756eea793a"/><file name="Webmoney.php" hash="67e6715fa62af240cef0367bbf262a3c"/></dir></dir><dir name="controllers"><file name="StandardController.php" hash="03a8928f3b8be013a3e0181a32b94684"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f81650bb81243ac3f8c887b0ccc81993"/><file name="config.xml" hash="1b63f627bc5c2e642e6d6050740a8aa0"/><file name="system.xml" hash="903b60368b3cc0e13779e4b02c3ec67d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cgp.xml" hash="4971f43f104b22a7fabb089d2e80e8f0"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cgp"><dir><dir name="form"><file name="ideal.phtml" hash="6f25c5cc0d29a9f0b30f1d985a571720"/></dir></dir><file name="redirect.phtml" hash="140b175f78fde16c3e681eaa4a601815"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Cgp.xml" hash="9a42b367cb9faf250c28a449da0a909e"/></dir></target><target name="magelocale"><dir name="nl_NL"><file name="Mage_Cgp.csv" hash="83a886bcf0b520727b1b84fd105359c7"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="cardgate_section.png" hash="b97b15baba0b27042733c8ea4b4fb6bc"/></dir><file name="cgp.css" hash="555e61e8aa5fb98ae030015fff2c24a3"/></dir></dir></dir></target></contents>
33
+ <compatible/>
34
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
35
+ </package>
skin/adminhtml/default/default/cgp.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* cardgate */
2
+ h3.cardgate-header { background:url(images/cardgate_section.png) no-repeat 0 0; height:0; overflow:hidden; padding:14px 0 0; width:71px; }
3
+
4
+ ul.tabs a.cardgate-section,
5
+ ul.tabs a.cardgate-section:hover { background:url(images/tabs_span_bg.gif) repeat-x 0 100%; border-bottom:none; padding:0.5em 0.5em 0.28em 1.5em; }
6
+ ul.tabs a.cardgate-section:hover { background-color:#d8e6e6; }
7
+ ul.tabs a.cardgate-section.active, ul.tabs a.cardgate-section.active:hover { background-color:#fff; }
8
+ ul.tabs a.cardgate-section span,
9
+ ul.tabs a.cardgate-section:hover span { background:url(images/cardgate_section.png) no-repeat 0 0; height:0; overflow:hidden; padding:14px 0 0; width:71px; }
10
+
11
+ .cardgate-selection { border-collapse:collapse; width:100%; }
12
+ .cardgate-selection .cardgate-selection-info { text-align:right; }
13
+ .cardgate-selection th { font-size:13px; padding:5px 0; text-align:left; vertical-align:middle; }
14
+ .cardgate-selection td { background:#f2f2f2; border-bottom:5px solid #fff; padding:5px; vertical-align:top; }
15
+ .cardgate-selection .cardgate-selection-simplified { background:#fff; padding-left:35px; }
16
+ .cardgate-selection td a { color:#2997d8; }
17
+ .cardgate-selection td strong { color:#3c616a; }
18
+ .cardgate-selection td label { display:block; padding-left:30px; text-indent:-30px; }
19
+ .cardgate-selection td div label { display:inline; padding:0; text-indent:0; }
20
+ .cardgate-selection td input { height:13px; overflow:hidden; margin-right:15px; position:relative; top:-1px; width:13px; vertical-align:middle; }
21
+
22
+ .cardgate-config .form-list { width:100%; }
23
+ .cardgate-config tr.hover { background:#f7f7f7; }
24
+ .cardgate-config tr.hover label { cursor:help; }
25
+
26
+ .cardgate-credentials { border:1px solid #f2f2f2; }
27
+ .cardgate-credentials caption { padding:5px; text-align:left; }
28
+ .cardgate-credentials .value { color:#ccc; }
skin/adminhtml/default/default/images/cardgate_section.png ADDED
Binary file