Icepay_IceAdvanced - Version 1.0.2

Version Notes

Added new webservice location

Fixed a javascript prototype bug in Magento 1.5

Fixed stock update bug when cancelled

Download this release

Release Info

Developer Olaf Abbenhuis
Extension Icepay_IceAdvanced
Version 1.0.2
Comparing to
See all releases


Version 1.0.2

Files changed (136) hide show
  1. app/code/community/Icepay/IceAdvanced/Block/Adminhtml/CheckSettings.php +36 -0
  2. app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Grid/Paymentmethods.php +82 -0
  3. app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Setting/Paymentmethod.php +58 -0
  4. app/code/community/Icepay/IceAdvanced/Block/Payment/Form/Default.php +57 -0
  5. app/code/community/Icepay/IceAdvanced/Helper/Data.php +158 -0
  6. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod01.php +10 -0
  7. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod02.php +10 -0
  8. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod03.php +10 -0
  9. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod04.php +10 -0
  10. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod05.php +10 -0
  11. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod06.php +10 -0
  12. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod07.php +10 -0
  13. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod08.php +10 -0
  14. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod09.php +10 -0
  15. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod10.php +10 -0
  16. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod11.php +10 -0
  17. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod12.php +10 -0
  18. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod13.php +10 -0
  19. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod14.php +10 -0
  20. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod15.php +10 -0
  21. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod16.php +10 -0
  22. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod17.php +10 -0
  23. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod18.php +10 -0
  24. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod19.php +10 -0
  25. app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod20.php +10 -0
  26. app/code/community/Icepay/IceAdvanced/Model/Checkout/Standard.php +154 -0
  27. app/code/community/Icepay/IceAdvanced/Model/Mysql4/IceAdvanced.php +369 -0
  28. app/code/community/Icepay/IceAdvanced/Model/Observer.php +203 -0
  29. app/code/community/Icepay/IceAdvanced/Model/Pay.php +69 -0
  30. app/code/community/Icepay/IceAdvanced/Model/Webservice.php +218 -0
  31. app/code/community/Icepay/IceAdvanced/controllers/AjaxController.php +63 -0
  32. app/code/community/Icepay/IceAdvanced/controllers/ConfigController.php +33 -0
  33. app/code/community/Icepay/IceAdvanced/controllers/ProcessingController.php +36 -0
  34. app/code/community/Icepay/IceAdvanced/etc/config.xml +147 -0
  35. app/code/community/Icepay/IceAdvanced/etc/system.xml +58 -0
  36. app/code/community/Icepay/IceAdvanced/sql/icepayadvanced_setup/mysql4-install-1.0.0.php +45 -0
  37. app/code/community/Icepay/IceAdvanced/sql/icepayadvanced_setup/mysql4-upgrade-1.0.0-1.0.1.php +11 -0
  38. app/code/community/Icepay/IceCore/Block/Adminhtml/CheckSettings.php +55 -0
  39. app/code/community/Icepay/IceCore/Block/Adminhtml/GenerateURL.php +36 -0
  40. app/code/community/Icepay/IceCore/Block/Adminhtml/Grid/Modules.php +62 -0
  41. app/code/community/Icepay/IceCore/Block/Adminhtml/Init.php +45 -0
  42. app/code/community/Icepay/IceCore/Block/Front/Statement.php +26 -0
  43. app/code/community/Icepay/IceCore/Block/Front/Template.php +21 -0
  44. app/code/community/Icepay/IceCore/Helper/Data.php +232 -0
  45. app/code/community/Icepay/IceCore/Model/Config.php +41 -0
  46. app/code/community/Icepay/IceCore/Model/Icepay/Postback.php +333 -0
  47. app/code/community/Icepay/IceCore/Model/Icepay/Result.php +57 -0
  48. app/code/community/Icepay/IceCore/Model/Icepay/Webservice/Api.php +152 -0
  49. app/code/community/Icepay/IceCore/Model/Mysql4/IceCore.php +177 -0
  50. app/code/community/Icepay/IceCore/controllers/AboutController.php +25 -0
  51. app/code/community/Icepay/IceCore/controllers/CheckController.php +33 -0
  52. app/code/community/Icepay/IceCore/controllers/IndexController.php +25 -0
  53. app/code/community/Icepay/IceCore/controllers/ProcessingController.php +31 -0
  54. app/code/community/Icepay/IceCore/etc/config.xml +182 -0
  55. app/code/community/Icepay/IceCore/etc/system.xml +169 -0
  56. app/code/community/Icepay/IceCore/sql/icepaycore_setup/mysql4-install-1.0.0.php +56 -0
  57. app/code/community/Icepay/IceCore/sql/icepaycore_setup/mysql4-upgrade-1.0.0-1.0.1.php +10 -0
  58. app/design/adminhtml/default/default/layout/icecore.xml +15 -0
  59. app/design/adminhtml/default/default/template/icepayadvanced/grid_paymentmethods.phtml +317 -0
  60. app/design/adminhtml/default/default/template/icepayadvanced/paymentmethod.phtml +83 -0
  61. app/design/adminhtml/default/default/template/icepaycore/grid_modules.phtml +91 -0
  62. app/design/frontend/base/default/layout/icecore.xml +10 -0
  63. app/design/frontend/base/default/template/icepayadvanced/form/default.phtml +52 -0
  64. app/design/frontend/base/default/template/icepaycore/front/check.phtml +1 -0
  65. app/design/frontend/base/default/template/icepaycore/front/statement.phtml +21 -0
  66. app/etc/modules/Icepay_IceAdvanced.xml +10 -0
  67. app/etc/modules/Icepay_IceCore.xml +10 -0
  68. app/locale/en_US/Icepay_IceAdvanced.csv +32 -0
  69. app/locale/en_US/Icepay_IceCore.csv +61 -0
  70. app/locale/nl_NL/Icepay_IceAdvanced.csv +32 -0
  71. app/locale/nl_NL/Icepay_IceCore.csv +62 -0
  72. package.xml +25 -0
  73. skin/adminhtml/default/default/icepay/admin.css +134 -0
  74. skin/adminhtml/default/default/icepay/general.css +9 -0
  75. skin/adminhtml/default/default/icepay/images/button-manual.png +0 -0
  76. skin/adminhtml/default/default/icepay/images/button-movie.png +0 -0
  77. skin/adminhtml/default/default/icepay/images/en/creditcard.png +0 -0
  78. skin/adminhtml/default/default/icepay/images/en/ddebit.png +0 -0
  79. skin/adminhtml/default/default/icepay/images/en/directebank.png +0 -0
  80. skin/adminhtml/default/default/icepay/images/en/elv.png +0 -0
  81. skin/adminhtml/default/default/icepay/images/en/giropay.png +0 -0
  82. skin/adminhtml/default/default/icepay/images/en/ideal.png +0 -0
  83. skin/adminhtml/default/default/icepay/images/en/mistercash.png +0 -0
  84. skin/adminhtml/default/default/icepay/images/en/nologo.png +0 -0
  85. skin/adminhtml/default/default/icepay/images/en/paypal.png +0 -0
  86. skin/adminhtml/default/default/icepay/images/en/paysafecard.png +0 -0
  87. skin/adminhtml/default/default/icepay/images/en/wallie.png +0 -0
  88. skin/adminhtml/default/default/icepay/images/en/wire.png +0 -0
  89. skin/adminhtml/default/default/icepay/images/error_msg_icon.gif +0 -0
  90. skin/adminhtml/default/default/icepay/images/icepay-logo.png +0 -0
  91. skin/adminhtml/default/default/icepay/images/nl/creditcard.png +0 -0
  92. skin/adminhtml/default/default/icepay/images/nl/ddebit.png +0 -0
  93. skin/adminhtml/default/default/icepay/images/nl/directebank.png +0 -0
  94. skin/adminhtml/default/default/icepay/images/nl/elv.png +0 -0
  95. skin/adminhtml/default/default/icepay/images/nl/giropay.png +0 -0
  96. skin/adminhtml/default/default/icepay/images/nl/ideal.png +0 -0
  97. skin/adminhtml/default/default/icepay/images/nl/mistercash.png +0 -0
  98. skin/adminhtml/default/default/icepay/images/nl/nologo.png +0 -0
  99. skin/adminhtml/default/default/icepay/images/nl/paypal.png +0 -0
  100. skin/adminhtml/default/default/icepay/images/nl/paysafecard.png +0 -0
  101. skin/adminhtml/default/default/icepay/images/nl/wallie.png +0 -0
  102. skin/adminhtml/default/default/icepay/images/nl/wire.png +0 -0
  103. skin/adminhtml/default/default/icepay/images/nologo.png +0 -0
  104. skin/adminhtml/default/default/icepay/images/section-logo.png +0 -0
  105. skin/adminhtml/default/default/icepay/images/success_msg_icon.gif +0 -0
  106. skin/frontend/base/default/images/icepay/en/creditcard.png +0 -0
  107. skin/frontend/base/default/images/icepay/en/ddebit.png +0 -0
  108. skin/frontend/base/default/images/icepay/en/directebank.png +0 -0
  109. skin/frontend/base/default/images/icepay/en/elv.png +0 -0
  110. skin/frontend/base/default/images/icepay/en/giropay.png +0 -0
  111. skin/frontend/base/default/images/icepay/en/icepay.png +0 -0
  112. skin/frontend/base/default/images/icepay/en/ideal.png +0 -0
  113. skin/frontend/base/default/images/icepay/en/mistercash.png +0 -0
  114. skin/frontend/base/default/images/icepay/en/nologo.png +0 -0
  115. skin/frontend/base/default/images/icepay/en/paypal.png +0 -0
  116. skin/frontend/base/default/images/icepay/en/paysafecard.png +0 -0
  117. skin/frontend/base/default/images/icepay/en/wallie.png +0 -0
  118. skin/frontend/base/default/images/icepay/en/wire.png +0 -0
  119. skin/frontend/base/default/images/icepay/icepay-logo.png +0 -0
  120. skin/frontend/base/default/images/icepay/logo-currence.png +0 -0
  121. skin/frontend/base/default/images/icepay/logo-thawte.png +0 -0
  122. skin/frontend/base/default/images/icepay/logo-thuiswinkel.png +0 -0
  123. skin/frontend/base/default/images/icepay/nl/creditcard.png +0 -0
  124. skin/frontend/base/default/images/icepay/nl/ddebit.png +0 -0
  125. skin/frontend/base/default/images/icepay/nl/directebank.png +0 -0
  126. skin/frontend/base/default/images/icepay/nl/elv.png +0 -0
  127. skin/frontend/base/default/images/icepay/nl/giropay.png +0 -0
  128. skin/frontend/base/default/images/icepay/nl/icepay.png +0 -0
  129. skin/frontend/base/default/images/icepay/nl/ideal.png +0 -0
  130. skin/frontend/base/default/images/icepay/nl/mistercash.png +0 -0
  131. skin/frontend/base/default/images/icepay/nl/nologo.png +0 -0
  132. skin/frontend/base/default/images/icepay/nl/paypal.png +0 -0
  133. skin/frontend/base/default/images/icepay/nl/paysafecard.png +0 -0
  134. skin/frontend/base/default/images/icepay/nl/wallie.png +0 -0
  135. skin/frontend/base/default/images/icepay/nl/wire.png +0 -0
  136. skin/frontend/base/default/images/icepay/nologo.png +0 -0
app/code/community/Icepay/IceAdvanced/Block/Adminhtml/CheckSettings.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Block displays settings check
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Block_Adminhtml_CheckSettings extends Mage_Adminhtml_Block_System_Config_Form_Field {
18
+
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
20
+ $html = "";
21
+
22
+
23
+ foreach (Mage::helper("iceadvanced")->doChecks() as $key => $value) {
24
+ $html.= 'ICEPAY.addMessage(\'' . $value['result'] . '\',\''.$value['line'].'\');';
25
+ }
26
+
27
+ return '<div class="icepay_debug" id="icepay_debugger"></div>
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ '.$html.'
31
+ //]]>
32
+ </script>
33
+ ';
34
+ }
35
+
36
+ }
app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Grid/Paymentmethods.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Block displays paymentmethods grid
5
+ * @version 1.0.1
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Block_Adminhtml_Grid_PaymentMethods extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface {
18
+
19
+ protected $_element;
20
+ protected $_scope;
21
+
22
+ protected $_ajaxLoadPaymentMethodURL;
23
+ protected $_ajaxSavePaymentMethodURL;
24
+ protected $_ajaxGetPaymentMethodsURL;
25
+
26
+ protected $debug;
27
+
28
+ public function __construct() {
29
+ $this->_scope = Mage::app()->getStore(Mage::helper("icecore")->getStoreFromRequest())->getId();
30
+ $this->_ajaxLoadPaymentMethodURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/config/index/paymentmethod/{{pm_code}}', array('_secure'=>true, 'store'=>$this->_scope, '_store'=>Mage::app()->getDefaultStoreView()));
31
+ $this->_ajaxSavePaymentMethodURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/save_paymentmethod', array('_secure'=>true, 'store'=>$this->_scope, '_store'=>Mage::app()->getDefaultStoreView()));
32
+ $this->_ajaxGetPaymentMethodsURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/get_paymentmethods', array('_secure'=>true, 'store'=>$this->_scope, '_store'=>Mage::app()->getDefaultStoreView()));
33
+
34
+ $this->setTemplate('icepayadvanced/grid_paymentmethods.phtml');
35
+ }
36
+
37
+ public function render(Varien_Data_Form_Element_Abstract $element) {
38
+ $this->setElement($element);
39
+ return $this->toHtml();
40
+ }
41
+
42
+ public function setElement(Varien_Data_Form_Element_Abstract $element) {
43
+ $this->_element = $element;
44
+ return $this;
45
+ }
46
+
47
+ public function getElement() {
48
+ return $this->_element;
49
+ }
50
+
51
+ public function getJS($uri){
52
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS, true).$uri;
53
+ }
54
+
55
+ public function getPaymentmethods() {
56
+ return Mage::getSingleton('iceadvanced/mysql4_iceAdvanced')->getAdminPaymentmethodConfigForStore($this->_scope);
57
+ }
58
+
59
+ public function getAddButtonHtml() {
60
+ return $this->getChildHtml('add_button');
61
+ }
62
+
63
+ protected function _prepareLayout() {
64
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
65
+ ->setData(array(
66
+ 'label' => Mage::helper('icecore')->__('Get paymentmethods'),
67
+ 'onclick' => 'return ICEPAY.retrieveFromICEPAY()',
68
+ 'class' => 'add'
69
+ ));
70
+ $button->setName('add_tier_price_item_button');
71
+
72
+ $this->setChild('add_button', $button);
73
+
74
+ $this->getLayout()
75
+ ->getBlock('head')
76
+ ->addItem('js_css', 'prototype/windows/themes/default.css')
77
+ ->addItem('js_css', 'prototype/windows/themes/magento.css');
78
+
79
+ return parent::_prepareLayout();
80
+ }
81
+
82
+ }
app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Setting/Paymentmethod.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Block displays settings check
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Block_Adminhtml_Setting_Paymentmethod extends Mage_Core_Block_Template {
18
+
19
+ protected $_template = 'icepayadvanced/paymentmethod.phtml';
20
+ private $viewData = null;
21
+ private $method = "";
22
+ protected $scopeID = null;
23
+
24
+ private $sqlModel = null;
25
+
26
+ private function useAdvancedSQL(){
27
+ if ($this->sqlModel == null) $this->sqlModel = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
28
+ return $this->sqlModel;
29
+ }
30
+
31
+
32
+ public function setPaymentmethod($method, $scopeID){
33
+ $this->method = $method;
34
+ $this->scopeID = $scopeID;
35
+ $this->setViewData();
36
+ return $this;
37
+ }
38
+
39
+ private function setViewData(){
40
+ if ($this->viewData != null) return;
41
+
42
+ $this->useAdvancedSQL()->setScope($this->scopeID);
43
+
44
+ $reference = $this->useAdvancedSQL()->getReferenceFromPMCode($this->method);
45
+ $data = $this->useAdvancedSQL()->getConfigDataByReference($reference);
46
+ $this->viewData = new stdClass();
47
+ $this->viewData->module = $reference;
48
+ $this->viewData->config = $data['config'];
49
+ $this->viewData->issuers = $data['issuers'];
50
+
51
+ $this->viewData->countryCollection = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(true);
52
+ }
53
+
54
+ public function getViewData(){
55
+ return $this->viewData;
56
+ }
57
+
58
+ }
app/code/community/Icepay/IceAdvanced/Block/Payment/Form/Default.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Block displays payment method
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Block_Payment_Form_Default extends Mage_Payment_Block_Form {
18
+
19
+ public $_code;
20
+ public $_issuer;
21
+ public $_model;
22
+ public $_countryArr = null;
23
+ public $_country;
24
+
25
+ protected function _construct() {
26
+ $this->setTemplate('icepayadvanced/form/default.phtml');
27
+ $this->model = Mage::getModel('iceadvanced/checkout_standard');
28
+ parent::_construct();
29
+ }
30
+
31
+ protected function _toHtml() {
32
+ $this->model->setCode($this->getMethodCode());
33
+ $this->_issuer = $this->model->getIssuerOptionArray();
34
+ Mage::dispatchEvent('payment_form_block_to_html_before', array(
35
+ 'block' => $this
36
+ ));
37
+ return parent::_toHtml();
38
+ }
39
+
40
+ public function getConfig($config) {
41
+ return $this->model->getConfigData($config);
42
+ }
43
+
44
+ public function getDescription() {
45
+ return $this->getConfig("description");
46
+ }
47
+
48
+ public function getPMCode() {
49
+ return $this->getConfig("pm_code");
50
+ }
51
+
52
+ public function getCountry(){
53
+ return $this->_country;
54
+ }
55
+
56
+ }
57
+
app/code/community/Icepay/IceAdvanced/Helper/Data.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Helper class
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+
20
+ /* Install values */
21
+ public $title = "Advanced";
22
+ public $version = "1.0.0";
23
+ public $id = "ADV";
24
+ public $fingerprint = "7f4de76ecbf7d847caeba64c42938a6a05821c4f";
25
+ public $compatibility_oldest_version = "1.5.0.0";
26
+ public $compatibility_latest_version = "1.6.2.0";
27
+ public $section = "iceadvanced";
28
+ public $serial_required = "0";
29
+
30
+ public $filteredPaymentmethods = array("SMS", "PHONE");
31
+
32
+ /* For admin */
33
+ public function doChecks(){
34
+ $lines = array();
35
+ $checkMerchant = true;
36
+ $checkCode = true;
37
+
38
+ /* Check Merchant ID */
39
+ $check = Mage::helper("icecore")->validateMerchantID($this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID));
40
+ array_push($lines, array(
41
+ 'id' => "merchantid",
42
+ 'line' => $check["msg"],
43
+ 'result' => ($check["val"]?"ok":"err")));
44
+ $checkMerchant = $check["val"]?true:false;
45
+
46
+ /* Check SecretCode */
47
+ $check = Mage::helper("icecore")->validateSecretCode($this->getValueForStore(Icepay_IceCore_Model_Config::SECRETCODE));
48
+ array_push($lines, array(
49
+ 'id' => "secretcode",
50
+ 'line' => $check["msg"],
51
+ 'result' => ($check["val"]?"ok":"err")));
52
+ $checkCode = $check["val"]?true:false;
53
+
54
+ /* The MerchantID and SecretCode checks will not be displayed in this module */
55
+ if (!$checkMerchant || !$checkCode){
56
+ $lines = array();
57
+ array_push($lines, array(
58
+ 'id' => "merchant",
59
+ 'line' => $this->__("Merchant settings are incorrect"),
60
+ 'result' => "err"));
61
+
62
+ } else $lines = array();
63
+
64
+ /* Check SOAP */
65
+ $check = Mage::helper("icecore")->hasSOAP();
66
+ array_push($lines, array(
67
+ 'id' => "soap",
68
+ 'line' => ($check)?$this->__("SOAP webservices available"):$this->__("SOAP was not found on this server"),
69
+ 'result' => ($check)?"ok":"err"));
70
+
71
+ /* Check Paymentmethods */
72
+ $showDefault = true;
73
+
74
+ if (Mage::helper("icecore")->adminGetFrontScope()){
75
+ $check = $this->countStoredPaymentmethods(Mage::helper("icecore")->adminGetStoreScopeID());
76
+ array_push($lines, array(
77
+ 'id' => "database",
78
+ 'line' => $check["msg"],
79
+ 'result' => ($check["val"])?"ok":"err"));
80
+ if ($check["val"]) $showDefault = false;
81
+ };
82
+
83
+ /* Check Default Paymentmethods */
84
+ if ($showDefault){
85
+ $check = $this->countStoredPaymentmethods(0);
86
+ array_push($lines, array(
87
+ 'id' => "default_database",
88
+ 'line' => $check["msg"],
89
+ 'result' => ($check["val"])?"ok":"err"));
90
+ }
91
+
92
+ return $lines;
93
+ }
94
+
95
+ public function getPaymentmethodExtraSettings(){
96
+ return array(
97
+ "description",
98
+ //"active_issuers",
99
+ "allowspecific",
100
+ "specificcountry",
101
+ "min_order_total",
102
+ "max_order_total",
103
+ "sort_order"
104
+ );
105
+ }
106
+
107
+ public function countStoredPaymentmethods($storeID){
108
+
109
+ $adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
110
+ $adv_sql->setScope($storeID);
111
+
112
+
113
+
114
+ $count = $adv_sql->countPaymentMethods();
115
+
116
+ if ($storeID == 0){
117
+ $return = array('val'=>false,'msg'=>$this->__("No paymentmethods stored in Default settings"));
118
+ $langvar = $this->__("%s paymentmethods stored in Default settings");
119
+ } else {
120
+ $return = array('val'=>false,'msg'=>$this->__("No paymentmethods stored for this Store view"));
121
+ $langvar = $this->__("%s paymentmethods stored for this Store view");
122
+ }
123
+
124
+ if ($count > 0) $return = array('val'=>true,'msg'=>sprintf($langvar,$count));
125
+
126
+ return $return;
127
+ }
128
+
129
+ public function addIcons($obj, $isArray=false){
130
+
131
+ if ($isArray){
132
+ foreach ($obj as $key => $value){
133
+ $issuerData = unserialize(urldecode($value["issuers"]));
134
+ $img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value["code"]));
135
+ $obj[$key]["Image"] = ($img)?$img:$value["code"];
136
+ }
137
+ } else {
138
+ foreach($obj as $key => $value){
139
+ $img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value->PaymentMethodCode));
140
+ $obj[$key]->Image = ($img)?$img:$value->PaymentMethodCode;
141
+ };
142
+ }
143
+
144
+ return $obj;
145
+ }
146
+
147
+ public function getIssuerArray($value){
148
+ return unserialize(urldecode($value));
149
+ }
150
+
151
+
152
+ protected function getValueForStore($val) {
153
+ $store = Mage::helper('icecore')->getStoreScopeID();
154
+ return Mage::helper('icecore')->getConfigForStore($store, $val);
155
+ }
156
+
157
+
158
+ }
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod01.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod01
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_01";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod02.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod02
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_02";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod03.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod03
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_03";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod04.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod04
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_04";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod05.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod05
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_05";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod06.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod06
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_06";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod07.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod07
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_07";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod08.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod08
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_08";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod09.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod09
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_09";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod10.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod10
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_10";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod11.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod11
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_11";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod12.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod12
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_12";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod13.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod13
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_13";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod14.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod14
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_14";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod15.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod15
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_15";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod16.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod16
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_16";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod17.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod17
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_17";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod18.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod18
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_18";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod19.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod19
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_19";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Placeholder/Paymentmethod20.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Icepay_IceAdvanced_Model_Checkout_Placeholder_Paymentmethod20
4
+ extends Icepay_IceAdvanced_Model_Checkout_Standard {
5
+
6
+ public $_code = "icepayadv_20";
7
+
8
+ }
9
+
10
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Checkout/Standard.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Main Paymentmethod class
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Method_Abstract {
18
+
19
+ public $_code;
20
+ public $_formBlockType = 'iceadvanced/payment_form_default';
21
+ private $_issuer;
22
+ private $_avail_issuer;
23
+ public $_quote;
24
+
25
+ protected $_coreSQL = null;
26
+ protected $_advancedSQL = null;
27
+
28
+ /**
29
+ * Payment Method features
30
+ * @var bool
31
+ */
32
+ public $_isGateway = true;
33
+ public $_canOrder = true;
34
+ public $_canAuthorize = false;
35
+ public $_canCapture = false;
36
+ public $_canCapturePartial = false;
37
+ public $_canRefund = true;
38
+ public $_canRefundInvoicePartial = false;
39
+ public $_canVoid = false;
40
+ public $_canUseInternal = true;
41
+ public $_canUseCheckout = true;
42
+ public $_canUseForMultishipping = true;
43
+ public $_isInitializeNeeded = true;
44
+ public $_canFetchTransactionInfo = false;
45
+ public $_canReviewPayment = false;
46
+ public $_canCreateBillingAgreement = false;
47
+ public $_canManageRecurringProfiles = false;
48
+
49
+
50
+ public function __construct(){
51
+ $this->advSQL()->setScope(Mage::app()->getStore()->getID());
52
+ if((int)$this->advSQL()->countPaymentMethods() == 0) $this->advSQL()->setScope(0); //Fallback to default store
53
+ }
54
+
55
+ public function initialize($paymentAction, $stateObject) {
56
+ $stateObject->setState(Mage_Sales_Model_Order::STATE_NEW);
57
+ $stateObject->setStatus(Icepay_IceCore_Model_Config::STATUS_MAGENTO_NEW);
58
+ $stateObject->setIsNotified(false);
59
+ }
60
+
61
+ public function getDescription() {
62
+ return $this->getConfigData("info");
63
+ }
64
+
65
+ public function getIssuers() {
66
+ if (!$this->_issuer) $this->_issuer = $this->advSQL()->getIssuersByPMReference($this->_code);
67
+ return $this->_issuer;
68
+ }
69
+
70
+ public function getAvailableIssuers() {
71
+ if (!$this->_avail_issuer) $this->_avail_issuer = $this->advSQL()->getAvailableIssuers($this->getConfigData("active_issuers"),$this->_code);
72
+ return $this->_avail_issuer;
73
+ }
74
+
75
+ public function getIssuerOptionArray(){
76
+ $options = array();
77
+ foreach ($this->getAvailableIssuers() as $issuer){
78
+ $options[] = array('value'=>$issuer['issuer_code'],'label'=>$issuer['issuer_name']);
79
+ }
80
+ return $options;
81
+ }
82
+
83
+ public function isAvailable($quote=null) {
84
+ $this->_quote = $quote;
85
+ if (!$this->getActive()) return false;
86
+ return true;
87
+ }
88
+
89
+ public function getActive() {
90
+ if ($this->getConfigData("active") != 1) return false;
91
+ if ($this->getConfigData("active_issuers") == "") return false;
92
+ return $this->coreSQL()->isActive(Mage::helper("iceadvanced")->section);
93
+ }
94
+
95
+ public function getOrderPlaceRedirectUrl() {
96
+ return Mage::getUrl('iceadvanced/processing/pay');
97
+ }
98
+
99
+ public function setCode($str) {
100
+ $this->_code = $str;
101
+ return;
102
+ }
103
+
104
+ public function canUseForCurrency($currencyCode) {
105
+ return (count($this->filterByCurrency($currencyCode)) > 0);
106
+ }
107
+
108
+ private function filterByCurrency($currencyCode){
109
+ $filtered_issuers = array();
110
+ foreach ($this->getAvailableIssuers() as $issuer){
111
+ $currencies = unserialize($issuer['issuer_currency']);
112
+ if (in_array($currencyCode, $currencies)) $filtered_issuers[] = $issuer;
113
+ }
114
+ return $filtered_issuers;
115
+ }
116
+
117
+
118
+ public function canUseForCountry($country) {
119
+
120
+ if($this->getConfigData('allowspecific')==1){
121
+ $availableCountries = explode(',', $this->getConfigData('specificcountry'));
122
+ if(!in_array($country, $availableCountries)){
123
+ return false;
124
+ }
125
+ }
126
+
127
+ $this->_avail_issuer = $this->filterByCountry($country);
128
+ if (count($this->_avail_issuer) == 0) return false;
129
+
130
+ return true;
131
+ }
132
+
133
+ private function filterByCountry($country){
134
+ $filtered_issuers = array();
135
+ foreach ($this->getAvailableIssuers() as $issuer){
136
+ $countries = unserialize($issuer['issuer_country']);
137
+ if (in_array($country, $countries) || in_array("00", $countries)) $filtered_issuers[] = $issuer;
138
+ }
139
+ return $filtered_issuers;
140
+ }
141
+
142
+ protected function advSQL() {
143
+ if ($this->_advancedSQL == null) $this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
144
+ return $this->_advancedSQL;
145
+ }
146
+
147
+ protected function coreSQL() {
148
+ if ($this->_coreSQL == null) $this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
149
+ return $this->_coreSQL;
150
+ }
151
+
152
+ }
153
+
154
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Mysql4/IceAdvanced.php ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Database model
5
+ * @version 1.0.1
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4_Abstract {
18
+
19
+
20
+
21
+ private $issuer_table = 'icepay_issuerdata';
22
+ private $pm_table = 'icepay_pmdata';
23
+ private $db = null;
24
+ private $_reference = "icepayadv_%s";
25
+ private $_standardModel = "iceadvanced/checkout_placeholder_paymentmethod%s";
26
+
27
+ private $scope = null;
28
+
29
+ public function _construct() {
30
+ // Note that the basicgateway_id refers to the key field in your database table.
31
+ $this->_init('icecore/icecore', 'icecore_id');
32
+ }
33
+
34
+ private function doSQL() {
35
+ if ($this->db == null) $this->db = $this->_getReadAdapter();
36
+ return $this->db;
37
+ }
38
+
39
+ public function getPaymentmethods() {
40
+ $config = array();
41
+ $mod_code = $this->getConfigData("code");
42
+ $mod_title = $this->getConfigData("title");
43
+ $mod_active = $this->getConfigData("active");
44
+ $mod_issuers = $this->getConfigData("issuer");
45
+ $mod_info = $this->getConfigData("info");
46
+
47
+ for ($i = 0; $i < count($mod_title); $i++) {
48
+ array_push($config, array(
49
+ 'code' => $mod_code[$i]["value"],
50
+ 'name' => $mod_title[$i]["value"],
51
+ 'info' => $mod_info[$i]["value"],
52
+ 'issuers' => $mod_issuers[$i]["value"],
53
+ 'active' => $mod_active[$i]["value"]
54
+ ));
55
+ };
56
+
57
+ return $config;
58
+ }
59
+
60
+ public function getPaymentmethodsForConfig() {
61
+ $config = array();
62
+
63
+ $mod_title = array();
64
+
65
+ for ($i = 0; $i < count($mod_title); $i++) {
66
+ array_push($config, array(
67
+ 'code' => $mod_code[$i]["value"],
68
+ 'name' => $mod_title[$i]["value"],
69
+ 'info' => $mod_info[$i]["value"],
70
+ 'issuers' => $mod_issuers[$i]["value"],
71
+ 'active' => $mod_active[$i]["value"]
72
+ ));
73
+ };
74
+
75
+ return $config;
76
+ }
77
+
78
+ public function getAdminPaymentmethodConfigForStore($storeScope){
79
+
80
+ $this->setScope($storeScope);
81
+
82
+ $total = $this->getAllConfigData();
83
+ $returnArr = array();
84
+
85
+ foreach ($total as $pm) {
86
+ array_push($returnArr, array(
87
+ 'code' => $pm["config"]["pm_code"],
88
+ 'name' => $pm["config"]["title"],
89
+ 'issuers' => count($pm["issuers"]),
90
+ 'active' => $pm["config"]["active"],
91
+ 'info' => "",
92
+ 'image' => Mage::helper("icecore")->toIcon($pm["config"]["pm_code"])
93
+ ));
94
+ }
95
+ return $returnArr;
96
+
97
+ }
98
+
99
+ public function setScope($storeScope){
100
+ /* allow overrides in same instance */
101
+ //if ($this->scope != null) return;
102
+ $this->scope = new stdClass();
103
+ $this->scope->scope = ((int)$storeScope == 0)?"default":"stores";
104
+ $this->scope->ID = $storeScope;
105
+ }
106
+
107
+ private function getScope(){
108
+ return $this->scope;
109
+ }
110
+
111
+ private function getPMIDbyCode($code){
112
+ $pm = $this->getPMbyCode($code);
113
+ return $pm['pm_id'];
114
+ }
115
+
116
+ private function getPMbyCode($code){
117
+ $select = $this->doSQL()
118
+ ->select()
119
+ ->from($this->getTable("iceadvanced/{$this->pm_table}"), array('pm_id'))
120
+ ->where('pm_code=?', $code);
121
+ return $this->doSQL()->fetchRow($select);
122
+ }
123
+
124
+ private function getModelFromID($id){
125
+ $sref = $this->createSrefFromID($id);
126
+ return $this->getModelFromSref($sref);
127
+ }
128
+
129
+ private function getModelFromSref($sref){
130
+ return sprintf($this->_standardModel,$sref);
131
+ }
132
+
133
+ private function getReferenceFromID($id){
134
+ $ref = $this->createSrefFromID($id);
135
+ return $this->getReferenceFromSref($ref);
136
+ }
137
+
138
+ private function getReferenceFromSref($sref){
139
+ return sprintf($this->_reference,$sref);
140
+ }
141
+
142
+ public function getReferenceFromPMCode($code){
143
+ return $this->getReferenceFromID($this->getPMIDbyCode($code));
144
+ }
145
+
146
+ private function createSrefFromID($id){
147
+ $id = intval($id);
148
+ if ($id < 10) return "0{$id}";
149
+ return "{$id}";
150
+ }
151
+
152
+ public function clearConfig(){
153
+ // Clear the issuer table
154
+ $condition = array('store_scope_id = ?' => $this->getScope()->ID);
155
+ $this->doSQL()->delete($this->getTable("iceadvanced/{$this->issuer_table}"), $condition);
156
+
157
+
158
+ // Disable the config data
159
+ $where = array('path LIKE ?' => "payment/icepayadv___/active",
160
+ 'scope = ?' => $this->getScope()->scope,
161
+ 'scope_id = ?' => $this->getScope()->ID
162
+ );
163
+ $data["value"] = 0;
164
+ $this->doSQL()->update(
165
+ $this->getTable('core/config_data'),
166
+ $data,
167
+ $where
168
+ );
169
+ }
170
+
171
+ public function savePaymentMethod($code, $merchant, $storeScope, $issuerlist){
172
+
173
+ $id = $this->getPMIDbyCode($code);
174
+
175
+ /* create main paymentmethod if not exists */
176
+ if (!$id){
177
+ $this->doSQL()->insertOnDuplicate(
178
+ $this->getTable("iceadvanced/{$this->pm_table}"),
179
+ array(
180
+ 'pm_code' => $code
181
+ ),
182
+ array('pm_code')
183
+ );
184
+ $id = $this->getPMIDbyCode($code);
185
+ }
186
+
187
+ $this->setScope($storeScope);
188
+
189
+ /* Save payment configuration for store view */
190
+
191
+ $this->saveConfigValue($this->getReferenceFromID($id),"model", $this->getModelFromID($id));
192
+ $this->saveConfigValue($this->getReferenceFromID($id),"group", "icepay");
193
+ $this->saveConfigValue($this->getReferenceFromID($id),"pm_code", $code);
194
+ $this->saveConfigValue($this->getReferenceFromID($id),"pm_id", $id);
195
+ $this->saveConfigValue($this->getReferenceFromID($id),"pm_ref", $this->getReferenceFromID($id));
196
+
197
+ $this->saveConfigValue($this->getReferenceFromID($id),"description", "");
198
+ $this->saveConfigValue($this->getReferenceFromID($id),"allowspecific", 0);
199
+ $this->saveConfigValue($this->getReferenceFromID($id),"specificcountry", "");
200
+ $this->saveConfigValue($this->getReferenceFromID($id),"sort_order", $id);
201
+ $this->saveConfigValue($this->getReferenceFromID($id),"min_order_total", "");
202
+ $this->saveConfigValue($this->getReferenceFromID($id),"max_order_total", "");
203
+
204
+ $this->saveConfigValue($this->getReferenceFromID($id),"active_issuers", $issuerlist);
205
+ }
206
+
207
+
208
+ public function saveIssuer($storeScope, $code, $merchant, $issuercode, $issuername, $countries, $currencies, $languages, $minimum, $maximum){
209
+
210
+
211
+ $id = $this->getPMIDbyCode($code);
212
+
213
+ $this->setScope($storeScope);
214
+
215
+ $result = $this->doSQL()->insertOnDuplicate(
216
+ $this->getTable("iceadvanced/{$this->issuer_table}"),
217
+ array(
218
+ 'pm_code' => $code,
219
+ 'store_scope_id' => $this->getScope()->ID,
220
+ 'merchant_id' => $merchant,
221
+ 'magento_code' => $this->getReferenceFromID($id),
222
+ 'issuer_code' => $issuercode,
223
+ 'issuer_name' => $issuername,
224
+ 'issuer_country' => $this->arrEncode($countries),
225
+ 'issuer_currency' => $this->arrEncode($currencies),
226
+ 'issuer_language' => $this->arrEncode($languages),
227
+ 'issuer_minimum' => $this->arrEncode($minimum),
228
+ 'issuer_maximum' => $this->arrEncode($maximum)
229
+ ),
230
+ array('issuer_code')
231
+ );
232
+
233
+ }
234
+
235
+
236
+ public function saveConfigFromAdmin($code,$option,$value){
237
+ $this->saveConfigValue($this->getReferenceFromPMCode($code),$option,$value);
238
+ }
239
+
240
+
241
+ public function saveConfigValue($reference, $option, $value) {
242
+ $this->doSQL()->insertOnDuplicate(
243
+ $this->getTable('core/config_data'),
244
+ array(
245
+ 'path' => "payment/{$reference}/{$option}",
246
+ 'value' => $value,
247
+ 'scope' => $this->getScope()->scope,
248
+ 'scope_id' => $this->getScope()->ID
249
+ ),
250
+ array('value')
251
+ );
252
+ }
253
+
254
+ private function getPaymentMethodIDs(){
255
+ $select = $this->doSQL()
256
+ ->select()
257
+ ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
258
+ ->where(new Zend_Db_Expr("path LIKE 'payment/icepayadv_%%/pm_ref'"))
259
+ ->where('scope=?', $this->getScope()->scope)
260
+ ->where('scope_id=?', $this->getScope()->ID)
261
+ ->order('path');
262
+ return $this->doSQL()->fetchAll($select);
263
+ }
264
+
265
+ public function getAvailableIssuers($activeIssuers, $reference){
266
+ $issuers = explode(",", $activeIssuers);
267
+ $arr = array();
268
+ foreach($issuers as $issuer){
269
+ $arr[] = $this->getIssuerData($issuer,$reference);
270
+ }
271
+ return $arr;
272
+ }
273
+
274
+ public function getIssuerData($issuerCode, $reference){
275
+ $select = $this->doSQL()
276
+ ->select()
277
+ ->from($this->getTable("iceadvanced/{$this->issuer_table}"))
278
+ ->where('magento_code=?',$reference)
279
+ ->where('store_scope_id=?',$this->getScope()->ID)
280
+ ->where('issuer_code=?',$issuerCode);
281
+ return $this->doSQL()->fetchRow($select);
282
+ }
283
+
284
+
285
+ public function getIssuersByPMReference($reference){
286
+ $select = $this->doSQL()
287
+ ->select()
288
+ ->from($this->getTable("iceadvanced/{$this->issuer_table}"))
289
+ ->where('magento_code=?',$reference)
290
+ ->where('store_scope_id=?',$this->getScope()->ID)
291
+ ->order('config_id');
292
+ return $this->doSQL()->fetchAll($select);
293
+ }
294
+
295
+
296
+ private function getPaymentMethodDataByReference($ref){
297
+ $select = $this->doSQL()
298
+ ->select()
299
+ ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
300
+ ->where(new Zend_Db_Expr("path LIKE 'payment/".$ref."/%'"))
301
+ ->where('scope=?', $this->getScope()->scope)
302
+ ->where('scope_id=?', $this->getScope()->ID)
303
+ ->order('path');
304
+
305
+ return $this->doSQL()->fetchAll($select);
306
+ }
307
+
308
+ public function getPaymentMethodDataArrayByReference($ref){
309
+ $data = $this->getPaymentMethodDataByReference($ref);
310
+ $returnArr = array();
311
+ foreach ($data as $value) {
312
+ $returnArr[$this->getFieldName($value["path"])] = $value["value"];
313
+ }
314
+ return $returnArr;
315
+ }
316
+
317
+ private function getFieldName($configValue){
318
+ $arr = explode("/", $configValue);
319
+ return $arr[2];
320
+ }
321
+
322
+ public function getAllConfigData(){
323
+
324
+ $pms = $this->getPaymentMethodIDs();
325
+ $returnArr = array();
326
+
327
+ foreach ($pms as $value) {
328
+ array_push($returnArr, $this->getConfigDataByReference($value["value"]));
329
+ }
330
+
331
+ return $returnArr;
332
+ }
333
+
334
+
335
+ public function getConfigDataByReference($reference){
336
+
337
+ return array(
338
+ "reference" => $reference,
339
+ "config" => $this->getPaymentMethodDataArrayByReference($reference),
340
+ "issuers" => $this->getIssuersByPMReference($reference)
341
+ );
342
+ }
343
+
344
+ public function arrEncode($arr){
345
+ return serialize($arr);
346
+ return urlencode(serialize($arr));
347
+ }
348
+
349
+ public function arrDecode($str){
350
+ return unserialize(urldecode($str));
351
+ }
352
+
353
+ /* Used for admin count and also to fallback to default if no paymentmethods are found for the current store view */
354
+ public function countPaymentMethods(){
355
+ $select = $this->doSQL()
356
+ ->select()
357
+ ->from($this->getTable('core/config_data'), array('count(value)'))
358
+ ->where(new Zend_Db_Expr("path LIKE 'payment/icepayadv___/title'"))
359
+ ->where('scope=?', $this->getScope()->scope)
360
+ ->where('scope_id=?', $this->getScope()->ID)
361
+ ->order('path');
362
+ $data = $this->doSQL()->fetchRow($select);
363
+ return $data["count(value)"];
364
+ }
365
+
366
+
367
+ }
368
+
369
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Observer.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Observer to save admin paymentmethods and save checkout payment
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Container {
18
+
19
+ public $_currencyArr = array();
20
+ public $_countryArr = array();
21
+ public $_minimumAmountArr = array();
22
+ public $_maximumAmountArr = array();
23
+
24
+ private $_setting = array();
25
+ private $_issuers = array();
26
+ private $_value;
27
+
28
+ private $_advancedSQL = null;
29
+ private $_coreSQL = null;
30
+
31
+ /* Save the payment */
32
+ public function sales_order_payment_place_end(Varien_Event_Observer $observer) {
33
+ Mage::helper("icecore")->log(__METHOD__);
34
+
35
+ $payment = $observer->getPayment();
36
+ $pmName = $payment->getMethodInstance()->getCode();
37
+
38
+ if (substr($pmName, 0, 10) != "icepayadv_")
39
+ return;
40
+
41
+ if ($this->coreSQL()->isActive("iceadvanced")) $this->coreSQL()->savePayment($observer);
42
+
43
+ return;
44
+ }
45
+
46
+
47
+
48
+ /* From admin */
49
+ public function model_save_before(Varien_Event_Observer $observer) {
50
+ /* Make sure we clear all the previously stored paymentmethods if the new total is less than stored in the database */
51
+ $data = $observer->getEvent()->getObject();
52
+ if ($data->getData("path") != "icecore/iceadvanced/webservice_data") return;
53
+ if ($data->getData("value") != "1") return;
54
+ if ($data->getData("scope") == "default" || $data->getData("scope") == "stores"){
55
+ $storeScope = $data->getData("scope_id");
56
+ } else return;
57
+ $this->advSQL()->setScope($storeScope);
58
+ $this->advSQL()->clearConfig();
59
+ }
60
+
61
+ private function set($setting){
62
+ $var = explode("_", $setting);
63
+ $this->_setting = $var;
64
+ }
65
+
66
+ private function getValue(){
67
+ return $this->_value;
68
+ }
69
+
70
+ private function getIssuers(){
71
+ return Mage::helper("icecore")->makeArray($this->_issuers['issuers']);
72
+ }
73
+
74
+ private function getIssuerPMCode(){
75
+ if (isset($this->_issuers['code'])) return strtolower($this->_issuers['code']);
76
+ }
77
+
78
+ private function getIssuerMerchantID(){
79
+ if (isset($this->_issuers['merchant'])) return strtolower($this->_issuers['merchant']);
80
+ }
81
+
82
+ private function getPMCode(){
83
+ return strtolower($this->_setting[1]);
84
+ }
85
+
86
+
87
+ private function handle($object){
88
+ $this->_value = $object->getData("value");
89
+
90
+ if ($this->isIssuer()) $this->_issuers = $this->advSQL()->arrDecode($this->getValue());
91
+ }
92
+
93
+ private function isActivate(){
94
+ return ($this->_setting[2] == "active")?true:false;
95
+ }
96
+
97
+ private function isTitle(){
98
+ return ($this->_setting[2] == "title")?true:false;
99
+ }
100
+
101
+ private function isIssuer(){
102
+ return ($this->_setting[2] == "issuer")?true:false;
103
+ }
104
+
105
+ protected function advSQL() {
106
+ if ($this->_advancedSQL == null) $this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
107
+ return $this->_advancedSQL;
108
+ }
109
+
110
+ protected function coreSQL() {
111
+ if ($this->_coreSQL == null) $this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
112
+ return $this->_coreSQL;
113
+ }
114
+
115
+
116
+ public function model_save_after(Varien_Event_Observer $observer) {
117
+ $data = $observer->getEvent()->getObject();
118
+
119
+ /* Save all the dynamic paymentmethods */
120
+ $object = $observer->getEvent()->getObject();
121
+ $setting = strstr($object->getData("path"), "icecore/paymentmethod/pm_");
122
+ if (!$setting) return;
123
+
124
+ // Load models
125
+ $this->set($setting);
126
+ $this->handle($object);
127
+
128
+ $storeScope = null;
129
+ // Only allow payment and issuer data at default and store level
130
+ if ($data->getData("scope") == "default" || $data->getData("scope") == "stores"){
131
+ $storeScope = $data->getData("scope_id");
132
+ } else return;
133
+ $this->advSQL()->setScope($storeScope);
134
+
135
+ // Issuer data is being saved from Admin
136
+ if ($this->isIssuer()){
137
+
138
+ $issuerListArr = array();
139
+ foreach ($this->getIssuers() as $issuer) {
140
+ array_push($issuerListArr, $issuer->IssuerKeyword);
141
+ }
142
+ $issuerList = implode(",", $issuerListArr);
143
+
144
+ /* Save paymentmethod through issuer data */
145
+ $this->advSQL()->savePaymentMethod(
146
+ $this->getIssuerPMCode(),
147
+ $this->getIssuerMerchantID(),
148
+ $storeScope,
149
+ $issuerList
150
+ );
151
+
152
+
153
+ foreach ($this->getIssuers() as $issuer) {
154
+
155
+ $arrCountry = array();
156
+ $arrCurrency = array();
157
+ $arrMinimum = array();
158
+ $arrMaximum = array();
159
+
160
+ foreach (Mage::helper("icecore")->makeArray($issuer->Countries->Country) as $country) {
161
+ array_push($arrCountry, trim($country->CountryCode));
162
+ array_push($arrMinimum, $country->MinimumAmount);
163
+ array_push($arrMaximum, $country->MaximumAmount);
164
+
165
+ $arrCurrency = $this->addCurrencies($arrCurrency, explode(',', $country->Currency));
166
+ }
167
+
168
+ $this->advSQL()->saveIssuer(
169
+ $storeScope,
170
+ $this->getIssuerPMCode(),
171
+ $this->getIssuerMerchantID(),
172
+ $issuer->IssuerKeyword,
173
+ $issuer->Description,
174
+ $arrCountry,
175
+ $arrCurrency,
176
+ $this->_countryArr,
177
+ $arrMinimum,
178
+ $arrMaximum
179
+ );
180
+
181
+ };
182
+ }
183
+
184
+ if ($this->isTitle()){
185
+ $this->advSQL()->saveConfigFromAdmin($this->getPMCode(),"title",$this->getValue());
186
+ }
187
+
188
+ if ($this->isActivate()){
189
+ $this->advSQL()->saveConfigFromAdmin($this->getPMCode(),"active",$this->getValue());
190
+ }
191
+ return;
192
+ }
193
+
194
+ private function addCurrencies($arr, $currencyArr) {
195
+ foreach ($currencyArr as $currency) {
196
+ array_push($arr, trim($currency));
197
+ }
198
+ return $arr;
199
+ }
200
+
201
+ }
202
+
203
+ ?>
app/code/community/Icepay/IceAdvanced/Model/Pay.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Start payment
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_Model_Pay extends Mage_Payment_Model_Method_Abstract {
18
+
19
+
20
+ protected $sqlModel;
21
+
22
+ public function __construct() {
23
+ $this->sqlModel = Mage::getModel('icecore/mysql4_iceCore');
24
+ }
25
+
26
+ public function getCheckoutResult(){
27
+
28
+ $session = $this->getCheckout();
29
+ $icedata = $this->sqlModel->loadPaymentByID( $session->getLastRealOrderId() );
30
+
31
+ $paymentData = unserialize(urldecode($icedata["transaction_data"]));
32
+ $webservice = Mage::getModel('icecore/icepay_webservice_api');
33
+
34
+ $webservice->webservice(
35
+ $this->getValueForStore($icedata["store_id"], Icepay_IceCore_Model_Config::MERCHANTID),
36
+ $this->getValueForStore($icedata["store_id"], Icepay_IceCore_Model_Config::SECRETCODE)
37
+ );
38
+
39
+ $checkoutResult = null;
40
+
41
+ try {
42
+ $checkoutResult = $webservice->doCheckout(
43
+ $paymentData['ic_amount'],
44
+ $paymentData['ic_country'],
45
+ $paymentData['ic_currency'],
46
+ $paymentData['ic_language'],
47
+ $paymentData['ic_description'],
48
+ $paymentData['ic_paymentmethod'],
49
+ $paymentData['ic_issuer'],
50
+ $paymentData['ic_orderid'],
51
+ $paymentData['ic_reference']
52
+ );
53
+ } catch (Exception $e){
54
+ $checkoutResult = $e->getMessage();
55
+ }
56
+
57
+ return $checkoutResult;
58
+ }
59
+
60
+ protected function getValueForStore($store, $val) {
61
+ return Mage::helper('icecore')->getConfigForStore($store, $val);
62
+ }
63
+
64
+ protected function getCheckout(){
65
+ return Mage::getSingleton('checkout/session');
66
+ }
67
+
68
+
69
+ }
app/code/community/Icepay/IceAdvanced/Model/Webservice.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Custom webservice extension
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+
18
+ class Icepay_IceAdvanced_Model_Webservice
19
+ extends Icepay_IceCore_Model_Icepay_Webservice_Api {
20
+
21
+ protected $url = "http://query.icepay.eu/Merchants.svc";
22
+
23
+ protected $_storeID = null;
24
+
25
+ public function connection($merchantID, $secretCode) {
26
+
27
+ return $this->webservice($merchantID, $secretCode);
28
+ }
29
+
30
+ protected function generateChecksum($obj = null) {
31
+ $arr = array();
32
+
33
+ array_push($arr, $this->getMerchantID());
34
+ array_push($arr, $this->getSecretCode());
35
+ array_push($arr, $this->getTimeStamp());
36
+
37
+ return sha1(implode("|", $arr));
38
+ }
39
+
40
+ public function getMyPaymentMethods() {
41
+
42
+ $obj = new stdClass();
43
+
44
+ $obj->MerchantID = $this->getMerchantID();
45
+ $obj->Timestamp = $this->getTimeStamp();
46
+ $obj->Checksum = $this->generateChecksum($obj);
47
+
48
+ return $this->client->GetMyPaymentMethods($obj);
49
+ }
50
+
51
+ public function setScopeID($storeID){
52
+ $this->_storeID = $storeID;
53
+ }
54
+
55
+ private function getScopeID(){
56
+ return $this->_storeID;
57
+ }
58
+
59
+ public function retrieveAdminGrid(){
60
+
61
+ $obj = $this->retrievePaymentmethods();
62
+
63
+ //Alter codes to images
64
+ $obj->paymentmethods = Mage::helper("iceadvanced")->addIcons($obj->paymentmethods);
65
+
66
+ return $obj;
67
+ }
68
+
69
+ public function retrievePaymentmethods() {
70
+
71
+ $submitObject = new stdClass();
72
+ $msgs = array();
73
+
74
+ if (!$this->doBasicChecks()) {
75
+ $submitObject->msg = array($this->addMessage("Basic configuration not properly set"));
76
+ $this->getResponse()->setBody(Zend_Json::encode($submitObject));
77
+ return;
78
+ }
79
+
80
+ // Start connection
81
+ $this->connection(
82
+ $this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID),
83
+ $this->getValueForStore(Icepay_IceCore_Model_Config::SECRETCODE)
84
+ );
85
+
86
+ // Catch Exception for display
87
+ try {
88
+ $paymentMethods = $this->getMyPaymentMethods();
89
+ array_push($msgs, $this->addMessage("SOAP connection established", "ok"));
90
+ } catch (SoapFault $e) {
91
+ array_push($msgs, $this->addMessage($e->faultstring));
92
+ }
93
+
94
+ //Convert to array (in case one payment method is active)
95
+ $paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod = Mage::helper("icecore")->makeArray($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod);
96
+
97
+ //Filter
98
+ $paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod = $this->filterPaymentmethods($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod);
99
+
100
+ //Count number of payment methods
101
+ array_push($msgs,
102
+ (($count = count($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod)) > 0 && $this->containsData($paymentMethods)) ?
103
+ $this->addMessage(sprintf(Mage::helper("iceadvanced")->__("%s active paymentmethods found"),$count), "ok") : $this->addMessage(Mage::helper("iceadvanced")->__("No active paymentmethods found"))
104
+ );
105
+ // Add issuers
106
+ $issuerObj = array();
107
+ foreach ($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod as $value) {
108
+
109
+ $arr = array(
110
+ 'merchant' => $this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID),
111
+ 'code' => $value->PaymentMethodCode,
112
+ 'issuers' => $value->Issuers->Issuer
113
+ );
114
+ array_push($issuerObj, array(
115
+
116
+ 'pmcode' => $value->PaymentMethodCode,
117
+ //'data' => $arr
118
+ 'data' => urlencode(serialize($arr))
119
+ ));
120
+ }
121
+
122
+ // Create submit object
123
+ $submitObject->msg = $msgs;
124
+ $submitObject->merchant = $this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID);
125
+
126
+ if (!$this->containsData($paymentMethods)) return $submitObject;
127
+
128
+
129
+ $submitObject->paymentmethods = $paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod;
130
+ $submitObject->issuers = $issuerObj;
131
+
132
+
133
+
134
+
135
+ return $submitObject;
136
+ }
137
+
138
+ private function containsData($obj){
139
+ return ($obj->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod[0] == null)?false:true;
140
+ }
141
+
142
+ private function filterPaymentmethods($obj) {
143
+ $arr = array();
144
+ $filter = Mage::helper("iceadvanced")->filteredPaymentmethods;
145
+ foreach ($obj as $key => $value) {
146
+ if (!in_array($obj[$key]->PaymentMethodCode, $filter))
147
+ array_push($arr, $obj[$key]);
148
+ };
149
+ return $arr;
150
+ }
151
+
152
+ private function populateData($obj) {
153
+
154
+ $configArray = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced')->getPaymentmethodsConfiguration();
155
+
156
+ foreach ($obj as $key => $value) {
157
+
158
+ $obj[$key]->ConfigDescription = "";
159
+ $obj[$key]->ConfigTitle = "";
160
+ $obj[$key]->ConfigActive = 0;
161
+
162
+ foreach ($configArray as $ckey => $cvalue) {
163
+ if ($cvalue["code"] == $obj[$key]->PaymentMethodCode) {
164
+ $obj[$key]->ConfigDescription = $cvalue["info"];
165
+ $obj[$key]->ConfigTitle = $cvalue["name"];
166
+ $obj[$key]->ConfigActive = $cvalue["active"];
167
+ }
168
+ }
169
+ };
170
+
171
+ return $obj;
172
+ }
173
+
174
+ private function addIcons($obj) {
175
+
176
+ foreach ($obj as $key => $value) {
177
+ $img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value->PaymentMethodCode));
178
+ $obj[$key]->Image = ($img) ? $img : $value->PaymentMethodCode;
179
+ };
180
+
181
+ return $obj;
182
+ }
183
+
184
+ private function doBasicChecks() {
185
+ foreach (Mage::helper("iceadvanced")->doChecks() as $key => $value) {
186
+ switch ($value['id']) {
187
+ case "merchantid": if ($value['result'] == "err")
188
+ return false; break;
189
+ case "secretcode": if ($value['result'] == "err")
190
+ return false; break;
191
+ case "soap": if ($value['result'] == "err")
192
+ return false; break;
193
+ }
194
+ }
195
+ return true;
196
+ }
197
+
198
+ private function addMessage($val, $type = "err") {
199
+ $msg = new stdClass();
200
+ $msg->type = $type;
201
+ $msg->msg = Mage::helper('iceadvanced')->__($val);
202
+ return $msg;
203
+ }
204
+
205
+ private function getValue($val) {
206
+ return Mage::helper('icecore')->getConfig($val);
207
+ }
208
+
209
+ private function getValueForStore($val){
210
+ return Mage::helper('icecore')->getConfigForStore($this->getScopeID(), $val);
211
+ }
212
+
213
+ }
214
+
215
+
216
+
217
+
218
+ ?>
app/code/community/Icepay/IceAdvanced/controllers/AjaxController.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - AJAX controller
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_AjaxController extends Mage_Adminhtml_Controller_Action {
18
+
19
+ protected $webservice = null;
20
+
21
+ public function iceWebservice() {
22
+ if ($this->webservice == null) $this->webservice = new Icepay_IceAdvanced_Model_Webservice();
23
+ return $this->webservice;
24
+ }
25
+
26
+ public function indexAction() {
27
+ $this->loadLayout();
28
+ $this->renderLayout();
29
+ }
30
+
31
+ public function get_paymentmethodsAction() {
32
+ $this->iceWebservice()->setScopeID($this->getRequest()->get("store"));
33
+ $this->getResponse()->setBody(Zend_Json::encode($this->iceWebservice()->retrieveAdminGrid()));
34
+ }
35
+
36
+ public function save_paymentmethodAction() {
37
+
38
+ $adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
39
+
40
+ $reference = $this->getRequest()->getPost("reference");
41
+ $scopeID = $this->getRequest()->getPost("store");
42
+
43
+ if (!isset($reference)) return;
44
+
45
+ $adv_sql->setScope($scopeID);
46
+
47
+ $settings = Mage::helper("iceadvanced")->getPaymentmethodExtraSettings();
48
+
49
+ if ($this->getRequest()->getPost("active_issuers")){
50
+ $issuers = explode(",",$this->getRequest()->getPost("active_issuers"));
51
+ if (count($issuers) >= 1) array_push($settings, "active_issuers"); //At least 1 issuer active is required
52
+ };
53
+
54
+ foreach ($settings as $setting) {
55
+ $adv_sql->saveConfigValue($reference, $setting, $this->getRequest()->getPost($setting));
56
+ }
57
+
58
+ $this->getResponse()->setBody(sprintf($this->__("%s settings have been saved."),$this->getRequest()->getPost("name")));
59
+ }
60
+
61
+
62
+
63
+ }
app/code/community/Icepay/IceAdvanced/controllers/ConfigController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Adminhtml config controller
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_ConfigController extends Mage_Adminhtml_Controller_Action {
18
+
19
+
20
+ public function indexAction() {
21
+
22
+ $paymentmethod = $this->getRequest()->get("paymentmethod");
23
+ $scopeID = $this->getRequest()->get("store");
24
+
25
+ $this->getResponse()->setBody(
26
+ $this->getLayout()->createBlock("iceadvanced/adminhtml_setting_paymentmethod")->setPaymentmethod($paymentmethod,$scopeID)->toHtml()
27
+ );
28
+
29
+ }
30
+
31
+
32
+
33
+ }
app/code/community/Icepay/IceAdvanced/controllers/ProcessingController.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Advanced - Process payment
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceAdvanced_ProcessingController extends Mage_Core_Controller_Front_Action {
18
+
19
+ public function indexAction() {
20
+ $this->loadLayout();
21
+ $this->renderLayout();
22
+ }
23
+
24
+ public function payAction() {
25
+ $pay = Mage::getModel('iceadvanced/pay');
26
+ $result = $pay->getCheckoutResult();
27
+
28
+ if (!is_array($result)){
29
+ Mage::getSingleton('checkout/session')->setErrorMessage(sprintf($this->__("The payment provider has returned the following error message: %s"),$result));
30
+ parent::_redirect('checkout/onepage/failure');
31
+ } else {
32
+ $this->getResponse()->setBody($this->__("Redirecting"))->setRedirect($result['CheckoutResult']->PaymentScreenURL);
33
+ }
34
+ }
35
+
36
+ }
app/code/community/Icepay/IceAdvanced/etc/config.xml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Icepay_IceAdvanced>
6
+ <version>1.0.1</version>
7
+ </Icepay_IceAdvanced>
8
+ </modules>
9
+ <frontend>
10
+ <routers>
11
+ <iceadvanced>
12
+ <use>standard</use>
13
+ <args>
14
+ <module>Icepay_IceAdvanced</module>
15
+ <frontName>icepayadvanced</frontName>
16
+ </args>
17
+ </iceadvanced>
18
+ </routers>
19
+ <layout>
20
+ <updates>
21
+ <iceadvanced>
22
+ <file>iceadvanced.xml</file>
23
+ </iceadvanced>
24
+ </updates>
25
+ </layout>
26
+ <translate>
27
+ <modules>
28
+ <Icepay_IceAdvanced>
29
+ <files>
30
+ <default>Icepay_IceAdvanced.csv</default>
31
+ </files>
32
+ </Icepay_IceAdvanced>
33
+ </modules>
34
+ </translate>
35
+ </frontend>
36
+
37
+ <global>
38
+ <models>
39
+ <iceadvanced>
40
+ <class>Icepay_IceAdvanced_Model</class>
41
+ <resourceModel>iceadvanced_mysql4</resourceModel>
42
+ </iceadvanced>
43
+ <iceadvanced_mysql4>
44
+ <class>Icepay_IceAdvanced_Model_Mysql4</class>
45
+ <entities>
46
+ <icepay_issuerdata>
47
+ <table>icepay_issuerdata</table>
48
+ </icepay_issuerdata>
49
+ <icepay_pmdata>
50
+ <table>icepay_pmdata</table>
51
+ </icepay_pmdata>
52
+ </entities>
53
+ </iceadvanced_mysql4>
54
+ </models>
55
+ <resources>
56
+ <icepayadvanced_setup>
57
+ <setup>
58
+ <module>Icepay_IceAdvanced</module>
59
+ </setup>
60
+ <connection>
61
+ <use>core_setup</use>
62
+ </connection>
63
+ </icepayadvanced_setup>
64
+ <iceadvanced_write>
65
+ <connection>
66
+ <use>core_write</use>
67
+ </connection>
68
+ </iceadvanced_write>
69
+ <iceadvanced_read>
70
+ <connection>
71
+ <use>core_read</use>
72
+ </connection>
73
+ </iceadvanced_read>
74
+ </resources>
75
+ <blocks>
76
+ <iceadvanced>
77
+ <class>Icepay_IceAdvanced_Block</class>
78
+ </iceadvanced>
79
+ </blocks>
80
+ <helpers>
81
+ <iceadvanced>
82
+ <class>Icepay_IceAdvanced_Helper</class>
83
+ </iceadvanced>
84
+ </helpers>
85
+ <events>
86
+ <model_save_before>
87
+ <observers>
88
+ <iceadvanced>
89
+ <type>singleton</type>
90
+ <class>iceadvanced/observer</class>
91
+ <method>model_save_before</method>
92
+ </iceadvanced>
93
+ </observers>
94
+ </model_save_before>
95
+ <model_save_after>
96
+ <observers>
97
+ <iceadvanced>
98
+ <type>singleton</type>
99
+ <class>iceadvanced/observer</class>
100
+ <method>model_save_after</method>
101
+ </iceadvanced>
102
+ </observers>
103
+ </model_save_after>
104
+ <sales_order_payment_place_end>
105
+ <observers>
106
+ <iceadvanced>
107
+ <type>singleton</type>
108
+ <class>iceadvanced/observer</class>
109
+ <method>sales_order_payment_place_end</method>
110
+ </iceadvanced>
111
+ </observers>
112
+ </sales_order_payment_place_end>
113
+ </events>
114
+ </global>
115
+
116
+ <adminhtml>
117
+ <translate>
118
+ <modules>
119
+ <Icepay_IceAdvanced>
120
+ <files>
121
+ <default>Icepay_IceAdvanced.csv</default>
122
+ </files>
123
+ </Icepay_IceAdvanced>
124
+ </modules>
125
+ </translate>
126
+
127
+ <acl>
128
+ <resources>
129
+ <admin>
130
+ <children>
131
+ <system>
132
+ <children>
133
+ <config>
134
+ <children>
135
+ <iceadvanced translate="title" module="iceadvanced">
136
+ <title>iceadvanced Settings</title>
137
+ </iceadvanced>
138
+ </children>
139
+ </config>
140
+ </children>
141
+ </system>
142
+ </children>
143
+ </admin>
144
+ </resources>
145
+ </acl>
146
+ </adminhtml>
147
+ </config>
app/code/community/Icepay/IceAdvanced/etc/system.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <sections>
5
+ <icecore translate="label" module="icecore">
6
+ <label>ICEPAY</label>
7
+ <tab>sales</tab>
8
+ <frontend_type>text</frontend_type>
9
+ <class>icepay-section</class>
10
+ <header_css>icepay-header</header_css>
11
+ <sort_order>350</sort_order>
12
+ <show_in_default>1</show_in_default>
13
+ <show_in_website>0</show_in_website>
14
+ <show_in_store>1</show_in_store>
15
+ <groups>
16
+ <advanced_settings translate="label comment">
17
+ <label>Paymentmethods</label>
18
+ <comment>Configure ICEPAY paymentmethods [STORE VIEW]</comment>
19
+ <expanded>0</expanded>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>50</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>0</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <paymentmethods>
27
+ <label>Paymentmethods</label>
28
+ <frontend_model>iceadvanced/adminhtml_grid_paymentmethods</frontend_model>
29
+ <sort_order>20</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>0</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <config_path>payment/icepay_testicepay/paymentmethods</config_path>
34
+ </paymentmethods>
35
+ <info>
36
+ <label>Configuration Information</label>
37
+ <frontend_type>label</frontend_type>
38
+ <frontend_model>iceadvanced/adminhtml_checkSettings</frontend_model>
39
+ <sort_order>30</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>0</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </info>
44
+ <manual>
45
+ <label></label>
46
+ <frontend_type>label</frontend_type>
47
+ <comment>Please read the advanced manual</comment>
48
+ <sort_order>40</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>0</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ </manual>
53
+ </fields>
54
+ </advanced_settings>
55
+ </groups>
56
+ </icecore>
57
+ </sections>
58
+ </config>
app/code/community/Icepay/IceAdvanced/sql/icepayadvanced_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $namespace = Mage::helper('iceadvanced')->section;
4
+
5
+ $installer = $this;
6
+ $installer->startSetup();
7
+
8
+ $conn = $installer->getConnection();
9
+ $conn->insertOnDuplicate($this->getTable('core/config_data'), array('path' => $namespace.'/module/title', 'value' => Mage::helper($namespace)->title), array('value'));
10
+ $conn->insertOnDuplicate($this->getTable('core/config_data'), array('path' => $namespace.'/module/namespace', 'value' => $namespace), array('value'));
11
+
12
+ $installer->run("
13
+ CREATE TABLE IF NOT EXISTS `icepay_pmdata` (
14
+ `pm_id` int(32) NOT NULL AUTO_INCREMENT,
15
+ `pm_code` varchar(120) NOT NULL,
16
+ PRIMARY KEY (`pm_id`),
17
+ UNIQUE KEY `pm_name` (`pm_code`),
18
+ KEY `pm_code` (`pm_code`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
20
+
21
+ CREATE TABLE IF NOT EXISTS `icepay_issuerdata` (
22
+ `config_id` int(32) NOT NULL AUTO_INCREMENT,
23
+ `pm_code` varchar(32) NOT NULL,
24
+ `store_scope_id` int(32) NOT NULL,
25
+ `merchant_id` int(32) NOT NULL DEFAULT '0',
26
+ `magento_code` varchar(32) NOT NULL,
27
+ `issuer_code` varchar(120) NOT NULL,
28
+ `issuer_name` varchar(120) NOT NULL,
29
+ `issuer_country` text NOT NULL COMMENT 'serialized array',
30
+ `issuer_currency` text NOT NULL COMMENT 'serialized array',
31
+ `issuer_language` text NOT NULL COMMENT 'serialized array',
32
+ `issuer_minimum` varchar(255) NOT NULL COMMENT 'array',
33
+ `issuer_maximum` varchar(255) NOT NULL COMMENT 'array',
34
+ PRIMARY KEY (`config_id`),
35
+ KEY `code` (`pm_code`),
36
+ KEY `magento_code` (`magento_code`),
37
+ KEY `issuer_code` (`issuer_code`),
38
+ KEY `merchant_id` (`merchant_id`)
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
40
+
41
+ ");
42
+
43
+
44
+
45
+ $installer->endSetup();
app/code/community/Icepay/IceAdvanced/sql/icepayadvanced_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+ ALTER TABLE `icepay_pmdata` RENAME TO `{$installer->getTable('icepay_pmdata')}`;
8
+ ALTER TABLE `icepay_issuerdata` RENAME TO `{$installer->getTable('icepay_issuerdata')}`;
9
+ ");
10
+
11
+ $installer->endSetup();
app/code/community/Icepay/IceCore/Block/Adminhtml/CheckSettings.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block checking settings
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Adminhtml_CheckSettings
18
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
19
+ {
20
+
21
+
22
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+ $html = "";
25
+ $lines = array();
26
+
27
+ /* Check Merchant ID */
28
+ $check = Mage::helper("icecore")->validateMerchantID($this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID));
29
+ array_push($lines, array(
30
+ 'line' => $check["msg"],
31
+ 'result' => ($check["val"]?"ok":"err")));
32
+
33
+
34
+ /* Check SecretCode */
35
+ $check = Mage::helper("icecore")->validateSecretCode($this->getValueForStore(Icepay_IceCore_Model_Config::SECRETCODE));
36
+ array_push($lines, array(
37
+ 'line' => $check["msg"],
38
+ 'result' => ($check["val"]?"ok":"err")));
39
+
40
+ foreach ($lines as $key => $value) {
41
+ $html.= '<p class="'.$value['result'].'">'.$value['line'].'</p>';
42
+ }
43
+
44
+ return '<div class="icepay_debug">'.$html.'</div>';
45
+ }
46
+
47
+
48
+ protected function getValueForStore($val) {
49
+ return Mage::helper('icecore')->getConfigForStore(Mage::helper('icecore')->adminGetStoreScopeID(), $val);
50
+ }
51
+
52
+
53
+
54
+
55
+ }
app/code/community/Icepay/IceCore/Block/Adminhtml/GenerateURL.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block generating store URLs
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Adminhtml_GenerateURL extends Mage_Adminhtml_Block_System_Config_Form_Field {
18
+
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
20
+ $this->setElement($element);
21
+ return $this->enCase(Mage::helper("icecore")->getStoreFrontURL($this->setAction($this->getElement()->getName())));
22
+ }
23
+
24
+ protected function setAction($elementName) {
25
+ switch ($elementName) {
26
+ case "groups[settings][fields][merchant_url_ok][value]": return "result";
27
+ case "groups[settings][fields][merchant_url_err][value]": return "result";
28
+ case "groups[settings][fields][merchant_url_notify][value]": return "notify";
29
+ }
30
+ }
31
+
32
+ protected function enCase($str) {
33
+ return '<input type="text" name="" class="icepay_url_form" value="' . $str . '"/>';
34
+ }
35
+
36
+ }
app/code/community/Icepay/IceCore/Block/Adminhtml/Grid/Modules.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block modules grid
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Adminhtml_Grid_Modules extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface {
18
+
19
+ protected $_element;
20
+
21
+ public function __construct() {
22
+ $this->setTemplate('icepaycore/grid_modules.phtml');
23
+ }
24
+
25
+ public function render(Varien_Data_Form_Element_Abstract $element) {
26
+ $this->setElement($element);
27
+ return $this->toHtml();
28
+ }
29
+
30
+ public function setElement(Varien_Data_Form_Element_Abstract $element) {
31
+ $this->_element = $element;
32
+ return $this;
33
+ }
34
+
35
+ public function getElement() {
36
+ return $this->_element;
37
+ }
38
+
39
+ public function getModules() {
40
+
41
+ $core_sql = Mage::getSingleton('icecore/mysql4_iceCore');
42
+ return $core_sql->getModulesConfiguration();
43
+ }
44
+
45
+ public function getAddButtonHtml() {
46
+ return $this->getChildHtml('add_button');
47
+ }
48
+
49
+ protected function _prepareLayout() {
50
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
51
+ ->setData(array(
52
+ 'label' => Mage::helper('catalog')->__('Save changes'),
53
+ 'onclick' => 'return tierPriceControl.addItem()',
54
+ 'class' => 'add'
55
+ ));
56
+ $button->setName('add_tier_price_item_button');
57
+
58
+ $this->setChild('add_button', $button);
59
+ return parent::_prepareLayout();
60
+ }
61
+
62
+ }
app/code/community/Icepay/IceCore/Block/Adminhtml/Init.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block loading CSS
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Adminhtml_Init
18
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
19
+ {
20
+
21
+ protected function _prepareLayout()
22
+ {
23
+ /* General pages CSS */
24
+ $this->getLayout()
25
+ ->getBlock('head')
26
+ ->addCss('icepay/general.css');
27
+
28
+ /* ADMIN page CSS */
29
+ if (Mage::helper('icecore')->isAdminPage()) {
30
+ $this->getLayout()
31
+ ->getBlock('head')
32
+ ->addCss('icepay/admin.css');
33
+ }
34
+
35
+ parent::_prepareLayout();
36
+ }
37
+
38
+ /* Don't use a template */
39
+ public function setTemplate($template) {
40
+ return "";
41
+ }
42
+
43
+
44
+
45
+ }
app/code/community/Icepay/IceCore/Block/Front/Statement.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block displaying the ICEPAY statement
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Front_Statement extends Mage_Core_Block_Template {
18
+
19
+ protected $_template = 'icepaycore/front/statement.phtml';
20
+ public $_info;
21
+
22
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
23
+ return Mage::helper("icecore")->getStatementHTML(false);
24
+ }
25
+
26
+ }
app/code/community/Icepay/IceCore/Block/Front/Template.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Block displaying a template
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Block_Front_Template extends Mage_Core_Block_Template {
18
+
19
+ //Controller does the template loading
20
+
21
+ }
app/code/community/Icepay/IceCore/Helper/Data.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Core Helper
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+
20
+ /* Install values */
21
+ public $title = "Core";
22
+ public $version = "1.0.0";
23
+ public $id = "003";
24
+ public $fingerprint = "003";
25
+ public $compatibility_oldest_version = "1.5.0.0";
26
+ public $compatibility_latest_version = "1.6.2.0";
27
+ public $section = "icecore";
28
+ public $serial_required = "0";
29
+
30
+ public $imageDir = "adminhtml/default/default/icepay/images/";
31
+ public $imageExtension = "png";
32
+ public $defaultLocale = "en_EN";
33
+
34
+
35
+ /* Public functions used in all modules */
36
+
37
+ public function isEnterPrise(){
38
+ return (str_replace('.', '', Mage::getVersion()) > 1600) ? true : false;
39
+ }
40
+
41
+ public function isAdminPage(){
42
+ return (Mage::app()->getFrontController()->getRequest()->getParam('section', false) == $this->section)? true: false;
43
+ }
44
+
45
+ public function hasSOAP(){
46
+ return (class_exists("SoapClient"))?true:false;
47
+ }
48
+
49
+ public function isCompatible($fromVersion, $toVersion){
50
+ return ((
51
+ str_replace('.', '', Mage::getVersion()) <= str_replace('.', '', $toVersion) &&
52
+ str_replace('.', '', Mage::getVersion()) >= str_replace('.', '', $fromVersion)
53
+ )?true:false);
54
+ }
55
+
56
+ public function makeArray($obj) {
57
+ if (is_array($obj))
58
+ return $obj;
59
+
60
+ $arr = array();
61
+ array_push($arr, $obj);
62
+ return $arr;
63
+ }
64
+
65
+
66
+ public function adminGetFrontScope(){
67
+ /* default/websites/stores */
68
+ return Mage::app()->getFrontController()->getRequest()->getParam('store');
69
+ }
70
+
71
+ /* note that this only works in default/stores scope
72
+ * If a 0 is returned, it'll be default (admin) store scope ID
73
+ */
74
+ public function adminGetStoreScopeID(){
75
+ if (Mage::app()->getStore($this->getStoreFromRequest())->isAdmin()){
76
+ //Store is Admin, so pick the first available store view
77
+ $stores = Mage::app()->getStores();
78
+ return $stores[1]->getId();
79
+ }
80
+ return Mage::app()->getStore($this->getStoreFromRequest())->getId();
81
+ }
82
+
83
+ public function getStoreFromRequest(){
84
+ return Mage::app()->getFrontController()->getRequest()->getParam('store');
85
+ }
86
+
87
+ public function adminGetStore(){
88
+ return Mage::app()->getStore($this->adminGetStoreScopeID());
89
+ }
90
+
91
+ public function getStoreFrontURL($action = "result"){
92
+ if (Mage::app()->getStore()->getStoreInUrl()) return Mage::app()->getStore($this->adminGetStoreScopeID())->getUrl("icepay/processing/".$action, array('_secure'=>true));
93
+ return Mage::app()->getStore()->getUrl("icepay/processing/".$action, array('_secure'=>true));
94
+ }
95
+
96
+ public function getStoreScopeID(){
97
+ return (Mage::app()->getStore()->getId() == NULL || Mage::app()->getStore()->isAdmin())?$this->adminGetStoreScopeID():Mage::app()->getStore()->getId();
98
+ }
99
+
100
+ public function getConfig($str){
101
+ return Mage::app()->getStore($this->getStoreScopeID())->getConfig($str);
102
+ }
103
+
104
+ public function getConfigForStore($storeID, $config){
105
+ return Mage::app()->getStore($storeID)->getConfig($config);
106
+ }
107
+
108
+ public function getMerchantIDForStore($storeID){
109
+ return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::MERCHANTID);
110
+ }
111
+
112
+ public function getSecretcodeForStore($storeID){
113
+ return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::SECRETCODE);
114
+ }
115
+
116
+ public function cleanArray($arr){
117
+ foreach($arr as $key => $val) $arr[$key] = trim($val);
118
+ return array_unique($arr);
119
+ }
120
+
121
+ public function setImageDir($str){
122
+ $this->imageDir = $str;
123
+ }
124
+
125
+ public function getLangISO2($default = false){
126
+ $locale = explode("_", ($default)?$this->defaultLocale:Mage::app()->getLocale()->getLocale());
127
+ if (is_array($locale) && !empty($locale)) {
128
+ return strtoupper($locale[0]);
129
+ }
130
+ return "EN";
131
+ }
132
+
133
+ public function log($str){
134
+ Mage::log($str, null, 'icepay.log');
135
+ }
136
+
137
+ /* Checks */
138
+ public function validateMerchantID($val){
139
+ $return = array('val'=>false,'msg'=>$this->__("Merchant ID is properly configured"));
140
+
141
+ if (!$val){
142
+ $return['msg'] = $this->__("Merchant ID not set for this storeview");
143
+ return $return;
144
+ }
145
+
146
+ if (strlen($val) != 5){
147
+ $return['msg'] = $this->__("Merchant ID does not contain 5 digits");
148
+ return $return;
149
+ }
150
+
151
+ if (!is_numeric($val)){
152
+ $return['msg'] = $this->__("Merchant ID is not numeric");
153
+ return $return;
154
+ }
155
+
156
+ $return['val'] = true;
157
+ return $return;
158
+ }
159
+
160
+ public function toIcon($code, $title=""){
161
+ $code = strtolower($code);
162
+ if (!$img = $this->getImage("{$code}.{$this->imageExtension}")) return false;
163
+ return "<img src=\"{$img}\" id=\"ICEPAY_{$code}\" title=\"{$title}\" >";
164
+ }
165
+
166
+ public function cleanString($string){
167
+ $string = trim($string);
168
+ return $string;
169
+ }
170
+
171
+ public function getImage($img){
172
+
173
+ // Get image in lang folder
174
+ if (file_exists(
175
+ Mage::getModel('core/config')->getOptions()->getSkinDir()."/".$this->imageDir.strtolower($this->getLangISO2())."/".$img
176
+ )) return $this->getImageURL().strtolower($this->getLangISO2())."/".$img;
177
+
178
+ // Get image in standard lang folder
179
+ if (file_exists(
180
+ Mage::getModel('core/config')->getOptions()->getSkinDir()."/".$this->imageDir.strtolower($this->getLangISO2(true))."/".$img
181
+ )) return $this->getImageURL().strtolower($this->getLangISO2(true))."/".$img;
182
+
183
+ // Get standard image
184
+ if (file_exists(
185
+ Mage::getModel('core/config')->getOptions()->getSkinDir()."/".$this->imageDir.$img
186
+ )) return $this->getImageURL().$img;
187
+
188
+ //Hmm still no image, lets return the nologo image
189
+ if (file_exists(
190
+ Mage::getModel('core/config')->getOptions()->getSkinDir()."/".$this->imageDir."nologo.png"
191
+ )) return $this->getImageURL()."nologo.png";
192
+
193
+ return false;
194
+ }
195
+
196
+ public function getImageURL(){
197
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).$this->imageDir;
198
+ }
199
+
200
+ public function validateSecretCode($val){
201
+ $return = array('val'=>false,'msg'=>$this->__("SecretCode is properly configured"));
202
+
203
+ if (!$val){
204
+ $return['msg'] = $this->__("SecretCode not set for this storeview");
205
+ return $return;
206
+ }
207
+
208
+ if (strlen($val) != 40){
209
+ $return['msg'] = $this->__("SecretCode does not contain 40 characters");
210
+ return $return;
211
+ }
212
+
213
+ $return['val'] = true;
214
+
215
+ return $return;
216
+ }
217
+
218
+ public function getTransactionDescription($default){
219
+ return ($statement = $this->getConfig(Icepay_IceCore_Model_Config::TRANSDESCR))?$statement:$default;
220
+
221
+ }
222
+
223
+ public function formatTotal($number){
224
+ return round($number*100);
225
+ }
226
+
227
+ public function generateChecksum($arr){
228
+ return sha1(implode("|",$arr));
229
+ }
230
+
231
+
232
+ }
app/code/community/Icepay/IceCore/Model/Config.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Configuration constants
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Model_Config
18
+ {
19
+ /* Config constants */
20
+
21
+ const MERCHANTID = "icecore/settings/merchant_id";
22
+ const SECRETCODE = "icecore/settings/merchant_secret";
23
+ const TRANSDESCR = "icecore/core_options/transaction_descr";
24
+ const AUTOINVOICE = "icecore/core_options/order_autoinvoice";
25
+
26
+ const STATUS_NEW = "NEW";
27
+ const STATUS_OPEN = "OPEN";
28
+ const STATUS_ERROR = "ERR";
29
+ const STATUS_SUCCESS = "OK";
30
+ const STATUS_REFUND = "REFUND";
31
+ const STATUS_CHARGEBACK = "CBACK";
32
+
33
+ const STATUS_MAGENTO_NEW = "icecore_new";
34
+ const STATUS_MAGENTO_OPEN = "icecore_open";
35
+ const STATUS_MAGENTO_ERROR = "icecore_err";
36
+ const STATUS_MAGENTO_SUCCESS = "icecore_ok";
37
+ const STATUS_MAGENTO_REFUND = "icecore_refund";
38
+ const STATUS_MAGENTO_CHARGEBACK = "icecore_cback";
39
+
40
+
41
+ }
app/code/community/Icepay/IceCore/Model/Icepay/Postback.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Postback processing
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Model_Icepay_Postback {
18
+
19
+ protected $sqlModel;
20
+ protected $orderModel;
21
+ protected $order;
22
+ protected $storeID;
23
+
24
+
25
+ public function __construct() {
26
+ $this->sqlModel = Mage::getModel('icecore/mysql4_iceCore');
27
+ $this->orderModel = Mage::getModel('sales/order');
28
+ }
29
+
30
+ public function handle($_vars) {
31
+ if (!$_vars) {
32
+ Mage::helper("icecore")->log("No Postback vars");
33
+ die("ICEPAY postback page installed correctly.");
34
+ }
35
+ Mage::helper("icecore")->log(serialize($_vars));
36
+
37
+ if (!$this->checkIP($_SERVER['REMOTE_ADDR'])){
38
+ Mage::helper("icecore")->log(sprintf("IP not in range (%s)",$_SERVER['REMOTE_ADDR']));
39
+ die("IP not in range");
40
+ }
41
+
42
+
43
+ $this->order = $this->orderModel->loadByIncrementId($_vars['OrderID']);
44
+
45
+ $icepayTransaction = $this->sqlModel->loadPaymentByID( $this->order->getRealOrderId() );
46
+
47
+ $this->storeID = $icepayTransaction["store_id"];
48
+
49
+ $transActionID = $this->saveTransaction($_vars);
50
+
51
+ $doSpecialActions = false;
52
+
53
+ if ($this->canUpdateBasedOnIcepayTable($icepayTransaction['status'], $_vars['Status'])) {
54
+
55
+ /* creating the invoice causes major overhead! Status should to be updated and saved first */
56
+ $doSpecialActions = true;
57
+
58
+ // Update ICEPAY transaction info
59
+ $newData = $icepayTransaction;
60
+ $newData['update_time'] = now();
61
+ $newData['status'] = $_vars['Status'];
62
+ $newData['transaction_id'] = $_vars['PaymentID'];
63
+ $this->sqlModel->changeStatus($newData);
64
+
65
+ // Update order status
66
+ $this->order->setState(
67
+ $this->getMagentoState($_vars['Status']),
68
+ $this->getMagentoStatus($_vars['Status']),
69
+ Mage::helper('icecore')->__('Status of order changed'),
70
+ true
71
+ );
72
+
73
+ };
74
+
75
+ $this->order->save();
76
+
77
+ $this->sendMail($icepayTransaction['status'], $_vars['Status']);
78
+
79
+ if ($doSpecialActions){
80
+ $extraMsg = $this->specialActions($_vars['Status'], $transActionID);
81
+ $this->order->setState(
82
+ $this->getMagentoState($_vars['Status']),
83
+ $this->getMagentoStatus($_vars['Status']),
84
+ $extraMsg,
85
+ false
86
+ );
87
+ $this->order->save();
88
+ }
89
+
90
+
91
+ }
92
+
93
+ protected function sendMail($currentStatus, $newStatus) {
94
+ switch ($currentStatus){
95
+ case Icepay_IceCore_Model_Config::STATUS_NEW:
96
+ if ($newStatus == Icepay_IceCore_Model_Config::STATUS_ERROR){
97
+ $this->order->sendOrderUpdateEmail();
98
+ } else {
99
+ $this->order->sendNewOrderEmail();
100
+ };
101
+ break;
102
+ default:
103
+ $this->order->sendOrderUpdateEmail();
104
+ }
105
+ }
106
+
107
+ protected function saveTransaction($_vars){
108
+
109
+ $payment = $this->order->getPayment();
110
+ $transaction = $payment->getTransaction($_vars['PaymentID']);
111
+
112
+ $i = 0;
113
+ do {
114
+ $id = $_vars['PaymentID'].(($i > 0)?"-{$i}":"");
115
+ $transaction = $payment->getTransaction($id);
116
+ $i++;
117
+ } while ($transaction);
118
+ $i--;
119
+
120
+ $id = $_vars['PaymentID'].(($i > 0)?"-{$i}":"");
121
+
122
+ $payment->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,$_vars);
123
+
124
+ $payment->setTransactionId($id)
125
+ ->setIsTransactionClosed($this->isClosedStatus($_vars['Status']));
126
+
127
+ if ($this->isRefund($_vars['Status'])){
128
+ $payment->setParentTransactionId($this->getParentPaymentID($_vars['StatusCode']));
129
+ //Creditmemo currently not supported
130
+ };
131
+
132
+ $payment->addTransaction(
133
+ $this->getTransactionStatus($_vars['Status']),
134
+ null,false);
135
+
136
+ $payment->save();
137
+
138
+ return $id;
139
+ }
140
+
141
+
142
+ protected function createInvoice($id)
143
+ {
144
+ $invoice = $this->order->prepareInvoice()
145
+ ->setTransactionId($id)
146
+ ->addComment(Mage::helper('icecore')->__('Auto-generated by ICEPAY'))
147
+ ->register()
148
+ ->pay();
149
+
150
+ $transactionSave = Mage::getModel('core/resource_transaction')
151
+ ->addObject($invoice)
152
+ ->addObject($invoice->getOrder());
153
+
154
+ $transactionSave->save();
155
+
156
+ $invoice->sendEmail();
157
+
158
+ return $invoice;
159
+ }
160
+
161
+
162
+ protected function specialActions($newStatus, $transActionID){
163
+ $msg = "";
164
+ switch ($newStatus){
165
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS:
166
+ if (!$this->order->hasInvoices() && Mage::app()->getStore($this->storeID)->getConfig(Icepay_IceCore_Model_Config::AUTOINVOICE) == 1){
167
+ $invoice = $this->createInvoice($transActionID);
168
+ $msg = Mage::helper("icecore")->__('Invoice Auto-Created: %s', '<strong>'.$invoice->getIncrementId().'</strong>');
169
+ };
170
+ break;
171
+ case Icepay_IceCore_Model_Config::STATUS_ERROR:
172
+ $this->order->cancel();
173
+ break;
174
+ }
175
+ return $msg;
176
+ }
177
+
178
+ protected function canUpdate($currentStatus, $newStatus) {
179
+ switch ($newStatus) {
180
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return ($currentStatus == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT || $currentStatus == Mage_Sales_Model_Order::STATE_NEW);
181
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return ($currentStatus == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT || $currentStatus == Mage_Sales_Model_Order::STATE_NEW);
182
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return ($currentStatus == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT || $currentStatus == Mage_Sales_Model_Order::STATE_NEW);
183
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return ($currentStatus == Mage_Sales_Model_Order::STATE_PROCESSING || $currentStatus == Mage_Sales_Model_Order::STATE_COMPLETE);
184
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return ($currentStatus == Mage_Sales_Model_Order::STATE_PROCESSING || $currentStatus == Mage_Sales_Model_Order::STATE_COMPLETE);
185
+ default:
186
+ return false;
187
+ };
188
+ }
189
+
190
+ protected function canUpdateBasedOnIcepayTable($currentStatus, $newStatus) {
191
+ switch ($newStatus) {
192
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return ($currentStatus == Icepay_IceCore_Model_Config::STATUS_OPEN || $currentStatus == Icepay_IceCore_Model_Config::STATUS_NEW);
193
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return ($currentStatus == Icepay_IceCore_Model_Config::STATUS_OPEN || $currentStatus == Icepay_IceCore_Model_Config::STATUS_NEW);
194
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return ($currentStatus == Icepay_IceCore_Model_Config::STATUS_OPEN || $currentStatus == Icepay_IceCore_Model_Config::STATUS_NEW);
195
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return ($currentStatus == Icepay_IceCore_Model_Config::STATUS_SUCCESS);
196
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return ($currentStatus == Icepay_IceCore_Model_Config::STATUS_SUCCESS);
197
+ default:
198
+ return false;
199
+ };
200
+ }
201
+
202
+ protected function getMagentoStatus($icepayStatus) {
203
+ switch ($icepayStatus) {
204
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return Icepay_IceCore_Model_Config::STATUS_MAGENTO_SUCCESS;
205
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return Icepay_IceCore_Model_Config::STATUS_MAGENTO_OPEN;
206
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return Icepay_IceCore_Model_Config::STATUS_MAGENTO_ERROR;
207
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return Icepay_IceCore_Model_Config::STATUS_MAGENTO_CHARGEBACK;
208
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return Icepay_IceCore_Model_Config::STATUS_MAGENTO_REFUND;
209
+ default:
210
+ return false;
211
+ };
212
+ }
213
+
214
+ protected function getMagentoState($icepayStatus) {
215
+ switch ($icepayStatus) {
216
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return Mage_Sales_Model_Order::STATE_PROCESSING;
217
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
218
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return Mage_Sales_Model_Order::STATE_CANCELED;
219
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
220
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
221
+ default:
222
+ return false;
223
+ };
224
+ }
225
+
226
+ protected function getTransactionStatus($icepayStatus) {
227
+ switch ($icepayStatus) {
228
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT;
229
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID;
230
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID;
231
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND;
232
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND;
233
+ default: return false;
234
+ };
235
+ }
236
+
237
+ protected function isClosedStatus($icepayStatus) {
238
+ switch ($icepayStatus) {
239
+ case Icepay_IceCore_Model_Config::STATUS_SUCCESS: return true;
240
+ case Icepay_IceCore_Model_Config::STATUS_OPEN: return false;
241
+ case Icepay_IceCore_Model_Config::STATUS_ERROR: return true;
242
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return true;
243
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return true;
244
+ default: return false;
245
+ };
246
+ }
247
+
248
+ protected function isRefund($icepayStatus) {
249
+ switch ($icepayStatus) {
250
+ case Icepay_IceCore_Model_Config::STATUS_CHARGEBACK: return true;
251
+ case Icepay_IceCore_Model_Config::STATUS_REFUND: return true;
252
+ default:
253
+ return false;
254
+ };
255
+ }
256
+
257
+ protected function getParentPaymentID($statusString) {
258
+ $arr = explode("PaymentID:", $statusString);
259
+ return intval($arr[1]);
260
+ }
261
+
262
+ protected function getTransactionString($_vars) {
263
+ $str = "";
264
+ foreach ($_vars as $key => $value){
265
+ $str .= "{$key}: {$value}<BR>";
266
+ }
267
+ return $str;
268
+ }
269
+
270
+ protected function checkIP($ip){
271
+ if (!$this->ip_in_range($ip, "194.30.175.0-194.30.175.255") && !$this->ip_in_range($ip, "194.126.241.128-194.126.241.191")) return false;
272
+ return true;
273
+ }
274
+
275
+ protected function decbin32($dec) {
276
+ return str_pad(decbin($dec), 32, '0', STR_PAD_LEFT);
277
+ }
278
+
279
+ protected function ip_in_range($ip, $range) {
280
+ if (strpos($range, '/') !== false) {
281
+ // $range is in IP/NETMASK format
282
+ list($range, $netmask) = explode('/', $range, 2);
283
+ if (strpos($netmask, '.') !== false) {
284
+ // $netmask is a 255.255.0.0 format
285
+ $netmask = str_replace('*', '0', $netmask);
286
+ $netmask_dec = ip2long($netmask);
287
+ return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );
288
+ } else {
289
+ // $netmask is a CIDR size block
290
+ // fix the range argument
291
+ $x = explode('.', $range);
292
+ while (count($x) < 4)
293
+ $x[] = '0';
294
+ list($a, $b, $c, $d) = $x;
295
+ $range = sprintf("%u.%u.%u.%u", empty($a) ? '0' : $a, empty($b) ? '0' : $b, empty($c) ? '0' : $c, empty($d) ? '0' : $d);
296
+ $range_dec = ip2long($range);
297
+ $ip_dec = ip2long($ip);
298
+
299
+ # Strategy 1 - Using substr to chop up the range and pad it with 1s to the right
300
+ $broadcast_dec = bindec(substr($this->decbin32($range_dec), 0, $netmask)
301
+ . str_pad('', 32 - $netmask, '1'));
302
+
303
+ # Strategy 2 - Use math to OR the range with the wildcard to create the Broadcast address
304
+ $wildcard_dec = pow(2, (32 - $netmask)) - 1;
305
+ $broadcast_dec = $range_dec | $wildcard_dec;
306
+
307
+ return (($ip_dec & $broadcast_dec) == $ip_dec);
308
+ }
309
+ } else {
310
+ // range might be 255.255.*.* or 1.2.3.0-1.2.3.255
311
+ if (strpos($range, '*') !== false) { // a.b.*.* format
312
+ // Just convert to A-B format by setting * to 0 for A and 255 for B
313
+ $lower = str_replace('*', '0', $range);
314
+ $upper = str_replace('*', '255', $range);
315
+ $range = "$lower-$upper";
316
+ }
317
+
318
+ if (strpos($range, '-') !== false) { // A-B format
319
+ list($lower, $upper) = explode('-', $range, 2);
320
+ $lower_dec = ip2long($lower);
321
+ $upper_dec = ip2long($upper);
322
+ $ip_dec = ip2long($ip);
323
+ return ( ($ip_dec >= $lower_dec) && ($ip_dec <= $upper_dec) );
324
+ }
325
+
326
+ return false;
327
+ }
328
+
329
+ $ip_dec = ip2long($ip);
330
+ return (($ip_dec & $netmask_dec) == $ip_dec);
331
+ }
332
+
333
+ }
app/code/community/Icepay/IceCore/Model/Icepay/Result.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Return page processing
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Model_Icepay_Result {
18
+
19
+ protected $sqlModel;
20
+
21
+ public function __construct() {
22
+ $this->sqlModel = Mage::getModel('icecore/mysql4_iceCore');
23
+ }
24
+
25
+ public function handle(array $_vars){
26
+ if (count($_vars) == 0) die("ICEPAY result page installed correctly.");
27
+ if (!$_vars['OrderID']) die("No orderID found");
28
+
29
+ $order = Mage::getModel('sales/order');
30
+ $order->loadByIncrementId(($_vars['OrderID'] == "DUMMY")?$_vars['Reference']:$_vars['OrderID'])
31
+ ->addStatusHistoryComment(sprintf(Mage::helper("icecore")->__("Customer returned with status: %s"),$_vars['StatusCode']))
32
+ ->save();
33
+
34
+ switch(strtoupper($_vars['Status'])){
35
+ case "ERR":
36
+ $cart = Mage::getModel('checkout/cart')->getQuote()->getData();
37
+ $msg = sprintf(Mage::helper("icecore")->__("The payment provider has returned the following error message: %s"),Mage::helper("icecore")->__($_vars['Status']. ": ".$_vars['StatusCode']));
38
+ if(!isset($cart['items_qty'])) $msg .= sprintf("<p>".Mage::helper("icecore")->__("Click <a href='%s'>here</a> to reorder.")."</p>",Mage::getUrl('sales/order/reorder', array('order_id'=>$order->getRealOrderId())));
39
+ Mage::getSingleton('checkout/session')->setErrorMessage($msg);
40
+ $url = 'checkout/onepage/failure';
41
+ break;
42
+ case "OK":
43
+ case "OPEN":
44
+ default:
45
+ Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
46
+ $url = 'checkout/onepage/success';
47
+ };
48
+
49
+ /* Redirect based on store */
50
+ //Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl($url));
51
+ $url = Mage::app()->getStore($order->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK,true) . $url;
52
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
53
+
54
+ }
55
+
56
+
57
+ }
app/code/community/Icepay/IceCore/Model/Icepay/Webservice/Api.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - ICEPAY Webservice API
5
+ * @version 0.1.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+
18
+ class Icepay_IceCore_Model_Icepay_Webservice_Api {
19
+
20
+ public $client; // SoapClient Object
21
+ protected $merchantID; // Integer
22
+ protected $secretCode; // String
23
+
24
+ protected $url = "https://pay.icepay.eu/api/icepay.svc";
25
+
26
+ public function webservice($merchantID, $secretCode){
27
+
28
+ $this->setMerchantID($merchantID);
29
+ $this->setSecretCode($secretCode);
30
+
31
+ $this->client = new SoapClient($this->url."?wsdl",
32
+ array("location" => $this->url)
33
+ );
34
+ $this->client->soap_defencoding = "utf-8";
35
+ }
36
+
37
+ /* Setters */
38
+ public function setMerchantID($val){
39
+ $this->merchantID = $val;
40
+ }
41
+
42
+ public function setSecretCode($val){
43
+ $this->secretCode = $val;
44
+ }
45
+
46
+ /* Getters */
47
+ public function getMerchantID(){
48
+ return intval($this->merchantID);
49
+ }
50
+
51
+ public function getSecretCode(){
52
+ return $this->secretCode;
53
+ }
54
+
55
+
56
+ protected function getTimeStamp(){
57
+ return gmdate("Y-m-d\TH:i:s\Z");
58
+ }
59
+
60
+ protected function generateChecksum($obj = null){
61
+ $arr = array();
62
+ array_push($arr, $this->getSecretCode());
63
+ foreach($obj as $val){
64
+ array_push($arr, $val);
65
+ }
66
+ return sha1(implode("|",$arr));
67
+ }
68
+
69
+ protected function getIP(){
70
+ return $_SERVER['REMOTE_ADDR'];
71
+ }
72
+
73
+
74
+ // Webservice methods below:
75
+
76
+ public function doCheckout(
77
+ $amount,
78
+ $country,
79
+ $currency,
80
+ $lang,
81
+ $descr,
82
+ $paymentmethod,
83
+ $issuer,
84
+ $orderID,
85
+ $reference,
86
+ $URLCompleted = "",
87
+ $URLError = ""
88
+ ){
89
+
90
+ $obj = new stdClass();
91
+
92
+ // Must be in specific order for checksum ---------
93
+ $obj->MerchantID = $this->merchantID;
94
+ $obj->Timestamp = $this->getTimeStamp();
95
+ $obj->Amount = $amount;
96
+ $obj->Country = $country;
97
+ $obj->Currency = $currency;
98
+ $obj->Description = $descr;
99
+ $obj->EndUserIP = $this->getIP();
100
+ $obj->Issuer = $issuer;
101
+ $obj->Language = $lang;
102
+ $obj->OrderID = $orderID;
103
+ $obj->PaymentMethod = $paymentmethod;
104
+ $obj->Reference = $reference;
105
+ $obj->URLCompleted = $URLCompleted;
106
+ $obj->URLError = $URLError;
107
+
108
+
109
+ // ------------------------------------------------
110
+ $obj->Checksum = $this->generateChecksum($obj);
111
+
112
+ return (array)$this->client->Checkout(array('request'=>$obj));
113
+ }
114
+
115
+ public function getPayment($id){
116
+
117
+ $obj = null;
118
+
119
+ // Must be in specific order for checksum ---------
120
+ $obj->MerchantID = $this->merchantID;
121
+ $obj->Timestamp = $this->getTimeStamp();
122
+ $obj->PaymentID = $id;
123
+
124
+ // ------------------------------------------------
125
+ $obj->Checksum = $this->generateChecksum($obj);
126
+ return (array)$this->client->GetPayment(array('request'=>$obj));
127
+ }
128
+
129
+ public function getPremiumRateNumbers(){
130
+
131
+ $obj = null;
132
+
133
+ // Must be in specific order for checksum ---------
134
+ $obj->MerchantID = $this->merchantID;
135
+ $obj->Timestamp = $this->getTimeStamp();
136
+
137
+ // ------------------------------------------------
138
+ $obj->Checksum = $this->generateChecksum($obj);
139
+ return (array)$this->client->GetPremiumRateNumbers(array('request'=>$obj));
140
+ }
141
+
142
+
143
+
144
+ public function completeObject($obj){
145
+ $obj->Checksum = $this->generateChecksum($obj);
146
+ return $obj;
147
+ }
148
+
149
+ }
150
+
151
+
152
+ ?>
app/code/community/Icepay/IceCore/Model/Mysql4/IceCore.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - SQL methods
5
+ * @version 1.0.1
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_Model_Mysql4_IceCore extends Mage_Core_Model_Mysql4_Abstract {
18
+
19
+ protected $modules = null;
20
+
21
+ public function _construct() {
22
+ // Note that the basicgateway_id refers to the key field in the database table.
23
+ $this->_init('icecore/icecore', 'icecore_id');
24
+ }
25
+
26
+ public function getModules() {
27
+
28
+ $modules = array();
29
+
30
+ $mod_namespace = $this->getModuleData("title");
31
+
32
+ foreach ($mod_namespace as $module){
33
+
34
+
35
+ try {
36
+ $class = sprintf("Icepay_Ice%s_Helper_Data",$module["value"]);
37
+ if (class_exists($class)){
38
+ $helper = new $class();
39
+ array_push($modules, array(
40
+ 'id' => $helper->id,
41
+ 'name' => $helper->title,
42
+ 'compatible' => sprintf("Magento %s - %s", $helper->compatibility_oldest_version, $helper->compatibility_latest_version),
43
+ 'compatibleFrom' => $helper->compatibility_oldest_version,
44
+ 'compatibleTo' => $helper->compatibility_latest_version,
45
+ 'active' => $this->getModuleConfiguration("active", $helper->section),
46
+ 'serial' => $this->getModuleConfiguration("serial", $helper->section),
47
+ 'serialreq' => $helper->serial_required,
48
+ 'version' => $helper->version,
49
+ 'fingerprint' => $helper->fingerprint,
50
+ 'namespace' => $helper->section
51
+ ));
52
+ }
53
+
54
+ } catch (Exception $e) {
55
+ Mage::helper("icecore")->log($e->getMessage());
56
+ };
57
+ }
58
+ return $modules;
59
+ }
60
+
61
+ public function isActive($namespace){
62
+ return ($this->getModuleConfiguration("active", $namespace) == "1")?true:false;
63
+ }
64
+
65
+ public function getModulesConfiguration() {
66
+ $moduleData = $this->getModules();
67
+
68
+ for ($i = 0; $i < count($moduleData); $i++) {
69
+ $moduleData[$i]["active"] = $this->getModuleConfiguration("active", $moduleData[$i]["namespace"]);
70
+ $moduleData[$i]["serial"] = $this->getModuleConfiguration("serial", $moduleData[$i]["namespace"]);
71
+ };
72
+
73
+ return $moduleData;
74
+ }
75
+
76
+ public function getModuleData($unique = "title") {
77
+ $conn = $this->_getReadAdapter();
78
+ $select = $conn
79
+ ->select()
80
+ ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
81
+ ->where(new Zend_Db_Expr("path LIKE 'ice%module/" . $unique . "'"))
82
+ ->order('path');
83
+ $data = $conn->fetchAll($select);
84
+ return $data;
85
+ }
86
+
87
+ public function getModuleConfiguration($config = "active", $namespace = "icecore") {
88
+ $conn = $this->_getReadAdapter();
89
+ $select = $conn
90
+ ->select()
91
+ ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
92
+ ->where(new Zend_Db_Expr("path = 'icecore/" . $namespace . "/" . $config . "'"));
93
+ $data = $conn->fetchRow($select);
94
+ return $data["value"];
95
+ }
96
+
97
+ protected function getAuthID() {
98
+ if($this->modules == null) $this->modules = $this->getModules();
99
+ $str = "";
100
+ foreach($this->modules as $module){
101
+ if ($module["serialreq"] == "1" && $module["active"] == "1") $str.= $module["id"];
102
+ }
103
+ return $str;
104
+ }
105
+
106
+ public function getAuthKey($storeID = 0) {
107
+ if($this->modules == null) $this->modules = $this->getModules();
108
+ $arr = array();
109
+ foreach($this->modules as $module){
110
+ if ($module["serialreq"] == "1" && $module["active"] == "1"){
111
+ array_push($arr,sprintf("[%s,%s,%s]",trim($module["id"]),trim($module["fingerprint"]),trim($module["serial"])));
112
+ }
113
+ }
114
+ $str = sprintf("%s,[%s]",Mage::helper('icecore')->getMerchantIDForStore($storeID),implode(",",$arr));
115
+ return sha1($str);
116
+ }
117
+
118
+ /* @sales_order_payment_place_end event */
119
+ public function savePayment(Varien_Event_Observer $observer) {
120
+
121
+ $payment = $observer->getPayment();
122
+ $order = $payment->getOrder();
123
+ $pmName = $payment->getMethodInstance()->getCode();
124
+
125
+ $param = Mage::app()->getFrontController()->getRequest()->getParam('payment');
126
+ $country = (isset($param[$pmName . '_country'])) ? $param[$pmName . '_country'] : $order->getBillingAddress()->getCountryId();
127
+ if ($country == "00")
128
+ $country = $order->getBillingAddress()->getCountryId();
129
+
130
+ $ice_payment = array(
131
+ 'ic_merchantid' => Mage::helper('icecore')->getMerchantIDForStore($order->getStore()->getId()),
132
+ 'ic_currency' => $order->getOrderCurrencyCode(),
133
+ 'ic_amount' => Mage::helper('icecore')->formatTotal($order->getGrandTotal()),//<---- getBaseGrandTotal / getGrandTotal / getQuoteBaseGrandTotal
134
+ //'ic_description' => Mage::helper('icecore')->getTransactionDescription($order->getStore()->getWebsite()->getName()),
135
+ 'ic_description' => Mage::helper('icecore')->getTransactionDescription($order->getRealOrderId()),
136
+ 'ic_country' => $country,
137
+ 'ic_language' => Mage::helper("icecore")->getLangISO2(),
138
+ 'ic_reference' => $order->getRealOrderId(),
139
+ 'ic_paymentmethod' => $param[$pmName . '_paymentmethod'],
140
+ 'ic_issuer' => $param[$pmName . '_issuer'],
141
+ 'ic_orderid' => $order->getRealOrderId(),
142
+ 'ic_moduleid' => $this->getAuthID(),
143
+ 'ic_authkey' => $this->getAuthKey($order->getStore()->getId())
144
+ );
145
+
146
+
147
+ $data = array(
148
+ 'order_id' => $order->getRealOrderId(),
149
+ 'model' => $pmName,
150
+ 'transaction_data' => urlencode(serialize($ice_payment)),
151
+ 'store_id' => $order->getStore()->getId(),
152
+ 'status' => Icepay_IceCore_Model_Config::STATUS_NEW,
153
+ 'update_time' => now(),
154
+ 'creation_time' => now()
155
+ );
156
+
157
+ $this->_getWriteAdapter()->insert($this->getTable('icepay_transactions'), $data);
158
+ }
159
+
160
+ public function loadPaymentByID($id) {
161
+ $conn = $this->_getReadAdapter();
162
+ $select = $conn
163
+ ->select()
164
+ ->from($this->getTable('icepay_transactions'), array('transaction_data', 'status', 'store_id', 'model', 'order_id'))
165
+ ->where(new Zend_Db_Expr("order_id = '" . $id . "'"));
166
+ $data = $conn->fetchRow($select);
167
+ return $data;
168
+ }
169
+
170
+ public function changeStatus(array $data) {
171
+ $where = $this->_getReadAdapter()->quoteInto('order_id = ?', $data["order_id"]);
172
+ $this->_getWriteAdapter()->update(
173
+ $this->getTable('icepay_transactions'),
174
+ $data, $where);
175
+ }
176
+
177
+ }
app/code/community/Icepay/IceCore/controllers/AboutController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Controller About
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_AboutController extends Mage_Core_Controller_Front_Action
18
+ {
19
+
20
+ public function indexAction()
21
+ {
22
+ $this->loadLayout()->renderLayout();
23
+ }
24
+
25
+ }
app/code/community/Icepay/IceCore/controllers/CheckController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Controller Check, misc. check scripts
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_CheckController extends Mage_Core_Controller_Front_Action
18
+ {
19
+ public function indexAction()
20
+ {
21
+ $this->_redirect('icepay/about');
22
+ }
23
+
24
+ //Example: icepay/check/template/module/icepayadvanced
25
+ public function templateAction(){
26
+ $module = strtolower($this->getRequest()->module);
27
+ if (substr($module, 0, 6) != "icepay") die("module must start with icepay");
28
+ $this->getResponse()->setBody(
29
+ $this->getLayout()->createBlock("icecore/front_template")->setTemplate(sprintf("%s/front/check.phtml",$module))->toHtml()
30
+ );
31
+ }
32
+
33
+ }
app/code/community/Icepay/IceCore/controllers/IndexController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Controller Index
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_IndexController extends Mage_Core_Controller_Front_Action
18
+ {
19
+ public function indexAction()
20
+ {
21
+ $this->_redirect('icepay/about');
22
+ }
23
+
24
+
25
+ }
app/code/community/Icepay/IceCore/controllers/ProcessingController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ICEPAY Core - Return process controller
5
+ * @version 1.0.0
6
+ * @author Olaf Abbenhuis
7
+ * @copyright ICEPAY <www.icepay.com>
8
+ *
9
+ * Disclaimer:
10
+ * The merchant is entitled to change de ICEPAY plug-in code,
11
+ * any changes will be at merchant's own risk.
12
+ * Requesting ICEPAY support for a modified plug-in will be
13
+ * charged in accordance with the standard ICEPAY tariffs.
14
+ *
15
+ */
16
+
17
+ class Icepay_IceCore_ProcessingController extends Mage_Core_Controller_Front_Action {
18
+
19
+ public function indexAction() {
20
+ $this->_redirect('icepay/about');
21
+ }
22
+
23
+ public function notifyAction() {
24
+ Mage::getModel('icecore/icepay_postback')->handle($this->getRequest()->getPost());
25
+ }
26
+
27
+ public function resultAction() {
28
+ Mage::getModel('icecore/icepay_result')->handle($this->getRequest()->getQuery());
29
+ }
30
+
31
+ }
app/code/community/Icepay/IceCore/etc/config.xml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Icepay_IceCore>
6
+ <version>1.0.1</version>
7
+ </Icepay_IceCore>
8
+ </modules>
9
+ <frontend>
10
+ <routers>
11
+ <icepay>
12
+ <use>standard</use>
13
+ <args>
14
+ <module>Icepay_IceCore</module>
15
+ <frontName>icepay</frontName>
16
+ </args>
17
+ </icepay>
18
+ </routers>
19
+ <layout>
20
+ <updates>
21
+ <icecore>
22
+ <file>icecore.xml</file>
23
+ </icecore>
24
+ </updates>
25
+ </layout>
26
+ <translate>
27
+ <modules>
28
+ <Icepay_IceCore>
29
+ <files>
30
+ <default>Icepay_IceCore.csv</default>
31
+ </files>
32
+ </Icepay_IceCore>
33
+ </modules>
34
+ </translate>
35
+ </frontend>
36
+ <adminhtml>
37
+ <translate>
38
+ <modules>
39
+ <Icepay_IceCore>
40
+ <files>
41
+ <default>Icepay_IceCore.csv</default>
42
+ </files>
43
+ </Icepay_IceCore>
44
+ </modules>
45
+ </translate>
46
+ <acl>
47
+ <resources>
48
+ <admin>
49
+ <children>
50
+ <system>
51
+ <children>
52
+ <config>
53
+ <children>
54
+ <icecore translate="title" module="icecore">
55
+ <title>icecore Settings</title>
56
+ </icecore>
57
+ </children>
58
+ </config>
59
+ </children>
60
+ </system>
61
+ </children>
62
+ </admin>
63
+ </resources>
64
+ </acl>
65
+ <layout>
66
+ <updates>
67
+ <icecore>
68
+ <file>icecore.xml</file>
69
+ </icecore>
70
+ </updates>
71
+ </layout>
72
+ </adminhtml>
73
+ <global>
74
+ <models>
75
+ <icecore>
76
+ <class>Icepay_IceCore_Model</class>
77
+ <resourceModel>icecore_mysql4</resourceModel>
78
+ </icecore>
79
+ <icecore_mysql4>
80
+ <class>Icepay_IceCore_Model_Mysql4</class>
81
+ <entities>
82
+ <icepay_transactions>
83
+ <table>icepay_transactions</table>
84
+ </icepay_transactions>
85
+ </entities>
86
+ </icecore_mysql4>
87
+ </models>
88
+ <resources>
89
+ <icepaycore_setup>
90
+ <setup>
91
+ <module>Icepay_IceCore</module>
92
+ </setup>
93
+ <connection>
94
+ <use>core_setup</use>
95
+ </connection>
96
+ </icepaycore_setup>
97
+ <icecore_write>
98
+ <connection>
99
+ <use>core_write</use>
100
+ </connection>
101
+ </icecore_write>
102
+ <icecore_read>
103
+ <connection>
104
+ <use>core_read</use>
105
+ </connection>
106
+ </icecore_read>
107
+ </resources>
108
+ <blocks>
109
+ <icecore>
110
+ <class>Icepay_IceCore_Block</class>
111
+ </icecore>
112
+ </blocks>
113
+ <helpers>
114
+ <icecore>
115
+ <class>Icepay_IceCore_Helper</class>
116
+ </icecore>
117
+ </helpers>
118
+ <payment>
119
+ <groups>
120
+ <icepay>ICEPAY</icepay>
121
+ </groups>
122
+ </payment>
123
+ <sales>
124
+ <order>
125
+ <statuses>
126
+ <icecore_new translate="label">
127
+ <label>New</label>
128
+ <visible_on_front/>
129
+ </icecore_new>
130
+ <icecore_open translate="label">
131
+ <label>Awaiting payment</label>
132
+ <visible_on_front/>
133
+ </icecore_open>
134
+ <icecore_ok translate="label">
135
+ <label>Payment received</label>
136
+ </icecore_ok>
137
+ <icecore_err translate="label">
138
+ <label>Payment error</label>
139
+ </icecore_err>
140
+ <icecore_refund translate="label">
141
+ <label>Payment refund request</label>
142
+ </icecore_refund>
143
+ <icecore_cback translate="label">
144
+ <label>Payment chargeback request</label>
145
+ </icecore_cback>
146
+ </statuses>
147
+ <states>
148
+ <pending_payment>
149
+ <statuses>
150
+ <icecore_new/>
151
+ <icecore_open/>
152
+ </statuses>
153
+ <visible_on_front/>
154
+ </pending_payment>
155
+ <processing_payment>
156
+ <statuses>
157
+ <icecore_ok/>
158
+ </statuses>
159
+ <visible_on_front/>
160
+ </processing_payment>
161
+ <cancel_payment>
162
+ <statuses>
163
+ <icecore_err/>
164
+ </statuses>
165
+ <visible_on_front/>
166
+ </cancel_payment>
167
+ </states>
168
+
169
+ </order>
170
+ </sales>
171
+ </global>
172
+ <default>
173
+ <icecore>
174
+ <advancedconfig>
175
+ <language>en_US</language>
176
+ </advancedconfig>
177
+ <core_options>
178
+ <order_autoinvoice>1</order_autoinvoice>
179
+ </core_options>
180
+ </icecore>
181
+ </default>
182
+ </config>
app/code/community/Icepay/IceCore/etc/system.xml ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <sections>
5
+ <icecore translate="label comment" module="icecore">
6
+ <label>ICEPAY</label>
7
+ <tab>sales</tab>
8
+
9
+ <frontend_type>text</frontend_type>
10
+ <class>icepay-section</class>
11
+ <header_css>icepay-header</header_css>
12
+ <sort_order>360</sort_order>
13
+ <show_in_default>1</show_in_default>
14
+ <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
+ <groups>
17
+ <settings translate="label comment">
18
+ <label>Set-up configuration</label>
19
+ <comment>This configuration section is for implementing ICEPAY, please do not change these settings after saving.</comment>
20
+ <expanded>0</expanded>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>0</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <step_1>
28
+ <label>Step 1.</label>
29
+ <frontend_type>Label</frontend_type>
30
+ <sort_order>5</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>0</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ </step_1>
35
+ <merchant_url_ok translate="label comment">
36
+ <label>URL for Success</label>
37
+ <frontend_type>text</frontend_type>
38
+ <frontend_model>icecore/adminhtml_generateURL</frontend_model>
39
+ <tooltip>Copy-Paste this URL to the Success URL section of a (new) ICEPAY merchant account.</tooltip>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>0</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <sort_order>6</sort_order>
44
+ </merchant_url_ok>
45
+ <merchant_url_err translate="label comment">
46
+ <label>URL for Error</label>
47
+ <frontend_type>text</frontend_type>
48
+ <frontend_model>icecore/adminhtml_generateURL</frontend_model>
49
+ <tooltip>Copy-Paste this URL to the Error URL section of a (new) ICEPAY merchant account.</tooltip>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>0</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <sort_order>7</sort_order>
54
+ </merchant_url_err>
55
+ <merchant_url_notify translate="label comment">
56
+ <label>URL for Postback/Notify</label>
57
+ <frontend_type>text</frontend_type>
58
+ <frontend_model>icecore/adminhtml_generateURL</frontend_model>
59
+ <tooltip>Copy-Paste this URL to the Postback URL section of a (new) ICEPAY merchant account.</tooltip>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>0</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <sort_order>8</sort_order>
64
+ </merchant_url_notify>
65
+ <step_2>
66
+ <label>Step 2.</label>
67
+ <frontend_type>label</frontend_type>
68
+ <sort_order>20</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>0</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </step_2>
73
+ <merchant_id>
74
+ <label>Merchant ID</label>
75
+ <frontend_type>text</frontend_type>
76
+ <sort_order>22</sort_order>
77
+ <validate>validate-number validate-length minimum-length-5 maximum-length-5</validate>
78
+ <tooltip>Copy the Merchant ID from your ICEPAY account.</tooltip>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>0</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ </merchant_id>
83
+ <merchant_secret translate="label comment">
84
+ <label>Secret Code</label>
85
+ <frontend_type>text</frontend_type>
86
+ <sort_order>24</sort_order>
87
+ <validate>validate-alphanum validate-length minimum-length-40 maximum-length-40</validate>
88
+ <tooltip>Copy the Secret Code from your ICEPAY account.</tooltip>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>0</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </merchant_secret>
93
+ <step_3>
94
+ <label>Configuration Information</label>
95
+ <frontend_type>label</frontend_type>
96
+ <frontend_model>icecore/adminhtml_checkSettings</frontend_model>
97
+ <sort_order>30</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>0</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ </step_3>
102
+ <manual>
103
+ <label></label>
104
+ <comment>Please read the core manual</comment>
105
+ <frontend_type>label</frontend_type>
106
+ <sort_order>40</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>0</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ </manual>
111
+ </fields>
112
+ </settings>
113
+
114
+ <modules translate="label">
115
+ <label>Installed modules</label>
116
+ <comment>This is an overview of installed ICEPAY modules</comment>
117
+ <expanded>1</expanded>
118
+ <sort_order>100</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>0</show_in_website>
121
+ <show_in_store>0</show_in_store>
122
+ <frontend_type>text</frontend_type>
123
+ <fields>
124
+ <version>
125
+ <label>Modules</label>
126
+ <frontend_model>icecore/adminhtml_grid_modules</frontend_model>
127
+ <sort_order>1</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>0</show_in_website>
130
+ <show_in_store>0</show_in_store>
131
+ </version>
132
+ </fields>
133
+ </modules>
134
+
135
+ <core_options translate="label">
136
+ <label>Options</label>
137
+ <expanded>0</expanded>
138
+ <frontend_type>text</frontend_type>
139
+ <sort_order>10</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>0</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ <fields>
144
+ <order_autoinvoice translate="label">
145
+ <label>Auto invoice</label>
146
+ <comment>Have Magento create the invoice automatically when payment has been completed.</comment>
147
+ <frontend_type>select</frontend_type>
148
+ <source_model>adminhtml/system_config_source_yesno</source_model>
149
+ <sort_order>20</sort_order>
150
+ <show_in_default>1</show_in_default>
151
+ <show_in_website>0</show_in_website>
152
+ <show_in_store>1</show_in_store>
153
+ </order_autoinvoice>
154
+ <transaction_descr translate="label">
155
+ <label>Description on transaction statement of customer</label>
156
+ <comment>Some payment methods allow customized descriptions on the transaction statement. If left empty the Magento Order ID is used. (Max 100 char.)</comment>
157
+ <frontend_type>text</frontend_type>
158
+ <validate>validate-length maximum-length-99</validate>
159
+ <sort_order>40</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>0</show_in_website>
162
+ <show_in_store>1</show_in_store>
163
+ </transaction_descr>
164
+ </fields>
165
+ </core_options>
166
+ </groups>
167
+ </icecore>
168
+ </sections>
169
+ </config>
app/code/community/Icepay/IceCore/sql/icepaycore_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $namespace = Mage::helper('icecore')->section;
4
+
5
+ $installer = $this;
6
+ $installer->startSetup();
7
+
8
+ $conn = $installer->getConnection();
9
+ $conn->insertOnDuplicate($this->getTable('core/config_data'), array('path' => $namespace . '/module/title', 'value' => Mage::helper($namespace)->title), array('value'));
10
+ $conn->insertOnDuplicate($this->getTable('core/config_data'), array('path' => $namespace . '/module/namespace', 'value' => $namespace), array('value'));
11
+ $conn->insertOnDuplicate($this->getTable('core/config_data'), array('path' => $namespace . '/' . $namespace . '/active', 'value' => '1'), array('value'));
12
+
13
+
14
+ $installer->run("
15
+
16
+ CREATE TABLE IF NOT EXISTS `icepay_transactions` (
17
+ `local_id` smallint(6) NOT NULL AUTO_INCREMENT,
18
+ `order_id` varchar(36) NOT NULL DEFAULT '0',
19
+ `model` varchar(32) NOT NULL,
20
+ `transaction_id` int(36) NOT NULL DEFAULT '0',
21
+ `status` varchar(255) NOT NULL DEFAULT '',
22
+ `transaction_data` text,
23
+ `creation_time` datetime DEFAULT NULL,
24
+ `update_time` datetime DEFAULT NULL,
25
+ `store_id` tinyint(4) NOT NULL DEFAULT '0',
26
+ PRIMARY KEY (`local_id`,`order_id`)
27
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ICEPAY transactions';
28
+ ");
29
+
30
+ try {
31
+
32
+ // Magento 1.5 statuscodes
33
+
34
+ $installer->run("
35
+ INSERT INTO `sales_order_status` (`status`, `label`) VALUES
36
+ ('icecore_cback', 'Payment chargeback request'),
37
+ ('icecore_ok', 'Payment received'),
38
+ ('icecore_err', 'Payment error'),
39
+ ('icecore_open', 'Awaiting payment'),
40
+ ('icecore_new', 'New'),
41
+ ('icecore_refund', 'Payment refund request');
42
+
43
+ INSERT INTO `sales_order_status_state` (`status`, `state`, `is_default`) VALUES
44
+ ('icecore_ok', 'processing', 0),
45
+ ('icecore_err', 'canceled', 0),
46
+ ('icecore_open', 'pending_payment', 0),
47
+ ('icecore_new', 'new', 0);
48
+
49
+ ");
50
+
51
+
52
+ } catch (exception $e) {
53
+ Mage::helper('icecore')->log($e->getMessage());
54
+ }
55
+
56
+ $installer->endSetup();
app/code/community/Icepay/IceCore/sql/icepaycore_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+ ALTER TABLE `icepay_transactions` RENAME TO `{$installer->getTable('icepay_transactions')}`;
8
+ ");
9
+
10
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/icecore.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+
4
+ <layout>
5
+ <adminhtml_system_config_edit>
6
+ <reference name="content">
7
+ <block type="icecore/adminhtml_init" name="icecore_init" template="icecore/init.phtml"></block>
8
+ </reference>
9
+ </adminhtml_system_config_edit>
10
+ <basicgateway_adminhtml_icecore_index>
11
+ <reference name="content">
12
+ <block type="icecore/adminhtml_icecore" name="icecore" />
13
+ </reference>
14
+ </basicgateway_adminhtml_icecore_index>
15
+ </layout>
app/design/adminhtml/default/default/template/icepayadvanced/grid_paymentmethods.phtml ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_htmlId = $this->getElement()->getHtmlId() ?>
2
+ <?php $_htmlClass = $this->getElement()->getClass() ?>
3
+ <?php $_htmlName = $this->getElement()->getName() ?>
4
+
5
+ <tr>
6
+
7
+ <td colspan="11" class="grid tier">
8
+ <input id="ice_webservice" type="hidden" name="groups[iceadvanced][fields][webservice_data][value]" value="0"/>
9
+ <table cellspacing="0" class="data border" id="modules_table" style="width:600px">
10
+ <col width="100" />
11
+ <col width="120" />
12
+ <col width="70" />
13
+ <col width="190" />
14
+ <col width="120" />
15
+ <thead>
16
+ <tr class="headings">
17
+ <th><?php echo Mage::helper('iceadvanced')->__('Paymentmethod') ?></th>
18
+ <th><?php echo Mage::helper('iceadvanced')->__('Title') ?></th>
19
+ <th><?php echo Mage::helper('iceadvanced')->__('# Issuers') ?></th>
20
+ <th><?php echo Mage::helper('iceadvanced')->__('Settings') ?></th>
21
+ <th><?php echo Mage::helper('iceadvanced')->__('Active') ?></th>
22
+ </tr>
23
+ </thead>
24
+ <tbody id="<?php echo $_htmlId ?>_container"></tbody>
25
+ <tfoot>
26
+ <tr>
27
+ <td colspan="5" class="a-right"><?php echo $this->getAddButtonHtml() ?></td>
28
+ </tr>
29
+ </tfoot>
30
+ </table>
31
+
32
+
33
+
34
+ <script type="text/javascript" src="<?php echo $this->getJS('tiny_mce/tiny_mce.js'); ?>"></script>
35
+ <script type="text/javascript">
36
+ //<![CDATA[
37
+
38
+ var ICEPAYPaymentMethodRowTemplate = '<tr id="icepay_{{index}}">'
39
+ + '<td>{{pm_img}}</td>'
40
+ + '<td><input class=" required-entry validate-length minimum-length-5 maximum-length-32 input-text" type="text" name="groups[{{module_namespace}}][fields][{{pm_key}}title][value]" value="{{pm_title}}" id="icepay_module_row_{{index}}_serial" style="width:93px;"/></td>'
41
+ + '<td>{{pm_issuers}}</td>'
42
+ + '<td><button type="button" class="scalable " onclick="icepayEditor.open(\'<?php echo $this->_ajaxLoadPaymentMethodURL ?>\', \'icepay_module_row_{{index}}_serial\')" style=""><span><?php echo $this->__('Configure') ?></span></button></td>'
43
+ + '<td><select class="<?php echo $_htmlClass ?>" name="groups[{{module_namespace}}][fields][{{pm_key}}active][value]" id="icepay_pm_row_{{index}}_enabled" {{module_active_switch}}>'
44
+ + '<option value="1"><?php echo Mage::helper("icecore")->__("Enabled")?></option>'
45
+ + '<option value="0"><?php echo Mage::helper("icecore")->__("Disabled")?></option>'
46
+ + '</select></td>'
47
+ + '</tr>';
48
+
49
+ var ICEPAYRetrievedPaymentMethodRowTemplate = '<tr id="icepay_{{index}}">'
50
+ + '<input type="hidden" name="groups[{{module_namespace}}][fields][{{pm_key}}_][value]" id="icepay_pm_row_{{index}}_issuerdata" value="{{pm_issuerdata}}"/>'
51
+ + '<input type="hidden" name="groups[{{module_namespace}}][fields][{{pm_key}}issuer][value]" id="icepay_pm_row_{{index}}_issuerdata" value="{{pm_issuerdata}}"/>'
52
+ + '<td>{{pm_img}}</td>'
53
+ + '<td><input class=" required-entry validate-length minimum-length-5 maximum-length-32 input-text" type="text" name="groups[{{module_namespace}}][fields][{{pm_key}}title][value]" value="{{pm_title}}" id="icepay_module_row_{{index}}_serial" style="width:93px;"/></td>'
54
+ + '<td>{{pm_issuers}}</td>'
55
+ + '<td><?php echo $this->__("Save Config to configure")?></td>'
56
+ + '<td><select class="<?php echo $_htmlClass ?>" name="groups[{{module_namespace}}][fields][{{pm_key}}active][value]" id="icepay_pm_row_{{index}}_enabled" {{module_active_switch}}>'
57
+ + '<option value="1"><?php echo Mage::helper("icecore")->__("Enabled")?></option>'
58
+ + '<option value="0"><?php echo Mage::helper("icecore")->__("Disabled")?></option>'
59
+ + '</select></td>'
60
+ //+ '<input type="hidden" name="groups[{{module_namespace}}][fields][{{pm_key}}code][value]" value="{{pm_code}}"/>'
61
+ + '</tr>';
62
+
63
+ var ICEPAYSettingsTemplate = '<p id="{{msg_id}}" class="{{type}}">{{msg}}</p>';
64
+
65
+
66
+ var ICEPAY = {
67
+
68
+ template: new Template(ICEPAYPaymentMethodRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
69
+ ajaxTemplate: new Template(ICEPAYRetrievedPaymentMethodRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
70
+ msgTemplate: new Template(ICEPAYSettingsTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
71
+
72
+ itemsCount: 0,
73
+ msgCount: 0,
74
+
75
+ addItem : function () {
76
+
77
+ var data = {
78
+ pm_code: '',
79
+ pm_title: '',
80
+ pm_active: '',
81
+ pm_key: '',
82
+ pm_info: '',
83
+ pm_img: '',
84
+ pm_issuers: '',
85
+ pm_issuerdata: '',
86
+ pm_issuerimage: '',
87
+ module_namespace: '',
88
+ module_template: '',
89
+ index: this.itemsCount++
90
+ };
91
+
92
+ data.pm_code = arguments[0];
93
+ data.pm_title = arguments[1];
94
+ data.pm_img = arguments[2];
95
+ data.pm_issuers = arguments[3];
96
+ data.pm_active = arguments[4];
97
+ data.pm_info = arguments[5];
98
+ data.pm_issuerdata = arguments[6];
99
+ data.module_template = (arguments[7])?1:0;
100
+
101
+ data.pm_key = 'pm_'+arguments[0].toLowerCase()+'_';
102
+ data.module_namespace = 'paymentmethod';
103
+
104
+ Element.insert($('<?php echo $_htmlId ?>_container'), {
105
+ bottom : (data.pm_issuerdata)?this.ajaxTemplate.evaluate(data):this.template.evaluate(data)
106
+ });
107
+
108
+ $('icepay_pm_row_' + data.index + '_enabled').selectedIndex = (data.pm_active=="1")?0:1;
109
+
110
+
111
+ },
112
+
113
+ addMessage: function (){
114
+
115
+ var data = {
116
+ type: '',
117
+ msg: '',
118
+ msg_id: '',
119
+ index: this.msgCount++
120
+ };
121
+
122
+
123
+ data.type = arguments[0];
124
+ data.msg = arguments[1];
125
+ data.msg_id = "msg_id_"+ data.index.toString();
126
+
127
+ Element.insert($('icepay_debugger'), {
128
+ bottom : this.msgTemplate.evaluate(data)
129
+ });
130
+
131
+ },
132
+
133
+ clearMessages: function (){
134
+ for(var i=0; i < this.msgCount; i++) {
135
+ try {
136
+ Element.remove($('msg_id_'+i.toString()));
137
+ } catch(err) {
138
+ alert(err.toString())
139
+
140
+ }
141
+ }
142
+ this.msgCount = 0;
143
+ },
144
+
145
+ clearAll: function () {
146
+ for(var i=0; i < this.itemsCount; i++) {
147
+ try {
148
+ Element.remove($('icepay_'+i));
149
+ } catch(err) {}
150
+ }
151
+ this.itemsCount = 0;
152
+ },
153
+
154
+ retrieveFromICEPAY: function() {
155
+ var url = '<?php echo $this->_ajaxGetPaymentMethodsURL ?>';
156
+ var parameters = { };
157
+ new Ajax.Request(url, {
158
+ parameters: parameters,
159
+ onComplete: function(response) {
160
+ if(response.status == 200) {
161
+
162
+ var result = response.responseText.evalJSON();
163
+
164
+ if (result.msg){
165
+ ICEPAY.clearMessages();
166
+ for(var i=0; i < result.msg.length; i++) {
167
+ ICEPAY.addMessage(result.msg[i].type,result.msg[i].msg);
168
+ }
169
+ }
170
+
171
+ if (result.paymentmethods){
172
+
173
+ ICEPAY.clearAll();
174
+ $('ice_webservice').value = 1;
175
+
176
+ for(var i=0; i < result.paymentmethods.length; i++) {
177
+
178
+ var issuers = (result.paymentmethods[i].Issuers.Issuer.length > 0)?result.paymentmethods[i].Issuers.Issuer.length.toString()+" issuers":"1 issuer";
179
+
180
+ ICEPAY.addItem(
181
+ result.paymentmethods[i].PaymentMethodCode,
182
+ result.paymentmethods[i].Description,
183
+ result.paymentmethods[i].Image,
184
+ issuers,
185
+ result.paymentmethods[i].ConfigActive,
186
+ result.paymentmethods[i].ConfigDescription,
187
+ result.issuers[i]["data"]);
188
+ }
189
+ }
190
+ }
191
+ },
192
+ onError: function(response) {
193
+
194
+ }
195
+ })
196
+ return true;
197
+ }
198
+ };
199
+
200
+
201
+ <?php foreach ($this->getPaymentmethods() as $_item): ?>
202
+ <?php if (intval($_item['issuers']) > 0): ?>
203
+ ICEPAY.addItem(
204
+ '<?php echo $_item['code'] ?>',
205
+ '<?php echo $_item['name'] ?>',
206
+ '<?php echo $_item['image'] ?>',
207
+ '<?php echo $_item['issuers'] ?>',
208
+ '<?php echo $_item['active'] ?>',
209
+ '<?php echo $_item['info'] ?>',
210
+ null
211
+ );
212
+ <?php endif; ?>
213
+ <?php endforeach; ?>
214
+
215
+
216
+ var url = '<?php echo $this->_ajaxSavePaymentMethodURL ?>';
217
+ var parameters = { };
218
+
219
+ var icepayEditor = {
220
+ overlayShowEffectOptions : null,
221
+ overlayHideEffectOptions : null,
222
+ open : function(editorUrl, elementId) {
223
+ if (editorUrl && elementId) {
224
+ new Ajax.Request(editorUrl, {
225
+ parameters: {
226
+ element_id: '',//elementId+'_editor',
227
+ store_id: '0'
228
+ },
229
+ onSuccess: function(transport) {
230
+ try {
231
+ this.openDialogWindow(transport.responseText, elementId);
232
+ } catch(e) {
233
+ alert(e.message);
234
+ }
235
+ }.bind(this)
236
+ });
237
+ }
238
+ },
239
+ openDialogWindow : function(content, elementId) {
240
+ this.overlayShowEffectOptions = Windows.overlayShowEffectOptions;
241
+ this.overlayHideEffectOptions = Windows.overlayHideEffectOptions;
242
+ Windows.overlayShowEffectOptions = {duration:0};
243
+ Windows.overlayHideEffectOptions = {duration:0};
244
+
245
+ Dialog.confirm(content, {
246
+ draggable:true,
247
+ resizable:true,
248
+ closable:true,
249
+ className:"magento",
250
+ windowClassName:"popup-window",
251
+ title:'<?php echo $this->__('ICEPAY paymentmethod configuration');?>',
252
+ width:750,
253
+ height:555,
254
+ zIndex:1000,
255
+ recenterAuto:false,
256
+ hideEffect:Element.hide,
257
+ showEffect:Element.show,
258
+ id:"catalog-wysiwyg-editor",
259
+ buttonClass:"form-button",
260
+ okLabel:"<?php echo $this->__('Save settings');?>",
261
+ cancelLabel:"<?php echo $this->__('Cancel');?>",
262
+ ok: this.saveDialogWindow.bind(this),
263
+ cancel: this.closeDialogWindow.bind(this),
264
+ onClose: this.closeDialogWindow.bind(this),
265
+ firedElementId: elementId
266
+ });
267
+
268
+ content.evalScripts.bind(content).defer();
269
+
270
+ },
271
+ saveDialogWindow: function(dialogWindow){
272
+ parameters = $('icepay_paymentmethod').serialize();
273
+ dialogWindow.hide();
274
+
275
+ new Ajax.Request(url, {
276
+ parameters: parameters,
277
+ onComplete: function(response) {
278
+ if(response.status == 200) {
279
+
280
+ }
281
+ },
282
+ onError: function(response) {
283
+ alert("error");
284
+ },
285
+ onSuccess: function(transport) {
286
+ alert(transport.responseText);
287
+ }
288
+
289
+ });
290
+ this.closeDialogWindow(dialogWindow);
291
+
292
+ },
293
+
294
+ okDialogWindow : function(dialogWindow) {
295
+ if (dialogWindow.options.firedElementId) {
296
+ wysiwygObj = eval('wysiwyg'+dialogWindow.options.firedElementId+'_editor');
297
+ wysiwygObj.turnOff();
298
+ if (tinyMCE.get(wysiwygObj.id)) {
299
+ $(dialogWindow.options.firedElementId).value = tinyMCE.get(wysiwygObj.id).getContent();
300
+ } else {
301
+ if ($(dialogWindow.options.firedElementId+'_editor')) {
302
+ $(dialogWindow.options.firedElementId).value = $(dialogWindow.options.firedElementId+'_editor').value;
303
+ }
304
+ }
305
+ }
306
+ this.closeDialogWindow(dialogWindow);
307
+ },
308
+ closeDialogWindow : function(dialogWindow) {
309
+ dialogWindow.close();
310
+ Windows.overlayShowEffectOptions = this.overlayShowEffectOptions;
311
+ Windows.overlayHideEffectOptions = this.overlayHideEffectOptions;
312
+ }
313
+ };
314
+
315
+ //]]>
316
+ </script>
317
+ </td></tr>
app/design/adminhtml/default/default/template/icepayadvanced/paymentmethod.phtml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <form id="icepay_paymentmethod" name="icepay_paymentmethod" >
3
+
4
+ <input type="hidden" name="reference" value="<?php echo $this->getViewData()->module ?>"/>
5
+ <input type="hidden" name="name" value="<?php echo $this->getViewData()->config['title'] ?>"/>
6
+ <input type="hidden" name="store" value="<?php echo $this->scopeID ?>"/>
7
+
8
+ <table class="form-list" cellspacing="0"><colgroup class="label"></colgroup><colgroup class="value"></colgroup><colgroup class="scope-label"></colgroup><colgroup class=""></colgroup><tbody>
9
+
10
+ <tr id="row_iceadvanced_generic_min_order_total">
11
+ <td class="label"><label for="iceadvanced_generic_min_order_total"><?php echo($this->__("Settings for")); ?></label></td>
12
+ <td class="value"><?php echo $this->getViewData()->config['title'] ?></td>
13
+ </tr>
14
+ <tr id="row_iceadvanced_generic_checkout_descr">
15
+ <td class="label"><label for="iceadvanced_generic_checkout_descr"><?php echo($this->__("Description in checkout")); ?></label></td>
16
+ <td class="value"><textarea id="iceadvanced_generic_checkout_descr" name="description" rows="2" cols="4" style="width:300px;height:40px"><?php echo $this->getViewData()->config['description'] ?></textarea>
17
+ <p class="note"><span><?php echo($this->__("Description displayed in checkout")); ?></span></p>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td class="label"><label><?php echo($this->__("Issuers")); ?></label></td>
22
+ <td class="value"><select id="iceadvanced_generic_issuers" name="active_issuers" class=" select multiselect" size="9" multiple="multiple" <?php if(count($this->getViewData()->issuers) == 1)echo('disabled="disabled"'); ?>>
23
+ <?php
24
+ foreach ($this->getViewData()->issuers as $key => $value) {
25
+ $selected = (strstr($this->getViewData()->config['active_issuers'],$value['issuer_code']))?"selected":"";
26
+ echo("<option value=\"{$value['issuer_code']}\" {$selected}>{$value['issuer_name']}</option>");
27
+ }
28
+ ?>
29
+ </select>
30
+ <p class="note"><span><?php echo($this->__("Use CTRL to activate/deactivate specific issuers")); ?></span></p>
31
+ </td>
32
+ </tr>
33
+ <tr id="row_iceadvanced_generic_allowspecific">
34
+ <td class="label"><label for="iceadvanced_generic_allowspecific"> <?php echo($this->__("Payment from Applicable Countries")); ?></label></td>
35
+ <td class="value">
36
+ <select id="iceadvanced_generic_allowspecific" name="allowspecific" class=" select">
37
+ <option value="0" <?php if($this->getViewData()->config['allowspecific'] != 1) echo('selected="selected"') ?>><?php echo($this->__("All Allowed Countries")); ?></option>
38
+ <option value="1" <?php if($this->getViewData()->config['allowspecific'] == 1) echo('selected="selected"') ?>><?php echo($this->__("Specific Countries")); ?></option>
39
+ </select>
40
+ <script type="text/javascript">
41
+ checkDisplay();
42
+ function checkDisplay(){
43
+ specific=$('iceadvanced_generic_allowspecific').value;
44
+ if (!specific || specific!=1){
45
+ $('row_iceadvanced_generic_specificcountry').hide();
46
+ } else {
47
+ $('row_iceadvanced_generic_specificcountry').show();
48
+ };
49
+ };
50
+ Event.observe('iceadvanced_generic_allowspecific', 'change', function(){
51
+ checkDisplay();
52
+ });
53
+ </script>
54
+ </td>
55
+ </tr>
56
+ <tr id="row_iceadvanced_generic_specificcountry">
57
+ <td class="label"><label for="iceadvanced_generic_specificcountry"> <?php echo($this->__("Payment from Specific Countries")); ?></label></td>
58
+ <td class="value"><input name="groups[generic][fields][specificcountry][value]" value="" type="hidden">
59
+ <select id="iceadvanced_generic_specificcountry" name="specificcountry" class=" select multiselect" size="10" multiple="multiple">
60
+ <?php
61
+ foreach ($this->getViewData()->countryCollection as $country) {
62
+ $selected = (strstr($this->getViewData()->config['specificcountry'],$country['value']))?"selected":"";
63
+ echo("<option value=\"{$country['value']}\" {$selected}>{$country['label']}</option>");
64
+ }
65
+ ?>
66
+ </select>
67
+ <p class="note"><span><?php echo($this->__("Use CTRL to select specific countries")); ?></span></p>
68
+ </td>
69
+ </tr>
70
+ <tr id="row_iceadvanced_generic_min_order_total">
71
+ <td class="label"><label for="iceadvanced_generic_min_order_total"> <?php echo($this->__("Minimum Order Total")); ?></label></td>
72
+ <td class="value"><input id="iceadvanced_generic_min_order_total" name="min_order_total" value="<?php echo $this->getViewData()->config['min_order_total'] ?>" class=" input-text" type="text"></td>
73
+ </tr>
74
+ <tr id="row_iceadvanced_generic_max_order_total">
75
+ <td class="label"><label for="iceadvanced_generic_max_order_total"> <?php echo($this->__("Maximum Order Total")); ?></label></td>
76
+ <td class="value"><input id="iceadvanced_generic_max_order_total" name="max_order_total" value="<?php echo $this->getViewData()->config['max_order_total'] ?>" class=" input-text" type="text"></td>
77
+ </tr>
78
+ <tr id="row_iceadvanced_generic_sort_order">
79
+ <td class="label"><label for="iceadvanced_generic_sort_order"> <?php echo($this->__("Sort order")); ?></label></td>
80
+ <td class="value"><input id="iceadvanced_generic_sort_order" name="sort_order" value="<?php echo $this->getViewData()->config['sort_order'] ?>" class=" input-text" type="text"></td>
81
+ </tr>
82
+ </tbody></table>
83
+ </form>
app/design/adminhtml/default/default/template/icepaycore/grid_modules.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_htmlId = $this->getElement()->getHtmlId() ?>
2
+ <?php $_htmlClass = $this->getElement()->getClass() ?>
3
+ <?php $_htmlName = $this->getElement()->getName() ?>
4
+
5
+
6
+
7
+ <tr>
8
+
9
+ <td colspan="11" class="grid tier">
10
+
11
+ <table cellspacing="0" class="data border" id="modules_table" style="width:600px">
12
+ <col width="90" />
13
+ <col width="40" />
14
+ <col width="120" />
15
+ <col width="90" />
16
+ <col width="120" />
17
+ <thead>
18
+ <tr class="headings">
19
+ <th><?php echo Mage::helper('icecore')->__('Module') ?></th>
20
+ <th><?php echo Mage::helper('icecore')->__('Version') ?></th>
21
+ <th><?php echo Mage::helper('icecore')->__('Compatibility') ?></th>
22
+ <th><?php echo Mage::helper('icecore')->__('Active') ?></th>
23
+ <th><?php echo Mage::helper('icecore')->__('Serial') ?></th>
24
+ </tr>
25
+ </thead>
26
+ <tbody id="<?php echo $_htmlId ?>_container"></tbody>
27
+ </table>
28
+
29
+
30
+ <script type="text/javascript">
31
+ //<![CDATA[
32
+ var ICEPAYModuleRowTemplate = '<tr>'
33
+ + '<td>'
34
+ + '{{module_name}}</td>'
35
+ + '<td>{{module_version}}</td>'
36
+ + '<td class="{{module_compatible}}">{{module_compatibility}}</td>'
37
+ + '<td><select class="<?php echo $_htmlClass ?>" name="groups[{{module_namespace}}][fields][active][value]" id="icepay_module_row_{{index}}_enabled" {{module_active_switch}}>'
38
+ + '<option value="1"><?php echo Mage::helper("icecore")->__("Enabled")?></option>'
39
+ + '<option value="0"><?php echo Mage::helper("icecore")->__("Disabled")?></option>'
40
+ + '</select></td>'
41
+ + '<td><input type="text" {{module_serialreq}} name="groups[{{module_namespace}}][fields][serial][value]" value="{{module_serial}}" id="icepay_module_row_{{index}}_serial" style="width:120px;"/></td>'
42
+ + '</tr>';
43
+
44
+
45
+ var ICEPAYControl = {
46
+ template: new Template(ICEPAYModuleRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
47
+ itemsCount: 0,
48
+ addItem : function () {
49
+
50
+ var data = {
51
+ module_name: '',
52
+ module_version: '',
53
+ module_compatibility: '',
54
+ module_active: '',
55
+ module_serial: '',
56
+ module_compatible: '',
57
+ module_serialreq: '',
58
+ module_namespace: '',
59
+ module_active_switch: '',
60
+ index: this.itemsCount++
61
+ };
62
+
63
+ data.module_name = arguments[0];
64
+ data.module_version = arguments[1];
65
+ data.module_compatibility = arguments[2];
66
+ data.module_active = arguments[3];
67
+ data.module_serial = arguments[4];
68
+ data.module_compatible = arguments[5];
69
+ data.module_serialreq = arguments[6];
70
+ data.module_namespace = arguments[7];
71
+ data.module_active_switch = (data.module_namespace == "icecore")?"disabled":"";
72
+
73
+ Element.insert($('<?php echo $_htmlId ?>_container'), {
74
+ bottom : this.template.evaluate(data)
75
+ });
76
+
77
+ $('icepay_module_row_' + data.index + '_enabled').selectedIndex = (data.module_active=="1")?0:1;
78
+
79
+
80
+ },
81
+ };
82
+ <?php foreach ($this->getModules() as $_item): ?>
83
+ ICEPAYControl.addItem('<?php echo $_item['name'] ?>', '<?php echo $_item['version'] ?>', '<?php echo $_item['compatible'] ?>', '<?php echo $_item['active'] ?>', '<?php echo (($_item['serialreq']==0)?"N/A":$_item['serial']) ?>', '<?php echo ((Mage::helper("icecore")->isCompatible($_item['compatibleFrom'],$_item['compatibleTo']))?"":"icemodule_incompatible") ?>','<?php echo (($_item['serialreq']==0)?"disabled":"") ?>','<?php echo ($_item['namespace']) ?>');
84
+ <?php endforeach; ?>
85
+
86
+
87
+
88
+ //]]>
89
+ </script>
90
+
91
+ </td></tr>
app/design/frontend/base/default/layout/icecore.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+
4
+ <layout>
5
+ <icepay_about_index>
6
+ <reference name="content">
7
+ <block type="icecore/front_statement" name="icecore_statement" ></block>
8
+ </reference>
9
+ </icepay_about_index>
10
+ </layout>
app/design/frontend/base/default/template/icepayadvanced/form/default.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $_code = $this->getMethodCode();
4
+
5
+ ?>
6
+
7
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
8
+
9
+ <input type="hidden" name="payment[<?php echo $_code ?>_paymentmethod]" value="<?php echo $this->getPMCode() ?>">
10
+
11
+ <?php if($this->getPMCode()): ?>
12
+ <li>
13
+ <label for="<?php echo $_code ?>_image"><?php
14
+ Mage::helper("icecore")->imageDir = "frontend/base/default/images/icepay/";
15
+ Mage::helper("icecore")->imageExtension = "png";
16
+ echo Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($this->getPMCode()));
17
+ ?></label>
18
+ </li>
19
+ <?php endif; ?>
20
+
21
+ <?php if($this->getTitle()): ?>
22
+ <li>
23
+ <label for="<?php echo $_code ?>_title"><?php echo $this->getTitle() ?></label>
24
+ </li>
25
+ <?php endif; ?>
26
+
27
+ <?php if($this->getDescription()): ?>
28
+ <li>
29
+ <label for="<?php echo $_code ?>_info"><?php echo $this->getDescription() ?></label>
30
+ </li>
31
+ <?php endif; ?>
32
+
33
+ <?php if($this->_issuer): ?>
34
+ <?php if(count($this->_issuer) > 1): ?>
35
+ <li>
36
+ <label for="<?php echo $_code ?>_icepay_issuer" class="required"><em>*</em><?php echo $this->__('Please select an issuer') ?></label>
37
+ <div class="input-box">
38
+ <select id="<?php echo $_code ?>_icepay_issuer" name="payment[<?php echo $_code ?>_issuer]" class="required-entry validate-alpha">
39
+ <option value="" selected><?php echo $this->__('--Please Select--')?></option>
40
+ <?php
41
+ foreach($this->_issuer as $issuer){
42
+ echo('<option value="'.$issuer['value'].'">'.$this->__($issuer['label']).'</option>');
43
+ };
44
+ ?>
45
+ </select>
46
+ </div>
47
+ </li>
48
+ <?php else: ?>
49
+ <input type="hidden" name="payment[<?php echo $_code ?>_issuer]" value="<?php echo $this->_issuer[0]['value'] ?>">
50
+ <?php endif; ?>
51
+ <?php endif; ?>
52
+ </ul>
app/design/frontend/base/default/template/icepaycore/front/check.phtml ADDED
@@ -0,0 +1 @@
 
1
+ The ICEPAY [<?php echo(Mage::helper("iceadvanced")->title);?>] template is accessible.
app/design/frontend/base/default/template/icepaycore/front/statement.phtml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <p><img src="<?php echo($this->getSkinUrl('images/icepay/icepay-logo.png')); ?>"></p>
3
+
4
+ <div id="icepay_statement" style="background-color: #FFF; padding:16px;border-radius: 4px; -moz-border-radius: 4px;-webkit-border-radius: 4px;">
5
+
6
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_line1"); ?></p>
7
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_line2"); ?></p>
8
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_line3"); ?></p>
9
+ <ul>
10
+ <li style="list-style:none; padding-left: 80px; min-height: 75px; background:url(<?php echo($this->getSkinUrl('images/icepay/logo-currence.png'))?>) no-repeat">
11
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_currence"); ?></p>
12
+ </li>
13
+ <li style="list-style:none; padding-left: 80px; min-height: 75px; background:url(<?php echo($this->getSkinUrl('images/icepay/logo-thawte.png'))?>) no-repeat">
14
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_thawte"); ?></p>
15
+ </li>
16
+ <li style="list-style:none; padding-left: 80px; min-height: 75px; background:url(<?php echo($this->getSkinUrl('images/icepay/logo-thuiswinkel.png'))?>) no-repeat">
17
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_thuiswinkel"); ?></p>
18
+ </li>
19
+ </ul>
20
+ <p><?php echo Mage::helper("icecore")->__("icepay_about_link"); ?></p>
21
+ </div>
app/etc/modules/Icepay_IceAdvanced.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Icepay_IceAdvanced>
6
+ <active>true</active>
7
+ <codePool>community</codePool>
8
+ </Icepay_IceAdvanced>
9
+ </modules>
10
+ </config>
app/etc/modules/Icepay_IceCore.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Icepay_IceCore>
6
+ <active>true</active>
7
+ <codePool>community</codePool>
8
+ </Icepay_IceCore>
9
+ </modules>
10
+ </config>
app/locale/en_US/Icepay_IceAdvanced.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*adminhtml*/
2
+ "Please read the advanced manual","<a href="http://www.icepay.com/downloads/pdf/manuals/magento/icepay-manual-magento-advanced.pdf" target="blank" class="btn-manual"></a> <a href="http://www.icepay.nl/webshop-modules/ideal-voor-magento-advanced" target="blank" class="btn-movie"></a><BR/><BR/><BR/><span class="manual-comment">Need help? View our manual or install video!</span>
3
+ "Paymentmethods","Paymentmethods"
4
+ "Filter paymentmethods on customer billing country","Filter paymentmethods on customer billing country"
5
+ "Configure ICEPAY paymentmethods [STORE VIEW]","Configure ICEPAY paymentmethods [STORE VIEW]"
6
+ "SOAP webservices available","SOAP webservices available"
7
+ "SOAP was not found on this server","SOAP was not found on this server"
8
+ "%s paymentmethods in database","%s paymentmethods in database"
9
+ "%s paymentmethods stored for this Store view","%s paymentmethods stored for this Store view"
10
+ "%s paymentmethods stored in Default settings","%s paymentmethods stored in Default settings"
11
+ "No active paymentmethods found","No active paymentmethods found"
12
+ "SOAP connection established","SOAP connection established"
13
+ "%s active paymentmethods found","%s active paymentmethods found"
14
+ "Configure","Configure"
15
+ "Title","Title"
16
+ "Settings","Settings"
17
+ "Settings for","Settings for"
18
+ "Sort order","Sort order"
19
+ "Get paymentmethods","Get paymentmethods"
20
+ "Paymentmethod","Paymentmethod"
21
+ "Save Config to configure","Save Config to configure"
22
+ "Some payment methods allow customized descriptions on the transaction statement. If left empty the Magento Order ID is used. (Max 100 char.)","Some payment methods allow customized descriptions on the transaction statement. If left empty the Magento Order ID is used. (Max 100 char.)"
23
+ "Description displayed in checkout","Description displayed in checkout"
24
+ "Save settings","Save settings"
25
+ "Cancel","Cancel"
26
+ "Use CTRL to activate/deactivate specific issuers","Use CTRL to activate/deactivate specific issuers"
27
+ "Use CTRL to select specific countries","Use CTRL to select specific countries"
28
+
29
+ /*frontend*/
30
+ "Please select an issuer","Please select an issuer"
31
+ "Please select a country","Please select a country"
32
+
app/locale/en_US/Icepay_IceCore.csv ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*headers*/
2
+ "Set-up configuration","Set-up configuration"
3
+ "Installed modules","Installed modules"
4
+
5
+ /*tooltips*/
6
+ "Copy the Merchant ID from your ICEPAY account.","Copy the Merchant ID from your ICEPAY account."
7
+ "Copy the Secret Code from your ICEPAY account.","Copy the Secret Code from your ICEPAY account."
8
+ "Copy-Paste this URL to the Success URL section of a (new) ICEPAY merchant account.","Copy-Paste this URL to the Success URL section of a (new) ICEPAY merchant account."
9
+ "Copy-Paste this URL to the Error URL section of a (new) ICEPAY merchant account.","Copy-Paste this URL to the Error URL section of a (new) ICEPAY merchant account."
10
+ "Copy-Paste this URL to the Postback URL section of a (new) ICEPAY merchant account.","Copy-Paste this URL to the Postback URL section of a (new) ICEPAY merchant account."
11
+
12
+ /*labels*/
13
+ "Merchant ID","Merchant ID"
14
+ "Secret Code","Secret Code"
15
+ "URL for Success","Thank you page"
16
+ "URL for Error","Error page"
17
+ "URL for Postback/Notify","Postback URL"
18
+ "Auto invoice","Auto invoice"
19
+ "Description on transaction statement of customer","Description on transaction statement of customer"
20
+ "Please read the core manual","<a href="http://www.icepay.com/downloads/pdf/manuals/magento/icepay-manual-magento-basic.pdf" target="blank" class="btn-manual"></a> <a href="http://www.icepay.nl/webshop-modules/ideal-voor-magento-basic" target="blank" class="btn-movie"></a><BR/><BR/><BR/><span class="manual-comment">Need help? View our manual or install video!</span>
21
+
22
+ /*comments*/
23
+ "Step 1.","Step 1."
24
+ "Step 2.","Step 2."
25
+ "This configuration section is for implementing ICEPAY, please do not change these settings after saving.","This configuration section is for linking to your <a href="https://www.icepay.com/EN/Login?origin=magento_admin" target="blank">ICEPAY Merchant website</a>, please do not change these settings after saving."
26
+ "Configuration Information","Configuration Information"
27
+ "This is an overview of installed ICEPAY modules",""
28
+ "Have Magento create the invoice automatically when payment has been completed.",""
29
+
30
+ /*notifications*/
31
+ "Merchant ID is properly configured","Merchant ID is properly configured"
32
+ "Merchant ID not set for this storeview","Merchant ID not set for this storeview"
33
+ "Merchant ID does not contain 5 digits","Merchant ID does not contain 5 digits"
34
+ "Merchant ID is not numeric","Merchant ID is not numeric"
35
+ "SecretCode is properly configured","SecretCode is properly configured"
36
+ "SecretCode not set for this storeview","SecretCode not set for this storeview"
37
+ "SecretCode does not contain 40 characters","SecretCode does not contain 40 characters"
38
+
39
+ /*statuscodes*/
40
+ "Awaiting payment","Awaiting payment"
41
+ "Payment received","Payment received"
42
+ "Payment error","Payment error"
43
+ "Payment refund request","Payment refund request"
44
+ "Payment chargeback request","Payment chargeback request"
45
+
46
+ /*statement*/
47
+ "icepay_about_line1","ICEPAY is a Dutch Payment Service Provider that provides online payments for third parties. The following happens when you, the consumer, do a payment to the owner of this web shop ( a customer of ICEPAY): First, the payment goes to ICEPAY ( or Stichting Escrow ICEPAY) and next ICEPAY ensures that the owner of the web shop receives your transaction. ICEPAY is an intermediary party."
48
+ "icepay_about_line2","Hence, ICEPAY does not have any influence on the delivery of the products or services you ordered .In case you have any questions about the delivery/cancellation/refunding of your order, we advise to contact the web shop."
49
+ "icepay_about_line3","Your payment is protected by ICEPAY in different ways, because:"
50
+ "icepay_about_currence","ICEPAY has a <a href='http://www.currence.nl/nl-NL/OverOnzeProducten/LicentieEnCertificaathouders/Pages/iDEAL.aspx' target='_blank'>Currence</a> (owner of iDEAL) iDEAL certification. This way, ICEPAY meets the Currence requirements of the competency guidelines;"
51
+ "icepay_about_thawte","ICEPAY has the Thawte SSL certification. Thus ICEPAY obtains the highest level of authentication during the processing of a payment. This means a guaranteed safe payment environment;"
52
+ "icepay_about_thuiswinkel","ICEPAY is an official business partner of Thuiswinkel.org (the Dutch organization for online shopping). This partnership shows that ICEPAY follows strict rules and regulations concerning privacy, right of withdrawal and dispute settlement."
53
+ "icepay_about_link","<a href='http://www.icepay.com' target='_blank'>Visit the ICEPAY website</a>"
54
+
55
+ /*frontend*/
56
+ "Redirecting...","Redirecting... Please wait a moment"
57
+
58
+ /* postback */
59
+ "Status of order changed","Status of order changed"
60
+ "Customer returned with status: %s","Customer returned with status: %s"
61
+ "The payment provider has returned the following error message: %s","The payment provider has returned the following error message: %s"
app/locale/nl_NL/Icepay_IceAdvanced.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*adminhtml*/
2
+ "Paymentmethods","Betaalmethoden"
3
+ "Filter paymentmethods on customer billing country","Filter de betaalmethoden op het betaaladres van de klant"
4
+ "Configure ICEPAY paymentmethods [STORE VIEW]","Configureer ICEPAY Betaalmethoden, dit kunt u doen per Store View (winkel overzicht)"
5
+ "SOAP webservices available","SOAP webservices zijn beschikbaar"
6
+ "SOAP was not found on this server","SOAP is niet gevonden op deze server"
7
+ "%s paymentmethods in database","%s betaalmethoden in database"
8
+ "%s paymentmethods stored for this Store view","%s betaalmethoden opgeslagen voor dit winkel overzicht"
9
+ "%s paymentmethods stored in Default settings","%s betaalmethoden opgeslagen bij de standaard instellingen"
10
+ "No active paymentmethods found","Geen betaalmethoden gevonden"
11
+ "SOAP connection established","SOAP connectie gemaakt"
12
+ "%s active paymentmethods found","%s actieve betaalmethoden gevonden"
13
+ "Configure","Instellen"
14
+ "Title","Titel"
15
+ "Settings","Instellingen"
16
+ "Settings for","Instellingen voor"
17
+ "Sort order","Sorteer volgorde"
18
+ "Get paymentmethods","Haal de betaalmethoden op"
19
+ "Paymentmethod","Betaalmethode"
20
+ "Save Config to configure","Sla de wijzigingen op om de betaalmethode verder in te stellen"
21
+ "Please read the advanced manual","<a href="http://www.icepay.com/downloads/pdf/manuals/magento/icepay-manual-magento-advanced.pdf" target="blank" class="btn-manual"></a> <a href="http://www.icepay.nl/webshop-modules/ideal-voor-magento-advanced" target="blank" class="btn-movie"></a><BR/><BR/><BR/><span class="manual-comment">Heeft u hulp nodig bij het instellen? Raadpleeg onze handleiding of installatie video.</span>
22
+ "Some payment methods allow customized descriptions on the transaction statement. If left empty the Magento Order ID is used. (Max 100 char.)","Enkele betaalmethoden ondersteunen een omschrijving in het transactie overzicht van de klant. Indien leeg gelaten wordt het Magento Bestel ID gebruikt."
23
+ "Description displayed in checkout","Omschrijving tijdens het afrekenen."
24
+ "Save settings","Instellingen opslaan"
25
+ "Cancel","Annuleer"
26
+ "Use CTRL to activate/deactivate specific issuers","Gebruik CTRL om specifieke issuers aan- of uit te schakelen. Minimaal 1 issuer dient geselecteerd te zijn."
27
+ "Use CTRL to select specific countries","Gebruik CTRL om specifieke landen te selecteren."
28
+
29
+ /*frontend*/
30
+ "Please select an issuer","Maak uw keuze"
31
+ "Please select a country","Maak uw keuze uit"
32
+
app/locale/nl_NL/Icepay_IceCore.csv ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*headers*/
2
+ "Set-up configuration","Installatie configuratie"
3
+ "Installed modules","Geïnstalleerde modules"
4
+
5
+ /*tooltips*/
6
+ "Copy the Merchant ID from your ICEPAY account.","Kopiëer de Merchant ID van uw ICEPAY merchant account"
7
+ "Copy the Secret Code from your ICEPAY account.","Kopiëer de Secret Code van uw ICEPAY merchant account"
8
+ "Copy-Paste this URL to the Success URL section of a (new) ICEPAY merchant account.","Kopiëer en plak deze URL naar het Bedanktpagina veld van uw (nieuwe) ICEPAY merchant website"
9
+ "Copy-Paste this URL to the Error URL section of a (new) ICEPAY merchant account.","Kopiëer en plak deze URL naar het Foutmeldingspagina veld van uw (nieuwe) ICEPAY merchant website"
10
+ "Copy-Paste this URL to the Postback URL section of a (new) ICEPAY merchant account.","Kopiëer en plak deze URL naar het Postbackpagina veld van uw (nieuwe) ICEPAY merchant website"
11
+
12
+ /*labels*/
13
+ "Merchant ID","Merchant ID"
14
+ "Secret Code","Secret Code"
15
+ "URL for Success","Bedanktpagina"
16
+ "URL for Error","Foutmeldingspagina"
17
+ "URL for Postback/Notify","Postback URL"
18
+ "Auto invoice","Automatische facturatie"
19
+ "Description on transaction statement of customer","Omschrijving op het transactie overzicht van de klant"
20
+ "Please read the core manual","<a href="http://www.icepay.com/downloads/pdf/manuals/magento/icepay-manual-magento-basic.pdf" target="blank" class="btn-manual"></a> <a href="http://www.icepay.nl/webshop-modules/ideal-voor-magento-basic" target="blank" class="btn-movie"></a><BR/><BR/><BR/><span class="manual-comment">Heeft u hulp nodig bij het instellen? Raadpleeg onze handleiding of installatie video.</span>
21
+
22
+ /*comments*/
23
+ "Step 1.","Stap 1."
24
+ "Step 2.","Stap 2."
25
+ "This configuration section is for implementing ICEPAY, please do not change these settings after saving.","Deze configuratie is voor het koppelen aan uw <a href="https://www.icepay.com/NL/Login?origin=magento_admin" target="blank">ICEPAY Merchant website</a>. Pas deze instellingen niet meer aan nadat alles correct is opgeslagen."
26
+ "Configuration Information","Informatie over de configuratie"
27
+ "This is an overview of installed ICEPAY modules",""
28
+ "Have Magento create the invoice automatically when payment has been completed.",""
29
+
30
+ /*notifications*/
31
+ "Merchant ID is properly configured","Merchant ID is goed ingesteld"
32
+ "Merchant ID not set for this storeview","Merchant ID is niet ingesteld in dit winkel overzicht"
33
+ "Merchant ID does not contain 5 digits","Merchant ID bevat niet de vereiste 5 cijfers"
34
+ "Merchant ID is not numeric","Merchant ID is geen getal"
35
+ "SecretCode is properly configured","Secret Code is goed ingesteld"
36
+ "SecretCode not set for this storeview","Secret Code is niet ingesteld in dit winkel overzicht"
37
+ "SecretCode does not contain 40 characters","Secret Code bevat niet de vereiste 40 karakters"
38
+
39
+ /*statuscodes*/
40
+ "Awaiting payment","In afwachting van betaling"
41
+ "Payment received","Betaling ontvangen"
42
+ "Payment error","Fout bij betaling"
43
+ "Payment refund request","Refund aanvraag"
44
+ "Payment chargeback request","Chargeback aanvraag"
45
+
46
+ /*statement*/
47
+ "icepay_about_line1","ICEPAY is een Nederlandse Payment Service Provider die online betalingen verzorgt voor derden. Als u als consument een betaling doet aan de eigenaar van deze webshop (een klant van ICEPAY), gaat de betaling eerst naar ICEPAY (of stichting Escrow ICEPAY) en ICEPAY zorgt ervoor dat uw transactie aan de webshop eigenaar wordt uitbetaald."
48
+ "icepay_about_line2","ICEPAY is dus een tussenpartij en heeft geen invloed op de levering van de door u bestelde producten of diensten. Mocht u vragen hebben over de levering/annulering/terugbetaling van uw bestelling, dan raden wij u aan om contact op te nemen met de webshop."
49
+ "icepay_about_line3","Uw betaling is op verschillende manieren door ICEPAY beveiligd doordat:"
50
+ "icepay_about_currence","ICEPAY een iDEAL Certificering van <a href='http://www.currence.nl/nl-NL/OverOnzeProducten/LicentieEnCertificaathouders/Pages/iDEAL.aspx' target='_blank'>Currence</a> (eigenaar iDEAL) heeft. ICEPAY voldoet daarmee aan de gestelde eisen van Currence op het gebied van o.a. techniek, veiligheid en betrouwbaarheid;"
51
+ "icepay_about_thawte","ICEPAY beschikt over de Thawte SSL certificering . Zo verkrijgt ICEPAY het hoogste niveau van authentificatie bij de afhandeling van een betaling. Dit betekent een gegarandeerd veilige betaalomgeving;"
52
+ "icepay_about_thuiswinkel","ICEPAY business partner van Thuiswinkel. org is. Dit verzekert u ervan dat ICEPAY strikte regels op gebied van informatieplicht, privacy, herroepingrecht en geschillenbeslechting naleeft."
53
+ "icepay_about_link","<a href='http://www.icepay.com' target='_blank'>Bezoek de ICEPAY website</a>"
54
+
55
+ /*frontend*/
56
+ "Redirecting...","Een moment geduld a.u.b. U wordt doorgestuurd..."
57
+
58
+ /* postback */
59
+ "Status of order changed","De status van de bestelling is veranderd"
60
+ "Customer returned with status: %s","Klant is teruggekeerd met status: %s"
61
+ "The payment provider has returned the following error message: %s","De betaal provider heeft de volgende foutmelding gegeven: %s"
62
+
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Icepay_IceAdvanced</name>
4
+ <version>1.0.2</version>
5
+ <stability>stable</stability>
6
+ <license>Commercial</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Enables payments using payment service provider ICEPAY.&#xD;
10
+ www.icepay.com</summary>
11
+ <description>Enables payments using payment service provider ICEPAY.&#xD;
12
+ The Advanced extension includes webservice support&#xD;
13
+ This package also contains the Icepay_IceCore extension.</description>
14
+ <notes>Added new webservice location&#xD;
15
+ &#xD;
16
+ Fixed a javascript prototype bug in Magento 1.5&#xD;
17
+ &#xD;
18
+ Fixed stock update bug when cancelled</notes>
19
+ <authors><author><name>Olaf Abbenhuis</name><user>Zechiel</user><email>olaf.abbenhuis@icepay.com</email></author></authors>
20
+ <date>2012-05-07</date>
21
+ <time>13:51:35</time>
22
+ <contents><target name="mageetc"><dir name="modules"><file name="Icepay_IceCore.xml" hash="268e777c318f1cd6258a56c3049ac678"/><file name="Icepay_IceAdvanced.xml" hash="069d0a2d2c7a34e366bc2b79483cd2b4"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Icepay_IceCore.csv" hash="e0d67599dc2088767b8ae2b1b601fec8"/><file name="Icepay_IceAdvanced.csv" hash="dd3ba59aeac6ac11d4071bd3529767cd"/></dir><dir name="nl_NL"><file name="Icepay_IceCore.csv" hash="becf356de17d63f4cd237e03b1d704e8"/><file name="Icepay_IceAdvanced.csv" hash="5fe0b58b6af66ba7cf668e346df80a94"/></dir></target><target name="magecommunity"><dir name="Icepay"><dir name="IceCore"><dir><dir name="Block"><dir name="Adminhtml"><file name="CheckSettings.php" hash="1e37aaa21895b1536895d4b2f2063061"/><file name="GenerateURL.php" hash="1b085eef7e7baff781c814376ab99314"/><dir name="Grid"><file name="Modules.php" hash="10bd64d92a0f0366d6a3ac2a19953725"/></dir><file name="Init.php" hash="0ec5a603fe82b11d7a0a3e7c82265e1a"/></dir><dir name="Front"><file name="Statement.php" hash="85ee089622ff4a3bc15d08f0a2e80813"/><file name="Template.php" hash="06eb31a4a51dc6ee7143d6c8866131d6"/></dir></dir><dir name="Helper"><file name="Data.php" hash="41db575feff9055c3ceb1cd4e1def422"/></dir><dir name="Model"><file name="Config.php" hash="b3bc383849457fdd4a9d7831843d69d3"/><dir name="Icepay"><file name="Postback.php" hash="bd740fee2aab92d452303eccdbe74705"/><file name="Result.php" hash="4bfc63bf6d76d0ddf3045bd855ff9ccc"/><dir name="Webservice"><file name="Api.php" hash="55361b1c85b644cba24be4f2e52c2995"/></dir></dir><dir name="Mysql4"><file name="IceCore.php" hash="4520f28682503a0e9044ba5f6e77d825"/></dir></dir><dir name="controllers"><file name="AboutController.php" hash="9ca5a652dbf27e57cc7bbcb7ed073e1b"/><file name="CheckController.php" hash="901adc45f9c44fa5b1a11dd36eb025d1"/><file name="IndexController.php" hash="01d74f3579ebf469788ee6e7e41d7b21"/><file name="ProcessingController.php" hash="4cbedbf49193562e9739b0a3d00b3dda"/></dir><dir name="etc"><file name="config.xml" hash="e4036f411e67bca4e7cee7ad0a61227a"/><file name="system.xml" hash="b9913d49a5cdb68d664b5ac42373fa2d"/></dir><dir name="sql"><dir name="icepaycore_setup"><file name="mysql4-install-1.0.0.php" hash="28681632944490a776d15c46d41d2e31"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="b1b1dfd41f1aff682dcf34fb544e922e"/></dir></dir></dir></dir><dir name="IceAdvanced"><dir><dir name="Block"><dir name="Adminhtml"><file name="CheckSettings.php" hash="1e9e08f5414b22dd84557ade567aba48"/><dir name="Grid"><file name="Paymentmethods.php" hash="cd01b43615ee520ea2b9153272a77136"/></dir><dir name="Setting"><file name="Paymentmethod.php" hash="dc5548c4bfde0375c3431d8d9972da1f"/></dir></dir><dir name="Payment"><dir name="Form"><file name="Default.php" hash="f96542cd1e5f13f3639ddc93b9c0172c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="8a8fffa309165ee80f62713f21b4e049"/></dir><dir name="Model"><dir name="Checkout"><dir name="Placeholder"><file name="Paymentmethod01.php" hash="b825da0ac49ce5fba409116b2a46bf4f"/><file name="Paymentmethod02.php" hash="202eac322f5cd2df65034476d3e87dd5"/><file name="Paymentmethod03.php" hash="1f193436b77bed331837ab64d148c977"/><file name="Paymentmethod04.php" hash="3d4775f70070381a492b7207fce0d606"/><file name="Paymentmethod05.php" hash="16f86a94192131bddd0f078501c277d2"/><file name="Paymentmethod06.php" hash="113c6788b168790700d2baacbdbcb20c"/><file name="Paymentmethod07.php" hash="50635324e7913f864af6a32a65e299bb"/><file name="Paymentmethod08.php" hash="dba0bf1fb39667ff4b94dcea6821d372"/><file name="Paymentmethod09.php" hash="0029e9dcbb989ac4c6ae686b5d2db262"/><file name="Paymentmethod10.php" hash="94ff83c6d23c879f27c958de595bff3b"/><file name="Paymentmethod11.php" hash="4725cefbb4cdc69d12961853b4c00d13"/><file name="Paymentmethod12.php" hash="b82d7e8830a7b22f942496614d84f2ed"/><file name="Paymentmethod13.php" hash="43f18f4948afc2f7613b3ad47baa2577"/><file name="Paymentmethod14.php" hash="a04a63494d6e4df283049abfe35f57f8"/><file name="Paymentmethod15.php" hash="a5d02861c4668c74492b1865d471afdf"/><file name="Paymentmethod16.php" hash="a9d90c5414e27f814aa7b1ff1e212682"/><file name="Paymentmethod17.php" hash="e55127cbf73fecbb8ec66848f300c414"/><file name="Paymentmethod18.php" hash="388c76235c1c35a97ab8893d1f672807"/><file name="Paymentmethod19.php" hash="454f5142fb3e17152c137a052e13294c"/><file name="Paymentmethod20.php" hash="638b60e75678908fc92df8b1469a2500"/></dir><file name="Standard.php" hash="3f6a56690d461f55c318220517159666"/></dir><dir name="Mysql4"><file name="IceAdvanced.php" hash="a90249053b0d3a6d7f5fad08dccc30c5"/></dir><file name="Observer.php" hash="fc323f07dac9aaa7b40b6cd5181be532"/><file name="Pay.php" hash="dcd186a140f5825816529fc23529eaad"/><file name="Webservice.php" hash="efe3cb1bf8e7a45132cfe8ed52e2c92c"/></dir><dir name="controllers"><file name="AjaxController.php" hash="5663eb36613923b2ccd9ede56787a0c9"/><file name="ConfigController.php" hash="9be40c50c69981034a9787a1f2e005f1"/><file name="ProcessingController.php" hash="63cb674cef9e11f20372cea2cf4d49c8"/></dir><dir name="etc"><file name="config.xml" hash="2386aab1c38666258f483016fd39f557"/><file name="system.xml" hash="d8b509ef49a7037cca8f5215a0551fd3"/></dir><dir name="sql"><dir name="icepayadvanced_setup"><file name="mysql4-install-1.0.0.php" hash="f0b069a3503871e8221dc30441012e56"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="6c771822888f14d9679f6b4ab71719c0"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="icepay"><file name="icepay-logo.png" hash="155f2d4dd137423ccbc3d4037cf46d5f"/><file name="logo-currence.png" hash="fa37b87e496d9955ef455e96251bd434"/><file name="logo-thawte.png" hash="dcf93e2d0631b1e2853ce8380d80c125"/><file name="logo-thuiswinkel.png" hash="4a54a5f4e09988a4b16697fe54a462e7"/><file name="nologo.png" hash="72e977c925c8b6c70ff5fb69c0e054c8"/><dir name="nl"><file name="creditcard.png" hash="1036251ede1a09299feecb75043d6e16"/><file name="ddebit.png" hash="2efd78c91a6558f0e5e71a4cdc6f82e4"/><file name="directebank.png" hash="70c2f9d0c6726b7b4b72b97437ed137b"/><file name="elv.png" hash="cdb571467e6e3f0718887ea5c6e9dc24"/><file name="giropay.png" hash="57167e2c98a48f3a24b1743e74f6158a"/><file name="icepay.png" hash="39a55d71460ccce2b65517ce40d3826a"/><file name="ideal.png" hash="fc18c3e422e4163afee4646623b2569b"/><file name="mistercash.png" hash="84164ec464031eb983cf971c93883291"/><file name="nologo.png" hash="59b4f3e8abf4cd51d1c5ab9f1a425999"/><file name="paypal.png" hash="944b54460b95c4842ce19982264e577d"/><file name="paysafecard.png" hash="23deaae36aa2cb0d7ef1c04804e30145"/><file name="wallie.png" hash="489236d8a7d678f355d6401a1f34dd5b"/><file name="wire.png" hash="63be6b74df1fc107d31e7830756ae39b"/></dir><dir name="en"><file name="creditcard.png" hash="1036251ede1a09299feecb75043d6e16"/><file name="ddebit.png" hash="408f41a0650a204cadb791c3e1b0e1a1"/><file name="directebank.png" hash="65bea681edb8442463b96ca0a6d2f604"/><file name="elv.png" hash="cdb571467e6e3f0718887ea5c6e9dc24"/><file name="giropay.png" hash="57167e2c98a48f3a24b1743e74f6158a"/><file name="icepay.png" hash="39a55d71460ccce2b65517ce40d3826a"/><file name="ideal.png" hash="fc18c3e422e4163afee4646623b2569b"/><file name="mistercash.png" hash="84164ec464031eb983cf971c93883291"/><file name="nologo.png" hash="72e977c925c8b6c70ff5fb69c0e054c8"/><file name="paypal.png" hash="944b54460b95c4842ce19982264e577d"/><file name="paysafecard.png" hash="23deaae36aa2cb0d7ef1c04804e30145"/><file name="wallie.png" hash="489236d8a7d678f355d6401a1f34dd5b"/><file name="wire.png" hash="d61bac01ea81d71bebc03f484b883c12"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="icepay"><file name="admin.css" hash="21126dd9de5b86311f8bd9ff8da82f8f"/><file name="general.css" hash="f2d7fc0cfb170a997892a6a3589cf7fc"/><dir name="images"><file name="icepay-logo.png" hash="584d79128e6df216e9f7304329158b56"/><file name="section-logo.png" hash="5242ece5dd1434831174ef7fba8c2c4a"/><file name="error_msg_icon.gif" hash="e4f28607f075a105e53fa3113d84bd26"/><file name="success_msg_icon.gif" hash="834dfafd5f8b44c4b24a4c00add56fcf"/><file name="nologo.png" hash="57404bbcfb3e5a70239d3085e14471cc"/><file name="button-manual.png" hash="7b708db3c8915897a4e3526389b7e3b2"/><file name="button-movie.png" hash="c164da277349322fcd4480ece39d6e00"/><dir name="nl"><file name="creditcard.png" hash="48a101cac247f07311ef3ccf1075092d"/><file name="ddebit.png" hash="89793240543046ce977a11eee9b99368"/><file name="directebank.png" hash="ec990be24336501593956872b5a69a0c"/><file name="elv.png" hash="af722d1a80025fbef18faf9baafe91e3"/><file name="giropay.png" hash="5e167cb8dbe05391b1ecceb02042a158"/><file name="ideal.png" hash="16ecbed935f5fb896620c1ec60d5fecd"/><file name="mistercash.png" hash="fe437531e8ea3160dd3ce7c22c6d1dd7"/><file name="nologo.png" hash="57404bbcfb3e5a70239d3085e14471cc"/><file name="paypal.png" hash="4d28dd0b563dcffb4192b5fe54a43530"/><file name="paysafecard.png" hash="55a46938a74dbba9f8fa2c63e464ae98"/><file name="wallie.png" hash="643897c26a2ad7be40457bc1faafd591"/><file name="wire.png" hash="6027a80b16b699c299e748fc1f891b03"/></dir><dir name="en"><file name="creditcard.png" hash="a1f1758c0ed18c576daddfad4e287dcf"/><file name="ddebit.png" hash="8eaa9ca96554a065bba75f3a3c62c25b"/><file name="directebank.png" hash="ec990be24336501593956872b5a69a0c"/><file name="elv.png" hash="af722d1a80025fbef18faf9baafe91e3"/><file name="giropay.png" hash="abbc084008a2bc4692cee1e014e88e01"/><file name="ideal.png" hash="3ad4441b5e59613b07efad0b4c781812"/><file name="mistercash.png" hash="fe437531e8ea3160dd3ce7c22c6d1dd7"/><file name="nologo.png" hash="57404bbcfb3e5a70239d3085e14471cc"/><file name="paypal.png" hash="db854b8832246666da38130f2d527331"/><file name="paysafecard.png" hash="d9fac94c828b6429641e74f027a6e23d"/><file name="wallie.png" hash="9bbc206f96bfeb2ec82a47d6ecbae4b9"/><file name="wire.png" hash="f602b0978725d2663fe69c93276cace0"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="icecore.xml" hash="98b5a6c55a72ba244b21a5815ae0c4fc"/></dir><dir name="template"><dir name="icepaycore"><file name="grid_modules.phtml" hash="a386ca826b2386094d54cce23fb90170"/></dir><dir name="icepayadvanced"><file name="grid_paymentmethods.phtml" hash="a51bddb36fc3c64f0955571030172313"/><file name="paymentmethod.phtml" hash="ad3f14775491b77a69c9943eb6a767a5"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="icecore.xml" hash="96ed3cf67c702affdb8869e1a6c5d980"/></dir><dir name="template"><dir name="icepaycore"><dir><dir name="front"><file name="check.phtml" hash="ae5608fb727b2457af10c7bd9faee6d9"/><file name="statement.phtml" hash="7cc11055297c480e75b6f082c41bdaa6"/></dir></dir></dir><dir name="icepayadvanced"><dir><dir name="form"><file name="default.phtml" hash="fdf9eb2d5c4a5ef8f43f6e9d8090ebd4"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>
skin/adminhtml/default/default/icepay/admin.css ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #row_icecore_settings_step_1,
3
+ #row_icecore_settings_step_2,
4
+ #row_icecore_settings_step_3 {
5
+ font-weight: bold;
6
+ border-bottom-width: 1px;
7
+ border-bottom-style: solid;
8
+ border-bottom-color: #333;
9
+ }
10
+ #row_icecore_settings_step_1 .scope-label,
11
+ #row_icecore_settings_step_1 .use-default,
12
+ #row_icecore_settings_step_2 .scope-label,
13
+ #row_icecore_settings_step_2 .use-default,
14
+ #row_icecore_settings_step_3 .scope-label,
15
+ #row_icecore_settings_step_3 .use-default,
16
+ #row_icecore_settings_manual .scope-label,
17
+ #row_icecore_settings_manual .use-default,
18
+ #row_icecore_settings_merchant_url_notify .use-default,
19
+ #row_icecore_settings_merchant_url_ok .use-default,
20
+ #row_icecore_settings_merchant_url_err .use-default,
21
+ #row_icecore_advanced_settings_info .scope-label,
22
+ #row_icecore_advanced_settings_info .use-default,
23
+ #row_icecore_advanced_settings_manual .scope-label,
24
+ #row_icecore_advanced_settings_manual .use-default
25
+
26
+ {
27
+ display: none;
28
+ }
29
+
30
+ #row_icecore_settings_merchant_url_notify input,
31
+ #row_icecore_settings_merchant_url_ok input,
32
+ #row_icecore_settings_merchant_url_err input,
33
+ #row_icecore_settings_merchant_id input,
34
+ #row_icecore_settings_merchant_secret input {
35
+ width: 316px;
36
+ }
37
+
38
+
39
+ #row_icecore_settings_merchant_url_notify label,
40
+ #row_icecore_settings_merchant_url_ok label,
41
+ #row_icecore_settings_merchant_url_err label,
42
+ #row_icecore_settings_merchant_url_notify label,
43
+ #row_icecore_settings_merchant_id label,
44
+ #row_icecore_settings_merchant_secret label
45
+ {
46
+ margin-left: 20px;
47
+ }
48
+
49
+ /* manual links */
50
+ #row_icecore_settings_manual .note,
51
+ #row_icecore_advanced_settings_manual .note {
52
+ width: 310px;
53
+ }
54
+
55
+ #row_icecore_settings_manual .btn-manual,
56
+ #row_icecore_settings_manual .btn-movie,
57
+ #row_icecore_advanced_settings_manual .btn-manual,
58
+ #row_icecore_advanced_settings_manual .btn-movie {
59
+ display: inline-block;
60
+ background-image: url("images/button-manual.png");
61
+ background-repeat: no-repeat;
62
+ background-attachment: scroll;
63
+ background-position: 0px 0px;
64
+ width: 150px;
65
+ height: 50px;
66
+ float: left;
67
+ margin-right: 4px;
68
+ }
69
+ #row_icecore_settings_manual .btn-movie,
70
+ #row_icecore_advanced_settings_manual .btn-movie {
71
+ background-image: url("images/button-movie.png");
72
+ }
73
+
74
+
75
+ .icepay_issuer {
76
+ font-size: 9px;
77
+ border-bottom: 1px solid #dadfe0;
78
+ /*white-space: nowrap;*/
79
+ }
80
+
81
+ .icepay_url_form {
82
+ padding: 2px;
83
+ width: 274px;
84
+ color:#6f8992;
85
+ }
86
+
87
+ .icepay_debug {
88
+ padding: 4px;
89
+ font-size: 9px;
90
+ font-weight: bold;
91
+ border: 1px solid #c8c8c8;
92
+ }
93
+ .icepay_debug .ok{
94
+ color: #3d6611;
95
+ background-color: #eff5ea;
96
+ background-image: url("images/success_msg_icon.gif");
97
+ background-repeat: no-repeat;
98
+ background-attachment: scroll;
99
+ background-position: 0px 0px;
100
+ padding-left: 20px;
101
+ }
102
+ .icepay_debug .err{
103
+ color: #eb5e00;
104
+ background-color: #fff9e9;
105
+ background-image: url("images/error_msg_icon.gif");
106
+ background-repeat: no-repeat;
107
+ background-attachment: scroll;
108
+ background-position: 0px 0px;
109
+ padding-left: 20px;
110
+ }
111
+
112
+ .icemodule_incompatible {
113
+ background-color: #fff9e9;
114
+ font-size: 11px;
115
+ font-weight: bold;
116
+ color: #eb5e00;
117
+ }
118
+
119
+ #icepay_statement table {
120
+ border: 1px solid #D9DEE4;
121
+ }
122
+
123
+ #icepay_statement td {
124
+ background-color: #FAFBFF;
125
+ font-family: Arial, Verdana, sans-serif;
126
+ color: #7093a9;
127
+ font-size: 12px;
128
+ padding: 8px;
129
+ text-align: left;
130
+ }
131
+
132
+ .content-header h3 {
133
+ background:url(images/icepay-logo.png) no-repeat 0 0; height:0; overflow:hidden; padding:59px 0 0; width:224px; display:block;
134
+ }
skin/adminhtml/default/default/icepay/general.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+
2
+ h3.icepay-header { background:url(images/section-logo.png) no-repeat 0 0; height:0; overflow:hidden; padding:18px 0 0; width:89px; }
3
+
4
+ ul.tabs a.icepay-section,
5
+ ul.tabs a.icepay-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.icepay-section:hover { background-color:#d8e6e6; }
7
+ ul.tabs a.icepay-section.active, ul.tabs a.icepay-section.active:hover { background-color:#fff; }
8
+ ul.tabs a.icepay-section span,
9
+ ul.tabs a.icepay-section:hover span { background:url(images/section-logo.png) no-repeat 0 0; height:0; overflow:hidden; padding:18px 0 0; width:89px; }
skin/adminhtml/default/default/icepay/images/button-manual.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/button-movie.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/creditcard.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/ddebit.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/directebank.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/elv.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/giropay.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/ideal.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/mistercash.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/nologo.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/paypal.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/paysafecard.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/wallie.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/en/wire.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/error_msg_icon.gif ADDED
Binary file
skin/adminhtml/default/default/icepay/images/icepay-logo.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/creditcard.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/ddebit.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/directebank.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/elv.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/giropay.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/ideal.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/mistercash.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/nologo.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/paypal.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/paysafecard.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/wallie.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nl/wire.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/nologo.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/section-logo.png ADDED
Binary file
skin/adminhtml/default/default/icepay/images/success_msg_icon.gif ADDED
Binary file
skin/frontend/base/default/images/icepay/en/creditcard.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/ddebit.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/directebank.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/elv.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/giropay.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/icepay.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/ideal.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/mistercash.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/nologo.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/paypal.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/paysafecard.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/wallie.png ADDED
Binary file
skin/frontend/base/default/images/icepay/en/wire.png ADDED
Binary file
skin/frontend/base/default/images/icepay/icepay-logo.png ADDED
Binary file
skin/frontend/base/default/images/icepay/logo-currence.png ADDED
Binary file
skin/frontend/base/default/images/icepay/logo-thawte.png ADDED
Binary file
skin/frontend/base/default/images/icepay/logo-thuiswinkel.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/creditcard.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/ddebit.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/directebank.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/elv.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/giropay.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/icepay.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/ideal.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/mistercash.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/nologo.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/paypal.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/paysafecard.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/wallie.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nl/wire.png ADDED
Binary file
skin/frontend/base/default/images/icepay/nologo.png ADDED
Binary file