Version Notes
- Fixed Compilation bug
- Fixed UTF-8 Afterpay issue
- Fixed recurring payment issuers being shown during checkout
- Fixed broken manual buttons
- Started code cleanup
Download this release
Release Info
Developer | ICEPAY |
Extension | Icepay_IceAdvanced |
Version | 1.1.9 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.1.9
- app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Grid/Paymentmethods.php +32 -27
- app/code/community/Icepay/IceAdvanced/Helper/Data.php +28 -59
- app/code/community/Icepay/IceAdvanced/Model/Checkout/PaymentObject.php +236 -0
- app/code/community/Icepay/IceAdvanced/Model/Checkout/Standard.php +46 -27
- app/code/community/Icepay/IceAdvanced/Model/Extensions/MS/Customerreward.php +14 -10
- app/code/community/Icepay/IceAdvanced/Model/Extensions/MW/GiftWrap.php +14 -10
- app/code/community/Icepay/IceAdvanced/Model/Mysql4/IceAdvanced.php +225 -214
- app/code/community/Icepay/IceAdvanced/Model/Observer.php +63 -42
- app/code/community/Icepay/IceAdvanced/Model/Order.php +640 -0
- app/code/community/Icepay/IceAdvanced/Model/Pay.php +142 -125
- app/code/community/Icepay/IceAdvanced/Model/Paymentmethods.php +110 -0
- app/code/community/Icepay/IceAdvanced/Model/Webservice.php +0 -219
- app/code/community/Icepay/IceAdvanced/Model/Webservice/Advanced.php +91 -0
- app/code/community/Icepay/IceAdvanced/Model/icepay_api_order.php +0 -783
- app/code/community/Icepay/IceAdvanced/controllers/AjaxController.php +2 -3
- app/code/community/Icepay/IceAdvanced/controllers/ProcessingController.php +8 -7
- app/code/community/Icepay/IceAdvanced/etc/config.xml +1 -1
- app/code/community/Icepay/IceAdvanced/etc/system.xml +0 -9
- app/code/community/Icepay/IceCore/Block/Adminhtml/Init.php +14 -17
- app/code/community/Icepay/IceCore/Helper/Data.php +72 -60
- app/code/community/Icepay/IceCore/Model/Icepay/Webservice/Api.php +0 -146
- app/code/community/Icepay/IceCore/Model/Mysql4/IceCore.php +70 -60
- app/code/community/Icepay/IceCore/Model/Webservice/Core.php +83 -0
- app/code/community/Icepay/IceCore/etc/system.xml +3 -3
- app/design/adminhtml/default/default/template/icepayadvanced/form/default.phtml +52 -0
- app/design/adminhtml/default/default/template/icepayadvanced/grid_paymentmethods.phtml +289 -304
- app/design/adminhtml/default/default/template/icepayadvanced/paymentmethod.phtml +79 -77
- app/design/adminhtml/default/default/template/icepaycore/grid_modules.phtml +68 -79
- app/locale/en_US/Icepay_IceAdvanced.csv +1 -1
- app/locale/en_US/Icepay_IceCore.csv +1 -1
- package.xml +11 -7
- skin/adminhtml/default/default/icepay/admin.css +1 -1
app/code/community/Icepay/IceAdvanced/Block/Adminhtml/Grid/Paymentmethods.php
CHANGED
@@ -13,60 +13,65 @@
|
|
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'
|
31 |
-
$this->_ajaxSavePaymentMethodURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/save_paymentmethod', array('_secure'=>true, 'store'
|
32 |
-
$this->_ajaxGetPaymentMethodsURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/get_paymentmethods', array('_secure'=>true, 'store'
|
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 |
-
|
|
|
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 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
$button->setName('add_tier_price_item_button');
|
71 |
|
72 |
$this->setChild('add_button', $button);
|
@@ -76,11 +81,11 @@ class Icepay_IceAdvanced_Block_Adminhtml_Grid_PaymentMethods extends Mage_Adminh
|
|
76 |
} else {
|
77 |
$this->getLayout()->getBlock('head')->addItem('skin_css', 'lib/prototype/windows/themes/magento.css');
|
78 |
}
|
79 |
-
|
80 |
$this->getLayout()
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
return parent::_prepareLayout();
|
85 |
}
|
86 |
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
|
|
16 |
class Icepay_IceAdvanced_Block_Adminhtml_Grid_PaymentMethods extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface {
|
17 |
|
18 |
protected $_element;
|
19 |
protected $_scope;
|
|
|
20 |
protected $_ajaxLoadPaymentMethodURL;
|
21 |
protected $_ajaxSavePaymentMethodURL;
|
22 |
protected $_ajaxGetPaymentMethodsURL;
|
|
|
23 |
protected $debug;
|
24 |
|
25 |
+
public function __construct()
|
26 |
+
{
|
27 |
$this->_scope = Mage::app()->getStore(Mage::helper("icecore")->getStoreFromRequest())->getId();
|
28 |
+
$this->_ajaxLoadPaymentMethodURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/config/index/paymentmethod/{{pm_code}}', array('_secure' => true, 'store' => $this->_scope, '_store' => Mage::app()->getDefaultStoreView()));
|
29 |
+
$this->_ajaxSavePaymentMethodURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/save_paymentmethod', array('_secure' => true, 'store' => $this->_scope, '_store' => Mage::app()->getDefaultStoreView()));
|
30 |
+
$this->_ajaxGetPaymentMethodsURL = Mage::helper('adminhtml')->getUrl('icepayadvanced/ajax/get_paymentmethods', array('_secure' => true, 'store' => $this->_scope, '_store' => Mage::app()->getDefaultStoreView()));
|
31 |
+
|
32 |
$this->setTemplate('icepayadvanced/grid_paymentmethods.phtml');
|
33 |
}
|
34 |
+
|
35 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
36 |
+
{
|
37 |
$this->setElement($element);
|
38 |
return $this->toHtml();
|
39 |
}
|
40 |
|
41 |
+
public function setElement(Varien_Data_Form_Element_Abstract $element)
|
42 |
+
{
|
43 |
$this->_element = $element;
|
44 |
return $this;
|
45 |
}
|
46 |
|
47 |
+
public function getElement()
|
48 |
+
{
|
49 |
return $this->_element;
|
50 |
}
|
51 |
|
52 |
+
public function getJS($uri)
|
53 |
+
{
|
54 |
+
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS, true) . $uri;
|
55 |
}
|
56 |
|
57 |
+
public function getPaymentmethods()
|
58 |
+
{
|
59 |
return Mage::getSingleton('iceadvanced/mysql4_iceAdvanced')->getAdminPaymentmethodConfigForStore($this->_scope);
|
60 |
}
|
61 |
|
62 |
+
public function getAddButtonHtml()
|
63 |
+
{
|
64 |
return $this->getChildHtml('add_button');
|
65 |
}
|
66 |
+
|
67 |
+
protected function _prepareLayout()
|
68 |
+
{
|
69 |
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
70 |
+
->setData(array(
|
71 |
+
'label' => Mage::helper('icecore')->__('Get paymentmethods'),
|
72 |
+
'onclick' => 'return ICEPAY.retrieveFromICEPAY()',
|
73 |
+
'class' => 'add'
|
74 |
+
));
|
75 |
$button->setName('add_tier_price_item_button');
|
76 |
|
77 |
$this->setChild('add_button', $button);
|
81 |
} else {
|
82 |
$this->getLayout()->getBlock('head')->addItem('skin_css', 'lib/prototype/windows/themes/magento.css');
|
83 |
}
|
84 |
+
|
85 |
$this->getLayout()
|
86 |
+
->getBlock('head')
|
87 |
+
->addItem('js_css', 'prototype/windows/themes/default.css');
|
88 |
+
|
89 |
return parent::_prepareLayout();
|
90 |
}
|
91 |
|
app/code/community/Icepay/IceAdvanced/Helper/Data.php
CHANGED
@@ -16,52 +16,21 @@
|
|
16 |
class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
17 |
/* Install values */
|
18 |
|
19 |
-
public $title =
|
20 |
-
public $version =
|
21 |
-
public $id =
|
22 |
-
public $fingerprint =
|
23 |
-
public $compatibility_oldest_version =
|
24 |
-
public $compatibility_latest_version =
|
25 |
-
public $section =
|
26 |
-
public $serial_required =
|
27 |
-
public $filteredPaymentmethods = array(
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
$lines = array();
|
34 |
-
$checkMerchant = true;
|
35 |
-
$checkCode = true;
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
/* Check Merchant ID */
|
40 |
-
$check = Mage::helper("icecore")->validateMerchantID($this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID));
|
41 |
-
array_push($lines, array(
|
42 |
-
'id' => "merchantid",
|
43 |
-
'line' => $check["msg"],
|
44 |
-
'result' => ($check["val"] ? "ok" : "err")));
|
45 |
-
$checkMerchant = $check["val"] ? true : false;
|
46 |
-
|
47 |
-
/* Check SecretCode */
|
48 |
-
$check = Mage::helper("icecore")->validateSecretCode($this->getValueForStore(Icepay_IceCore_Model_Config::SECRETCODE));
|
49 |
-
array_push($lines, array(
|
50 |
-
'id' => "secretcode",
|
51 |
-
'line' => $check["msg"],
|
52 |
-
'result' => ($check["val"] ? "ok" : "err")));
|
53 |
-
$checkCode = $check["val"] ? true : false;
|
54 |
-
|
55 |
-
/* The MerchantID and SecretCode checks will not be displayed in this module */
|
56 |
-
if (!$checkMerchant || !$checkCode) {
|
57 |
-
$lines = array();
|
58 |
-
array_push($lines, array(
|
59 |
-
'id' => "merchant",
|
60 |
-
'line' => $this->__("Merchant settings are incorrect"),
|
61 |
-
'result' => "err"));
|
62 |
-
} else
|
63 |
-
$lines = array();
|
64 |
-
|
65 |
/* Check SOAP */
|
66 |
$check = Mage::helper("icecore")->hasSOAP();
|
67 |
array_push($lines, array(
|
@@ -90,21 +59,22 @@ class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
90 |
'line' => $check["msg"],
|
91 |
'result' => ($check["val"]) ? "ok" : "err"));
|
92 |
}
|
93 |
-
|
94 |
$adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
95 |
-
|
96 |
if ($adv_sql->getPMbyCode('afterpay')) {
|
97 |
if (Mage::getModel('tax/config')->getAlgorithm() != Mage_Tax_Model_Calculation::CALC_UNIT_BASE)
|
98 |
array_push($lines, array(
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
}
|
103 |
|
104 |
return $lines;
|
105 |
}
|
106 |
|
107 |
-
public function getPaymentmethodExtraSettings()
|
|
|
108 |
return array(
|
109 |
"description",
|
110 |
//"active_issuers",
|
@@ -116,13 +86,11 @@ class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
116 |
);
|
117 |
}
|
118 |
|
119 |
-
public function countStoredPaymentmethods($storeID)
|
120 |
-
|
121 |
$adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
122 |
$adv_sql->setScope($storeID);
|
123 |
|
124 |
-
|
125 |
-
|
126 |
$count = $adv_sql->countPaymentMethods();
|
127 |
|
128 |
if ($storeID == 0) {
|
@@ -139,11 +107,10 @@ class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
139 |
return $return;
|
140 |
}
|
141 |
|
142 |
-
public function addIcons($obj, $isArray = false)
|
143 |
-
|
144 |
if ($isArray) {
|
145 |
foreach ($obj as $key => $value) {
|
146 |
-
$issuerData = unserialize(urldecode($value["issuers"]));
|
147 |
$img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value["code"]));
|
148 |
$obj[$key]["Image"] = ($img) ? $img : $value["code"];
|
149 |
}
|
@@ -157,11 +124,13 @@ class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
157 |
return $obj;
|
158 |
}
|
159 |
|
160 |
-
public function getIssuerArray($value)
|
|
|
161 |
return unserialize(urldecode($value));
|
162 |
}
|
163 |
|
164 |
-
protected function getValueForStore($val)
|
|
|
165 |
$store = Mage::helper('icecore')->getStoreScopeID();
|
166 |
return Mage::helper('icecore')->getConfigForStore($store, $val);
|
167 |
}
|
16 |
class Icepay_IceAdvanced_Helper_Data extends Mage_Core_Helper_Abstract {
|
17 |
/* Install values */
|
18 |
|
19 |
+
public $title = 'Advanced';
|
20 |
+
public $version = '1.1.9';
|
21 |
+
public $id = 'ADV';
|
22 |
+
public $fingerprint = '7f4de76ecbf7d847caeba64c42938a6a05821c4f';
|
23 |
+
public $compatibility_oldest_version = '1.5.0.0';
|
24 |
+
public $compatibility_latest_version = '1.7.0.2';
|
25 |
+
public $section = 'iceadvanced';
|
26 |
+
public $serial_required = '0';
|
27 |
+
public $filteredPaymentmethods = array('SMS', 'PHONE');
|
28 |
+
public $filteredPaymentMethodIssuers = array('CCAUTOCHECKOUT', 'IDEALINCASSO');
|
29 |
+
|
30 |
+
public function doChecks()
|
31 |
+
{
|
|
|
32 |
$lines = array();
|
|
|
|
|
|
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
/* Check SOAP */
|
35 |
$check = Mage::helper("icecore")->hasSOAP();
|
36 |
array_push($lines, array(
|
59 |
'line' => $check["msg"],
|
60 |
'result' => ($check["val"]) ? "ok" : "err"));
|
61 |
}
|
62 |
+
|
63 |
$adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
64 |
+
|
65 |
if ($adv_sql->getPMbyCode('afterpay')) {
|
66 |
if (Mage::getModel('tax/config')->getAlgorithm() != Mage_Tax_Model_Calculation::CALC_UNIT_BASE)
|
67 |
array_push($lines, array(
|
68 |
+
'id' => "tax",
|
69 |
+
'line' => "In order to use Afterpay you must have set the Tax Calculation Method Based On Unit Price.",
|
70 |
+
'result' => "err"));
|
71 |
}
|
72 |
|
73 |
return $lines;
|
74 |
}
|
75 |
|
76 |
+
public function getPaymentmethodExtraSettings()
|
77 |
+
{
|
78 |
return array(
|
79 |
"description",
|
80 |
//"active_issuers",
|
86 |
);
|
87 |
}
|
88 |
|
89 |
+
public function countStoredPaymentmethods($storeID)
|
90 |
+
{
|
91 |
$adv_sql = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
92 |
$adv_sql->setScope($storeID);
|
93 |
|
|
|
|
|
94 |
$count = $adv_sql->countPaymentMethods();
|
95 |
|
96 |
if ($storeID == 0) {
|
107 |
return $return;
|
108 |
}
|
109 |
|
110 |
+
public function addIcons($obj, $isArray = false)
|
111 |
+
{
|
112 |
if ($isArray) {
|
113 |
foreach ($obj as $key => $value) {
|
|
|
114 |
$img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value["code"]));
|
115 |
$obj[$key]["Image"] = ($img) ? $img : $value["code"];
|
116 |
}
|
124 |
return $obj;
|
125 |
}
|
126 |
|
127 |
+
public function getIssuerArray($value)
|
128 |
+
{
|
129 |
return unserialize(urldecode($value));
|
130 |
}
|
131 |
|
132 |
+
protected function getValueForStore($val)
|
133 |
+
{
|
134 |
$store = Mage::helper('icecore')->getStoreScopeID();
|
135 |
return Mage::helper('icecore')->getConfigForStore($store, $val);
|
136 |
}
|
app/code/community/Icepay/IceAdvanced/Model/Checkout/PaymentObject.php
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ICEPAY Pro - Webservice PaymentObject
|
5 |
+
*
|
6 |
+
* @version 1.0.0
|
7 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
8 |
+
* @copyright ICEPAY <www.icepay.com>
|
9 |
+
*
|
10 |
+
* Disclaimer:
|
11 |
+
* The merchant is entitled to change de ICEPAY plug-in code,
|
12 |
+
* any changes will be at merchant's own risk.
|
13 |
+
* Requesting ICEPAY support for a modified plug-in will be
|
14 |
+
* charged in accordance with the standard ICEPAY tariffs.
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class Icepay_IceAdvanced_Model_Checkout_PaymentObject {
|
18 |
+
|
19 |
+
private $amount;
|
20 |
+
private $country;
|
21 |
+
private $currency;
|
22 |
+
private $description = '';
|
23 |
+
private $language;
|
24 |
+
private $orderID;
|
25 |
+
private $paymentMethod;
|
26 |
+
private $paymentMethodIssuer;
|
27 |
+
private $reference = '';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Sets the total amount to be paid in cents
|
31 |
+
*
|
32 |
+
* @param int $amount
|
33 |
+
* @since 1.0.0
|
34 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
35 |
+
*/
|
36 |
+
public function setAmount($amount) {
|
37 |
+
$this->amount = $amount;
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* sets the country
|
44 |
+
*
|
45 |
+
* @param string $country
|
46 |
+
* @since 1.0.0
|
47 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
48 |
+
*/
|
49 |
+
public function setCountry($country) {
|
50 |
+
$this->country = (string) strtoupper($country);
|
51 |
+
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Sets the currency
|
57 |
+
*
|
58 |
+
* @param string $currency
|
59 |
+
* @since 1.0.0
|
60 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
61 |
+
*/
|
62 |
+
public function setCurrency($currency) {
|
63 |
+
$this->currency = (string) strtoupper($currency);
|
64 |
+
|
65 |
+
return $this;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Sets the description
|
70 |
+
*
|
71 |
+
* @param string $description
|
72 |
+
* @since 1.0.0
|
73 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
74 |
+
*/
|
75 |
+
public function setDescription($description = '') {
|
76 |
+
$this->description = (string) $description;
|
77 |
+
|
78 |
+
return $this;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Sets the language
|
83 |
+
*
|
84 |
+
* @param string $language
|
85 |
+
* @since 1.0.0
|
86 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
87 |
+
*/
|
88 |
+
public function setLanguage($language) {
|
89 |
+
$this->language = (string) strtoupper($language);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Sets the OrderID
|
96 |
+
*
|
97 |
+
* @param string $orderID
|
98 |
+
* @since 1.0.0
|
99 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
100 |
+
*/
|
101 |
+
public function setOrderID($orderID) {
|
102 |
+
$this->orderID = (string) $orderID;
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Sets the paymentmethod
|
109 |
+
*
|
110 |
+
* @param string $paymentMethod
|
111 |
+
* @since 1.0.0
|
112 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
113 |
+
*/
|
114 |
+
public function setPaymentMethod($paymentMethod) {
|
115 |
+
$this->paymentMethod = (string) $paymentMethod;
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Set the paymentmethod issuer
|
122 |
+
*
|
123 |
+
* @param string $paymentMethodIssuer
|
124 |
+
* @since 1.0.0
|
125 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
126 |
+
*/
|
127 |
+
public function setPaymentMethodIssuer($paymentMethodIssuer) {
|
128 |
+
$this->paymentMethodIssuer = (string) $paymentMethodIssuer;
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Sets the reference
|
135 |
+
*
|
136 |
+
* @param string $reference
|
137 |
+
* @since 1.0.0
|
138 |
+
* @return Icepay_Pro_Model_Webservice_PaymentObject
|
139 |
+
*/
|
140 |
+
public function setReference($reference = '') {
|
141 |
+
$this->reference = (string) $reference;
|
142 |
+
|
143 |
+
return $this;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Returns the total amount in cents
|
148 |
+
*
|
149 |
+
* @since 1.0.0
|
150 |
+
* @return int
|
151 |
+
*/
|
152 |
+
public function getAmount() {
|
153 |
+
return $this->amount;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Returns the country
|
158 |
+
*
|
159 |
+
* @since 1.0.0
|
160 |
+
* @return string
|
161 |
+
*/
|
162 |
+
public function getCountry() {
|
163 |
+
return $this->country;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Returns the currency
|
168 |
+
*
|
169 |
+
* @since 1.0.0
|
170 |
+
* @return string
|
171 |
+
*/
|
172 |
+
public function getCurrency() {
|
173 |
+
return $this->currency;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Returns the description
|
178 |
+
*
|
179 |
+
* @since 1.0.0
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public function getDescription() {
|
183 |
+
return $this->description;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Returns the language
|
188 |
+
*
|
189 |
+
* @since 1.0.0
|
190 |
+
* @return string
|
191 |
+
*/
|
192 |
+
public function getLanguage() {
|
193 |
+
return $this->language;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Returns the order ID
|
198 |
+
*
|
199 |
+
* @since 1.0.0
|
200 |
+
* @return string
|
201 |
+
*/
|
202 |
+
public function getOrderID() {
|
203 |
+
return $this->orderID;
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Returns the paymentmethod
|
208 |
+
*
|
209 |
+
* @since 1.0.0
|
210 |
+
* @return string
|
211 |
+
*/
|
212 |
+
public function getPaymentMethod() {
|
213 |
+
return $this->paymentMethod;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Returns the paymentmethod issuer
|
218 |
+
*
|
219 |
+
* @since 1.0.0
|
220 |
+
* @return string
|
221 |
+
*/
|
222 |
+
public function getPaymentMethodIssuer() {
|
223 |
+
return $this->paymentMethodIssuer;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Returns the reference
|
228 |
+
*
|
229 |
+
* @since 1.0.0
|
230 |
+
* @return string
|
231 |
+
*/
|
232 |
+
public function getReference() {
|
233 |
+
return $this->reference;
|
234 |
+
}
|
235 |
+
|
236 |
+
}
|
app/code/community/Icepay/IceAdvanced/Model/Checkout/Standard.php
CHANGED
@@ -44,36 +44,42 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
44 |
public $_canCreateBillingAgreement = false;
|
45 |
public $_canManageRecurringProfiles = false;
|
46 |
|
47 |
-
public function __construct()
|
|
|
48 |
$this->advSQL()->setScope(Mage::app()->getStore()->getID());
|
49 |
if ((int) $this->advSQL()->countPaymentMethods() == 0)
|
50 |
$this->advSQL()->setScope(0); //Fallback to default store
|
51 |
}
|
52 |
|
53 |
-
public function initialize($paymentAction, $stateObject)
|
|
|
54 |
$stateObject->setState(Mage_Sales_Model_Order::STATE_NEW);
|
55 |
$stateObject->setStatus(Icepay_IceCore_Model_Config::STATUS_MAGENTO_NEW);
|
56 |
$stateObject->setIsNotified(false);
|
57 |
}
|
58 |
|
59 |
-
public function getDescription()
|
|
|
60 |
return $this->getConfigData("info");
|
61 |
}
|
62 |
|
63 |
-
public function getIssuers()
|
|
|
64 |
if (!$this->_issuer)
|
65 |
$this->_issuer = $this->advSQL()->getIssuersByPMReference($this->_code);
|
66 |
return $this->_issuer;
|
67 |
}
|
68 |
|
69 |
-
public function getAvailableIssuers()
|
|
|
70 |
if (!$this->_avail_issuer)
|
71 |
$this->_avail_issuer = $this->advSQL()->getAvailableIssuers($this->getConfigData("active_issuers"), $this->_code);
|
72 |
|
73 |
return $this->_avail_issuer;
|
74 |
}
|
75 |
|
76 |
-
public function getIssuerOptionArray()
|
|
|
77 |
$options = array();
|
78 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
79 |
$options[] = array('value' => $issuer['issuer_code'], 'label' => $issuer['issuer_name']);
|
@@ -82,31 +88,34 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
82 |
return $options;
|
83 |
}
|
84 |
|
85 |
-
public function isAvailable($quote = null)
|
|
|
86 |
$this->_quote = $quote;
|
87 |
-
|
88 |
-
if (strtoupper($this->getConfigData('pm_code')) == 'AFTERPAY') {
|
89 |
if (!$this->checkEqualBillingAndShippingCountry($quote))
|
90 |
-
return false;
|
91 |
-
|
92 |
if (!$this->checkTaxCalculationUnitBase())
|
93 |
-
return false;
|
94 |
}
|
95 |
|
96 |
if ($this->getActive() && parent::isAvailable($quote))
|
97 |
return true;
|
98 |
-
|
99 |
return false;
|
100 |
}
|
101 |
|
102 |
-
private function checkTaxCalculationUnitBase()
|
|
|
103 |
if (Mage::getModel('tax/config')->getAlgorithm() != Mage_Tax_Model_Calculation::CALC_UNIT_BASE)
|
104 |
return false;
|
105 |
-
|
106 |
return true;
|
107 |
}
|
108 |
|
109 |
-
private function checkEqualBillingAndShippingCountry($quote)
|
|
|
110 |
$billingCountry = $quote->getBillingAddress()->getCountry();
|
111 |
$shippingCountry = $quote->getShippingAddress()->getCountry();
|
112 |
|
@@ -115,11 +124,12 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
115 |
return false;
|
116 |
}
|
117 |
}
|
118 |
-
|
119 |
return true;
|
120 |
}
|
121 |
|
122 |
-
public function getActive()
|
|
|
123 |
if ($this->getConfigData("active") != 1)
|
124 |
return false;
|
125 |
if ($this->getConfigData("active_issuers") == "")
|
@@ -128,20 +138,24 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
128 |
return $this->coreSQL()->isActive(Mage::helper("iceadvanced")->section);
|
129 |
}
|
130 |
|
131 |
-
public function getOrderPlaceRedirectUrl()
|
|
|
132 |
return Mage::getUrl('iceadvanced/processing/pay');
|
133 |
}
|
134 |
|
135 |
-
public function setCode($str)
|
|
|
136 |
$this->_code = $str;
|
137 |
return;
|
138 |
}
|
139 |
|
140 |
-
public function canUseForCurrency($currencyCode)
|
|
|
141 |
return (count($this->filterByCurrency($currencyCode)) > 0);
|
142 |
}
|
143 |
|
144 |
-
private function filterByCurrency($currencyCode)
|
|
|
145 |
$filtered_issuers = array();
|
146 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
147 |
$currencies = unserialize($issuer['issuer_currency']);
|
@@ -151,7 +165,8 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
151 |
return $filtered_issuers;
|
152 |
}
|
153 |
|
154 |
-
public function canUseForCountry($country)
|
|
|
155 |
|
156 |
if ($this->getConfigData('allowspecific') == 1) {
|
157 |
$availableCountries = explode(',', $this->getConfigData('specificcountry'));
|
@@ -167,7 +182,8 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
167 |
return true;
|
168 |
}
|
169 |
|
170 |
-
private function filterByCountry($country)
|
|
|
171 |
$filtered_issuers = array();
|
172 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
173 |
$countries = unserialize($issuer['issuer_country']);
|
@@ -178,7 +194,8 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
178 |
return $filtered_issuers;
|
179 |
}
|
180 |
|
181 |
-
public function filterByAmountForCountry($issuers, $country)
|
|
|
182 |
$grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
|
183 |
|
184 |
// Order is being created from admin
|
@@ -212,13 +229,15 @@ class Icepay_IceAdvanced_Model_Checkout_Standard extends Mage_Payment_Model_Meth
|
|
212 |
return $filtered_issuers;
|
213 |
}
|
214 |
|
215 |
-
protected function advSQL()
|
|
|
216 |
if ($this->_advancedSQL == null)
|
217 |
$this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
218 |
return $this->_advancedSQL;
|
219 |
}
|
220 |
|
221 |
-
protected function coreSQL()
|
|
|
222 |
if ($this->_coreSQL == null)
|
223 |
$this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
|
224 |
return $this->_coreSQL;
|
44 |
public $_canCreateBillingAgreement = false;
|
45 |
public $_canManageRecurringProfiles = false;
|
46 |
|
47 |
+
public function __construct()
|
48 |
+
{
|
49 |
$this->advSQL()->setScope(Mage::app()->getStore()->getID());
|
50 |
if ((int) $this->advSQL()->countPaymentMethods() == 0)
|
51 |
$this->advSQL()->setScope(0); //Fallback to default store
|
52 |
}
|
53 |
|
54 |
+
public function initialize($paymentAction, $stateObject)
|
55 |
+
{
|
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 |
+
{
|
63 |
return $this->getConfigData("info");
|
64 |
}
|
65 |
|
66 |
+
public function getIssuers()
|
67 |
+
{
|
68 |
if (!$this->_issuer)
|
69 |
$this->_issuer = $this->advSQL()->getIssuersByPMReference($this->_code);
|
70 |
return $this->_issuer;
|
71 |
}
|
72 |
|
73 |
+
public function getAvailableIssuers()
|
74 |
+
{
|
75 |
if (!$this->_avail_issuer)
|
76 |
$this->_avail_issuer = $this->advSQL()->getAvailableIssuers($this->getConfigData("active_issuers"), $this->_code);
|
77 |
|
78 |
return $this->_avail_issuer;
|
79 |
}
|
80 |
|
81 |
+
public function getIssuerOptionArray()
|
82 |
+
{
|
83 |
$options = array();
|
84 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
85 |
$options[] = array('value' => $issuer['issuer_code'], 'label' => $issuer['issuer_name']);
|
88 |
return $options;
|
89 |
}
|
90 |
|
91 |
+
public function isAvailable($quote = null)
|
92 |
+
{
|
93 |
$this->_quote = $quote;
|
94 |
+
|
95 |
+
if (strtoupper($this->getConfigData('pm_code')) == 'AFTERPAY') {
|
96 |
if (!$this->checkEqualBillingAndShippingCountry($quote))
|
97 |
+
return false;
|
98 |
+
|
99 |
if (!$this->checkTaxCalculationUnitBase())
|
100 |
+
return false;
|
101 |
}
|
102 |
|
103 |
if ($this->getActive() && parent::isAvailable($quote))
|
104 |
return true;
|
105 |
+
|
106 |
return false;
|
107 |
}
|
108 |
|
109 |
+
private function checkTaxCalculationUnitBase()
|
110 |
+
{
|
111 |
if (Mage::getModel('tax/config')->getAlgorithm() != Mage_Tax_Model_Calculation::CALC_UNIT_BASE)
|
112 |
return false;
|
113 |
+
|
114 |
return true;
|
115 |
}
|
116 |
|
117 |
+
private function checkEqualBillingAndShippingCountry($quote)
|
118 |
+
{
|
119 |
$billingCountry = $quote->getBillingAddress()->getCountry();
|
120 |
$shippingCountry = $quote->getShippingAddress()->getCountry();
|
121 |
|
124 |
return false;
|
125 |
}
|
126 |
}
|
127 |
+
|
128 |
return true;
|
129 |
}
|
130 |
|
131 |
+
public function getActive()
|
132 |
+
{
|
133 |
if ($this->getConfigData("active") != 1)
|
134 |
return false;
|
135 |
if ($this->getConfigData("active_issuers") == "")
|
138 |
return $this->coreSQL()->isActive(Mage::helper("iceadvanced")->section);
|
139 |
}
|
140 |
|
141 |
+
public function getOrderPlaceRedirectUrl()
|
142 |
+
{
|
143 |
return Mage::getUrl('iceadvanced/processing/pay');
|
144 |
}
|
145 |
|
146 |
+
public function setCode($str)
|
147 |
+
{
|
148 |
$this->_code = $str;
|
149 |
return;
|
150 |
}
|
151 |
|
152 |
+
public function canUseForCurrency($currencyCode)
|
153 |
+
{
|
154 |
return (count($this->filterByCurrency($currencyCode)) > 0);
|
155 |
}
|
156 |
|
157 |
+
private function filterByCurrency($currencyCode)
|
158 |
+
{
|
159 |
$filtered_issuers = array();
|
160 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
161 |
$currencies = unserialize($issuer['issuer_currency']);
|
165 |
return $filtered_issuers;
|
166 |
}
|
167 |
|
168 |
+
public function canUseForCountry($country)
|
169 |
+
{
|
170 |
|
171 |
if ($this->getConfigData('allowspecific') == 1) {
|
172 |
$availableCountries = explode(',', $this->getConfigData('specificcountry'));
|
182 |
return true;
|
183 |
}
|
184 |
|
185 |
+
private function filterByCountry($country)
|
186 |
+
{
|
187 |
$filtered_issuers = array();
|
188 |
foreach ($this->getAvailableIssuers() as $issuer) {
|
189 |
$countries = unserialize($issuer['issuer_country']);
|
194 |
return $filtered_issuers;
|
195 |
}
|
196 |
|
197 |
+
public function filterByAmountForCountry($issuers, $country)
|
198 |
+
{
|
199 |
$grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
|
200 |
|
201 |
// Order is being created from admin
|
229 |
return $filtered_issuers;
|
230 |
}
|
231 |
|
232 |
+
protected function advSQL()
|
233 |
+
{
|
234 |
if ($this->_advancedSQL == null)
|
235 |
$this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
236 |
return $this->_advancedSQL;
|
237 |
}
|
238 |
|
239 |
+
protected function coreSQL()
|
240 |
+
{
|
241 |
if ($this->_coreSQL == null)
|
242 |
$this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
|
243 |
return $this->_coreSQL;
|
app/code/community/Icepay/IceAdvanced/Model/Extensions/MS/Customerreward.php
CHANGED
@@ -2,20 +2,24 @@
|
|
2 |
|
3 |
class Icepay_IceAdvanced_Model_Extensions_MS_Customerreward extends Mage_Payment_Model_Method_Abstract {
|
4 |
|
5 |
-
public function addCustomerRewardPrices($orderData)
|
|
|
6 |
$rawDiscount = $orderData['current_money'];
|
7 |
|
8 |
$discount = (int) ($rawDiscount * 100);
|
9 |
|
10 |
-
|
11 |
-
->
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
}
|
2 |
|
3 |
class Icepay_IceAdvanced_Model_Extensions_MS_Customerreward extends Mage_Payment_Model_Method_Abstract {
|
4 |
|
5 |
+
public function addCustomerRewardPrices($orderData, $ic_order)
|
6 |
+
{
|
7 |
$rawDiscount = $orderData['current_money'];
|
8 |
|
9 |
$discount = (int) ($rawDiscount * 100);
|
10 |
|
11 |
+
$product = $ic_order->createProduct()
|
12 |
+
->setProductID('03')
|
13 |
+
->setProductName('Reward Points')
|
14 |
+
->setDescription('Reward Points')
|
15 |
+
->setQuantity(1)
|
16 |
+
->setUnitPrice($discount)
|
17 |
+
->setVATCategory(Icepay_Order_VAT::getCategoryForPercentage(21))
|
18 |
+
;
|
19 |
+
|
20 |
+
$ic_order->addProduct($product);
|
21 |
+
|
22 |
+
return $ic_order;
|
23 |
}
|
24 |
|
25 |
}
|
app/code/community/Icepay/IceAdvanced/Model/Extensions/MW/GiftWrap.php
CHANGED
@@ -2,7 +2,8 @@
|
|
2 |
|
3 |
class Icepay_IceAdvanced_Model_Extensions_MW_GiftWrap extends Mage_Payment_Model_Method_Abstract {
|
4 |
|
5 |
-
public function addGiftWrapPrices($quoteID)
|
|
|
6 |
$collections1 = Mage::getModel('giftwrap/quote')->getCollection()
|
7 |
->addFieldToFilter('quote_id', array('eq' => $quoteID));
|
8 |
|
@@ -18,15 +19,18 @@ class Icepay_IceAdvanced_Model_Extensions_MW_GiftWrap extends Mage_Payment_Model
|
|
18 |
$productQuantity = $collection2->getQuantity();
|
19 |
}
|
20 |
|
21 |
-
|
22 |
-
->
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
30 |
}
|
31 |
}
|
32 |
|
2 |
|
3 |
class Icepay_IceAdvanced_Model_Extensions_MW_GiftWrap extends Mage_Payment_Model_Method_Abstract {
|
4 |
|
5 |
+
public function addGiftWrapPrices($quoteID, $ic_order)
|
6 |
+
{
|
7 |
$collections1 = Mage::getModel('giftwrap/quote')->getCollection()
|
8 |
->addFieldToFilter('quote_id', array('eq' => $quoteID));
|
9 |
|
19 |
$productQuantity = $collection2->getQuantity();
|
20 |
}
|
21 |
|
22 |
+
$product = $ic_order->createProduct()
|
23 |
+
->setProductID($productID)
|
24 |
+
->setProductName('Gift Wrapping')
|
25 |
+
->setDescription('Gift Wrapping')
|
26 |
+
->setQuantity($productQuantity)
|
27 |
+
->setUnitPrice($giftPrice * 100)
|
28 |
+
->setVATCategory($ic_order->getCategoryForPercentage(0))
|
29 |
+
;
|
30 |
+
|
31 |
+
$ic_order->addProduct($product);
|
32 |
+
|
33 |
+
return $ic_order;
|
34 |
}
|
35 |
}
|
36 |
|
app/code/community/Icepay/IceAdvanced/Model/Mysql4/IceAdvanced.php
CHANGED
@@ -13,30 +13,30 @@
|
|
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 $
|
22 |
-
private $
|
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 |
-
|
|
|
|
|
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");
|
@@ -56,12 +56,13 @@ class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4
|
|
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"],
|
@@ -74,111 +75,121 @@ class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4
|
|
74 |
|
75 |
return $config;
|
76 |
}
|
77 |
-
|
78 |
-
public function getAdminPaymentmethodConfigForStore($storeScope)
|
|
|
79 |
$this->setScope($storeScope);
|
80 |
|
81 |
$total = $this->getAllConfigData();
|
82 |
$returnArr = array();
|
83 |
-
|
84 |
foreach ($total as $pm) {
|
85 |
array_push($returnArr, array(
|
86 |
-
'code'
|
87 |
-
'name'
|
88 |
-
'issuers'
|
89 |
-
'active'
|
90 |
-
'info'
|
91 |
-
'image'
|
92 |
));
|
93 |
}
|
|
|
94 |
return $returnArr;
|
95 |
-
|
96 |
}
|
97 |
|
98 |
-
public function setScope($storeScope)
|
|
|
99 |
/* allow overrides in same instance */
|
100 |
//if ($this->scope != null) return;
|
101 |
$this->scope = new stdClass();
|
102 |
-
$this->scope->scope = ((int)$storeScope == 0)?"default":"stores";
|
103 |
$this->scope->ID = $storeScope;
|
104 |
}
|
105 |
|
106 |
-
private function getScope()
|
|
|
107 |
return $this->scope;
|
108 |
}
|
109 |
-
|
110 |
-
private function getPMIDbyCode($code)
|
|
|
111 |
$pm = $this->getPMbyCode($code);
|
112 |
return $pm['pm_id'];
|
113 |
}
|
114 |
|
115 |
-
public function getPMbyCode($code)
|
|
|
116 |
$select = $this->doSQL()
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
return $this->doSQL()->fetchRow($select);
|
121 |
}
|
122 |
-
|
123 |
-
private function getModelFromID($id)
|
|
|
124 |
$sref = $this->createSrefFromID($id);
|
125 |
return $this->getModelFromSref($sref);
|
126 |
}
|
127 |
-
|
128 |
-
private function getModelFromSref($sref)
|
129 |
-
|
|
|
130 |
}
|
131 |
|
132 |
-
private function getReferenceFromID($id)
|
|
|
133 |
$ref = $this->createSrefFromID($id);
|
134 |
return $this->getReferenceFromSref($ref);
|
135 |
}
|
136 |
-
|
137 |
-
private function getReferenceFromSref($sref)
|
138 |
-
|
|
|
139 |
}
|
140 |
-
|
141 |
-
public function getReferenceFromPMCode($code)
|
|
|
142 |
return $this->getReferenceFromID($this->getPMIDbyCode($code));
|
143 |
}
|
144 |
-
|
145 |
-
private function createSrefFromID($id)
|
|
|
146 |
$id = intval($id);
|
147 |
-
if ($id < 10)
|
|
|
148 |
return "{$id}";
|
149 |
}
|
150 |
-
|
151 |
-
public function clearConfig()
|
|
|
152 |
// Clear the issuer table
|
153 |
$condition = array('store_scope_id = ?' => $this->getScope()->ID);
|
154 |
$this->doSQL()->delete($this->getTable("iceadvanced/{$this->issuer_table}"), $condition);
|
155 |
|
156 |
$condition = array('store_scope_id = ?' => Mage::app()->getStore()->getId());
|
157 |
$this->doSQL()->delete($this->getTable("iceadvanced/{$this->issuer_table}"), $condition);
|
158 |
-
|
159 |
// Disable the config data
|
160 |
-
$where = array('path LIKE ?'
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
$data["value"] = 0;
|
165 |
$this->doSQL()->update(
|
166 |
-
$this->getTable('core/config_data'),
|
167 |
-
|
168 |
-
$where
|
169 |
-
);
|
170 |
}
|
171 |
-
|
172 |
-
public function savePaymentMethod($code, $merchant, $storeScope, $issuerlist)
|
|
|
173 |
$id = $this->getPMIDbyCode($code);
|
174 |
/* create main paymentmethod if not exists */
|
175 |
-
if (!$id){
|
176 |
$this->doSQL()->insertOnDuplicate(
|
177 |
-
$this->getTable("iceadvanced/{$this->pm_table}"),
|
178 |
-
|
179 |
-
|
180 |
-
),
|
181 |
-
array('pm_code')
|
182 |
);
|
183 |
$id = $this->getPMIDbyCode($code);
|
184 |
}
|
@@ -186,162 +197,157 @@ class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4
|
|
186 |
$this->setScope($storeScope);
|
187 |
|
188 |
/* Save payment configuration for store view */
|
189 |
-
|
190 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"model",
|
191 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"group",
|
192 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"pm_code",
|
193 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"pm_id",
|
194 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"pm_ref",
|
195 |
-
|
196 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"description",
|
197 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"allowspecific",
|
198 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"specificcountry",
|
199 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"sort_order",
|
200 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"min_order_total",
|
201 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"max_order_total",
|
202 |
-
|
203 |
-
$this->saveConfigValue($this->getReferenceFromID($id),"active_issuers",
|
204 |
-
}
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
$id = $this->getPMIDbyCode($code);
|
209 |
|
210 |
$this->setScope($storeScope);
|
211 |
|
212 |
$result = $this->doSQL()->insertOnDuplicate(
|
213 |
-
$this->getTable("iceadvanced/{$this->issuer_table}"),
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
),
|
227 |
-
array('issuer_code')
|
228 |
);
|
229 |
-
|
230 |
$select = $this->doSQL()
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
$res = $this->doSQL()->fetchRow($select);
|
237 |
-
|
238 |
-
if (!$res) {
|
239 |
$result = $this->doSQL()->insertOnDuplicate(
|
240 |
-
$this->getTable("iceadvanced/{$this->issuer_table}"),
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
),
|
254 |
-
array('issuer_code')
|
255 |
);
|
256 |
}
|
257 |
-
|
258 |
-
}
|
259 |
-
|
260 |
-
|
261 |
-
public function saveConfigFromAdmin($code,$option,$value){
|
262 |
-
$this->saveConfigValue($this->getReferenceFromPMCode($code),$option,$value);
|
263 |
}
|
264 |
|
|
|
|
|
|
|
|
|
265 |
|
266 |
-
public function saveConfigValue($reference, $option, $value)
|
|
|
267 |
$this->doSQL()->insertOnDuplicate(
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
'
|
274 |
-
|
275 |
-
|
276 |
-
);
|
277 |
-
|
278 |
$this->doSQL()->insertOnDuplicate(
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
'
|
285 |
-
),
|
286 |
-
array('value')
|
287 |
);
|
288 |
}
|
289 |
-
|
290 |
-
private function getPaymentMethodIDs()
|
|
|
291 |
$select = $this->doSQL()
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
return
|
299 |
}
|
300 |
|
301 |
-
public function getAvailableIssuers($activeIssuers, $reference)
|
|
|
302 |
$issuers = explode(",", $activeIssuers);
|
303 |
$arr = array();
|
304 |
-
foreach($issuers as $issuer){
|
305 |
-
$arr[] = $this->getIssuerData($issuer
|
306 |
}
|
307 |
return $arr;
|
308 |
}
|
309 |
|
310 |
-
public function getIssuerData($issuerCode, $reference)
|
|
|
311 |
$select = $this->doSQL()
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
return
|
318 |
}
|
319 |
|
320 |
-
|
321 |
-
|
322 |
$select = $this->doSQL()
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
return
|
329 |
}
|
330 |
|
331 |
-
|
332 |
-
|
333 |
$select = $this->doSQL()
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
|
341 |
return $this->doSQL()->fetchAll($select);
|
342 |
}
|
343 |
-
|
344 |
-
public function getPaymentMethodDataArrayByReference($ref)
|
|
|
345 |
$data = $this->getPaymentMethodDataByReference($ref);
|
346 |
$returnArr = array();
|
347 |
foreach ($data as $value) {
|
@@ -349,56 +355,61 @@ class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4
|
|
349 |
}
|
350 |
return $returnArr;
|
351 |
}
|
352 |
-
|
353 |
-
private function getFieldName($configValue)
|
|
|
354 |
$arr = explode("/", $configValue);
|
355 |
return $arr[2];
|
356 |
}
|
357 |
-
|
358 |
-
public function getAllConfigData()
|
|
|
359 |
$pms = $this->getPaymentMethodIDs();
|
360 |
$returnArr = array();
|
361 |
-
|
362 |
foreach ($pms as $value) {
|
363 |
array_push($returnArr, $this->getConfigDataByReference($value["value"]));
|
364 |
}
|
365 |
-
|
366 |
return $returnArr;
|
367 |
}
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
|
372 |
return array(
|
373 |
-
"reference" =>
|
374 |
-
"config"
|
375 |
-
"issuers"
|
376 |
-
|
377 |
}
|
378 |
-
|
379 |
-
public function arrEncode($arr)
|
|
|
380 |
return serialize($arr);
|
381 |
return urlencode(serialize($arr));
|
382 |
}
|
383 |
-
|
384 |
-
public function arrDecode($str)
|
|
|
385 |
return unserialize(urldecode($str));
|
386 |
}
|
387 |
-
|
388 |
/* Used for admin count and also to fallback to default if no paymentmethods are found for the current store view */
|
389 |
-
|
|
|
|
|
390 |
$select = $this->doSQL()
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
$data = $this->doSQL()->fetchRow($select);
|
398 |
return $data["count(value)"];
|
399 |
}
|
400 |
|
401 |
-
|
402 |
}
|
403 |
|
404 |
?>
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
|
|
16 |
class Icepay_IceAdvanced_Model_Mysql4_IceAdvanced extends Mage_Core_Model_Mysql4_Abstract {
|
17 |
|
18 |
+
private $issuer_table = 'icepay_issuerdata';
|
19 |
+
private $pm_table = 'icepay_pmdata';
|
20 |
+
private $db = null;
|
21 |
+
private $_reference = "icepayadv_%s";
|
|
|
|
|
22 |
private $_standardModel = "iceadvanced/checkout_placeholder_paymentmethod%s";
|
|
|
23 |
private $scope = null;
|
24 |
|
25 |
+
public function _construct()
|
26 |
+
{
|
27 |
// Note that the basicgateway_id refers to the key field in your database table.
|
28 |
$this->_init('icecore/icecore', 'icecore_id');
|
29 |
}
|
30 |
+
|
31 |
+
private function doSQL()
|
32 |
+
{
|
33 |
+
if ($this->db == null)
|
34 |
+
$this->db = $this->_getReadAdapter();
|
35 |
return $this->db;
|
36 |
}
|
37 |
|
38 |
+
public function getPaymentmethods()
|
39 |
+
{
|
40 |
$config = array();
|
41 |
$mod_code = $this->getConfigData("code");
|
42 |
$mod_title = $this->getConfigData("title");
|
56 |
|
57 |
return $config;
|
58 |
}
|
59 |
+
|
60 |
+
public function getPaymentmethodsForConfig()
|
61 |
+
{
|
62 |
$config = array();
|
63 |
+
|
64 |
$mod_title = array();
|
65 |
+
|
66 |
for ($i = 0; $i < count($mod_title); $i++) {
|
67 |
array_push($config, array(
|
68 |
'code' => $mod_code[$i]["value"],
|
75 |
|
76 |
return $config;
|
77 |
}
|
78 |
+
|
79 |
+
public function getAdminPaymentmethodConfigForStore($storeScope)
|
80 |
+
{
|
81 |
$this->setScope($storeScope);
|
82 |
|
83 |
$total = $this->getAllConfigData();
|
84 |
$returnArr = array();
|
85 |
+
|
86 |
foreach ($total as $pm) {
|
87 |
array_push($returnArr, array(
|
88 |
+
'code' => $pm["config"]["pm_code"],
|
89 |
+
'name' => $pm["config"]["title"],
|
90 |
+
'issuers' => count($pm["issuers"]),
|
91 |
+
'active' => $pm["config"]["active"],
|
92 |
+
'info' => "",
|
93 |
+
'image' => Mage::helper("icecore")->toIcon($pm["config"]["pm_code"])
|
94 |
));
|
95 |
}
|
96 |
+
|
97 |
return $returnArr;
|
|
|
98 |
}
|
99 |
|
100 |
+
public function setScope($storeScope)
|
101 |
+
{
|
102 |
/* allow overrides in same instance */
|
103 |
//if ($this->scope != null) return;
|
104 |
$this->scope = new stdClass();
|
105 |
+
$this->scope->scope = ((int) $storeScope == 0) ? "default" : "stores";
|
106 |
$this->scope->ID = $storeScope;
|
107 |
}
|
108 |
|
109 |
+
private function getScope()
|
110 |
+
{
|
111 |
return $this->scope;
|
112 |
}
|
113 |
+
|
114 |
+
private function getPMIDbyCode($code)
|
115 |
+
{
|
116 |
$pm = $this->getPMbyCode($code);
|
117 |
return $pm['pm_id'];
|
118 |
}
|
119 |
|
120 |
+
public function getPMbyCode($code)
|
121 |
+
{
|
122 |
$select = $this->doSQL()
|
123 |
+
->select()
|
124 |
+
->from($this->getTable("iceadvanced/{$this->pm_table}"), array('pm_id'))
|
125 |
+
->where('pm_code=?', $code);
|
126 |
return $this->doSQL()->fetchRow($select);
|
127 |
}
|
128 |
+
|
129 |
+
private function getModelFromID($id)
|
130 |
+
{
|
131 |
$sref = $this->createSrefFromID($id);
|
132 |
return $this->getModelFromSref($sref);
|
133 |
}
|
134 |
+
|
135 |
+
private function getModelFromSref($sref)
|
136 |
+
{
|
137 |
+
return sprintf($this->_standardModel, $sref);
|
138 |
}
|
139 |
|
140 |
+
private function getReferenceFromID($id)
|
141 |
+
{
|
142 |
$ref = $this->createSrefFromID($id);
|
143 |
return $this->getReferenceFromSref($ref);
|
144 |
}
|
145 |
+
|
146 |
+
private function getReferenceFromSref($sref)
|
147 |
+
{
|
148 |
+
return sprintf($this->_reference, $sref);
|
149 |
}
|
150 |
+
|
151 |
+
public function getReferenceFromPMCode($code)
|
152 |
+
{
|
153 |
return $this->getReferenceFromID($this->getPMIDbyCode($code));
|
154 |
}
|
155 |
+
|
156 |
+
private function createSrefFromID($id)
|
157 |
+
{
|
158 |
$id = intval($id);
|
159 |
+
if ($id < 10)
|
160 |
+
return "0{$id}";
|
161 |
return "{$id}";
|
162 |
}
|
163 |
+
|
164 |
+
public function clearConfig()
|
165 |
+
{
|
166 |
// Clear the issuer table
|
167 |
$condition = array('store_scope_id = ?' => $this->getScope()->ID);
|
168 |
$this->doSQL()->delete($this->getTable("iceadvanced/{$this->issuer_table}"), $condition);
|
169 |
|
170 |
$condition = array('store_scope_id = ?' => Mage::app()->getStore()->getId());
|
171 |
$this->doSQL()->delete($this->getTable("iceadvanced/{$this->issuer_table}"), $condition);
|
172 |
+
|
173 |
// Disable the config data
|
174 |
+
$where = array('path LIKE ?' => "payment/icepayadv___/active",
|
175 |
+
'scope = ?' => $this->getScope()->scope,
|
176 |
+
'scope_id = ?' => $this->getScope()->ID
|
177 |
+
);
|
178 |
$data["value"] = 0;
|
179 |
$this->doSQL()->update(
|
180 |
+
$this->getTable('core/config_data'), $data, $where
|
181 |
+
);
|
|
|
|
|
182 |
}
|
183 |
+
|
184 |
+
public function savePaymentMethod($code, $merchant, $storeScope, $issuerlist)
|
185 |
+
{
|
186 |
$id = $this->getPMIDbyCode($code);
|
187 |
/* create main paymentmethod if not exists */
|
188 |
+
if (!$id) {
|
189 |
$this->doSQL()->insertOnDuplicate(
|
190 |
+
$this->getTable("iceadvanced/{$this->pm_table}"), array(
|
191 |
+
'pm_code' => $code
|
192 |
+
), array('pm_code')
|
|
|
|
|
193 |
);
|
194 |
$id = $this->getPMIDbyCode($code);
|
195 |
}
|
197 |
$this->setScope($storeScope);
|
198 |
|
199 |
/* Save payment configuration for store view */
|
200 |
+
|
201 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "model", $this->getModelFromID($id));
|
202 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "group", "icepay");
|
203 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "pm_code", $code);
|
204 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "pm_id", $id);
|
205 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "pm_ref", $this->getReferenceFromID($id));
|
206 |
+
|
207 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "description", "");
|
208 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "allowspecific", 0);
|
209 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "specificcountry", "");
|
210 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "sort_order", $id);
|
211 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "min_order_total", "");
|
212 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "max_order_total", "");
|
213 |
+
|
214 |
+
$this->saveConfigValue($this->getReferenceFromID($id), "active_issuers", $issuerlist);
|
215 |
+
}
|
216 |
+
|
217 |
+
public function saveIssuer($storeScope, $code, $merchant, $issuercode, $issuername, $countries, $currencies, $languages, $minimum, $maximum)
|
218 |
+
{
|
219 |
$id = $this->getPMIDbyCode($code);
|
220 |
|
221 |
$this->setScope($storeScope);
|
222 |
|
223 |
$result = $this->doSQL()->insertOnDuplicate(
|
224 |
+
$this->getTable("iceadvanced/{$this->issuer_table}"), array(
|
225 |
+
'pm_code' => $code,
|
226 |
+
'store_scope_id' => $this->getScope()->ID,
|
227 |
+
'merchant_id' => $merchant,
|
228 |
+
'magento_code' => $this->getReferenceFromID($id),
|
229 |
+
'issuer_code' => $issuercode,
|
230 |
+
'issuer_name' => $issuername,
|
231 |
+
'issuer_country' => $this->arrEncode($countries),
|
232 |
+
'issuer_currency' => $this->arrEncode($currencies),
|
233 |
+
'issuer_language' => $this->arrEncode($languages),
|
234 |
+
'issuer_minimum' => $this->arrEncode($minimum),
|
235 |
+
'issuer_maximum' => $this->arrEncode($maximum)
|
236 |
+
), array('issuer_code')
|
|
|
|
|
237 |
);
|
238 |
+
|
239 |
$select = $this->doSQL()
|
240 |
+
->select()
|
241 |
+
->from($this->getTable("iceadvanced/{$this->issuer_table}"))
|
242 |
+
->where('magento_code=?', $this->getReferenceFromID($id))
|
243 |
+
->where('store_scope_id =?', Mage::app()->getStore()->getId())
|
244 |
+
->where('issuer_name =?', $issuername);
|
245 |
$res = $this->doSQL()->fetchRow($select);
|
246 |
+
|
247 |
+
if (!$res) {
|
248 |
$result = $this->doSQL()->insertOnDuplicate(
|
249 |
+
$this->getTable("iceadvanced/{$this->issuer_table}"), array(
|
250 |
+
'pm_code' => $code,
|
251 |
+
'store_scope_id' => Mage::app()->getStore()->getId(),
|
252 |
+
'merchant_id' => $merchant,
|
253 |
+
'magento_code' => $this->getReferenceFromID($id),
|
254 |
+
'issuer_code' => $issuercode,
|
255 |
+
'issuer_name' => $issuername,
|
256 |
+
'issuer_country' => $this->arrEncode($countries),
|
257 |
+
'issuer_currency' => $this->arrEncode($currencies),
|
258 |
+
'issuer_language' => $this->arrEncode($languages),
|
259 |
+
'issuer_minimum' => $this->arrEncode($minimum),
|
260 |
+
'issuer_maximum' => $this->arrEncode($maximum)
|
261 |
+
), array('issuer_code')
|
|
|
|
|
262 |
);
|
263 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
|
266 |
+
public function saveConfigFromAdmin($code, $option, $value)
|
267 |
+
{
|
268 |
+
$this->saveConfigValue($this->getReferenceFromPMCode($code), $option, $value);
|
269 |
+
}
|
270 |
|
271 |
+
public function saveConfigValue($reference, $option, $value)
|
272 |
+
{
|
273 |
$this->doSQL()->insertOnDuplicate(
|
274 |
+
$this->getTable('core/config_data'), array(
|
275 |
+
'path' => "payment/{$reference}/{$option}",
|
276 |
+
'value' => $value,
|
277 |
+
'scope' => $this->getScope()->scope,
|
278 |
+
'scope_id' => $this->getScope()->ID
|
279 |
+
), array('value')
|
280 |
+
);
|
281 |
+
|
|
|
|
|
282 |
$this->doSQL()->insertOnDuplicate(
|
283 |
+
$this->getTable('core/config_data'), array(
|
284 |
+
'path' => "payment/{$reference}/{$option}",
|
285 |
+
'value' => $value,
|
286 |
+
'scope' => 'default',
|
287 |
+
'scope_id' => Mage::app()->getStore()->getId()
|
288 |
+
), array('value')
|
|
|
|
|
289 |
);
|
290 |
}
|
291 |
+
|
292 |
+
private function getPaymentMethodIDs()
|
293 |
+
{
|
294 |
$select = $this->doSQL()
|
295 |
+
->select()
|
296 |
+
->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
|
297 |
+
->where(new Zend_Db_Expr("path LIKE 'payment/icepayadv_%%/pm_ref'"))
|
298 |
+
->where('scope=?', $this->getScope()->scope)
|
299 |
+
->where('scope_id=?', $this->getScope()->ID)
|
300 |
+
->order('path');
|
301 |
+
return $this->doSQL()->fetchAll($select);
|
302 |
}
|
303 |
|
304 |
+
public function getAvailableIssuers($activeIssuers, $reference)
|
305 |
+
{
|
306 |
$issuers = explode(",", $activeIssuers);
|
307 |
$arr = array();
|
308 |
+
foreach ($issuers as $issuer) {
|
309 |
+
$arr[] = $this->getIssuerData($issuer, $reference);
|
310 |
}
|
311 |
return $arr;
|
312 |
}
|
313 |
|
314 |
+
public function getIssuerData($issuerCode, $reference)
|
315 |
+
{
|
316 |
$select = $this->doSQL()
|
317 |
+
->select()
|
318 |
+
->from($this->getTable("iceadvanced/{$this->issuer_table}"))
|
319 |
+
->where('magento_code=?', $reference)
|
320 |
+
->where('store_scope_id=?', $this->getScope()->ID)
|
321 |
+
->where('issuer_code=?', $issuerCode);
|
322 |
+
return $this->doSQL()->fetchRow($select);
|
323 |
}
|
324 |
|
325 |
+
public function getIssuersByPMReference($reference)
|
326 |
+
{
|
327 |
$select = $this->doSQL()
|
328 |
+
->select()
|
329 |
+
->from($this->getTable("iceadvanced/{$this->issuer_table}"))
|
330 |
+
->where('magento_code=?', $reference)
|
331 |
+
->where('store_scope_id=?', $this->getScope()->ID)
|
332 |
+
->order('config_id');
|
333 |
+
return $this->doSQL()->fetchAll($select);
|
334 |
}
|
335 |
|
336 |
+
private function getPaymentMethodDataByReference($ref)
|
337 |
+
{
|
338 |
$select = $this->doSQL()
|
339 |
+
->select()
|
340 |
+
->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
|
341 |
+
->where(new Zend_Db_Expr("path LIKE 'payment/" . $ref . "/%'"))
|
342 |
+
->where('scope=?', $this->getScope()->scope)
|
343 |
+
->where('scope_id=?', $this->getScope()->ID)
|
344 |
+
->order('path');
|
345 |
|
346 |
return $this->doSQL()->fetchAll($select);
|
347 |
}
|
348 |
+
|
349 |
+
public function getPaymentMethodDataArrayByReference($ref)
|
350 |
+
{
|
351 |
$data = $this->getPaymentMethodDataByReference($ref);
|
352 |
$returnArr = array();
|
353 |
foreach ($data as $value) {
|
355 |
}
|
356 |
return $returnArr;
|
357 |
}
|
358 |
+
|
359 |
+
private function getFieldName($configValue)
|
360 |
+
{
|
361 |
$arr = explode("/", $configValue);
|
362 |
return $arr[2];
|
363 |
}
|
364 |
+
|
365 |
+
public function getAllConfigData()
|
366 |
+
{
|
367 |
$pms = $this->getPaymentMethodIDs();
|
368 |
$returnArr = array();
|
369 |
+
|
370 |
foreach ($pms as $value) {
|
371 |
array_push($returnArr, $this->getConfigDataByReference($value["value"]));
|
372 |
}
|
373 |
+
|
374 |
return $returnArr;
|
375 |
}
|
376 |
+
|
377 |
+
public function getConfigDataByReference($reference)
|
378 |
+
{
|
379 |
|
380 |
return array(
|
381 |
+
"reference" => $reference,
|
382 |
+
"config" => $this->getPaymentMethodDataArrayByReference($reference),
|
383 |
+
"issuers" => $this->getIssuersByPMReference($reference)
|
384 |
+
);
|
385 |
}
|
386 |
+
|
387 |
+
public function arrEncode($arr)
|
388 |
+
{
|
389 |
return serialize($arr);
|
390 |
return urlencode(serialize($arr));
|
391 |
}
|
392 |
+
|
393 |
+
public function arrDecode($str)
|
394 |
+
{
|
395 |
return unserialize(urldecode($str));
|
396 |
}
|
397 |
+
|
398 |
/* Used for admin count and also to fallback to default if no paymentmethods are found for the current store view */
|
399 |
+
|
400 |
+
public function countPaymentMethods()
|
401 |
+
{
|
402 |
$select = $this->doSQL()
|
403 |
+
->select()
|
404 |
+
->from($this->getTable('core/config_data'), array('count(value)'))
|
405 |
+
->where(new Zend_Db_Expr("path LIKE 'payment/icepayadv___/title'"))
|
406 |
+
->where('scope=?', $this->getScope()->scope)
|
407 |
+
->where('scope_id=?', $this->getScope()->ID)
|
408 |
+
->order('path');
|
409 |
$data = $this->doSQL()->fetchRow($select);
|
410 |
return $data["count(value)"];
|
411 |
}
|
412 |
|
|
|
413 |
}
|
414 |
|
415 |
?>
|
app/code/community/Icepay/IceAdvanced/Model/Observer.php
CHANGED
@@ -25,44 +25,43 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
25 |
private $_advancedSQL = null;
|
26 |
private $_coreSQL = null;
|
27 |
|
28 |
-
private function validateStreetAddress($streetAddress)
|
29 |
-
|
|
|
30 |
|
31 |
$aMatch = array();
|
32 |
-
|
33 |
-
if (preg_match($pattern, $streetAddress, $aMatch)) {
|
34 |
-
array_shift($aMatch);
|
35 |
|
36 |
-
|
37 |
-
$
|
38 |
-
|
39 |
|
40 |
if (empty($street) || empty($houseNumber))
|
41 |
return false;
|
42 |
} else {
|
43 |
return false;
|
44 |
}
|
45 |
-
|
46 |
return true;
|
47 |
}
|
48 |
-
|
49 |
-
public function sales_quote_collect_totals_after(Varien_Event_Observer $observer)
|
|
|
50 |
$paymentMethod = Mage::app()->getFrontController()->getRequest()->getParam('payment');
|
51 |
-
|
52 |
if (!isset($paymentMethod))
|
53 |
return;
|
54 |
-
|
55 |
try {
|
56 |
$paymentMethodCode = $observer->getEvent()->getQuote()->getPayment()->getMethodInstance()->getCode();
|
57 |
$paymentMethodTitle = $observer->getEvent()->getQuote()->getPayment()->getMethodInstance()->getTitle();
|
58 |
} catch (Exception $e) {
|
59 |
return;
|
60 |
}
|
61 |
-
|
62 |
if (substr($paymentMethodCode, 0, 10) != "icepayadv_")
|
63 |
return;
|
64 |
|
65 |
-
if ($paymentMethodTitle != '
|
66 |
return;
|
67 |
|
68 |
$message = false;
|
@@ -83,23 +82,23 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
83 |
$message = "Your postal code is incorrect, must be in 11111 format.";
|
84 |
break;
|
85 |
}
|
86 |
-
|
87 |
$phoneNumber = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getTelephone();
|
88 |
-
|
89 |
switch (Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getCountry()) {
|
90 |
case 'NL':
|
91 |
if (!preg_match('/^\(?\+?\d{1,3}\)?\s?-?\s?[\d\s]*$/', $phoneNumber) OR strlen($phoneNumber) < 10) {
|
92 |
$message = "Your phonenumber is incorrect.";
|
93 |
}
|
94 |
-
|
95 |
}
|
96 |
-
|
97 |
$billingStreetAddress = implode(' ', Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getStreet());
|
98 |
if (!$this->validateStreetAddress($billingStreetAddress)) {
|
99 |
$message = "Billing address incorrect.";
|
100 |
}
|
101 |
-
|
102 |
-
$shippingStreetAddress = implode(' ', Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getStreet());
|
103 |
if (!$this->validateStreetAddress($shippingStreetAddress)) {
|
104 |
$message = "Shipping address incorrect.";
|
105 |
}
|
@@ -107,7 +106,7 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
107 |
if ($message) {
|
108 |
Mage::getSingleton('checkout/session')->addError($message);
|
109 |
|
110 |
-
Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
|
111 |
Mage::app()->getResponse()->sendResponse();
|
112 |
exit();
|
113 |
}
|
@@ -117,7 +116,8 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
117 |
|
118 |
/* Save the payment */
|
119 |
|
120 |
-
public function sales_order_payment_place_end(Varien_Event_Observer $observer)
|
|
|
121 |
$payment = $observer->getPayment();
|
122 |
$pmName = $payment->getMethodInstance()->getCode();
|
123 |
|
@@ -132,7 +132,8 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
132 |
|
133 |
/* From admin */
|
134 |
|
135 |
-
public function model_save_before(Varien_Event_Observer $observer)
|
|
|
136 |
/* Make sure we clear all the previously stored paymentmethods if the new total is less than stored in the database */
|
137 |
$data = $observer->getEvent()->getObject();
|
138 |
if ($data->getData("path") != "icecore/iceadvanced/webservice_data")
|
@@ -141,71 +142,85 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
141 |
return;
|
142 |
if ($data->getData("scope") == "default" || $data->getData("scope") == "stores") {
|
143 |
$storeScope = $data->getData("scope_id");
|
144 |
-
}
|
|
|
145 |
return;
|
146 |
$this->advSQL()->setScope($storeScope);
|
147 |
$this->advSQL()->clearConfig();
|
148 |
}
|
149 |
|
150 |
-
private function set($setting)
|
|
|
151 |
$var = explode("_", $setting);
|
152 |
$this->_setting = $var;
|
153 |
}
|
154 |
|
155 |
-
private function getValue()
|
|
|
156 |
return $this->_value;
|
157 |
}
|
158 |
|
159 |
-
private function getIssuers()
|
|
|
160 |
return Mage::helper("icecore")->makeArray($this->_issuers['issuers']);
|
161 |
}
|
162 |
|
163 |
-
private function getIssuerPMCode()
|
|
|
164 |
if (isset($this->_issuers['code']))
|
165 |
return strtolower($this->_issuers['code']);
|
166 |
}
|
167 |
|
168 |
-
private function getIssuerMerchantID()
|
|
|
169 |
if (isset($this->_issuers['merchant']))
|
170 |
return strtolower($this->_issuers['merchant']);
|
171 |
}
|
172 |
|
173 |
-
private function getPMCode()
|
|
|
174 |
return strtolower($this->_setting[1]);
|
175 |
}
|
176 |
|
177 |
-
private function handle($object)
|
|
|
178 |
$this->_value = $object->getData("value");
|
179 |
|
180 |
if ($this->isIssuer())
|
181 |
$this->_issuers = $this->advSQL()->arrDecode($this->getValue());
|
182 |
}
|
183 |
|
184 |
-
private function isActivate()
|
|
|
185 |
return ($this->_setting[2] == "active") ? true : false;
|
186 |
}
|
187 |
|
188 |
-
private function isTitle()
|
|
|
189 |
return ($this->_setting[2] == "title") ? true : false;
|
190 |
}
|
191 |
|
192 |
-
private function isIssuer()
|
|
|
193 |
return ($this->_setting[2] == "issuer") ? true : false;
|
194 |
}
|
195 |
|
196 |
-
protected function advSQL()
|
|
|
197 |
if ($this->_advancedSQL == null)
|
198 |
$this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
199 |
return $this->_advancedSQL;
|
200 |
}
|
201 |
|
202 |
-
protected function coreSQL()
|
|
|
203 |
if ($this->_coreSQL == null)
|
204 |
$this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
|
205 |
return $this->_coreSQL;
|
206 |
}
|
207 |
|
208 |
-
public function model_save_after(Varien_Event_Observer $observer)
|
|
|
209 |
$data = $observer->getEvent()->getObject();
|
210 |
|
211 |
/* Save all the dynamic paymentmethods */
|
@@ -222,7 +237,8 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
222 |
// Only allow payment and issuer data at default and store level
|
223 |
if ($data->getData("scope") == "default" || $data->getData("scope") == "stores") {
|
224 |
$storeScope = $data->getData("scope_id");
|
225 |
-
}
|
|
|
226 |
return;
|
227 |
$this->advSQL()->setScope($storeScope);
|
228 |
|
@@ -230,9 +246,11 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
230 |
if ($this->isIssuer()) {
|
231 |
|
232 |
$issuerListArr = array();
|
233 |
-
foreach ($this->getIssuers() as $issuer) {
|
234 |
-
|
|
|
235 |
}
|
|
|
236 |
$issuerList = implode(",", $issuerListArr);
|
237 |
|
238 |
/* Save paymentmethod through issuer data */
|
@@ -242,6 +260,8 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
242 |
|
243 |
|
244 |
foreach ($this->getIssuers() as $issuer) {
|
|
|
|
|
245 |
|
246 |
$arrCountry = array();
|
247 |
$arrCurrency = array();
|
@@ -272,7 +292,8 @@ class Icepay_IceAdvanced_Model_Observer extends Mage_Payment_Block_Form_Containe
|
|
272 |
return;
|
273 |
}
|
274 |
|
275 |
-
private function addCurrencies($arr, $currencyArr)
|
|
|
276 |
foreach ($currencyArr as $currency) {
|
277 |
array_push($arr, trim($currency));
|
278 |
}
|
25 |
private $_advancedSQL = null;
|
26 |
private $_coreSQL = null;
|
27 |
|
28 |
+
private function validateStreetAddress($streetAddress)
|
29 |
+
{
|
30 |
+
$pattern = '#^(.+\D+){1} ([0-9]{1,})\s?([\s\/]?[0-9]{0,}?[\s\S]{0,}?)?$#i';
|
31 |
|
32 |
$aMatch = array();
|
|
|
|
|
|
|
33 |
|
34 |
+
if (preg_match($pattern, $streetAddress, $aMatch)) {
|
35 |
+
$street = utf8_decode($aMatch[1]);
|
36 |
+
$houseNumber = utf8_decode($aMatch[2]);
|
37 |
|
38 |
if (empty($street) || empty($houseNumber))
|
39 |
return false;
|
40 |
} else {
|
41 |
return false;
|
42 |
}
|
43 |
+
|
44 |
return true;
|
45 |
}
|
46 |
+
|
47 |
+
public function sales_quote_collect_totals_after(Varien_Event_Observer $observer)
|
48 |
+
{
|
49 |
$paymentMethod = Mage::app()->getFrontController()->getRequest()->getParam('payment');
|
50 |
+
|
51 |
if (!isset($paymentMethod))
|
52 |
return;
|
53 |
+
|
54 |
try {
|
55 |
$paymentMethodCode = $observer->getEvent()->getQuote()->getPayment()->getMethodInstance()->getCode();
|
56 |
$paymentMethodTitle = $observer->getEvent()->getQuote()->getPayment()->getMethodInstance()->getTitle();
|
57 |
} catch (Exception $e) {
|
58 |
return;
|
59 |
}
|
60 |
+
|
61 |
if (substr($paymentMethodCode, 0, 10) != "icepayadv_")
|
62 |
return;
|
63 |
|
64 |
+
if (strtoupper($paymentMethodTitle) != 'AFTERPAY')
|
65 |
return;
|
66 |
|
67 |
$message = false;
|
82 |
$message = "Your postal code is incorrect, must be in 11111 format.";
|
83 |
break;
|
84 |
}
|
85 |
+
|
86 |
$phoneNumber = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getTelephone();
|
87 |
+
|
88 |
switch (Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getCountry()) {
|
89 |
case 'NL':
|
90 |
if (!preg_match('/^\(?\+?\d{1,3}\)?\s?-?\s?[\d\s]*$/', $phoneNumber) OR strlen($phoneNumber) < 10) {
|
91 |
$message = "Your phonenumber is incorrect.";
|
92 |
}
|
93 |
+
break;
|
94 |
}
|
95 |
+
|
96 |
$billingStreetAddress = implode(' ', Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getStreet());
|
97 |
if (!$this->validateStreetAddress($billingStreetAddress)) {
|
98 |
$message = "Billing address incorrect.";
|
99 |
}
|
100 |
+
|
101 |
+
$shippingStreetAddress = implode(' ', Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getStreet());
|
102 |
if (!$this->validateStreetAddress($shippingStreetAddress)) {
|
103 |
$message = "Shipping address incorrect.";
|
104 |
}
|
106 |
if ($message) {
|
107 |
Mage::getSingleton('checkout/session')->addError($message);
|
108 |
|
109 |
+
Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
|
110 |
Mage::app()->getResponse()->sendResponse();
|
111 |
exit();
|
112 |
}
|
116 |
|
117 |
/* Save the payment */
|
118 |
|
119 |
+
public function sales_order_payment_place_end(Varien_Event_Observer $observer)
|
120 |
+
{
|
121 |
$payment = $observer->getPayment();
|
122 |
$pmName = $payment->getMethodInstance()->getCode();
|
123 |
|
132 |
|
133 |
/* From admin */
|
134 |
|
135 |
+
public function model_save_before(Varien_Event_Observer $observer)
|
136 |
+
{
|
137 |
/* Make sure we clear all the previously stored paymentmethods if the new total is less than stored in the database */
|
138 |
$data = $observer->getEvent()->getObject();
|
139 |
if ($data->getData("path") != "icecore/iceadvanced/webservice_data")
|
142 |
return;
|
143 |
if ($data->getData("scope") == "default" || $data->getData("scope") == "stores") {
|
144 |
$storeScope = $data->getData("scope_id");
|
145 |
+
}
|
146 |
+
else
|
147 |
return;
|
148 |
$this->advSQL()->setScope($storeScope);
|
149 |
$this->advSQL()->clearConfig();
|
150 |
}
|
151 |
|
152 |
+
private function set($setting)
|
153 |
+
{
|
154 |
$var = explode("_", $setting);
|
155 |
$this->_setting = $var;
|
156 |
}
|
157 |
|
158 |
+
private function getValue()
|
159 |
+
{
|
160 |
return $this->_value;
|
161 |
}
|
162 |
|
163 |
+
private function getIssuers()
|
164 |
+
{
|
165 |
return Mage::helper("icecore")->makeArray($this->_issuers['issuers']);
|
166 |
}
|
167 |
|
168 |
+
private function getIssuerPMCode()
|
169 |
+
{
|
170 |
if (isset($this->_issuers['code']))
|
171 |
return strtolower($this->_issuers['code']);
|
172 |
}
|
173 |
|
174 |
+
private function getIssuerMerchantID()
|
175 |
+
{
|
176 |
if (isset($this->_issuers['merchant']))
|
177 |
return strtolower($this->_issuers['merchant']);
|
178 |
}
|
179 |
|
180 |
+
private function getPMCode()
|
181 |
+
{
|
182 |
return strtolower($this->_setting[1]);
|
183 |
}
|
184 |
|
185 |
+
private function handle($object)
|
186 |
+
{
|
187 |
$this->_value = $object->getData("value");
|
188 |
|
189 |
if ($this->isIssuer())
|
190 |
$this->_issuers = $this->advSQL()->arrDecode($this->getValue());
|
191 |
}
|
192 |
|
193 |
+
private function isActivate()
|
194 |
+
{
|
195 |
return ($this->_setting[2] == "active") ? true : false;
|
196 |
}
|
197 |
|
198 |
+
private function isTitle()
|
199 |
+
{
|
200 |
return ($this->_setting[2] == "title") ? true : false;
|
201 |
}
|
202 |
|
203 |
+
private function isIssuer()
|
204 |
+
{
|
205 |
return ($this->_setting[2] == "issuer") ? true : false;
|
206 |
}
|
207 |
|
208 |
+
protected function advSQL()
|
209 |
+
{
|
210 |
if ($this->_advancedSQL == null)
|
211 |
$this->_advancedSQL = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced');
|
212 |
return $this->_advancedSQL;
|
213 |
}
|
214 |
|
215 |
+
protected function coreSQL()
|
216 |
+
{
|
217 |
if ($this->_coreSQL == null)
|
218 |
$this->_coreSQL = Mage::getSingleton('icecore/mysql4_iceCore');
|
219 |
return $this->_coreSQL;
|
220 |
}
|
221 |
|
222 |
+
public function model_save_after(Varien_Event_Observer $observer)
|
223 |
+
{
|
224 |
$data = $observer->getEvent()->getObject();
|
225 |
|
226 |
/* Save all the dynamic paymentmethods */
|
237 |
// Only allow payment and issuer data at default and store level
|
238 |
if ($data->getData("scope") == "default" || $data->getData("scope") == "stores") {
|
239 |
$storeScope = $data->getData("scope_id");
|
240 |
+
}
|
241 |
+
else
|
242 |
return;
|
243 |
$this->advSQL()->setScope($storeScope);
|
244 |
|
246 |
if ($this->isIssuer()) {
|
247 |
|
248 |
$issuerListArr = array();
|
249 |
+
foreach ($this->getIssuers() as $issuer) {
|
250 |
+
if (!in_array($issuer->IssuerKeyword, Mage::helper("iceadvanced")->filteredPaymentMethodIssuers))
|
251 |
+
array_push($issuerListArr, $issuer->IssuerKeyword);
|
252 |
}
|
253 |
+
|
254 |
$issuerList = implode(",", $issuerListArr);
|
255 |
|
256 |
/* Save paymentmethod through issuer data */
|
260 |
|
261 |
|
262 |
foreach ($this->getIssuers() as $issuer) {
|
263 |
+
if (in_array($issuer->IssuerKeyword, Mage::helper("iceadvanced")->filteredPaymentMethodIssuers))
|
264 |
+
continue;
|
265 |
|
266 |
$arrCountry = array();
|
267 |
$arrCurrency = array();
|
292 |
return;
|
293 |
}
|
294 |
|
295 |
+
private function addCurrencies($arr, $currencyArr)
|
296 |
+
{
|
297 |
foreach ($currencyArr as $currency) {
|
298 |
array_push($arr, trim($currency));
|
299 |
}
|
app/code/community/Icepay/IceAdvanced/Model/Order.php
ADDED
@@ -0,0 +1,640 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ICEPAY Advanced - Webservice Order
|
5 |
+
*
|
6 |
+
* @version 1.0.0
|
7 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
8 |
+
* @copyright ICEPAY <www.icepay.com>
|
9 |
+
*
|
10 |
+
* Disclaimer:
|
11 |
+
* The merchant is entitled to change de ICEPAY plug-in code,
|
12 |
+
* any changes will be at merchant's own risk.
|
13 |
+
* Requesting ICEPAY support for a modified plug-in will be
|
14 |
+
* charged in accordance with the standard ICEPAY tariffs.
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class Icepay_IceAdvanced_Model_Order {
|
18 |
+
|
19 |
+
private $data = array();
|
20 |
+
private $defaultVATCategories = array();
|
21 |
+
private $orderData;
|
22 |
+
private $consumerNode;
|
23 |
+
private $addressesNode;
|
24 |
+
private $productsNode;
|
25 |
+
private $debug = false;
|
26 |
+
|
27 |
+
public function __construct()
|
28 |
+
{
|
29 |
+
$this->setData('products', array());
|
30 |
+
|
31 |
+
$this->defaultVATCategories = array(
|
32 |
+
'zero' => 0,
|
33 |
+
'reduced-low' => array('1', '6'),
|
34 |
+
'reduced-middle' => array('7', '12'),
|
35 |
+
'standard' => array('13', '100')
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getProducts()
|
40 |
+
{
|
41 |
+
return $this->data['products'];
|
42 |
+
}
|
43 |
+
|
44 |
+
private function setData($tag, $object)
|
45 |
+
{
|
46 |
+
$this->data[$tag] = $object;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function setShippingAddress(Icepay_Order_Address $shippingAddress)
|
50 |
+
{
|
51 |
+
$this->setData('shippingAddress', $shippingAddress);
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function setBillingAddress(Icepay_Order_Address $billingAddress)
|
56 |
+
{
|
57 |
+
$this->setData('billingAddress', $billingAddress);
|
58 |
+
return $this;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function setConsumer(Icepay_Order_Consumer $consumer)
|
62 |
+
{
|
63 |
+
$this->setData('consumer', $consumer);
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function addProduct(Icepay_Order_Product $product)
|
68 |
+
{
|
69 |
+
array_push($this->data["products"], $product);
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function createAddress()
|
74 |
+
{
|
75 |
+
return new Icepay_Order_Address();
|
76 |
+
}
|
77 |
+
|
78 |
+
public function createConsumer()
|
79 |
+
{
|
80 |
+
return new Icepay_Order_Consumer();
|
81 |
+
}
|
82 |
+
|
83 |
+
public function createProduct()
|
84 |
+
{
|
85 |
+
return new Icepay_Order_Product();
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getCategoryForPercentage($number = null, $default = "exempt")
|
89 |
+
{
|
90 |
+
foreach ($this->defaultVATCategories as $category => $value) {
|
91 |
+
if (!is_array($value)) {
|
92 |
+
if ($value == $number)
|
93 |
+
return $category;
|
94 |
+
}
|
95 |
+
|
96 |
+
if ($number >= $value[0] && $number <= $value[1])
|
97 |
+
return $category;
|
98 |
+
}
|
99 |
+
|
100 |
+
return $default;
|
101 |
+
}
|
102 |
+
|
103 |
+
public function setOrderDiscountAmount($amount, $name = 'Discount', $description = 'Order Discount')
|
104 |
+
{
|
105 |
+
$obj = $this->createProduct();
|
106 |
+
$obj->setProductID('02')
|
107 |
+
->setProductName($name)
|
108 |
+
->setDescription($description)
|
109 |
+
->setQuantity('1')
|
110 |
+
->setUnitPrice(-$amount)
|
111 |
+
->setVATCategory($this->getCategoryForPercentage(-1));
|
112 |
+
|
113 |
+
$this->addProduct($obj);
|
114 |
+
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function setShippingCosts($amount, $vat = -1, $name = 'Shipping Costs')
|
119 |
+
{
|
120 |
+
$obj = $this->createProduct();
|
121 |
+
$obj->setProductID('01')
|
122 |
+
->setProductName($name)
|
123 |
+
->setDescription('')
|
124 |
+
->setQuantity('1')
|
125 |
+
->setUnitPrice($amount)
|
126 |
+
->setVATCategory($this->getCategoryForPercentage($vat));
|
127 |
+
|
128 |
+
$this->addProduct($obj);
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
private function array_to_xml($childs, $node = 'Order')
|
134 |
+
{
|
135 |
+
$childs = (array) $childs;
|
136 |
+
|
137 |
+
foreach ($childs as $key => $value) {
|
138 |
+
$node->addChild(ucfirst($key), $value);
|
139 |
+
}
|
140 |
+
|
141 |
+
return $node;
|
142 |
+
}
|
143 |
+
|
144 |
+
public function getXML()
|
145 |
+
{
|
146 |
+
|
147 |
+
$this->orderData = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Order></Order>");
|
148 |
+
$this->consumerNode = $this->orderData->addChild('Consumer');
|
149 |
+
$this->addressesNode = $this->orderData->addChild('Addresses');
|
150 |
+
$this->productsNode = $this->orderData->addChild('Products');
|
151 |
+
|
152 |
+
// Set Consumer
|
153 |
+
$this->array_to_xml($this->data['consumer'], $this->consumerNode);
|
154 |
+
|
155 |
+
// Set Addresses
|
156 |
+
$shippingNode = $this->addressesNode->addChild('Address');
|
157 |
+
$shippingNode->addAttribute('id', 'shipping');
|
158 |
+
|
159 |
+
$this->array_to_xml($this->data['shippingAddress'], $shippingNode);
|
160 |
+
|
161 |
+
$billingNode = $this->addressesNode->addChild('Address');
|
162 |
+
$billingNode->addAttribute('id', 'billing');
|
163 |
+
|
164 |
+
$this->array_to_xml($this->data['billingAddress'], $billingNode);
|
165 |
+
|
166 |
+
// Set Products
|
167 |
+
foreach ($this->data['products'] as $product) {
|
168 |
+
$productNode = $this->productsNode->addChild('Product');
|
169 |
+
$this->array_to_xml($product, $productNode);
|
170 |
+
}
|
171 |
+
|
172 |
+
if ($this->debug == true) {
|
173 |
+
header("Content-type: text/xml");
|
174 |
+
echo $this->orderData->asXML();
|
175 |
+
exit;
|
176 |
+
}
|
177 |
+
|
178 |
+
return $this->orderData->asXML();
|
179 |
+
}
|
180 |
+
|
181 |
+
public function validateOrder($paymentObj)
|
182 |
+
{
|
183 |
+
switch (strtoupper($paymentObj->getPaymentMethod())) {
|
184 |
+
case 'AFTERPAY':
|
185 |
+
if ($this->data['shippingAddress']->country !== $this->data['billingAddress']->country)
|
186 |
+
throw new Exception('Billing and Shipping country must be equal in order to use Afterpay.');
|
187 |
+
|
188 |
+
if (!Icepay_Order_Helper::validateZipCode($this->data['shippingAddress']->zipCode, $this->data['shippingAddress']->country))
|
189 |
+
throw new Exception('Zipcode format for shipping address is incorrect.');
|
190 |
+
|
191 |
+
if (!Icepay_Order_Helper::validateZipCode($this->data['billingAddress']->zipCode, $this->data['billingAddress']->country))
|
192 |
+
throw new Exception('Zipcode format for billing address is incorrect.');
|
193 |
+
|
194 |
+
if (!Icepay_Order_Helper::validatePhonenumber($this->data['consumer']->phone))
|
195 |
+
throw new Exception('Phonenumber is incorrect.');
|
196 |
+
|
197 |
+
break;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* ICEPAY - Webservice Order Consumer Class
|
205 |
+
*
|
206 |
+
* @version 1.0.0
|
207 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
208 |
+
* @copyright ICEPAY <www.icepay.com>
|
209 |
+
*/
|
210 |
+
class Icepay_Order_Consumer {
|
211 |
+
|
212 |
+
public $consumerID = '';
|
213 |
+
public $email = '';
|
214 |
+
public $phone = '';
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Sets the consumer ID
|
218 |
+
*
|
219 |
+
* @since 1.0.0
|
220 |
+
* @param string $consumerID
|
221 |
+
* @return \Icepay_Order_Consumer
|
222 |
+
*/
|
223 |
+
public function setConsumerID($consumerID)
|
224 |
+
{
|
225 |
+
$this->consumerID = (string) $consumerID;
|
226 |
+
return $this;
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Sets the consumer email address
|
231 |
+
*
|
232 |
+
* @since 1.0.0
|
233 |
+
* @param string $emailAddress
|
234 |
+
* @return \Icepay_Order_Consumer
|
235 |
+
*/
|
236 |
+
public function setEmailAddress($emailAddress)
|
237 |
+
{
|
238 |
+
$this->email = (string) $emailAddress;
|
239 |
+
return $this;
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* sets the consumer phonenumber
|
244 |
+
*
|
245 |
+
* @since 1.0.0
|
246 |
+
* @param string $phoneNumber
|
247 |
+
* @return \Icepay_Order_Consumer
|
248 |
+
*/
|
249 |
+
public function setPhoneNumber($phoneNumber)
|
250 |
+
{
|
251 |
+
$this->phone = (string) $phoneNumber;
|
252 |
+
return $this;
|
253 |
+
}
|
254 |
+
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* ICEPAY - Webservice Order Product Class
|
259 |
+
*
|
260 |
+
* @version 1.0.0
|
261 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
262 |
+
* @copyright ICEPAY <www.icepay.com>
|
263 |
+
*/
|
264 |
+
class Icepay_Order_Product {
|
265 |
+
|
266 |
+
public $productID = '00';
|
267 |
+
public $productName = '';
|
268 |
+
public $description = '';
|
269 |
+
public $quantity = '1';
|
270 |
+
public $unitPrice = '0';
|
271 |
+
public $VATCategory = 'standard';
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Sets the Product's ID
|
275 |
+
*
|
276 |
+
* @since 1.0.0
|
277 |
+
* @param string $productID
|
278 |
+
* @return \Icepay_Order_Product
|
279 |
+
*/
|
280 |
+
public function setProductID($productID)
|
281 |
+
{
|
282 |
+
$this->productID = (string) $productID;
|
283 |
+
return $this;
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Sets the Product's name
|
288 |
+
*
|
289 |
+
* @since 1.0.0
|
290 |
+
* @param string $productName
|
291 |
+
* @return \Icepay_Order_Product
|
292 |
+
*/
|
293 |
+
public function setProductName($productName)
|
294 |
+
{
|
295 |
+
$this->productName = (string) $productName;
|
296 |
+
return $this;
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Sets the description
|
301 |
+
*
|
302 |
+
* @since 1.0.0
|
303 |
+
* @param string $description
|
304 |
+
* @return \Icepay_Order_Product
|
305 |
+
*/
|
306 |
+
public function setDescription($description)
|
307 |
+
{
|
308 |
+
$this->description = (string) $description;
|
309 |
+
return $this;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Sets the quantity
|
314 |
+
*
|
315 |
+
* @since 1.0.0
|
316 |
+
* @param string $quantity
|
317 |
+
* @return \Icepay_Order_Product
|
318 |
+
*/
|
319 |
+
public function setQuantity($quantity)
|
320 |
+
{
|
321 |
+
$this->quantity = (string) $quantity;
|
322 |
+
return $this;
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Sets the unitprice
|
327 |
+
*
|
328 |
+
* @since 1.0.0
|
329 |
+
* @param string $unitPrice
|
330 |
+
* @return \Icepay_Order_Product
|
331 |
+
*/
|
332 |
+
public function setUnitPrice($unitPrice)
|
333 |
+
{
|
334 |
+
$this->unitPrice = (string) $unitPrice;
|
335 |
+
return $this;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Sets the VAT Category
|
340 |
+
*
|
341 |
+
* @since 1.0.0
|
342 |
+
* @param string $category
|
343 |
+
* @return \Icepay_Order_Product
|
344 |
+
*/
|
345 |
+
public function setVATCategory($category)
|
346 |
+
{
|
347 |
+
$this->VATCategory = (string) $category;
|
348 |
+
return $this;
|
349 |
+
}
|
350 |
+
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* ICEPAY - Webservice Order Address Class
|
355 |
+
*
|
356 |
+
* @version 1.0.0
|
357 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
358 |
+
* @copyright ICEPAY <www.icepay.com>
|
359 |
+
*/
|
360 |
+
class Icepay_Order_Address {
|
361 |
+
|
362 |
+
public $initials = '';
|
363 |
+
public $prefix = '';
|
364 |
+
public $lastName = '';
|
365 |
+
public $street = '';
|
366 |
+
public $houseNumber = '';
|
367 |
+
public $houseNumberAddition = '';
|
368 |
+
public $zipCode = '';
|
369 |
+
public $city = '';
|
370 |
+
public $country = '';
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Sets the address initials
|
374 |
+
*
|
375 |
+
* @since 1.0.0
|
376 |
+
* @param string $initials
|
377 |
+
* @return \Icepay_Order_Address
|
378 |
+
*/
|
379 |
+
public function setInitials($initials)
|
380 |
+
{
|
381 |
+
$initials = preg_replace('~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(utf8_encode($initials), ENT_QUOTES, 'UTF-8'));
|
382 |
+
|
383 |
+
$this->initials = (string) $initials;
|
384 |
+
return $this;
|
385 |
+
}
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Sets the address prefix
|
389 |
+
*
|
390 |
+
* @since 1.0.0
|
391 |
+
* @param string $prefix
|
392 |
+
* @return \Icepay_Order_Address
|
393 |
+
*/
|
394 |
+
public function setPrefix($prefix)
|
395 |
+
{
|
396 |
+
$this->prefix = (string) $prefix;
|
397 |
+
return $this;
|
398 |
+
}
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Sets the address lastname
|
402 |
+
*
|
403 |
+
* @since 1.0.0
|
404 |
+
* @param string $lastName
|
405 |
+
* @return \Icepay_Order_Address
|
406 |
+
*/
|
407 |
+
public function setLastname($lastName)
|
408 |
+
{
|
409 |
+
$lastName = preg_replace('~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(utf8_encode($lastName), ENT_QUOTES, 'UTF-8'));
|
410 |
+
|
411 |
+
$this->lastName = (string) $lastName;
|
412 |
+
return $this;
|
413 |
+
}
|
414 |
+
|
415 |
+
/**
|
416 |
+
* Sets the address streetname
|
417 |
+
*
|
418 |
+
* @since 1.0.0
|
419 |
+
* @param string $streetName
|
420 |
+
* @return \Icepay_Order_Address
|
421 |
+
*/
|
422 |
+
public function setStreetName($streetName)
|
423 |
+
{
|
424 |
+
$streetName = preg_replace('~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(utf8_encode($streetName), ENT_QUOTES, 'UTF-8'));
|
425 |
+
$this->street = (string) $streetName;
|
426 |
+
return $this;
|
427 |
+
}
|
428 |
+
|
429 |
+
/**
|
430 |
+
* Sets the address housenumber
|
431 |
+
*
|
432 |
+
* @since 1.0.0
|
433 |
+
* @param string $houseNumber
|
434 |
+
* @return \Icepay_Order_Address
|
435 |
+
*/
|
436 |
+
public function setHouseNumber($houseNumber)
|
437 |
+
{
|
438 |
+
$this->houseNumber = (string) $houseNumber;
|
439 |
+
return $this;
|
440 |
+
}
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Sets the address housenumber addition
|
444 |
+
*
|
445 |
+
* @since 1.0.0
|
446 |
+
* @param string $houseNumberAddition
|
447 |
+
* @return \Icepay_Order_Address
|
448 |
+
*/
|
449 |
+
public function setHouseNumberAddition($houseNumberAddition)
|
450 |
+
{
|
451 |
+
$this->houseNumberAddition = (string) $houseNumberAddition;
|
452 |
+
return $this;
|
453 |
+
}
|
454 |
+
|
455 |
+
/**
|
456 |
+
* Sets the address zipcode
|
457 |
+
*
|
458 |
+
* @since 1.0.0
|
459 |
+
* @param string $zipCode
|
460 |
+
* @return \Icepay_Order_Address
|
461 |
+
*/
|
462 |
+
public function setZipCode($zipCode)
|
463 |
+
{
|
464 |
+
$this->zipCode = (string) $zipCode;
|
465 |
+
return $this;
|
466 |
+
}
|
467 |
+
|
468 |
+
/**
|
469 |
+
* Sets the address city
|
470 |
+
*
|
471 |
+
* @since 1.0.0
|
472 |
+
* @param string $city
|
473 |
+
* @return \Icepay_Order_Address
|
474 |
+
*/
|
475 |
+
public function setCity($city)
|
476 |
+
{
|
477 |
+
$this->city = (string) $city;
|
478 |
+
return $this;
|
479 |
+
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Sets the address country
|
483 |
+
*
|
484 |
+
* @since 1.0.0
|
485 |
+
* @param string $country
|
486 |
+
* @return \Icepay_Order_Address
|
487 |
+
*/
|
488 |
+
public function setCountry($country)
|
489 |
+
{
|
490 |
+
$this->country = (string) $country;
|
491 |
+
return $this;
|
492 |
+
}
|
493 |
+
|
494 |
+
}
|
495 |
+
|
496 |
+
/**
|
497 |
+
* ICEPAY - Webservice Order Helper Class
|
498 |
+
*
|
499 |
+
* The Order Helper class contains handy fuctions to validate the input, such as a telephonenumber and zipcode check
|
500 |
+
*
|
501 |
+
* @version 1.0.0
|
502 |
+
*
|
503 |
+
* @author Wouter van Tilburg
|
504 |
+
* @author Olaf Abbenhuis
|
505 |
+
* @copyright Copyright (c) 2011-2012, ICEPAY
|
506 |
+
*/
|
507 |
+
class Icepay_Order_Helper {
|
508 |
+
|
509 |
+
private static $street;
|
510 |
+
private static $houseNumber;
|
511 |
+
private static $houseNumberAddition;
|
512 |
+
|
513 |
+
/**
|
514 |
+
* Sets and explodes the streetaddress
|
515 |
+
*
|
516 |
+
* @since 1.0.0
|
517 |
+
* @param string Contains the street address
|
518 |
+
* @return Icepay_Order_Helper
|
519 |
+
*/
|
520 |
+
public static function setStreetAddress($streetAddress)
|
521 |
+
{
|
522 |
+
self::explodeStreetAddress($streetAddress);
|
523 |
+
|
524 |
+
return new self;
|
525 |
+
}
|
526 |
+
|
527 |
+
/**
|
528 |
+
* Get the street from address
|
529 |
+
*
|
530 |
+
* @since 1.0.0
|
531 |
+
* @param string Contains the street address
|
532 |
+
* @return Icepay_Order_Helper
|
533 |
+
*/
|
534 |
+
public static function getStreetFromAddress($streetAddress = null)
|
535 |
+
{
|
536 |
+
if ($streetAddress)
|
537 |
+
self::explodeStreetAddress($streetAddress);
|
538 |
+
|
539 |
+
return self::$street;
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Get the housenumber from address
|
544 |
+
*
|
545 |
+
* @since 1.0.0
|
546 |
+
* @param string Contains the street address
|
547 |
+
* @return Icepay_Order_Helper
|
548 |
+
*/
|
549 |
+
public static function getHouseNumberFromAddress($streetAddress = null)
|
550 |
+
{
|
551 |
+
if ($streetAddress)
|
552 |
+
self::explodeStreetAddress($streetAddress);
|
553 |
+
|
554 |
+
return self::$houseNumber;
|
555 |
+
}
|
556 |
+
|
557 |
+
/**
|
558 |
+
* Get the housenumber addition from address
|
559 |
+
*
|
560 |
+
* @since 1.0.0
|
561 |
+
* @param string Contains the street address
|
562 |
+
* @return Icepay_Order_Helper
|
563 |
+
*/
|
564 |
+
public static function getHouseNumberAdditionFromAddress($streetAddress = null)
|
565 |
+
{
|
566 |
+
if ($streetAddress)
|
567 |
+
self::explodeStreetAddress($streetAddress);
|
568 |
+
|
569 |
+
return self::$houseNumberAddition;
|
570 |
+
}
|
571 |
+
|
572 |
+
/**
|
573 |
+
* Validates a zipcode based on country
|
574 |
+
*
|
575 |
+
* @since 1.0.0
|
576 |
+
* @param string $zipCode A string containing the zipcode
|
577 |
+
* @param string $country A string containing the ISO 3166-1 alpha-2 code of the country
|
578 |
+
* @example validateZipCode('1122AA', 'NL')
|
579 |
+
* @return boolean
|
580 |
+
*/
|
581 |
+
public static function validateZipCode($zipCode, $country)
|
582 |
+
{
|
583 |
+
switch (strtoupper($country)) {
|
584 |
+
case 'NL':
|
585 |
+
if (preg_match('/^[1-9]{1}[0-9]{3}[A-Z]{2}$/', $zipCode))
|
586 |
+
return true;
|
587 |
+
break;
|
588 |
+
case 'BE':
|
589 |
+
if (preg_match('/^[1-9]{4}$/', $zipCode))
|
590 |
+
return true;
|
591 |
+
break;
|
592 |
+
case 'DE':
|
593 |
+
if (preg_match('/^[1-9]{5}$/', $zipCode))
|
594 |
+
return true;
|
595 |
+
break;
|
596 |
+
}
|
597 |
+
|
598 |
+
return false;
|
599 |
+
}
|
600 |
+
|
601 |
+
/**
|
602 |
+
* Validates a phonenumber
|
603 |
+
*
|
604 |
+
* @since 1.0.0
|
605 |
+
* @param string Contains the phonenumber
|
606 |
+
* @return boolean
|
607 |
+
*/
|
608 |
+
public static function validatePhonenumber($phoneNumber)
|
609 |
+
{
|
610 |
+
if (strlen($phoneNumber) < 10) {
|
611 |
+
return false;
|
612 |
+
}
|
613 |
+
|
614 |
+
if (preg_match('/^(?:\((\+?\d+)?\)|\+?\d+) ?\d*(-?\d{2,3} ?){0,4}$/', $phoneNumber)) {
|
615 |
+
return true;
|
616 |
+
}
|
617 |
+
|
618 |
+
return false;
|
619 |
+
}
|
620 |
+
|
621 |
+
private static function explodeStreetAddress($streetAddress)
|
622 |
+
{
|
623 |
+
|
624 |
+
$streetAddress = utf8_decode($streetAddress);
|
625 |
+
|
626 |
+
$pattern = '#^(.+\D+){1} ([0-9]{1,})\s?([\s\/]?[0-9]{0,}?[\s\S]{0,}?)?$#i';
|
627 |
+
|
628 |
+
$aMatch = array();
|
629 |
+
|
630 |
+
if (preg_match($pattern, $streetAddress, $aMatch)) {
|
631 |
+
self::$street = $aMatch[1];
|
632 |
+
self::$houseNumber = $aMatch[2];
|
633 |
+
|
634 |
+
$houseNumberAddition = $aMatch[3];
|
635 |
+
$hNa = str_replace('/', '', $houseNumberAddition);
|
636 |
+
self::$houseNumberAddition = $hNa;
|
637 |
+
}
|
638 |
+
}
|
639 |
+
|
640 |
+
}
|
app/code/community/Icepay/IceAdvanced/Model/Pay.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* ICEPAY Advanced - Start payment
|
5 |
* @version 1.0.0
|
6 |
-
* @author
|
7 |
* @copyright ICEPAY <www.icepay.com>
|
8 |
*
|
9 |
* Disclaimer:
|
@@ -13,151 +13,168 @@
|
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
16 |
-
require_once('icepay_api_order.php');
|
17 |
-
|
18 |
class Icepay_IceAdvanced_Model_Pay extends Mage_Payment_Model_Method_Abstract {
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
public function __construct()
|
|
|
23 |
$this->sqlModel = Mage::getModel('icecore/mysql4_iceCore');
|
24 |
}
|
25 |
|
26 |
-
public function getCheckoutResult()
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
$icedata = $this->sqlModel->loadPaymentByID($session->getLastRealOrderId());
|
29 |
|
|
|
30 |
$paymentData = unserialize(urldecode($icedata["transaction_data"]));
|
31 |
-
$webservice = Mage::getModel('icecore/icepay_webservice_api');
|
32 |
-
|
33 |
-
$webservice->webservice(
|
34 |
-
$this->getValueForStore($icedata["store_id"], Icepay_IceCore_Model_Config::MERCHANTID), $this->getValueForStore($icedata["store_id"], Icepay_IceCore_Model_Config::SECRETCODE)
|
35 |
-
);
|
36 |
-
|
37 |
-
$checkoutResult = null;
|
38 |
-
|
39 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($paymentData['ic_orderid']);
|
40 |
-
|
41 |
-
if (strtoupper($paymentData['ic_paymentmethod']) == 'AFTERPAY') {
|
42 |
-
// Fetch the Icepay_Order class
|
43 |
-
$ic_order = Icepay_Order::getInstance();
|
44 |
-
|
45 |
-
// Set consumer information
|
46 |
-
$ic_order->setConsumer(Icepay_Order_Consumer::create()
|
47 |
-
->setConsumerID($order->getCustomerName())
|
48 |
-
->setEmail($order->getCustomerEmail())
|
49 |
-
->setPhone($order->getBillingAddress()->getTelephone())
|
50 |
-
);
|
51 |
-
|
52 |
-
$billingStreetaddress = implode(' ', $order->getBillingAddress()->getStreet());
|
53 |
-
|
54 |
-
// Set the billing address
|
55 |
-
$ic_order->setBillingAddress(Icepay_Order_Address::create()
|
56 |
-
->setInitials($order->getBillingAddress()->getFirstname())
|
57 |
-
->setPrefix($order->getBillingAddress()->getPrefix())
|
58 |
-
->setLastName($order->getBillingAddress()->getLastname())
|
59 |
-
->setStreet(Icepay_Order_Helper::getStreetFromAddress($billingStreetaddress))
|
60 |
-
->setHouseNumber(Icepay_Order_Helper::getHouseNumberFromAddress())
|
61 |
-
->setHouseNumberAddition(Icepay_Order_Helper::getHouseNumberAdditionFromAddress())
|
62 |
-
->setZipCode($order->getBillingAddress()->getPostcode())
|
63 |
-
->setCity($order->getBillingAddress()->getCity())
|
64 |
-
->setCountry($order->getBillingAddress()->getCountry())
|
65 |
-
);
|
66 |
-
|
67 |
-
$shippingStreetAddress = implode(' ', $order->getShippingAddress()->getStreet());
|
68 |
-
|
69 |
-
// Set the shipping address
|
70 |
-
$ic_order->setShippingAddress(Icepay_Order_Address::create()
|
71 |
-
->setInitials($order->getShippingAddress()->getFirstname())
|
72 |
-
->setPrefix($order->getShippingAddress()->getPrefix())
|
73 |
-
->setLastName($order->getShippingAddress()->getLastname())
|
74 |
-
->setStreet(Icepay_Order_Helper::getStreetFromAddress($shippingStreetAddress))
|
75 |
-
->setHouseNumber(Icepay_Order_Helper::getHouseNumberFromAddress())
|
76 |
-
->setHouseNumberAddition(Icepay_Order_Helper::getHouseNumberAdditionFromAddress())
|
77 |
-
->setZipCode($order->getShippingAddress()->getPostcode())
|
78 |
-
->setCity($order->getShippingAddress()->getCity())
|
79 |
-
->setCountry($order->getShippingAddress()->getCountry())
|
80 |
-
);
|
81 |
-
|
82 |
-
$orderItems = $order->getItemsCollection();
|
83 |
-
|
84 |
-
foreach ($orderItems as $item) {
|
85 |
-
$itemData = $item->getData();
|
86 |
-
|
87 |
-
if ($itemData['price'] == 0)
|
88 |
-
continue;
|
89 |
-
|
90 |
-
$product = Mage::getModel('catalog/product')->load($itemData['product_id']);
|
91 |
-
$productData = $product->getData();
|
92 |
-
|
93 |
-
$itemData['price'] * $itemData['tax_percent'];
|
94 |
-
|
95 |
-
$itemData['price_incl_tax'] = number_format($itemData['price_incl_tax'], 2);
|
96 |
-
|
97 |
-
if ($productData['tax_class_id'] == '0')
|
98 |
-
$itemData['tax_percent'] = -1;
|
99 |
-
|
100 |
-
$itemData['description'] = (isset($itemData['description'])) ? $itemData['description'] : '';
|
101 |
-
// Add the products
|
102 |
-
$ic_order->addProduct(Icepay_Order_Product::create()
|
103 |
-
->setProductID($itemData['item_id'])
|
104 |
-
->setProductName($itemData['name'])
|
105 |
-
->setDescription($itemData['description'])
|
106 |
-
->setQuantity(round($itemData['qty_ordered']))
|
107 |
-
->setUnitPrice($itemData['price_incl_tax'] * 100)
|
108 |
-
->setVATCategory(Icepay_Order_VAT::getCategoryForPercentage($itemData['tax_percent']))
|
109 |
-
);
|
110 |
-
}
|
111 |
|
112 |
-
|
|
|
|
|
113 |
|
114 |
-
|
115 |
-
|
|
|
116 |
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
138 |
}
|
139 |
-
|
140 |
-
// Log the XML Send
|
141 |
-
Mage::helper("icecore")->log(serialize(Icepay_Order::getInstance()->createXML()));
|
142 |
}
|
143 |
|
144 |
try {
|
145 |
-
|
146 |
-
$paymentData['ic_amount'], $paymentData['ic_country'], $paymentData['ic_currency'], $paymentData['ic_language'], $paymentData['ic_description'], $paymentData['ic_paymentmethod'], $paymentData['ic_issuer'], $paymentData['ic_orderid'], $paymentData['ic_reference']
|
147 |
-
);
|
148 |
} catch (Exception $e) {
|
149 |
-
|
150 |
}
|
151 |
-
|
152 |
-
return $checkoutResult;
|
153 |
-
}
|
154 |
-
|
155 |
-
protected function getValueForStore($store, $val) {
|
156 |
-
return Mage::helper('icecore')->getConfigForStore($store, $val);
|
157 |
-
}
|
158 |
-
|
159 |
-
protected function getCheckout() {
|
160 |
-
return Mage::getSingleton('checkout/session');
|
161 |
}
|
162 |
|
163 |
}
|
3 |
/**
|
4 |
* ICEPAY Advanced - Start payment
|
5 |
* @version 1.0.0
|
6 |
+
* @author Wouter van Tilburg
|
7 |
* @copyright ICEPAY <www.icepay.com>
|
8 |
*
|
9 |
* Disclaimer:
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
|
|
|
|
16 |
class Icepay_IceAdvanced_Model_Pay extends Mage_Payment_Model_Method_Abstract {
|
17 |
|
18 |
+
private $sqlModel;
|
19 |
+
|
20 |
+
public function __construct()
|
21 |
+
{
|
22 |
$this->sqlModel = Mage::getModel('icecore/mysql4_iceCore');
|
23 |
}
|
24 |
|
25 |
+
public function getCheckoutResult()
|
26 |
+
{
|
27 |
+
// Get Magento's checkout session
|
28 |
+
$session = Mage::getSingleton('checkout/session');
|
29 |
+
|
30 |
+
// Retrieve icepay order
|
31 |
$icedata = $this->sqlModel->loadPaymentByID($session->getLastRealOrderId());
|
32 |
|
33 |
+
// Retrieve payment data
|
34 |
$paymentData = unserialize(urldecode($icedata["transaction_data"]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
// Retrieve merchant id and secretcode
|
37 |
+
$merchantID = Mage::app()->getStore($icedata["store_id"])->getConfig(Icepay_IceCore_Model_Config::MERCHANTID);
|
38 |
+
$secretCode = Mage::app()->getStore($icedata["store_id"])->getConfig(Icepay_IceCore_Model_Config::SECRETCODE);
|
39 |
|
40 |
+
// Initialize webservice
|
41 |
+
$webservice = Mage::getModel('Icepay_IceAdvanced_Model_Webservice_Advanced');
|
42 |
+
$webservice->init($merchantID, $secretCode);
|
43 |
|
44 |
+
// Create the PaymentObject
|
45 |
+
$paymentObject = Mage::getModel('Icepay_IceAdvanced_Model_Checkout_PaymentObject');
|
46 |
+
$paymentObject->setAmount($paymentData['ic_amount'])
|
47 |
+
->setCountry($paymentData['ic_country'])
|
48 |
+
->setLanguage($paymentData['ic_language'])
|
49 |
+
->setCurrency($paymentData['ic_currency'])
|
50 |
+
->setPaymentMethod($paymentData['ic_paymentmethod'])
|
51 |
+
->setPaymentMethodIssuer($paymentData['ic_issuer'])
|
52 |
+
->setReference($paymentData['ic_reference'])
|
53 |
+
->setOrderID($paymentData['ic_orderid'])
|
54 |
+
->setDescription($paymentData['ic_description']);
|
55 |
|
56 |
+
// Fetch the Icepay_Order class
|
57 |
+
$ic_order = Mage::getModel('iceadvanced/order');
|
58 |
+
|
59 |
+
if ($webservice->isExtendedCheckout($paymentData['ic_paymentmethod'])) {
|
60 |
+
try {
|
61 |
+
// Retrieve Magento Order
|
62 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($paymentData['ic_orderid']);
|
63 |
+
|
64 |
+
// Add the consumer information for Afterpay
|
65 |
+
$consumer = $ic_order->createConsumer()
|
66 |
+
->setConsumerID($order->getCustomerName())
|
67 |
+
->setEmailAddress($order->getCustomerEmail())
|
68 |
+
->setPhoneNumber($order->getBillingAddress()->getTelephone());
|
69 |
+
|
70 |
+
$ic_order->setConsumer($consumer);
|
71 |
+
|
72 |
+
// Add the billing address information for Afterpay
|
73 |
+
$billingStreetaddress = implode(' ', $order->getBillingAddress()->getStreet());
|
74 |
+
|
75 |
+
$billingAddress = $ic_order->createAddress()
|
76 |
+
->setInitials($order->getBillingAddress()->getFirstname())
|
77 |
+
->setPrefix($order->getBillingAddress()->getPrefix())
|
78 |
+
->setLastName($order->getBillingAddress()->getLastname())
|
79 |
+
->setStreetName(Icepay_Order_Helper::getStreetFromAddress($billingStreetaddress))
|
80 |
+
->setHouseNumber(Icepay_Order_Helper::getHouseNumberFromAddress())
|
81 |
+
->setHouseNumberAddition(Icepay_Order_Helper::getHouseNumberAdditionFromAddress())
|
82 |
+
->setZipCode($order->getBillingAddress()->getPostcode())
|
83 |
+
->setCity($order->getBillingAddress()->getCity())
|
84 |
+
->setCountry($order->getBillingAddress()->getCountry());
|
85 |
+
|
86 |
+
$ic_order->setBillingAddress($billingAddress);
|
87 |
+
|
88 |
+
// Add the shipping address information for Afterpay
|
89 |
+
$shippingStreetAddress = implode(' ', $order->getShippingAddress()->getStreet());
|
90 |
+
|
91 |
+
$shippingAddress = $ic_order->createAddress()
|
92 |
+
->setInitials($order->getShippingAddress()->getFirstname())
|
93 |
+
->setPrefix($order->getShippingAddress()->getPrefix())
|
94 |
+
->setLastName($order->getShippingAddress()->getLastname())
|
95 |
+
->setStreetName(Icepay_Order_Helper::getStreetFromAddress($shippingStreetAddress))
|
96 |
+
->setHouseNumber(Icepay_Order_Helper::getHouseNumberFromAddress())
|
97 |
+
->setHouseNumberAddition(Icepay_Order_Helper::getHouseNumberAdditionFromAddress())
|
98 |
+
->setZipCode($order->getShippingAddress()->getPostcode())
|
99 |
+
->setCity($order->getShippingAddress()->getCity())
|
100 |
+
->setCountry($order->getShippingAddress()->getCountry());
|
101 |
+
|
102 |
+
$ic_order->setShippingAddress($shippingAddress);
|
103 |
+
|
104 |
+
// Add item specification for Afterpay
|
105 |
+
$orderItems = $order->getItemsCollection();
|
106 |
+
|
107 |
+
foreach ($orderItems as $item) {
|
108 |
+
$itemData = $item->getData();
|
109 |
+
|
110 |
+
if ($itemData['price'] == 0)
|
111 |
+
continue;
|
112 |
+
|
113 |
+
$product = Mage::getModel('catalog/product')->load($itemData['product_id']);
|
114 |
+
$productData = $product->getData();
|
115 |
+
|
116 |
+
$itemData['price'] * $itemData['tax_percent'];
|
117 |
+
|
118 |
+
$itemData['price_incl_tax'] = number_format($itemData['price_incl_tax'], 2);
|
119 |
+
|
120 |
+
if ($productData['tax_class_id'] == '0')
|
121 |
+
$itemData['tax_percent'] = -1;
|
122 |
+
|
123 |
+
|
124 |
+
// Add the products
|
125 |
+
$itemData['description'] = (isset($itemData['description'])) ? $itemData['description'] : '';
|
126 |
+
|
127 |
+
$ic_product = $ic_order->createProduct()
|
128 |
+
->setProductID($itemData['item_id'])
|
129 |
+
->setProductName($itemData['name'])
|
130 |
+
->setDescription($itemData['description'])
|
131 |
+
->setQuantity(round($itemData['qty_ordered']))
|
132 |
+
->setUnitPrice($itemData['price_incl_tax'] * 100)
|
133 |
+
->setVATCategory($ic_order->getCategoryForPercentage($itemData['tax_percent']));
|
134 |
+
|
135 |
+
$ic_order->addproduct($ic_product);
|
136 |
+
}
|
137 |
+
|
138 |
+
$orderData = $order->getData();
|
139 |
+
|
140 |
+
// Set total order discount if any
|
141 |
+
$discount = $orderData['base_discount_amount'] * 100;
|
142 |
+
|
143 |
+
if ($discount != '0')
|
144 |
+
$ic_order->setOrderDiscountAmount(-$discount);
|
145 |
+
|
146 |
+
// Set shipping costs
|
147 |
+
if ($orderData['shipping_amount'] != 0) {
|
148 |
+
$shippingCosts = ($orderData['shipping_amount'] + $orderData['shipping_tax_amount']) * 100;
|
149 |
+
$shippingTax = $orderData['shipping_tax_amount'] / $orderData['shipping_amount'] * 100;
|
150 |
+
|
151 |
+
$ic_order->setShippingCosts($shippingCosts, $shippingTax);
|
152 |
+
} else {
|
153 |
+
$ic_order->setShippingCosts(0, -1);
|
154 |
+
}
|
155 |
|
156 |
+
if (Mage::helper('icecore')->isModuleInstalled('MW_GiftWrap')) {
|
157 |
+
$giftWrapExtension = Mage::getModel('iceadvanced/extensions_MW_GiftWrap');
|
158 |
+
$ic_order = $giftWrapExtension->addGiftWrapPrices($session->getLastQuoteId(), $ic_order);
|
159 |
+
}
|
160 |
|
161 |
+
if (Mage::helper('icecore')->isModuleInstalled('Magestore_Customerreward')) {
|
162 |
+
$customerRewardExtension = Mage::getModel('iceadvanced/extensions_MS_Customerreward');
|
163 |
+
$ic_order = $customerRewardExtension->addCustomerRewardPrices($orderData, $ic_order);
|
164 |
+
}
|
165 |
|
166 |
+
// Log the XML Send
|
167 |
+
Mage::helper("icecore")->log(serialize($ic_order->getXML()));
|
168 |
+
} catch (Exception $e) {
|
169 |
+
return $e->getMessage();
|
170 |
}
|
|
|
|
|
|
|
171 |
}
|
172 |
|
173 |
try {
|
174 |
+
return $webservice->doCheckout($paymentObject, $ic_order);
|
|
|
|
|
175 |
} catch (Exception $e) {
|
176 |
+
return $e->getMessage();
|
177 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
|
180 |
}
|
app/code/community/Icepay/IceAdvanced/Model/Paymentmethods.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ICEPAY Advanced - Webservice Paymentmethods
|
5 |
+
* @version 2.0.0
|
6 |
+
* @author Wouter van Tilburg
|
7 |
+
* @author Olaf Abbenhuis
|
8 |
+
* @copyright ICEPAY <www.icepay.com>
|
9 |
+
*
|
10 |
+
* Disclaimer:
|
11 |
+
* The merchant is entitled to change de ICEPAY plug-in code,
|
12 |
+
* any changes will be at merchant's own risk.
|
13 |
+
* Requesting ICEPAY support for a modified plug-in will be
|
14 |
+
* charged in accordance with the standard ICEPAY tariffs.
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class Icepay_IceAdvanced_Model_Paymentmethods {
|
18 |
+
|
19 |
+
protected $storeID = null;
|
20 |
+
private $messages = array();
|
21 |
+
|
22 |
+
public function retrieveAdminGrid($storeID)
|
23 |
+
{
|
24 |
+
$this->storeID = $storeID;
|
25 |
+
|
26 |
+
return $this->retrievePaymentmethods();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function retrievePaymentmethods()
|
30 |
+
{
|
31 |
+
$merchantID = Mage::getStoreConfig('icecore/settings/merchant_id', $this->storeID);
|
32 |
+
$secretCode = Mage::getStoreConfig('icecore/settings/merchant_secret', $this->storeID);
|
33 |
+
|
34 |
+
$submitObject = new stdClass();
|
35 |
+
|
36 |
+
$webservice = Mage::getModel('Icepay_IceAdvanced_Model_Webservice_Advanced');
|
37 |
+
$webservice->init($merchantID, $secretCode);
|
38 |
+
|
39 |
+
try {
|
40 |
+
$paymentMethods = $webservice->getMyPaymentMethods();
|
41 |
+
$this->addMessage('SOAP connection established', 'ok');
|
42 |
+
|
43 |
+
if (isset($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod)) {
|
44 |
+
$pMethods = $this->clean($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod);
|
45 |
+
|
46 |
+
$this->addMessage(sprintf(Mage::helper('iceadvanced')->__('%s active paymentmethods found'), count($pMethods)), 'ok');
|
47 |
+
|
48 |
+
// Add issuers
|
49 |
+
$issuerObj = array();
|
50 |
+
foreach ($pMethods as $value) {
|
51 |
+
$arr = array(
|
52 |
+
'merchant' => $merchantID,
|
53 |
+
'code' => $value->PaymentMethodCode,
|
54 |
+
'issuers' => $value->Issuers->Issuer
|
55 |
+
);
|
56 |
+
array_push($issuerObj, array(
|
57 |
+
'pmcode' => $value->PaymentMethodCode,
|
58 |
+
'data' => urlencode(serialize($arr))
|
59 |
+
));
|
60 |
+
}
|
61 |
+
|
62 |
+
$submitObject->paymentmethods = Mage::helper("iceadvanced")->addIcons($pMethods);
|
63 |
+
|
64 |
+
$submitObject->issuers = $issuerObj;
|
65 |
+
} else {
|
66 |
+
$this->addMessage(Mage::helper('iceadvanced')->__('No active paymentmethods found'));
|
67 |
+
}
|
68 |
+
} catch (Exception $e) {
|
69 |
+
$this->addMessage('SOAP connection established', 'ok');
|
70 |
+
$this->addMessage($e->getMessage());
|
71 |
+
}
|
72 |
+
|
73 |
+
$submitObject->msg = $this->messages;
|
74 |
+
|
75 |
+
return $submitObject;
|
76 |
+
}
|
77 |
+
|
78 |
+
private function clean($paymentMethods)
|
79 |
+
{
|
80 |
+
//Convert to array (in case one payment method is active)
|
81 |
+
$pMethodsArray = Mage::helper('icecore')->makeArray($paymentMethods);
|
82 |
+
|
83 |
+
//Filter
|
84 |
+
$pMethods = array_values($this->filterPaymentmethods($pMethodsArray));
|
85 |
+
|
86 |
+
return $pMethods;
|
87 |
+
}
|
88 |
+
|
89 |
+
private function filterPaymentmethods($paymentMethods)
|
90 |
+
{
|
91 |
+
$filter = Mage::helper("iceadvanced")->filteredPaymentmethods;
|
92 |
+
foreach (array_keys((array) $paymentMethods) as $key) {
|
93 |
+
if (in_array($paymentMethods[$key]->PaymentMethodCode, $filter))
|
94 |
+
unset($paymentMethods[$key]);
|
95 |
+
};
|
96 |
+
return $paymentMethods;
|
97 |
+
}
|
98 |
+
|
99 |
+
private function addMessage($val, $type = 'err')
|
100 |
+
{
|
101 |
+
$msg = new stdClass();
|
102 |
+
$msg->type = $type;
|
103 |
+
$msg->msg = Mage::helper('iceadvanced')->__($val);
|
104 |
+
|
105 |
+
array_push($this->messages, $msg);
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
?>
|
app/code/community/Icepay/IceAdvanced/Model/Webservice.php
DELETED
@@ -1,219 +0,0 @@
|
|
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 $_storeID = null;
|
22 |
-
|
23 |
-
public function connection($merchantID, $secretCode) {
|
24 |
-
|
25 |
-
return $this->webservice($merchantID, $secretCode);
|
26 |
-
}
|
27 |
-
|
28 |
-
protected function generateChecksum($obj = null, $paymentID = null) {
|
29 |
-
$arr = array();
|
30 |
-
|
31 |
-
array_push($arr, $this->getMerchantID());
|
32 |
-
array_push($arr, $this->getSecretCode());
|
33 |
-
array_push($arr, $this->getTimeStamp());
|
34 |
-
|
35 |
-
if ($paymentID)
|
36 |
-
array_push($arr, $paymentID);
|
37 |
-
|
38 |
-
return sha1(implode("|", $arr));
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getMyPaymentMethods() {
|
42 |
-
|
43 |
-
$obj = new stdClass();
|
44 |
-
|
45 |
-
$obj->MerchantID = $this->getMerchantID();
|
46 |
-
$obj->Timestamp = $this->getTimeStamp();
|
47 |
-
$obj->Checksum = $this->generateChecksum($obj);
|
48 |
-
|
49 |
-
return $this->client->GetMyPaymentMethods(array('request'=>$obj));
|
50 |
-
}
|
51 |
-
|
52 |
-
public function setScopeID($storeID){
|
53 |
-
$this->_storeID = $storeID;
|
54 |
-
}
|
55 |
-
|
56 |
-
private function getScopeID(){
|
57 |
-
return $this->_storeID;
|
58 |
-
}
|
59 |
-
|
60 |
-
public function retrieveAdminGrid(){
|
61 |
-
|
62 |
-
$obj = $this->retrievePaymentmethods();
|
63 |
-
|
64 |
-
//Alter codes to images
|
65 |
-
$obj->paymentmethods = Mage::helper("iceadvanced")->addIcons($obj->paymentmethods);
|
66 |
-
|
67 |
-
return $obj;
|
68 |
-
}
|
69 |
-
|
70 |
-
public function retrievePaymentmethods() {
|
71 |
-
|
72 |
-
$submitObject = new stdClass();
|
73 |
-
$msgs = array();
|
74 |
-
|
75 |
-
if (!$this->doBasicChecks()) {
|
76 |
-
$submitObject->msg = array($this->addMessage("Basic configuration not properly set"));
|
77 |
-
$this->getResponse()->setBody(Zend_Json::encode($submitObject));
|
78 |
-
return;
|
79 |
-
}
|
80 |
-
|
81 |
-
// Start connection
|
82 |
-
$this->connection(
|
83 |
-
$this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID),
|
84 |
-
$this->getValueForStore(Icepay_IceCore_Model_Config::SECRETCODE)
|
85 |
-
);
|
86 |
-
|
87 |
-
// Catch Exception for display
|
88 |
-
try {
|
89 |
-
$paymentMethods = $this->getMyPaymentMethods();
|
90 |
-
array_push($msgs, $this->addMessage("SOAP connection established", "ok"));
|
91 |
-
} catch (SoapFault $e) {
|
92 |
-
array_push($msgs, $this->addMessage($e->faultstring));
|
93 |
-
}
|
94 |
-
|
95 |
-
//Convert to array (in case one payment method is active)
|
96 |
-
$paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod = Mage::helper("icecore")->makeArray($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod);
|
97 |
-
|
98 |
-
//Filter
|
99 |
-
$paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod = $this->filterPaymentmethods($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod);
|
100 |
-
|
101 |
-
//Count number of payment methods
|
102 |
-
array_push($msgs,
|
103 |
-
(($count = count($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod)) > 0 && $this->containsData($paymentMethods)) ?
|
104 |
-
$this->addMessage(sprintf(Mage::helper("iceadvanced")->__("%s active paymentmethods found"),$count), "ok") : $this->addMessage(Mage::helper("iceadvanced")->__("No active paymentmethods found"))
|
105 |
-
);
|
106 |
-
// Add issuers
|
107 |
-
$issuerObj = array();
|
108 |
-
foreach ($paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod as $value) {
|
109 |
-
|
110 |
-
$arr = array(
|
111 |
-
'merchant' => $this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID),
|
112 |
-
'code' => $value->PaymentMethodCode,
|
113 |
-
'issuers' => $value->Issuers->Issuer
|
114 |
-
);
|
115 |
-
array_push($issuerObj, array(
|
116 |
-
|
117 |
-
'pmcode' => $value->PaymentMethodCode,
|
118 |
-
//'data' => $arr
|
119 |
-
'data' => urlencode(serialize($arr))
|
120 |
-
));
|
121 |
-
}
|
122 |
-
|
123 |
-
// Create submit object
|
124 |
-
$submitObject->msg = $msgs;
|
125 |
-
$submitObject->merchant = $this->getValueForStore(Icepay_IceCore_Model_Config::MERCHANTID);
|
126 |
-
|
127 |
-
if (!$this->containsData($paymentMethods)) return $submitObject;
|
128 |
-
|
129 |
-
|
130 |
-
$submitObject->paymentmethods = $paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod;
|
131 |
-
$submitObject->issuers = $issuerObj;
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
return $submitObject;
|
137 |
-
}
|
138 |
-
|
139 |
-
private function containsData($obj){
|
140 |
-
return ($obj->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod[0] == null)?false:true;
|
141 |
-
}
|
142 |
-
|
143 |
-
private function filterPaymentmethods($obj) {
|
144 |
-
$arr = array();
|
145 |
-
$filter = Mage::helper("iceadvanced")->filteredPaymentmethods;
|
146 |
-
foreach ($obj as $key => $value) {
|
147 |
-
if (!in_array($obj[$key]->PaymentMethodCode, $filter))
|
148 |
-
array_push($arr, $obj[$key]);
|
149 |
-
};
|
150 |
-
return $arr;
|
151 |
-
}
|
152 |
-
|
153 |
-
private function populateData($obj) {
|
154 |
-
|
155 |
-
$configArray = Mage::getSingleton('iceadvanced/mysql4_iceAdvanced')->getPaymentmethodsConfiguration();
|
156 |
-
|
157 |
-
foreach ($obj as $key => $value) {
|
158 |
-
|
159 |
-
$obj[$key]->ConfigDescription = "";
|
160 |
-
$obj[$key]->ConfigTitle = "";
|
161 |
-
$obj[$key]->ConfigActive = 0;
|
162 |
-
|
163 |
-
foreach ($configArray as $ckey => $cvalue) {
|
164 |
-
if ($cvalue["code"] == $obj[$key]->PaymentMethodCode) {
|
165 |
-
$obj[$key]->ConfigDescription = $cvalue["info"];
|
166 |
-
$obj[$key]->ConfigTitle = $cvalue["name"];
|
167 |
-
$obj[$key]->ConfigActive = $cvalue["active"];
|
168 |
-
}
|
169 |
-
}
|
170 |
-
};
|
171 |
-
|
172 |
-
return $obj;
|
173 |
-
}
|
174 |
-
|
175 |
-
private function addIcons($obj) {
|
176 |
-
|
177 |
-
foreach ($obj as $key => $value) {
|
178 |
-
$img = Mage::helper("icecore")->toIcon(Mage::helper("icecore")->cleanString($value->PaymentMethodCode));
|
179 |
-
$obj[$key]->Image = ($img) ? $img : $value->PaymentMethodCode;
|
180 |
-
};
|
181 |
-
|
182 |
-
return $obj;
|
183 |
-
}
|
184 |
-
|
185 |
-
private function doBasicChecks() {
|
186 |
-
foreach (Mage::helper("iceadvanced")->doChecks() as $key => $value) {
|
187 |
-
switch ($value['id']) {
|
188 |
-
case "merchantid": if ($value['result'] == "err")
|
189 |
-
return false; break;
|
190 |
-
case "secretcode": if ($value['result'] == "err")
|
191 |
-
return false; break;
|
192 |
-
case "soap": if ($value['result'] == "err")
|
193 |
-
return false; break;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
return true;
|
197 |
-
}
|
198 |
-
|
199 |
-
private function addMessage($val, $type = "err") {
|
200 |
-
$msg = new stdClass();
|
201 |
-
$msg->type = $type;
|
202 |
-
$msg->msg = Mage::helper('iceadvanced')->__($val);
|
203 |
-
return $msg;
|
204 |
-
}
|
205 |
-
|
206 |
-
private function getValue($val) {
|
207 |
-
return Mage::helper('icecore')->getConfig($val);
|
208 |
-
}
|
209 |
-
|
210 |
-
private function getValueForStore($val){
|
211 |
-
return Mage::helper('icecore')->getConfigForStore($this->getScopeID(), $val);
|
212 |
-
}
|
213 |
-
|
214 |
-
}
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Icepay/IceAdvanced/Model/Webservice/Advanced.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ICEPAY Advanced - Webservice
|
5 |
+
*
|
6 |
+
* @version 1.0.0
|
7 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
8 |
+
* @copyright ICEPAY <www.icepay.com>
|
9 |
+
*
|
10 |
+
* Disclaimer:
|
11 |
+
* The merchant is entitled to change de ICEPAY plug-in code,
|
12 |
+
* any changes will be at merchant's own risk.
|
13 |
+
* Requesting ICEPAY support for a modified plug-in will be
|
14 |
+
* charged in accordance with the standard ICEPAY tariffs.
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class Icepay_IceAdvanced_Model_Webservice_Advanced extends Icepay_IceCore_Model_Webservice_Core {
|
18 |
+
|
19 |
+
private $extendedCheckoutMethods = array('AFTERPAY');
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Retrieve and return merchant's paymentmethods
|
23 |
+
*
|
24 |
+
* @return object
|
25 |
+
*/
|
26 |
+
public function getMyPaymentMethods()
|
27 |
+
{
|
28 |
+
$obj = new stdClass();
|
29 |
+
|
30 |
+
$obj->MerchantID = $this->merchantID;
|
31 |
+
$obj->SecretCode = $this->secretCode;
|
32 |
+
$obj->Timestamp = $this->getTimeStamp();
|
33 |
+
$obj->Checksum = $this->generateChecksum($obj);
|
34 |
+
|
35 |
+
return $this->client->GetMyPaymentMethods(array('request' => $obj));
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Create transaction and return result
|
40 |
+
*
|
41 |
+
* @param object $paymentObj
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function doCheckout($paymentObj, $orderObj = null)
|
45 |
+
{
|
46 |
+
$obj = new StdClass();
|
47 |
+
|
48 |
+
$obj->MerchantID = $this->merchantID;
|
49 |
+
$obj->Timestamp = $this->getTimeStamp();
|
50 |
+
$obj->Amount = $paymentObj->getAmount();
|
51 |
+
$obj->Country = $paymentObj->getCountry();
|
52 |
+
$obj->Currency = $paymentObj->getCurrency();
|
53 |
+
$obj->Description = $paymentObj->getDescription();
|
54 |
+
$obj->EndUserIP = $this->getIP();
|
55 |
+
$obj->Issuer = $paymentObj->getPaymentMethodIssuer();
|
56 |
+
$obj->Language = $paymentObj->getLanguage();
|
57 |
+
$obj->OrderID = $paymentObj->getOrderID();
|
58 |
+
$obj->PaymentMethod = $paymentObj->getPaymentMethod();
|
59 |
+
$obj->Reference = $paymentObj->getReference();
|
60 |
+
$obj->URLCompleted = '';
|
61 |
+
$obj->URLError = '';
|
62 |
+
|
63 |
+
if ($this->isExtendedCheckout($obj->PaymentMethod))
|
64 |
+
$obj->XML = $orderObj->getXML();
|
65 |
+
|
66 |
+
$obj->Checksum = $this->generateChecksum($obj, $this->secretCode);
|
67 |
+
|
68 |
+
if ($this->isExtendedCheckout($obj->PaymentMethod)) {
|
69 |
+
$result = $this->client->CheckoutExtended(array('request' => $obj));
|
70 |
+
} else {
|
71 |
+
$result = $this->client->Checkout(array('request' => $obj));
|
72 |
+
}
|
73 |
+
|
74 |
+
return (array) $result;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Checks if paymentmethod requires extended checkout
|
79 |
+
*
|
80 |
+
* @param object $paymentMethod
|
81 |
+
* @since 1.0.0
|
82 |
+
* @return bool
|
83 |
+
*/
|
84 |
+
public function isExtendedCheckout($paymentMethod)
|
85 |
+
{
|
86 |
+
$paymentMethod = strtoupper($paymentMethod);
|
87 |
+
|
88 |
+
return (bool) in_array($paymentMethod, $this->extendedCheckoutMethods);
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
app/code/community/Icepay/IceAdvanced/Model/icepay_api_order.php
DELETED
@@ -1,783 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Icepay_Order_Helper
|
5 |
-
*
|
6 |
-
* The Order Helper class contains handy fuctions to validate the input, such as a telephonenumber and zipcode check
|
7 |
-
*
|
8 |
-
* @version 1.0.0
|
9 |
-
*
|
10 |
-
* @author Wouter van Tilburg
|
11 |
-
* @author Olaf Abbenhuis
|
12 |
-
* @copyright Copyright (c) 2011-2012, ICEPAY
|
13 |
-
*/
|
14 |
-
class Icepay_Order_Helper {
|
15 |
-
|
16 |
-
private static $street;
|
17 |
-
private static $houseNumber;
|
18 |
-
private static $houseNumberAddition;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Sets and explodes the streetaddress
|
22 |
-
*
|
23 |
-
* @since 1.0.0
|
24 |
-
* @param string Contains the street address
|
25 |
-
* @return Icepay_Order_Helper
|
26 |
-
*/
|
27 |
-
public static function setStreetAddress($streetAddress) {
|
28 |
-
self::explodeStreetAddress($streetAddress);
|
29 |
-
|
30 |
-
return new self;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Get the street from address
|
35 |
-
*
|
36 |
-
* @since 1.0.0
|
37 |
-
* @param string Contains the street address
|
38 |
-
* @return Icepay_Order_Helper
|
39 |
-
*/
|
40 |
-
public static function getStreetFromAddress($streetAddress = null) {
|
41 |
-
if ($streetAddress)
|
42 |
-
self::explodeStreetAddress($streetAddress);
|
43 |
-
|
44 |
-
return self::$street;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Get the housenumber from address
|
49 |
-
*
|
50 |
-
* @since 1.0.0
|
51 |
-
* @param string Contains the street address
|
52 |
-
* @return Icepay_Order_Helper
|
53 |
-
*/
|
54 |
-
public static function getHouseNumberFromAddress($streetAddress = null) {
|
55 |
-
if ($streetAddress)
|
56 |
-
self::explodeStreetAddress($streetAddress);
|
57 |
-
|
58 |
-
return self::$houseNumber;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Get the housenumber addition from address
|
63 |
-
*
|
64 |
-
* @since 1.0.0
|
65 |
-
* @param string Contains the street address
|
66 |
-
* @return Icepay_Order_Helper
|
67 |
-
*/
|
68 |
-
public static function getHouseNumberAdditionFromAddress($streetAddress = null) {
|
69 |
-
if ($streetAddress)
|
70 |
-
self::explodeStreetAddress($streetAddress);
|
71 |
-
|
72 |
-
return self::$houseNumberAddition;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Validates a zipcode based on country
|
77 |
-
*
|
78 |
-
* @since 1.0.0
|
79 |
-
* @param string $zipCode A string containing the zipcode
|
80 |
-
* @param string $country A string containing the ISO 3166-1 alpha-2 code of the country
|
81 |
-
* @example validateZipCode('1122AA', 'NL')
|
82 |
-
* @return boolean
|
83 |
-
*/
|
84 |
-
public static function validateZipCode($zipCode, $country) {
|
85 |
-
switch (strtoupper($country)) {
|
86 |
-
case 'NL':
|
87 |
-
if (preg_match('/^[1-9]{1}[0-9]{3}[A-Z]{2}$/', $zipCode))
|
88 |
-
return true;
|
89 |
-
break;
|
90 |
-
case 'BE':
|
91 |
-
if (preg_match('/^[1-9]{4}$/', $zipCode))
|
92 |
-
return true;
|
93 |
-
break;
|
94 |
-
case 'DE':
|
95 |
-
if (preg_match('/^[1-9]{5}$/', $zipCode))
|
96 |
-
return true;
|
97 |
-
break;
|
98 |
-
}
|
99 |
-
|
100 |
-
return false;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Validates a phonenumber
|
105 |
-
*
|
106 |
-
* @since 1.0.0
|
107 |
-
* @param string Contains the phonenumber
|
108 |
-
* @return boolean
|
109 |
-
*/
|
110 |
-
public static function validatePhonenumber($phoneNumber) {
|
111 |
-
if (strlen($phoneNumber) < 10) {
|
112 |
-
return false;
|
113 |
-
}
|
114 |
-
|
115 |
-
if (preg_match('/^(?:\((\+?\d+)?\)|\+?\d+) ?\d*(-?\d{2,3} ?){0,4}$/', $phoneNumber)) {
|
116 |
-
return true;
|
117 |
-
}
|
118 |
-
|
119 |
-
return false;
|
120 |
-
}
|
121 |
-
|
122 |
-
private static function explodeStreetAddress($streetAddress) {
|
123 |
-
$pattern = '#^(.+\D+){1} ([0-9]{1,})\s?([\s\/]?[0-9]{0,}?[a-z]{0,}?)?$#i';
|
124 |
-
|
125 |
-
$aMatch = array();
|
126 |
-
|
127 |
-
if (preg_match($pattern, $streetAddress, $aMatch)) {
|
128 |
-
self::$street = utf8_decode($aMatch[1]);
|
129 |
-
self::$houseNumber = utf8_decode($aMatch[2]);
|
130 |
-
self::$houseNumberAddition = utf8_decode($aMatch[3]);
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Icepay_Order_Product
|
138 |
-
*
|
139 |
-
* The product object contains all information about the customers address
|
140 |
-
* You can add as many products as you want, just remember that the total amount for the products must match the total amount of the Icepay Payment Object
|
141 |
-
*
|
142 |
-
* @version 1.0.0
|
143 |
-
*
|
144 |
-
* @author Wouter van Tilburg
|
145 |
-
* @author Olaf Abbenhuis
|
146 |
-
* @copyright Copyright (c) 2011-2012, ICEPAY
|
147 |
-
*/
|
148 |
-
class Icepay_Order_Product {
|
149 |
-
|
150 |
-
public $productID = '00';
|
151 |
-
public $productName = '';
|
152 |
-
public $description = '';
|
153 |
-
public $quantity = '1';
|
154 |
-
public $unitPrice = '0';
|
155 |
-
public $VATCategory = 'standard';
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Creates and returns a new Icepay_Order_Product
|
159 |
-
*
|
160 |
-
* @since 1.0.0
|
161 |
-
* @return \Icepay_Order_Product
|
162 |
-
*/
|
163 |
-
public static function create() {
|
164 |
-
return new self();
|
165 |
-
}
|
166 |
-
|
167 |
-
/**
|
168 |
-
* Sets the product ID
|
169 |
-
*
|
170 |
-
* @since 1.0.0
|
171 |
-
* @param string Contains the product ID
|
172 |
-
* @return \Icepay_Order_Product
|
173 |
-
* @throws Exception when empty
|
174 |
-
*/
|
175 |
-
public function setProductID($productID) {
|
176 |
-
if (empty($productID))
|
177 |
-
throw new Exception('Product ID must be set and cannot be empty.');
|
178 |
-
|
179 |
-
$this->productID = trim($productID);
|
180 |
-
|
181 |
-
return $this;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Sets the product name
|
186 |
-
*
|
187 |
-
* @since 1.0.0
|
188 |
-
* @param string Contains the product name
|
189 |
-
* @return \Icepay_Order_Product
|
190 |
-
* @throws Exception when empty
|
191 |
-
*/
|
192 |
-
public function setProductName($productName) {
|
193 |
-
if (empty($productName))
|
194 |
-
throw new Exception('Product name must be set and cannot be empty.');
|
195 |
-
|
196 |
-
$this->productName = trim($productName);
|
197 |
-
|
198 |
-
return $this;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Sets the product description
|
203 |
-
*
|
204 |
-
* @since 1.0.0
|
205 |
-
* @param string Contains the product discription
|
206 |
-
* @return \Icepay_Order_Product
|
207 |
-
* @throws Exception when empty
|
208 |
-
*/
|
209 |
-
public function setDescription($description) {
|
210 |
-
$this->description = trim($description);
|
211 |
-
|
212 |
-
return $this;
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Sets the product quantity
|
217 |
-
*
|
218 |
-
* @since 1.0.0
|
219 |
-
* @param string Contains the quantity of the product
|
220 |
-
* @return \Icepay_Order_Product
|
221 |
-
* @throws Exception when empty
|
222 |
-
*/
|
223 |
-
public function setQuantity($quantity) {
|
224 |
-
if (empty($quantity))
|
225 |
-
throw new Exception('Quantity must be set and cannot be empty.');
|
226 |
-
|
227 |
-
$this->quantity = trim($quantity);
|
228 |
-
|
229 |
-
return $this;
|
230 |
-
}
|
231 |
-
|
232 |
-
/**
|
233 |
-
* Sets the product unit price
|
234 |
-
*
|
235 |
-
* @since 1.0.0
|
236 |
-
* @param string Contains the unitprice in cents
|
237 |
-
* @return \Icepay_Order_Product
|
238 |
-
* @throws Exception when empty
|
239 |
-
*/
|
240 |
-
public function setUnitPrice($unitPrice) {
|
241 |
-
$this->unitPrice = trim($unitPrice);
|
242 |
-
|
243 |
-
return $this;
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Sets the product's VAT Category
|
248 |
-
*
|
249 |
-
* @since 1.0.0
|
250 |
-
* @param string Contains the VAT Category (Choices are: zero, reduced-low, reduced-middle, standard)
|
251 |
-
* @return \Icepay_Order_Product
|
252 |
-
* @throws Exception when empty
|
253 |
-
*/
|
254 |
-
public function setVATCategory($vatCategory) {
|
255 |
-
if (empty($vatCategory))
|
256 |
-
throw new Exception('VAT Category must be set and cannot be empty.');
|
257 |
-
|
258 |
-
$this->VATCategory = $vatCategory;
|
259 |
-
|
260 |
-
return $this;
|
261 |
-
}
|
262 |
-
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Icepay_Order_Address
|
267 |
-
*
|
268 |
-
* The address class contains all information about the consumer's address
|
269 |
-
*
|
270 |
-
* @version 1.0.0
|
271 |
-
*
|
272 |
-
* @author Wouter van Tilburg
|
273 |
-
* @author Olaf Abbenhuis
|
274 |
-
* @copyright Copyright (c) 2011-2012, ICEPAY
|
275 |
-
*/
|
276 |
-
class Icepay_Order_Address {
|
277 |
-
|
278 |
-
public $initials = '';
|
279 |
-
public $prefix = '';
|
280 |
-
public $lastName = '';
|
281 |
-
public $street = '';
|
282 |
-
public $houseNumber = '';
|
283 |
-
public $houseNumberAddition = '';
|
284 |
-
public $zipCode = '';
|
285 |
-
public $city = '';
|
286 |
-
public $country = '';
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Creates and returns a new Icepay_Order_Address
|
290 |
-
*
|
291 |
-
* @since 1.0.0
|
292 |
-
* @return \Icepay_Order_Address
|
293 |
-
*/
|
294 |
-
public static function create() {
|
295 |
-
return new self();
|
296 |
-
}
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Sets the initials
|
300 |
-
*
|
301 |
-
* @since 1.0.0
|
302 |
-
* @param string A string containing the initials
|
303 |
-
* @return \Icepay_Order_Address
|
304 |
-
* @throws Exception when empty
|
305 |
-
*/
|
306 |
-
public function setInitials($initials) {
|
307 |
-
if (empty($initials))
|
308 |
-
throw new Exception('Initials must be set and cannot be empty.');
|
309 |
-
|
310 |
-
$this->initials = trim(utf8_decode($initials));
|
311 |
-
|
312 |
-
return $this;
|
313 |
-
}
|
314 |
-
|
315 |
-
/**
|
316 |
-
* Sets the prefix
|
317 |
-
*
|
318 |
-
* @since 1.0.0
|
319 |
-
* @param string A string containing the prefix
|
320 |
-
* @return \Icepay_Order_Address
|
321 |
-
* @throws Exception when empty
|
322 |
-
*/
|
323 |
-
public function setPrefix($prefix) {
|
324 |
-
$this->prefix = trim(utf8_decode($prefix));
|
325 |
-
|
326 |
-
return $this;
|
327 |
-
}
|
328 |
-
|
329 |
-
/**
|
330 |
-
* Sets the last name
|
331 |
-
*
|
332 |
-
* @since 1.0.0
|
333 |
-
* @param string A string containing the family name
|
334 |
-
* @return \Icepay_Order_Address
|
335 |
-
* @throws Exception when empty
|
336 |
-
*/
|
337 |
-
public function setLastName($lastName) {
|
338 |
-
if (empty($lastName))
|
339 |
-
throw new Exception('Lastname must be set and cannot be empty.');
|
340 |
-
|
341 |
-
$this->lastName = trim(utf8_decode($lastName));
|
342 |
-
|
343 |
-
return $this;
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Sets the streetname
|
348 |
-
*
|
349 |
-
* @since 1.0.0
|
350 |
-
* @param string A string containing the streetname
|
351 |
-
* @return \Icepay_Order_Address
|
352 |
-
* @throws Exception when empty
|
353 |
-
*/
|
354 |
-
public function setStreet($street) {
|
355 |
-
if (empty($street))
|
356 |
-
throw new Exception('Streetname incorrect.');
|
357 |
-
|
358 |
-
$this->street = trim($street);
|
359 |
-
|
360 |
-
return $this;
|
361 |
-
}
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Sets the housenumber
|
365 |
-
*
|
366 |
-
* @since 1.0.0
|
367 |
-
* @param string A string containing the housenumber
|
368 |
-
* @return \Icepay_Order_Address
|
369 |
-
* @throws Exception when empty
|
370 |
-
*/
|
371 |
-
public function setHouseNumber($houseNumber) {
|
372 |
-
if (empty($houseNumber))
|
373 |
-
throw new Exception('Housenumber must be set and cannot be empty.');
|
374 |
-
|
375 |
-
$this->houseNumber = trim($houseNumber);
|
376 |
-
|
377 |
-
return $this;
|
378 |
-
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Sets the housenumberaddition
|
382 |
-
*
|
383 |
-
* @since 1.0.0
|
384 |
-
* @param string A string containing the housenumber addition
|
385 |
-
* @return \Icepay_Order_Address
|
386 |
-
*/
|
387 |
-
public function setHouseNumberAddition($houseNumberAddition) {
|
388 |
-
$this->houseNumberAddition = trim($houseNumberAddition);
|
389 |
-
|
390 |
-
return $this;
|
391 |
-
}
|
392 |
-
|
393 |
-
/**
|
394 |
-
* Sets the address zipcode
|
395 |
-
*
|
396 |
-
* @since 1.0.0
|
397 |
-
* @param string A string containing the zipcode
|
398 |
-
* @return \Icepay_Order_Address
|
399 |
-
* @throws Exception when empty
|
400 |
-
*/
|
401 |
-
public function setZipCode($zipCode) {
|
402 |
-
if (empty($zipCode))
|
403 |
-
throw new Exception('Zipcode must be set and cannot be empty.');
|
404 |
-
|
405 |
-
$zipCode = str_replace(' ', '', $zipCode);
|
406 |
-
|
407 |
-
$this->zipCode = trim($zipCode);
|
408 |
-
|
409 |
-
return $this;
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Sets the address city
|
414 |
-
*
|
415 |
-
* @since 1.0.0
|
416 |
-
* @param string A string containing the cityname
|
417 |
-
* @return \Icepay_Order_Address
|
418 |
-
* @throws Exception when empty
|
419 |
-
*/
|
420 |
-
public function setCity($city) {
|
421 |
-
if (empty($city))
|
422 |
-
throw new Exception('City must be set and cannot be empty.');
|
423 |
-
|
424 |
-
$this->city = trim($city);
|
425 |
-
|
426 |
-
return $this;
|
427 |
-
}
|
428 |
-
|
429 |
-
/**
|
430 |
-
* Sets the country
|
431 |
-
*
|
432 |
-
* @since 1.0.0
|
433 |
-
* @param string A string containing the countryname
|
434 |
-
* @return \Icepay_Order_Address
|
435 |
-
* @throws Exception when empty
|
436 |
-
*/
|
437 |
-
public function setCountry($country) {
|
438 |
-
if (empty($country))
|
439 |
-
throw new Exception('Country must be set and cannot be empty.');
|
440 |
-
|
441 |
-
$this->country = trim($country);
|
442 |
-
|
443 |
-
return $this;
|
444 |
-
}
|
445 |
-
|
446 |
-
}
|
447 |
-
|
448 |
-
/**
|
449 |
-
* Icepay_Order_Consumer
|
450 |
-
*
|
451 |
-
* The consumer class contains all information about the consumer
|
452 |
-
*
|
453 |
-
* @version 1.0.0
|
454 |
-
*
|
455 |
-
* @author Wouter van Tilburg
|
456 |
-
* @author Olaf Abbenhuis
|
457 |
-
* @copyright Copyright (c) 2011-2012, ICEPAY
|
458 |
-
*/
|
459 |
-
class Icepay_Order_Consumer {
|
460 |
-
|
461 |
-
public $consumerID = '';
|
462 |
-
public $email = '';
|
463 |
-
public $phone = '';
|
464 |
-
|
465 |
-
/**
|
466 |
-
* Creates and returns a new Icepay_Order_Product
|
467 |
-
*
|
468 |
-
* @since 1.0.0
|
469 |
-
* @return \Icepay_Order_Consumer
|
470 |
-
*/
|
471 |
-
public static function create() {
|
472 |
-
return new self();
|
473 |
-
}
|
474 |
-
|
475 |
-
/**
|
476 |
-
* Sets the consumer ID
|
477 |
-
*
|
478 |
-
* @since 1.0.0
|
479 |
-
* @param string A string containing the consumerID
|
480 |
-
* @return \Icepay_Order_Consumer
|
481 |
-
* @throws Exception when empty
|
482 |
-
*/
|
483 |
-
public function setConsumerID($consumerID) {
|
484 |
-
if (empty($consumerID))
|
485 |
-
throw new Exception('Consumer ID must be set and cannot be empty.');
|
486 |
-
|
487 |
-
$this->consumerID = $consumerID;
|
488 |
-
|
489 |
-
return $this;
|
490 |
-
}
|
491 |
-
|
492 |
-
/**
|
493 |
-
* Sets the consumer's email
|
494 |
-
*
|
495 |
-
* @since 1.0.0
|
496 |
-
* @param string A string containing the consumer's email address.
|
497 |
-
* @return \Icepay_Order_Consumer
|
498 |
-
* @throws Exception when empty
|
499 |
-
*/
|
500 |
-
public function setEmail($email) {
|
501 |
-
if (empty($email))
|
502 |
-
throw new Exception('Email must be set and cannot be empty.');
|
503 |
-
|
504 |
-
$this->email = $email;
|
505 |
-
|
506 |
-
return $this;
|
507 |
-
}
|
508 |
-
|
509 |
-
/**
|
510 |
-
* Sets the consumer's phonenumber
|
511 |
-
*
|
512 |
-
* @since 1.0.0
|
513 |
-
* @param string A string containing the consumer's phonenumber
|
514 |
-
* @return \Icepay_Order_Consumer
|
515 |
-
* @throws Exception when empty
|
516 |
-
*/
|
517 |
-
public function setPhone($phone) {
|
518 |
-
$phone = trim(str_replace('-', '', $phone));
|
519 |
-
|
520 |
-
if (empty($phone))
|
521 |
-
throw new Exception('Phone must be set and cannot be empty.');
|
522 |
-
|
523 |
-
$this->phone = $phone;
|
524 |
-
|
525 |
-
return $this;
|
526 |
-
}
|
527 |
-
|
528 |
-
}
|
529 |
-
|
530 |
-
/**
|
531 |
-
* Icepay_Order
|
532 |
-
*
|
533 |
-
* Contains all the order information and can generate it into XML for the extended checkout.
|
534 |
-
*
|
535 |
-
* @version 1.0.0
|
536 |
-
*
|
537 |
-
* @author Wouter van Tilburg
|
538 |
-
* @author Olaf Abbenhuis
|
539 |
-
* @copyright Copyright (c) 2011-2012, ICEPAY
|
540 |
-
*/
|
541 |
-
class Icepay_Order {
|
542 |
-
|
543 |
-
private $_orderData;
|
544 |
-
private $_consumerNode;
|
545 |
-
private $_addressesNode;
|
546 |
-
private $_productsNode;
|
547 |
-
private static $instance;
|
548 |
-
private $_debug = false;
|
549 |
-
public $_data = Array();
|
550 |
-
|
551 |
-
public function setData($id, $obj) {
|
552 |
-
$this->_data[$id] = $obj;
|
553 |
-
}
|
554 |
-
|
555 |
-
/**
|
556 |
-
* Sets the consumer information for the order
|
557 |
-
*
|
558 |
-
* @since 1.0.0
|
559 |
-
* @param obj Object containing the Icepay_Order_Consumer class
|
560 |
-
* @return \Icepay_Order
|
561 |
-
*/
|
562 |
-
public function setConsumer(Icepay_Order_Consumer $obj) {
|
563 |
-
$this->setData("consumer", $obj);
|
564 |
-
return $this;
|
565 |
-
}
|
566 |
-
|
567 |
-
/**
|
568 |
-
* Sets the shipping address for the order
|
569 |
-
*
|
570 |
-
* @since 1.0.0
|
571 |
-
* @param obj Object containing the Icepay_Order_Address class
|
572 |
-
* @return \Icepay_Order
|
573 |
-
*/
|
574 |
-
public function setShippingAddress(Icepay_Order_Address $obj) {
|
575 |
-
$this->setData("shippingAddress", $obj);
|
576 |
-
return $this;
|
577 |
-
}
|
578 |
-
|
579 |
-
/**
|
580 |
-
* Sets the billing address for the order
|
581 |
-
*
|
582 |
-
* @since 1.0.0
|
583 |
-
* @param obj Object containing the Icepay_Order_Address class
|
584 |
-
* @return \Icepay_Order
|
585 |
-
*/
|
586 |
-
public function setBillingAddress(Icepay_Order_Address $obj) {
|
587 |
-
$this->setData("billingAddress", $obj);
|
588 |
-
return $this;
|
589 |
-
}
|
590 |
-
|
591 |
-
/**
|
592 |
-
* Adds a product to the order
|
593 |
-
*
|
594 |
-
* @since 1.0.0
|
595 |
-
* @param obj object containing the Icepay_Order_Product class
|
596 |
-
* @return \Icepay_Order
|
597 |
-
*/
|
598 |
-
public function addProduct(Icepay_Order_Product $obj) {
|
599 |
-
if (!isset($this->_data["products"]))
|
600 |
-
$this->_data["products"] = Array();
|
601 |
-
array_push($this->_data["products"], $obj);
|
602 |
-
return $this;
|
603 |
-
}
|
604 |
-
|
605 |
-
/**
|
606 |
-
* Sets the order discount
|
607 |
-
*
|
608 |
-
* @since 1.0.0
|
609 |
-
* @param string $amount Contains the discount amount in cents
|
610 |
-
* @param string $name Contains the name of the discount
|
611 |
-
* @param string $description Contains description of the discount
|
612 |
-
* @return \Icepay_Order
|
613 |
-
*/
|
614 |
-
public function setOrderDiscountAmount($amount, $name = 'Discount', $description = 'Order Discount') {
|
615 |
-
$obj = Icepay_Order_Product::create()
|
616 |
-
->setProductID('02')
|
617 |
-
->setProductName($name)
|
618 |
-
->setDescription($description)
|
619 |
-
->setQuantity('1')
|
620 |
-
->setUnitPrice(-$amount)
|
621 |
-
->setVATCategory(Icepay_Order_VAT::getCategoryForPercentage(-1));
|
622 |
-
|
623 |
-
$this->addProduct($obj);
|
624 |
-
|
625 |
-
return $this;
|
626 |
-
}
|
627 |
-
|
628 |
-
/**
|
629 |
-
* Sets the order shipping costs
|
630 |
-
*
|
631 |
-
* @since 1.0.0
|
632 |
-
* @param string $amount Contains the shipping costs in cents
|
633 |
-
* @param int $vat Contains the VAT category in percentages
|
634 |
-
* @param string $name Contains the shipping name
|
635 |
-
* @return \Icepay_Order
|
636 |
-
*/
|
637 |
-
public function setShippingCosts($amount, $vat = -1, $name = 'Shipping Costs') {
|
638 |
-
$obj = Icepay_Order_Product::create()
|
639 |
-
->setProductID('01')
|
640 |
-
->setProductName($name)
|
641 |
-
->setDescription('')
|
642 |
-
->setQuantity('1')
|
643 |
-
->setUnitPrice($amount)
|
644 |
-
->setVATCategory(Icepay_Order_VAT::getCategoryForPercentage($vat));
|
645 |
-
|
646 |
-
$this->addProduct($obj);
|
647 |
-
|
648 |
-
return $this;
|
649 |
-
}
|
650 |
-
|
651 |
-
/**
|
652 |
-
* Validates the Order
|
653 |
-
*
|
654 |
-
* <p>Validates the order information based on the paymentmethod and country used</p>
|
655 |
-
* <p>For example Afterpay, it will check the zipcodes and it makes sure that the billing and shipping address are in the same country</p>
|
656 |
-
*
|
657 |
-
* @param obj $paymentObj
|
658 |
-
* @throws Exception
|
659 |
-
*/
|
660 |
-
public function validateOrder($paymentObj) {
|
661 |
-
switch (strtoupper($paymentObj->getPaymentMethod())) {
|
662 |
-
case 'AFTERPAY':
|
663 |
-
if ($this->_data['shippingAddress']->country !== $this->_data['billingAddress']->country)
|
664 |
-
throw new Exception('Billing and Shipping country must be equal in order to use Afterpay.');
|
665 |
-
|
666 |
-
if (!Icepay_Order_Helper::validateZipCode($this->_data['shippingAddress']->zipCode, $this->_data['shippingAddress']->country))
|
667 |
-
throw new Exception('Zipcode format for shipping address is incorrect.');
|
668 |
-
|
669 |
-
if (!Icepay_Order_Helper::validateZipCode($this->_data['billingAddress']->zipCode, $this->_data['billingAddress']->country))
|
670 |
-
throw new Exception('Zipcode format for billing address is incorrect.');
|
671 |
-
|
672 |
-
if (!Icepay_Order_Helper::validatePhonenumber($this->_data['consumer']->phone))
|
673 |
-
throw new Exception('Phonenumber is incorrect.');
|
674 |
-
|
675 |
-
break;
|
676 |
-
}
|
677 |
-
}
|
678 |
-
|
679 |
-
private function array_to_xml($childs, $node = 'Order') {
|
680 |
-
$childs = (array) $childs;
|
681 |
-
|
682 |
-
foreach ($childs as $key => $value) {
|
683 |
-
$node->addChild(ucfirst($key), $value);
|
684 |
-
}
|
685 |
-
|
686 |
-
return $node;
|
687 |
-
}
|
688 |
-
|
689 |
-
/**
|
690 |
-
* Generates the XML for the webservice
|
691 |
-
*
|
692 |
-
* @since 1.0.0
|
693 |
-
* @return XML
|
694 |
-
*/
|
695 |
-
public function createXML() {
|
696 |
-
|
697 |
-
$this->_orderData = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Order></Order>");
|
698 |
-
$this->_consumerNode = $this->_orderData->addChild('Consumer');
|
699 |
-
$this->_addressesNode = $this->_orderData->addChild('Addresses');
|
700 |
-
$this->_productsNode = $this->_orderData->addChild('Products');
|
701 |
-
|
702 |
-
// Set Consumer
|
703 |
-
$this->array_to_xml($this->_data['consumer'], $this->_consumerNode);
|
704 |
-
|
705 |
-
// Set Addresses
|
706 |
-
$shippingNode = $this->_addressesNode->addChild('Address');
|
707 |
-
$shippingNode->addAttribute('id', 'shipping');
|
708 |
-
|
709 |
-
$this->array_to_xml($this->_data['shippingAddress'], $shippingNode);
|
710 |
-
|
711 |
-
$billingNode = $this->_addressesNode->addChild('Address');
|
712 |
-
$billingNode->addAttribute('id', 'billing');
|
713 |
-
|
714 |
-
$this->array_to_xml($this->_data['billingAddress'], $billingNode);
|
715 |
-
|
716 |
-
// Set Products
|
717 |
-
foreach ($this->_data['products'] as $product) {
|
718 |
-
$productNode = $this->_productsNode->addChild('Product');
|
719 |
-
$this->array_to_xml($product, $productNode);
|
720 |
-
}
|
721 |
-
|
722 |
-
if ($this->_debug == true) {
|
723 |
-
header("Content-type: text/xml");
|
724 |
-
echo $this->_orderData->asXML();
|
725 |
-
exit;
|
726 |
-
}
|
727 |
-
|
728 |
-
return $this->_orderData->asXML();
|
729 |
-
}
|
730 |
-
|
731 |
-
public static function getInstance() {
|
732 |
-
if (!self::$instance)
|
733 |
-
self::$instance = new self();
|
734 |
-
return self::$instance;
|
735 |
-
}
|
736 |
-
|
737 |
-
}
|
738 |
-
|
739 |
-
class Icepay_Order_VAT {
|
740 |
-
|
741 |
-
private static $categories = array();
|
742 |
-
|
743 |
-
public static function setDefaultCategories() {
|
744 |
-
$ranges = array(
|
745 |
-
'zero' => 0,
|
746 |
-
'reduced-low' => array('1', '6'),
|
747 |
-
'reduced-middle' => array('7', '12'),
|
748 |
-
'standard' => array('13', '100')
|
749 |
-
);
|
750 |
-
|
751 |
-
self::setCategories($ranges);
|
752 |
-
}
|
753 |
-
|
754 |
-
public static function setCategories($array) {
|
755 |
-
self::$categories = $array;
|
756 |
-
}
|
757 |
-
|
758 |
-
public static function getCategories() {
|
759 |
-
return self::$categories;
|
760 |
-
}
|
761 |
-
|
762 |
-
public static function getCategory($name) {
|
763 |
-
return self::$categories[$name];
|
764 |
-
}
|
765 |
-
|
766 |
-
public static function getCategoryForPercentage($number = null, $default = "exempt") {
|
767 |
-
if (!self::$categories)
|
768 |
-
self::setDefaultCategories();
|
769 |
-
|
770 |
-
foreach (self::getCategories() as $category => $value) {
|
771 |
-
if (!is_array($value)) {
|
772 |
-
if ($value == $number)
|
773 |
-
return $category;
|
774 |
-
}
|
775 |
-
|
776 |
-
if ($number >= $value[0] && $number <= $value[1])
|
777 |
-
return $category;
|
778 |
-
}
|
779 |
-
|
780 |
-
return $default;
|
781 |
-
}
|
782 |
-
|
783 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Icepay/IceAdvanced/controllers/AjaxController.php
CHANGED
@@ -19,7 +19,7 @@ class Icepay_IceAdvanced_AjaxController extends Mage_Adminhtml_Controller_Action
|
|
19 |
protected $webservice = null;
|
20 |
|
21 |
public function iceWebservice() {
|
22 |
-
if ($this->webservice == null) $this->webservice = new
|
23 |
return $this->webservice;
|
24 |
}
|
25 |
|
@@ -29,8 +29,7 @@ class Icepay_IceAdvanced_AjaxController extends Mage_Adminhtml_Controller_Action
|
|
29 |
}
|
30 |
|
31 |
public function get_paymentmethodsAction() {
|
32 |
-
$this->iceWebservice()->
|
33 |
-
$this->getResponse()->setBody(Zend_Json::encode($this->iceWebservice()->retrieveAdminGrid()));
|
34 |
}
|
35 |
|
36 |
public function save_paymentmethodAction() {
|
19 |
protected $webservice = null;
|
20 |
|
21 |
public function iceWebservice() {
|
22 |
+
if ($this->webservice == null) $this->webservice = new Icepay_IceAdvanced_Model_Paymentmethods();
|
23 |
return $this->webservice;
|
24 |
}
|
25 |
|
29 |
}
|
30 |
|
31 |
public function get_paymentmethodsAction() {
|
32 |
+
$this->getResponse()->setBody(Zend_Json::encode($this->iceWebservice()->retrieveAdminGrid($this->getRequest()->get("store"))));
|
|
|
33 |
}
|
34 |
|
35 |
public function save_paymentmethodAction() {
|
app/code/community/Icepay/IceAdvanced/controllers/ProcessingController.php
CHANGED
@@ -13,24 +13,25 @@
|
|
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")
|
30 |
parent::_redirect('checkout/onepage/failure');
|
31 |
-
} else {
|
32 |
$checkoutResult = (isset($result['CheckoutExtendedResult'])) ? $result['CheckoutExtendedResult'] : $result['CheckoutResult'];
|
33 |
-
|
34 |
$this->getResponse()->setBody($this->__("Redirecting"))->setRedirect($checkoutResult->PaymentScreenURL);
|
35 |
}
|
36 |
}
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
|
|
16 |
class Icepay_IceAdvanced_ProcessingController extends Mage_Core_Controller_Front_Action {
|
17 |
|
18 |
+
public function indexAction()
|
19 |
+
{
|
20 |
$this->loadLayout();
|
21 |
$this->renderLayout();
|
22 |
}
|
23 |
|
24 |
+
public function payAction()
|
25 |
+
{
|
26 |
$pay = Mage::getModel('iceadvanced/pay');
|
27 |
$result = $pay->getCheckoutResult();
|
28 |
|
29 |
+
if (!is_array($result)) {
|
30 |
+
Mage::getSingleton('checkout/session')->setErrorMessage(sprintf($this->__("The payment provider has returned the following error message: %s"), $result));
|
31 |
parent::_redirect('checkout/onepage/failure');
|
32 |
+
} else {
|
33 |
$checkoutResult = (isset($result['CheckoutExtendedResult'])) ? $result['CheckoutExtendedResult'] : $result['CheckoutResult'];
|
34 |
+
|
35 |
$this->getResponse()->setBody($this->__("Redirecting"))->setRedirect($checkoutResult->PaymentScreenURL);
|
36 |
}
|
37 |
}
|
app/code/community/Icepay/IceAdvanced/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Icepay_IceAdvanced>
|
6 |
-
<version>1.1.
|
7 |
</Icepay_IceAdvanced>
|
8 |
</modules>
|
9 |
<frontend>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Icepay_IceAdvanced>
|
6 |
+
<version>1.1.9</version>
|
7 |
</Icepay_IceAdvanced>
|
8 |
</modules>
|
9 |
<frontend>
|
app/code/community/Icepay/IceAdvanced/etc/system.xml
CHANGED
@@ -41,15 +41,6 @@
|
|
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>
|
41 |
<show_in_website>0</show_in_website>
|
42 |
<show_in_store>1</show_in_store>
|
43 |
</info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
</fields>
|
45 |
</advanced_settings>
|
46 |
</groups>
|
app/code/community/Icepay/IceCore/Block/Adminhtml/Init.php
CHANGED
@@ -13,33 +13,30 @@
|
|
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 |
-
|
22 |
{
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
if (Mage::helper('icecore')->isAdminPage()) {
|
30 |
$this->getLayout()
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
-
|
35 |
parent::_prepareLayout();
|
36 |
}
|
37 |
|
38 |
/* Don't use a template */
|
39 |
-
|
|
|
|
|
40 |
return "";
|
41 |
}
|
42 |
-
|
43 |
|
44 |
-
|
45 |
}
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
16 |
+
class Icepay_IceCore_Block_Adminhtml_Init extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
|
|
|
|
|
|
17 |
|
18 |
+
protected function _prepareLayout()
|
19 |
{
|
20 |
+
/* General pages CSS */
|
21 |
+
$this->getLayout()
|
22 |
+
->getBlock('head')
|
23 |
+
->addCss('icepay/general.css');
|
24 |
+
|
25 |
+
/* ADMIN page CSS */
|
26 |
if (Mage::helper('icecore')->isAdminPage()) {
|
27 |
$this->getLayout()
|
28 |
+
->getBlock('head')
|
29 |
+
->addCss('icepay/admin.css');
|
30 |
}
|
31 |
+
|
32 |
parent::_prepareLayout();
|
33 |
}
|
34 |
|
35 |
/* Don't use a template */
|
36 |
+
|
37 |
+
public function setTemplate($template)
|
38 |
+
{
|
39 |
return "";
|
40 |
}
|
|
|
41 |
|
|
|
42 |
}
|
app/code/community/Icepay/IceCore/Helper/Data.php
CHANGED
@@ -17,7 +17,7 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
17 |
/* Install values */
|
18 |
|
19 |
public $title = "Core";
|
20 |
-
public $version = "1.1.
|
21 |
public $id = "003";
|
22 |
public $fingerprint = "003";
|
23 |
public $compatibility_oldest_version = "1.5.0.0";
|
@@ -28,24 +28,25 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
28 |
public $imageExtension = "png";
|
29 |
public $defaultLocale = "en_EN";
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
return (Mage::app()->getFrontController()->getRequest()->getParam('section', false) == $this->section) ? true : false;
|
35 |
}
|
36 |
|
37 |
-
public function hasSOAP()
|
38 |
-
|
|
|
39 |
}
|
40 |
|
41 |
-
public function isCompatible($fromVersion, $toVersion)
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
}
|
47 |
|
48 |
-
public function makeArray($obj)
|
|
|
49 |
if (is_array($obj))
|
50 |
return $obj;
|
51 |
|
@@ -54,18 +55,16 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
54 |
return $arr;
|
55 |
}
|
56 |
|
57 |
-
public function isModuleInstalled($name)
|
|
|
58 |
$modules = Mage::getConfig()->getNode('modules')->children();
|
59 |
$modulesArray = (array) $modules;
|
60 |
-
|
61 |
-
if (isset($modulesArray[$name])) {
|
62 |
-
return true;
|
63 |
-
}
|
64 |
|
65 |
-
return
|
66 |
}
|
67 |
|
68 |
-
public function adminGetFrontScope()
|
|
|
69 |
/* default/websites/stores */
|
70 |
return Mage::app()->getFrontController()->getRequest()->getParam('store');
|
71 |
}
|
@@ -74,60 +73,70 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
74 |
* If a 0 is returned, it'll be default (admin) store scope ID
|
75 |
*/
|
76 |
|
77 |
-
public function adminGetStoreScopeID()
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
return Mage::app()->getStore()->getId();
|
82 |
-
|
83 |
return Mage::app()->getStore($this->getStoreFromRequest())->getId();
|
84 |
}
|
85 |
|
86 |
-
public function getStoreFromRequest()
|
|
|
87 |
return Mage::app()->getFrontController()->getRequest()->getParam('store');
|
88 |
}
|
89 |
|
90 |
-
public function adminGetStore()
|
|
|
91 |
return Mage::app()->getStore($this->adminGetStoreScopeID());
|
92 |
}
|
93 |
|
94 |
-
public function getStoreFrontURL($action = "result")
|
|
|
95 |
if (Mage::app()->getStore()->getStoreInUrl())
|
96 |
return Mage::app()->getStore($this->adminGetStoreScopeID())->getUrl("icepay/processing/" . $action, array('_secure' => true));
|
97 |
return Mage::app()->getStore()->getUrl("icepay/processing/" . $action, array('_secure' => true));
|
98 |
}
|
99 |
|
100 |
-
public function getStoreScopeID()
|
|
|
101 |
return (Mage::app()->getStore()->getId() == NULL || Mage::app()->getStore()->isAdmin()) ? $this->adminGetStoreScopeID() : Mage::app()->getStore()->getId();
|
102 |
}
|
103 |
|
104 |
-
public function getConfig($str)
|
|
|
105 |
return Mage::app()->getStore($this->getStoreScopeID())->getConfig($str);
|
106 |
}
|
107 |
|
108 |
-
public function getConfigForStore($storeID, $config)
|
|
|
109 |
return Mage::app()->getStore($storeID)->getConfig($config);
|
110 |
}
|
111 |
|
112 |
-
public function getMerchantIDForStore($storeID)
|
|
|
113 |
return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::MERCHANTID);
|
114 |
}
|
115 |
|
116 |
-
public function getSecretcodeForStore($storeID)
|
|
|
117 |
return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::SECRETCODE);
|
118 |
}
|
119 |
|
120 |
-
public function cleanArray($arr)
|
|
|
121 |
foreach ($arr as $key => $val)
|
122 |
$arr[$key] = trim($val);
|
123 |
return array_unique($arr);
|
124 |
}
|
125 |
|
126 |
-
public function setImageDir($str)
|
|
|
127 |
$this->imageDir = $str;
|
128 |
}
|
129 |
|
130 |
-
public function getLangISO2($default = false)
|
|
|
131 |
$locale = explode("_", ($default) ? $this->defaultLocale : Mage::app()->getLocale()->getLocale());
|
132 |
if (is_array($locale) && !empty($locale)) {
|
133 |
return strtoupper($locale[0]);
|
@@ -135,13 +144,15 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
135 |
return "EN";
|
136 |
}
|
137 |
|
138 |
-
public function log($str)
|
|
|
139 |
Mage::log($str, null, 'icepay.log');
|
140 |
}
|
141 |
|
142 |
/* Checks */
|
143 |
|
144 |
-
public function validateMerchantID($val)
|
|
|
145 |
$return = array('val' => false, 'msg' => $this->__("Merchant ID is properly configured"));
|
146 |
|
147 |
if (!$val) {
|
@@ -163,52 +174,50 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
163 |
return $return;
|
164 |
}
|
165 |
|
166 |
-
public function toIcon($code, $title = "")
|
|
|
167 |
$code = strtolower($code);
|
168 |
if (!$img = $this->getImage("{$code}.{$this->imageExtension}"))
|
169 |
return false;
|
170 |
return "<img src=\"{$img}\" id=\"ICEPAY_{$code}\" title=\"{$title}\" >";
|
171 |
}
|
172 |
|
173 |
-
public function cleanString($string)
|
|
|
174 |
$string = trim($string);
|
175 |
return $string;
|
176 |
}
|
177 |
|
178 |
-
public function getImage($img)
|
179 |
-
|
|
|
|
|
180 |
// Get image in lang folder
|
181 |
-
if (file_exists(
|
182 |
-
Mage::getModel('core/config')->getOptions()->getSkinDir() . "/" . $this->imageDir . strtolower($this->getLangISO2()) . "/" . $img
|
183 |
-
))
|
184 |
return $this->getImageURL() . strtolower($this->getLangISO2()) . "/" . $img;
|
185 |
|
186 |
// Get image in standard lang folder
|
187 |
-
if (file_exists(
|
188 |
-
Mage::getModel('core/config')->getOptions()->getSkinDir() . "/" . $this->imageDir . strtolower($this->getLangISO2(true)) . "/" . $img
|
189 |
-
))
|
190 |
return $this->getImageURL() . strtolower($this->getLangISO2(true)) . "/" . $img;
|
191 |
|
192 |
// Get standard image
|
193 |
-
if (file_exists(
|
194 |
-
Mage::getModel('core/config')->getOptions()->getSkinDir() . "/" . $this->imageDir . $img
|
195 |
-
))
|
196 |
return $this->getImageURL() . $img;
|
197 |
|
198 |
//Hmm still no image, lets return the nologo image
|
199 |
-
if (file_exists(
|
200 |
-
|
201 |
-
))
|
202 |
-
return $this->getImageURL() . "nologo.png";
|
203 |
|
204 |
return false;
|
205 |
}
|
206 |
|
207 |
-
public function getImageURL()
|
|
|
208 |
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . $this->imageDir;
|
209 |
}
|
210 |
|
211 |
-
public function validateSecretCode($val)
|
|
|
212 |
$return = array('val' => false, 'msg' => $this->__("SecretCode is properly configured"));
|
213 |
|
214 |
if (!$val) {
|
@@ -226,15 +235,18 @@ class Icepay_IceCore_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
226 |
return $return;
|
227 |
}
|
228 |
|
229 |
-
public function getTransactionDescription($default)
|
|
|
230 |
return ($statement = $this->getConfig(Icepay_IceCore_Model_Config::TRANSDESCR)) ? $statement : $default;
|
231 |
}
|
232 |
|
233 |
-
public function formatTotal($number)
|
|
|
234 |
return round($number * 100);
|
235 |
}
|
236 |
|
237 |
-
public function generateChecksum($arr)
|
|
|
238 |
return sha1(implode("|", $arr));
|
239 |
}
|
240 |
|
17 |
/* Install values */
|
18 |
|
19 |
public $title = "Core";
|
20 |
+
public $version = "1.1.9";
|
21 |
public $id = "003";
|
22 |
public $fingerprint = "003";
|
23 |
public $compatibility_oldest_version = "1.5.0.0";
|
28 |
public $imageExtension = "png";
|
29 |
public $defaultLocale = "en_EN";
|
30 |
|
31 |
+
public function isAdminPage()
|
32 |
+
{
|
33 |
+
return Mage::app()->getStore()->isAdmin();
|
|
|
34 |
}
|
35 |
|
36 |
+
public function hasSOAP()
|
37 |
+
{
|
38 |
+
return class_exists('SoapClient');
|
39 |
}
|
40 |
|
41 |
+
public function isCompatible($fromVersion, $toVersion)
|
42 |
+
{
|
43 |
+
$mVersion = Mage::getVersion();
|
44 |
+
|
45 |
+
return ((version_compare($mVersion, $toVersion, '<=')) && version_compare($mVersion, $fromVersion, '>='));
|
46 |
}
|
47 |
|
48 |
+
public function makeArray($obj)
|
49 |
+
{
|
50 |
if (is_array($obj))
|
51 |
return $obj;
|
52 |
|
55 |
return $arr;
|
56 |
}
|
57 |
|
58 |
+
public function isModuleInstalled($name)
|
59 |
+
{
|
60 |
$modules = Mage::getConfig()->getNode('modules')->children();
|
61 |
$modulesArray = (array) $modules;
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
return isset($modulesArray[$name]);
|
64 |
}
|
65 |
|
66 |
+
public function adminGetFrontScope()
|
67 |
+
{
|
68 |
/* default/websites/stores */
|
69 |
return Mage::app()->getFrontController()->getRequest()->getParam('store');
|
70 |
}
|
73 |
* If a 0 is returned, it'll be default (admin) store scope ID
|
74 |
*/
|
75 |
|
76 |
+
public function adminGetStoreScopeID()
|
77 |
+
{
|
78 |
+
if (Mage::app()->getStore($this->getStoreFromRequest())->isAdmin())
|
|
|
79 |
return Mage::app()->getStore()->getId();
|
80 |
+
|
81 |
return Mage::app()->getStore($this->getStoreFromRequest())->getId();
|
82 |
}
|
83 |
|
84 |
+
public function getStoreFromRequest()
|
85 |
+
{
|
86 |
return Mage::app()->getFrontController()->getRequest()->getParam('store');
|
87 |
}
|
88 |
|
89 |
+
public function adminGetStore()
|
90 |
+
{
|
91 |
return Mage::app()->getStore($this->adminGetStoreScopeID());
|
92 |
}
|
93 |
|
94 |
+
public function getStoreFrontURL($action = "result")
|
95 |
+
{
|
96 |
if (Mage::app()->getStore()->getStoreInUrl())
|
97 |
return Mage::app()->getStore($this->adminGetStoreScopeID())->getUrl("icepay/processing/" . $action, array('_secure' => true));
|
98 |
return Mage::app()->getStore()->getUrl("icepay/processing/" . $action, array('_secure' => true));
|
99 |
}
|
100 |
|
101 |
+
public function getStoreScopeID()
|
102 |
+
{
|
103 |
return (Mage::app()->getStore()->getId() == NULL || Mage::app()->getStore()->isAdmin()) ? $this->adminGetStoreScopeID() : Mage::app()->getStore()->getId();
|
104 |
}
|
105 |
|
106 |
+
public function getConfig($str)
|
107 |
+
{
|
108 |
return Mage::app()->getStore($this->getStoreScopeID())->getConfig($str);
|
109 |
}
|
110 |
|
111 |
+
public function getConfigForStore($storeID, $config)
|
112 |
+
{
|
113 |
return Mage::app()->getStore($storeID)->getConfig($config);
|
114 |
}
|
115 |
|
116 |
+
public function getMerchantIDForStore($storeID)
|
117 |
+
{
|
118 |
return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::MERCHANTID);
|
119 |
}
|
120 |
|
121 |
+
public function getSecretcodeForStore($storeID)
|
122 |
+
{
|
123 |
return Mage::app()->getStore($storeID)->getConfig(Icepay_IceCore_Model_Config::SECRETCODE);
|
124 |
}
|
125 |
|
126 |
+
public function cleanArray($arr)
|
127 |
+
{
|
128 |
foreach ($arr as $key => $val)
|
129 |
$arr[$key] = trim($val);
|
130 |
return array_unique($arr);
|
131 |
}
|
132 |
|
133 |
+
public function setImageDir($str)
|
134 |
+
{
|
135 |
$this->imageDir = $str;
|
136 |
}
|
137 |
|
138 |
+
public function getLangISO2($default = false)
|
139 |
+
{
|
140 |
$locale = explode("_", ($default) ? $this->defaultLocale : Mage::app()->getLocale()->getLocale());
|
141 |
if (is_array($locale) && !empty($locale)) {
|
142 |
return strtoupper($locale[0]);
|
144 |
return "EN";
|
145 |
}
|
146 |
|
147 |
+
public function log($str)
|
148 |
+
{
|
149 |
Mage::log($str, null, 'icepay.log');
|
150 |
}
|
151 |
|
152 |
/* Checks */
|
153 |
|
154 |
+
public function validateMerchantID($val)
|
155 |
+
{
|
156 |
$return = array('val' => false, 'msg' => $this->__("Merchant ID is properly configured"));
|
157 |
|
158 |
if (!$val) {
|
174 |
return $return;
|
175 |
}
|
176 |
|
177 |
+
public function toIcon($code, $title = "")
|
178 |
+
{
|
179 |
$code = strtolower($code);
|
180 |
if (!$img = $this->getImage("{$code}.{$this->imageExtension}"))
|
181 |
return false;
|
182 |
return "<img src=\"{$img}\" id=\"ICEPAY_{$code}\" title=\"{$title}\" >";
|
183 |
}
|
184 |
|
185 |
+
public function cleanString($string)
|
186 |
+
{
|
187 |
$string = trim($string);
|
188 |
return $string;
|
189 |
}
|
190 |
|
191 |
+
public function getImage($img)
|
192 |
+
{
|
193 |
+
$skinDir = Mage::getModel('core/config')->getOptions()->getSkinDir();
|
194 |
+
|
195 |
// Get image in lang folder
|
196 |
+
if (file_exists($skinDir . '/' . $this->imageDir . strtolower($this->getLangISO2()) . "/" . $img))
|
|
|
|
|
197 |
return $this->getImageURL() . strtolower($this->getLangISO2()) . "/" . $img;
|
198 |
|
199 |
// Get image in standard lang folder
|
200 |
+
if (file_exists($skinDir . '/' . $this->imageDir . strtolower($this->getLangISO2(true)) . "/" . $img))
|
|
|
|
|
201 |
return $this->getImageURL() . strtolower($this->getLangISO2(true)) . "/" . $img;
|
202 |
|
203 |
// Get standard image
|
204 |
+
if (file_exists($skinDir . '/' . $this->imageDir . $img))
|
|
|
|
|
205 |
return $this->getImageURL() . $img;
|
206 |
|
207 |
//Hmm still no image, lets return the nologo image
|
208 |
+
if (file_exists($skinDir . '/' . $this->imageDir . 'nologo.png'))
|
209 |
+
return $this->getImageURL() . 'nologo.png';
|
|
|
|
|
210 |
|
211 |
return false;
|
212 |
}
|
213 |
|
214 |
+
public function getImageURL()
|
215 |
+
{
|
216 |
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . $this->imageDir;
|
217 |
}
|
218 |
|
219 |
+
public function validateSecretCode($val)
|
220 |
+
{
|
221 |
$return = array('val' => false, 'msg' => $this->__("SecretCode is properly configured"));
|
222 |
|
223 |
if (!$val) {
|
235 |
return $return;
|
236 |
}
|
237 |
|
238 |
+
public function getTransactionDescription($default)
|
239 |
+
{
|
240 |
return ($statement = $this->getConfig(Icepay_IceCore_Model_Config::TRANSDESCR)) ? $statement : $default;
|
241 |
}
|
242 |
|
243 |
+
public function formatTotal($number)
|
244 |
+
{
|
245 |
return round($number * 100);
|
246 |
}
|
247 |
|
248 |
+
public function generateChecksum($arr)
|
249 |
+
{
|
250 |
return sha1(implode("|", $arr));
|
251 |
}
|
252 |
|
app/code/community/Icepay/IceCore/Model/Icepay/Webservice/Api.php
DELETED
@@ -1,146 +0,0 @@
|
|
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 |
-
class Icepay_IceCore_Model_Icepay_Webservice_Api {
|
17 |
-
|
18 |
-
public $client; // SoapClient Object
|
19 |
-
protected $merchantID; // Integer
|
20 |
-
protected $secretCode; // String
|
21 |
-
protected $url = "https://connect.icepay.com/webservice/icepay.svc?wsdl";
|
22 |
-
|
23 |
-
public function webservice($merchantID, $secretCode) {
|
24 |
-
$this->setMerchantID($merchantID);
|
25 |
-
$this->setSecretCode($secretCode);
|
26 |
-
|
27 |
-
$this->client = new SoapClient(
|
28 |
-
$this->url,
|
29 |
-
array(
|
30 |
-
"location" => $this->url,
|
31 |
-
'cache_wsdl' => 'WSDL_CACHE_NONE'
|
32 |
-
)
|
33 |
-
);
|
34 |
-
$this->client->soap_defencoding = "utf-8";
|
35 |
-
}
|
36 |
-
|
37 |
-
/* Setters */
|
38 |
-
|
39 |
-
public function setMerchantID($val) {
|
40 |
-
$this->merchantID = $val;
|
41 |
-
}
|
42 |
-
|
43 |
-
public function setSecretCode($val) {
|
44 |
-
$this->secretCode = $val;
|
45 |
-
}
|
46 |
-
|
47 |
-
/* Getters */
|
48 |
-
|
49 |
-
public function getMerchantID() {
|
50 |
-
return intval($this->merchantID);
|
51 |
-
}
|
52 |
-
|
53 |
-
public function getSecretCode() {
|
54 |
-
return $this->secretCode;
|
55 |
-
}
|
56 |
-
|
57 |
-
protected function getTimeStamp() {
|
58 |
-
return gmdate("Y-m-d\TH:i:s\Z");
|
59 |
-
}
|
60 |
-
|
61 |
-
protected function generateChecksum($obj = null) {
|
62 |
-
$arr = array();
|
63 |
-
array_push($arr, $this->getSecretCode());
|
64 |
-
|
65 |
-
foreach ($obj as $val) {
|
66 |
-
array_push($arr, $val);
|
67 |
-
}
|
68 |
-
|
69 |
-
return sha1(implode("|", $arr));
|
70 |
-
}
|
71 |
-
|
72 |
-
protected function getIP() {
|
73 |
-
return $_SERVER['REMOTE_ADDR'];
|
74 |
-
}
|
75 |
-
|
76 |
-
// Webservice methods below:
|
77 |
-
public function doCheckout(
|
78 |
-
$amount, $country, $currency, $lang, $descr, $paymentmethod, $issuer, $orderID, $reference, $URLCompleted = "", $URLError = ""
|
79 |
-
) {
|
80 |
-
|
81 |
-
$obj = new stdClass();
|
82 |
-
|
83 |
-
// Must be in specific order for checksum ---------
|
84 |
-
$obj->MerchantID = $this->merchantID;
|
85 |
-
$obj->Timestamp = $this->getTimeStamp();
|
86 |
-
$obj->Amount = $amount;
|
87 |
-
$obj->Country = $country;
|
88 |
-
$obj->Currency = $currency;
|
89 |
-
$obj->Description = $descr;
|
90 |
-
$obj->EndUserIP = $this->getIP();
|
91 |
-
$obj->Issuer = $issuer;
|
92 |
-
$obj->Language = $lang;
|
93 |
-
$obj->OrderID = $orderID;
|
94 |
-
$obj->PaymentMethod = $paymentmethod;
|
95 |
-
$obj->Reference = $reference;
|
96 |
-
$obj->URLCompleted = $URLCompleted;
|
97 |
-
$obj->URLError = $URLError;
|
98 |
-
|
99 |
-
if (strtoupper($paymentmethod) == 'AFTERPAY')
|
100 |
-
$obj->XML = Icepay_Order::getInstance()->createXML();
|
101 |
-
|
102 |
-
// ------------------------------------------------
|
103 |
-
$obj->Checksum = $this->generateChecksum($obj);
|
104 |
-
|
105 |
-
if (strtoupper($paymentmethod) == 'AFTERPAY') {
|
106 |
-
return (array) $this->client->CheckoutExtended(array('request' => $obj));
|
107 |
-
} else {
|
108 |
-
return (array) $this->client->Checkout(array('request' => $obj));
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
public function getPayment($id) {
|
113 |
-
|
114 |
-
$obj = null;
|
115 |
-
|
116 |
-
// Must be in specific order for checksum ---------
|
117 |
-
$obj->MerchantID = $this->merchantID;
|
118 |
-
$obj->Timestamp = $this->getTimeStamp();
|
119 |
-
$obj->PaymentID = $id;
|
120 |
-
|
121 |
-
// ------------------------------------------------
|
122 |
-
$obj->Checksum = $this->generateChecksum($obj);
|
123 |
-
return (array) $this->client->GetPayment(array('request' => $obj));
|
124 |
-
}
|
125 |
-
|
126 |
-
public function getPremiumRateNumbers() {
|
127 |
-
|
128 |
-
$obj = null;
|
129 |
-
|
130 |
-
// Must be in specific order for checksum ---------
|
131 |
-
$obj->MerchantID = $this->merchantID;
|
132 |
-
$obj->Timestamp = $this->getTimeStamp();
|
133 |
-
|
134 |
-
// ------------------------------------------------
|
135 |
-
$obj->Checksum = $this->generateChecksum($obj);
|
136 |
-
return (array) $this->client->GetPremiumRateNumbers(array('request' => $obj));
|
137 |
-
}
|
138 |
-
|
139 |
-
public function completeObject($obj) {
|
140 |
-
$obj->Checksum = $this->generateChecksum($obj);
|
141 |
-
return $obj;
|
142 |
-
}
|
143 |
-
|
144 |
-
}
|
145 |
-
|
146 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Icepay/IceCore/Model/Mysql4/IceCore.php
CHANGED
@@ -13,56 +13,55 @@
|
|
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"
|
37 |
-
if (class_exists($class)){
|
38 |
$helper = new $class();
|
39 |
array_push($modules, array(
|
40 |
-
'id'
|
41 |
-
'name'
|
42 |
-
'compatible'
|
43 |
-
'compatibleFrom'
|
44 |
-
'compatibleTo'
|
45 |
-
'active'
|
46 |
-
'serial'
|
47 |
-
'serialreq'
|
48 |
-
'version'
|
49 |
-
'fingerprint'
|
50 |
-
'namespace'
|
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 |
-
|
|
|
63 |
}
|
64 |
|
65 |
-
public function getModulesConfiguration()
|
|
|
66 |
$moduleData = $this->getModules();
|
67 |
|
68 |
for ($i = 0; $i < count($moduleData); $i++) {
|
@@ -73,58 +72,70 @@ class Icepay_IceCore_Model_Mysql4_IceCore extends Mage_Core_Model_Mysql4_Abstrac
|
|
73 |
return $moduleData;
|
74 |
}
|
75 |
|
76 |
-
public function getModuleData($unique = "title")
|
|
|
77 |
$conn = $this->_getReadAdapter();
|
78 |
$select = $conn
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
$data = $conn->fetchAll($select);
|
84 |
-
|
85 |
return $data;
|
86 |
}
|
87 |
|
88 |
-
public function getModuleConfiguration($config = "active", $namespace = "icecore")
|
|
|
89 |
$conn = $this->_getReadAdapter();
|
90 |
$select = $conn
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
$data = $conn->fetchRow($select);
|
95 |
return $data["value"];
|
96 |
}
|
97 |
|
98 |
-
protected function getAuthID()
|
99 |
-
|
|
|
|
|
100 |
$str = "";
|
101 |
-
foreach($this->modules as $module){
|
102 |
-
if ($module["serialreq"] == "1" && $module["active"] == "1")
|
|
|
103 |
}
|
104 |
|
105 |
return $str;
|
106 |
}
|
107 |
|
108 |
-
public function getAuthKey($storeID = 0)
|
109 |
-
|
|
|
|
|
110 |
$arr = array();
|
111 |
-
foreach($this->modules as $module){
|
112 |
-
if ($module["serialreq"] == "1" && $module["active"] == "1"){
|
113 |
-
array_push($arr,sprintf("[%s,%s,%s]",trim($module["id"]),trim($module["fingerprint"]),trim($module["serial"])));
|
114 |
}
|
115 |
}
|
116 |
-
$str = sprintf("%s,[%s]",Mage::helper('icecore')->getMerchantIDForStore($storeID),implode(","
|
117 |
return sha1($str);
|
118 |
}
|
119 |
|
120 |
/* @sales_order_payment_place_end event */
|
121 |
-
public function savePayment(Varien_Event_Observer $observer) {
|
122 |
|
|
|
|
|
123 |
$payment = $observer->getPayment();
|
124 |
$order = $payment->getOrder();
|
125 |
$pmName = $payment->getMethodInstance()->getCode();
|
126 |
|
127 |
-
$param = Mage::app()->getFrontController()->getRequest()->getParam('payment');
|
|
|
|
|
|
|
|
|
128 |
$country = (isset($param[$pmName . '_country'])) ? $param[$pmName . '_country'] : $order->getBillingAddress()->getCountryId();
|
129 |
if ($country == "00")
|
130 |
$country = $order->getBillingAddress()->getCountryId();
|
@@ -132,20 +143,18 @@ class Icepay_IceCore_Model_Mysql4_IceCore extends Mage_Core_Model_Mysql4_Abstrac
|
|
132 |
$ice_payment = array(
|
133 |
'ic_merchantid' => Mage::helper('icecore')->getMerchantIDForStore($order->getStore()->getId()),
|
134 |
'ic_currency' => $order->getOrderCurrencyCode(),
|
135 |
-
'ic_amount' => Mage::helper('icecore')->formatTotal($order->getGrandTotal())
|
136 |
-
//'ic_description' => Mage::helper('icecore')->getTransactionDescription($order->getStore()->getWebsite()->getName()),
|
137 |
'ic_description' => Mage::helper('icecore')->getTransactionDescription($order->getRealOrderId()),
|
138 |
'ic_country' => $country,
|
139 |
'ic_language' => Mage::helper("icecore")->getLangISO2(),
|
140 |
'ic_reference' => $order->getRealOrderId(),
|
141 |
-
'ic_paymentmethod' => $
|
142 |
-
'ic_issuer' => $
|
143 |
'ic_orderid' => $order->getRealOrderId(),
|
144 |
'ic_moduleid' => $this->getAuthID(),
|
145 |
'ic_authkey' => $this->getAuthKey($order->getStore()->getId())
|
146 |
);
|
147 |
-
|
148 |
-
|
149 |
$data = array(
|
150 |
'order_id' => $order->getRealOrderId(),
|
151 |
'model' => $pmName,
|
@@ -159,21 +168,22 @@ class Icepay_IceCore_Model_Mysql4_IceCore extends Mage_Core_Model_Mysql4_Abstrac
|
|
159 |
$this->_getWriteAdapter()->insert($this->getTable('icepay_transactions'), $data);
|
160 |
}
|
161 |
|
162 |
-
public function loadPaymentByID($id)
|
|
|
163 |
$conn = $this->_getReadAdapter();
|
164 |
$select = $conn
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
$data = $conn->fetchRow($select);
|
169 |
return $data;
|
170 |
}
|
171 |
|
172 |
-
public function changeStatus(array $data)
|
|
|
173 |
$where = $this->_getReadAdapter()->quoteInto('order_id = ?', $data["order_id"]);
|
174 |
$this->_getWriteAdapter()->update(
|
175 |
-
$this->getTable('icepay_transactions'),
|
176 |
-
$data, $where);
|
177 |
}
|
178 |
|
179 |
}
|
13 |
* charged in accordance with the standard ICEPAY tariffs.
|
14 |
*
|
15 |
*/
|
|
|
16 |
class Icepay_IceCore_Model_Mysql4_IceCore extends Mage_Core_Model_Mysql4_Abstract {
|
17 |
|
18 |
protected $modules = null;
|
19 |
|
20 |
+
public function _construct()
|
21 |
+
{
|
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 |
try {
|
34 |
+
$class = sprintf("Icepay_Ice%s_Helper_Data", $module["value"]);
|
35 |
+
if (class_exists($class)) {
|
36 |
$helper = new $class();
|
37 |
array_push($modules, array(
|
38 |
+
'id' => $helper->id,
|
39 |
+
'name' => $helper->title,
|
40 |
+
'compatible' => sprintf("Magento %s - %s", $helper->compatibility_oldest_version, $helper->compatibility_latest_version),
|
41 |
+
'compatibleFrom' => $helper->compatibility_oldest_version,
|
42 |
+
'compatibleTo' => $helper->compatibility_latest_version,
|
43 |
+
'active' => $this->getModuleConfiguration("active", $helper->section),
|
44 |
+
'serial' => $this->getModuleConfiguration("serial", $helper->section),
|
45 |
+
'serialreq' => $helper->serial_required,
|
46 |
+
'version' => $helper->version,
|
47 |
+
'fingerprint' => $helper->fingerprint,
|
48 |
+
'namespace' => $helper->section
|
49 |
));
|
50 |
}
|
|
|
51 |
} catch (Exception $e) {
|
52 |
Mage::helper("icecore")->log($e->getMessage());
|
53 |
+
};
|
54 |
}
|
55 |
return $modules;
|
56 |
}
|
57 |
|
58 |
+
public function isActive($namespace)
|
59 |
+
{
|
60 |
+
return ($this->getModuleConfiguration("active", $namespace) == "1");
|
61 |
}
|
62 |
|
63 |
+
public function getModulesConfiguration()
|
64 |
+
{
|
65 |
$moduleData = $this->getModules();
|
66 |
|
67 |
for ($i = 0; $i < count($moduleData); $i++) {
|
72 |
return $moduleData;
|
73 |
}
|
74 |
|
75 |
+
public function getModuleData($unique = "title")
|
76 |
+
{
|
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 |
+
|
85 |
return $data;
|
86 |
}
|
87 |
|
88 |
+
public function getModuleConfiguration($config = "active", $namespace = "icecore")
|
89 |
+
{
|
90 |
$conn = $this->_getReadAdapter();
|
91 |
$select = $conn
|
92 |
+
->select()
|
93 |
+
->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value'))
|
94 |
+
->where(new Zend_Db_Expr("path = 'icecore/" . $namespace . "/" . $config . "'"));
|
95 |
$data = $conn->fetchRow($select);
|
96 |
return $data["value"];
|
97 |
}
|
98 |
|
99 |
+
protected function getAuthID()
|
100 |
+
{
|
101 |
+
if ($this->modules == null)
|
102 |
+
$this->modules = $this->getModules();
|
103 |
$str = "";
|
104 |
+
foreach ($this->modules as $module) {
|
105 |
+
if ($module["serialreq"] == "1" && $module["active"] == "1")
|
106 |
+
$str.= $module["id"];
|
107 |
}
|
108 |
|
109 |
return $str;
|
110 |
}
|
111 |
|
112 |
+
public function getAuthKey($storeID = 0)
|
113 |
+
{
|
114 |
+
if ($this->modules == null)
|
115 |
+
$this->modules = $this->getModules();
|
116 |
$arr = array();
|
117 |
+
foreach ($this->modules as $module) {
|
118 |
+
if ($module["serialreq"] == "1" && $module["active"] == "1") {
|
119 |
+
array_push($arr, sprintf("[%s,%s,%s]", trim($module["id"]), trim($module["fingerprint"]), trim($module["serial"])));
|
120 |
}
|
121 |
}
|
122 |
+
$str = sprintf("%s,[%s]", Mage::helper('icecore')->getMerchantIDForStore($storeID), implode(",", $arr));
|
123 |
return sha1($str);
|
124 |
}
|
125 |
|
126 |
/* @sales_order_payment_place_end event */
|
|
|
127 |
|
128 |
+
public function savePayment(Varien_Event_Observer $observer)
|
129 |
+
{
|
130 |
$payment = $observer->getPayment();
|
131 |
$order = $payment->getOrder();
|
132 |
$pmName = $payment->getMethodInstance()->getCode();
|
133 |
|
134 |
+
$param = Mage::app()->getFrontController()->getRequest()->getParam('payment');
|
135 |
+
|
136 |
+
$paymentMethod = (isset($param[$pmName . '_paymentmethod'])) ? $param[$pmName . '_paymentmethod'] : $param['method'];
|
137 |
+
$issuer = isset($param[$pmName . '_issuer']) ? $param[$pmName . '_issuer'] : '0';
|
138 |
+
|
139 |
$country = (isset($param[$pmName . '_country'])) ? $param[$pmName . '_country'] : $order->getBillingAddress()->getCountryId();
|
140 |
if ($country == "00")
|
141 |
$country = $order->getBillingAddress()->getCountryId();
|
143 |
$ice_payment = array(
|
144 |
'ic_merchantid' => Mage::helper('icecore')->getMerchantIDForStore($order->getStore()->getId()),
|
145 |
'ic_currency' => $order->getOrderCurrencyCode(),
|
146 |
+
'ic_amount' => Mage::helper('icecore')->formatTotal($order->getGrandTotal()),
|
|
|
147 |
'ic_description' => Mage::helper('icecore')->getTransactionDescription($order->getRealOrderId()),
|
148 |
'ic_country' => $country,
|
149 |
'ic_language' => Mage::helper("icecore")->getLangISO2(),
|
150 |
'ic_reference' => $order->getRealOrderId(),
|
151 |
+
'ic_paymentmethod' => $paymentMethod,
|
152 |
+
'ic_issuer' => $issuer,
|
153 |
'ic_orderid' => $order->getRealOrderId(),
|
154 |
'ic_moduleid' => $this->getAuthID(),
|
155 |
'ic_authkey' => $this->getAuthKey($order->getStore()->getId())
|
156 |
);
|
157 |
+
|
|
|
158 |
$data = array(
|
159 |
'order_id' => $order->getRealOrderId(),
|
160 |
'model' => $pmName,
|
168 |
$this->_getWriteAdapter()->insert($this->getTable('icepay_transactions'), $data);
|
169 |
}
|
170 |
|
171 |
+
public function loadPaymentByID($id)
|
172 |
+
{
|
173 |
$conn = $this->_getReadAdapter();
|
174 |
$select = $conn
|
175 |
+
->select()
|
176 |
+
->from($this->getTable('icepay_transactions'), array('transaction_data', 'transaction_id', 'status', 'store_id', 'model', 'order_id'))
|
177 |
+
->where(new Zend_Db_Expr("order_id = '" . $id . "'"));
|
178 |
$data = $conn->fetchRow($select);
|
179 |
return $data;
|
180 |
}
|
181 |
|
182 |
+
public function changeStatus(array $data)
|
183 |
+
{
|
184 |
$where = $this->_getReadAdapter()->quoteInto('order_id = ?', $data["order_id"]);
|
185 |
$this->_getWriteAdapter()->update(
|
186 |
+
$this->getTable('icepay_transactions'), $data, $where);
|
|
|
187 |
}
|
188 |
|
189 |
}
|
app/code/community/Icepay/IceCore/Model/Webservice/Core.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ICEPAY - Webservice Core Model
|
5 |
+
*
|
6 |
+
* @version 1.0.0
|
7 |
+
* @author Wouter van Tilburg <wouter@icepay.eu>
|
8 |
+
* @copyright ICEPAY <www.icepay.com>
|
9 |
+
*
|
10 |
+
* Disclaimer:
|
11 |
+
* The merchant is entitled to change de ICEPAY plug-in code,
|
12 |
+
* any changes will be at merchant's own risk.
|
13 |
+
* Requesting ICEPAY support for a modified plug-in will be
|
14 |
+
* charged in accordance with the standard ICEPAY tariffs.
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class Icepay_IceCore_Model_Webservice_Core {
|
18 |
+
|
19 |
+
protected $merchantID;
|
20 |
+
protected $secretCode;
|
21 |
+
protected $client;
|
22 |
+
protected $serviceURL = 'https://connect.icepay.com/webservice/icepay.svc?wsdl';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Create the SOAP client
|
26 |
+
*
|
27 |
+
* @param int $merchantID
|
28 |
+
* @param string $secretCode
|
29 |
+
* @since 1.0.0
|
30 |
+
*/
|
31 |
+
public function init($merchantID, $secretCode)
|
32 |
+
{
|
33 |
+
$this->merchantID = (int) $merchantID;
|
34 |
+
$this->secretCode = (string) $secretCode;
|
35 |
+
|
36 |
+
$this->client = new SoapClient($this->serviceURL, array('cache_wsdl' => 'WSDL_CACHE_NONE', 'encoding' => 'UTF-8'));
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Return the user IP address
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
protected function getIP()
|
45 |
+
{
|
46 |
+
return (string) $_SERVER['REMOTE_ADDR'];
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Return the current timestamp
|
51 |
+
*
|
52 |
+
* @since 1.0.0
|
53 |
+
* @return type
|
54 |
+
*/
|
55 |
+
protected function getTimestamp()
|
56 |
+
{
|
57 |
+
return (string) gmdate("Y-m-d\TH:i:s\Z");
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Generate and return the checksum
|
62 |
+
*
|
63 |
+
* @param object $obj
|
64 |
+
* @param string $secretCode
|
65 |
+
* @return string
|
66 |
+
*/
|
67 |
+
protected function generateChecksum($obj = null, $secretCode = null)
|
68 |
+
{
|
69 |
+
$arr = array();
|
70 |
+
|
71 |
+
if ($secretCode)
|
72 |
+
array_push($arr, $secretCode);
|
73 |
+
|
74 |
+
foreach ($obj as $val) {
|
75 |
+
if (is_bool($val))
|
76 |
+
$val = ($val) ? 'true' : 'false';
|
77 |
+
array_push($arr, $val);
|
78 |
+
}
|
79 |
+
|
80 |
+
return (string) sha1(implode("|", $arr));
|
81 |
+
}
|
82 |
+
|
83 |
+
}
|
app/code/community/Icepay/IceCore/etc/system.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<tabs>
|
5 |
<icepay translate="label" module="icecore">
|
6 |
-
<label>Icepay</label>
|
7 |
<sort_order>99999</sort_order>
|
8 |
</icepay>
|
9 |
</tabs>
|
@@ -104,7 +104,7 @@
|
|
104 |
</step_3>
|
105 |
<manual>
|
106 |
<label></label>
|
107 |
-
<comment>Please read the
|
108 |
<frontend_type>label</frontend_type>
|
109 |
<sort_order>40</sort_order>
|
110 |
<show_in_default>1</show_in_default>
|
@@ -139,7 +139,7 @@
|
|
139 |
<label>Options</label>
|
140 |
<expanded>1</expanded>
|
141 |
<frontend_type>text</frontend_type>
|
142 |
-
<sort_order>
|
143 |
<show_in_default>1</show_in_default>
|
144 |
<show_in_website>0</show_in_website>
|
145 |
<show_in_store>1</show_in_store>
|
3 |
<config>
|
4 |
<tabs>
|
5 |
<icepay translate="label" module="icecore">
|
6 |
+
<label>Icepay Extensions</label>
|
7 |
<sort_order>99999</sort_order>
|
8 |
</icepay>
|
9 |
</tabs>
|
104 |
</step_3>
|
105 |
<manual>
|
106 |
<label></label>
|
107 |
+
<comment>Please read the advanced manual</comment>
|
108 |
<frontend_type>label</frontend_type>
|
109 |
<sort_order>40</sort_order>
|
110 |
<show_in_default>1</show_in_default>
|
139 |
<label>Options</label>
|
140 |
<expanded>1</expanded>
|
141 |
<frontend_type>text</frontend_type>
|
142 |
+
<sort_order>60</sort_order>
|
143 |
<show_in_default>1</show_in_default>
|
144 |
<show_in_website>0</show_in_website>
|
145 |
<show_in_store>1</show_in_store>
|
app/design/adminhtml/default/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/adminhtml/default/default/template/icepayadvanced/grid_paymentmethods.phtml
CHANGED
@@ -1,320 +1,305 @@
|
|
1 |
-
<?php $_htmlId
|
2 |
-
<?php $_htmlClass
|
3 |
-
<?php $_htmlName
|
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 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
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 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
var ICEPAYRetrievedPaymentMethodRowTemplate = '<tr id="icepay_{{index}}">'
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
var ICEPAYSettingsTemplate = '<p id="{{msg_id}}" class="{{type}}">{{msg}}</p>';
|
64 |
-
|
65 |
-
|
66 |
-
var ICEPAY = {
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
type
|
117 |
-
msg
|
118 |
-
msg_id
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
140 |
}
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
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 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
<?php endforeach; ?>
|
214 |
|
215 |
|
216 |
-
var url = '<?php echo $this->_ajaxSavePaymentMethodURL ?>';
|
217 |
-
var parameters = {
|
218 |
|
219 |
-
var icepayEditor = {
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
234 |
}
|
235 |
-
}
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
onError: function(response) {
|
286 |
-
alert("error");
|
287 |
-
},
|
288 |
onSuccess: function(transport) {
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
}
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
if (dialogWindow.options.firedElementId) {
|
299 |
-
wysiwygObj = eval('wysiwyg'+dialogWindow.options.firedElementId+'_editor');
|
300 |
-
wysiwygObj.turnOff();
|
301 |
-
if (tinyMCE.get(wysiwygObj.id)) {
|
302 |
-
$(dialogWindow.options.firedElementId).value = tinyMCE.get(wysiwygObj.id).getContent();
|
303 |
-
} else {
|
304 |
-
if ($(dialogWindow.options.firedElementId+'_editor')) {
|
305 |
-
$(dialogWindow.options.firedElementId).value = $(dialogWindow.options.firedElementId+'_editor').value;
|
306 |
}
|
307 |
-
}
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
dialogWindow.close();
|
313 |
-
Windows.overlayShowEffectOptions = this.overlayShowEffectOptions;
|
314 |
-
Windows.overlayHideEffectOptions = this.overlayHideEffectOptions;
|
315 |
-
}
|
316 |
-
};
|
317 |
-
|
318 |
-
//]]>
|
319 |
-
</script>
|
320 |
-
</td></tr>
|
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 |
+
template: new Template(ICEPAYPaymentMethodRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
|
68 |
+
ajaxTemplate: new Template(ICEPAYRetrievedPaymentMethodRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
|
69 |
+
msgTemplate: new Template(ICEPAYSettingsTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
|
70 |
+
itemsCount: 0,
|
71 |
+
msgCount: 0,
|
72 |
+
addItem: function() {
|
73 |
+
var data = {
|
74 |
+
pm_code: '',
|
75 |
+
pm_title: '',
|
76 |
+
pm_active: '',
|
77 |
+
pm_key: '',
|
78 |
+
pm_info: '',
|
79 |
+
pm_img: '',
|
80 |
+
pm_issuers: '',
|
81 |
+
pm_issuerdata: '',
|
82 |
+
pm_issuerimage: '',
|
83 |
+
module_namespace: '',
|
84 |
+
module_template: '',
|
85 |
+
index: this.itemsCount++
|
86 |
+
};
|
87 |
+
|
88 |
+
data.pm_code = arguments[0];
|
89 |
+
data.pm_title = arguments[1];
|
90 |
+
data.pm_img = arguments[2];
|
91 |
+
data.pm_issuers = arguments[3];
|
92 |
+
data.pm_active = arguments[4];
|
93 |
+
data.pm_info = arguments[5];
|
94 |
+
data.pm_issuerdata = arguments[6];
|
95 |
+
data.module_template = (arguments[7]) ? 1 : 0;
|
96 |
+
|
97 |
+
data.pm_key = 'pm_' + arguments[0].toLowerCase() + '_';
|
98 |
+
data.module_namespace = 'paymentmethod';
|
99 |
+
|
100 |
+
Element.insert($('<?php echo $_htmlId ?>_container'), {
|
101 |
+
bottom: (data.pm_issuerdata) ? this.ajaxTemplate.evaluate(data) : this.template.evaluate(data)
|
102 |
+
});
|
103 |
+
|
104 |
+
$('icepay_pm_row_' + data.index + '_enabled').selectedIndex = (data.pm_active == "1") ? 0 : 1;
|
105 |
+
},
|
106 |
+
addMessage: function() {
|
107 |
+
|
108 |
+
var data = {
|
109 |
+
type: '',
|
110 |
+
msg: '',
|
111 |
+
msg_id: '',
|
112 |
+
index: this.msgCount++
|
113 |
+
};
|
114 |
+
|
115 |
+
|
116 |
+
data.type = arguments[0];
|
117 |
+
data.msg = arguments[1];
|
118 |
+
data.msg_id = "msg_id_" + data.index.toString();
|
119 |
+
|
120 |
+
Element.insert($('icepay_debugger'), {
|
121 |
+
bottom: this.msgTemplate.evaluate(data)
|
122 |
+
});
|
123 |
+
|
124 |
+
},
|
125 |
+
clearMessages: function() {
|
126 |
+
for (var i = 0; i < this.msgCount; i++) {
|
127 |
+
try {
|
128 |
+
Element.remove($('msg_id_' + i.toString()));
|
129 |
+
} catch (err) {
|
130 |
+
alert(err.toString());
|
131 |
+
}
|
132 |
+
}
|
133 |
+
this.msgCount = 0;
|
134 |
+
},
|
135 |
+
clearAll: function() {
|
136 |
+
for (var i = 0; i < this.itemsCount; i++) {
|
137 |
+
try {
|
138 |
+
Element.remove($('icepay_' + i));
|
139 |
+
} catch (err) {
|
140 |
+
}
|
141 |
}
|
142 |
+
this.itemsCount = 0;
|
143 |
+
},
|
144 |
+
retrieveFromICEPAY: function() {
|
145 |
+
var url = '<?php echo $this->_ajaxGetPaymentMethodsURL ?>';
|
146 |
+
var parameters = {};
|
147 |
+
new Ajax.Request(url, {
|
148 |
+
parameters: parameters,
|
149 |
+
onComplete: function(response) {
|
150 |
+
if (response.status === 200) {
|
151 |
+
var result = response.responseText.evalJSON();
|
152 |
+
|
153 |
+
if (result.msg) {
|
154 |
+
ICEPAY.clearMessages();
|
155 |
+
for (var i = 0; i < result.msg.length; i++)
|
156 |
+
ICEPAY.addMessage(result.msg[i].type, result.msg[i].msg);
|
157 |
+
}
|
158 |
+
|
159 |
+
if (result.paymentmethods) {
|
160 |
+
ICEPAY.clearAll();
|
161 |
+
$('ice_webservice').value = 1;
|
162 |
+
|
163 |
+
for (var i = 0; i < result.paymentmethods.length; i++) {
|
164 |
+
var issuers = (result.paymentmethods[i].Issuers.Issuer.length > 0) ? result.paymentmethods[i].Issuers.Issuer.length.toString() + " issuers" : "1 issuer";
|
165 |
+
|
166 |
+
ICEPAY.addItem(
|
167 |
+
result.paymentmethods[i].PaymentMethodCode,
|
168 |
+
result.paymentmethods[i].Description,
|
169 |
+
result.paymentmethods[i].Image,
|
170 |
+
issuers,
|
171 |
+
result.paymentmethods[i].ConfigActive,
|
172 |
+
result.paymentmethods[i].ConfigDescription,
|
173 |
+
result.issuers[i]["data"]);
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
},
|
178 |
+
onError: function(response) {
|
179 |
+
|
180 |
+
}
|
181 |
+
});
|
182 |
+
return true;
|
183 |
+
}
|
184 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
|
187 |
<?php foreach ($this->getPaymentmethods() as $_item): ?>
|
188 |
+
<?php if (intval($_item['issuers']) > 0): ?>
|
189 |
+
ICEPAY.addItem(
|
190 |
+
'<?php echo $_item['code'] ?>',
|
191 |
+
'<?php echo $_item['name'] ?>',
|
192 |
+
'<?php echo $_item['image'] ?>',
|
193 |
+
'<?php echo $_item['issuers'] ?>',
|
194 |
+
'<?php echo $_item['active'] ?>',
|
195 |
+
'<?php echo $_item['info'] ?>',
|
196 |
+
null
|
197 |
+
);
|
198 |
+
<?php endif; ?>
|
199 |
<?php endforeach; ?>
|
200 |
|
201 |
|
202 |
+
var url = '<?php echo $this->_ajaxSavePaymentMethodURL ?>';
|
203 |
+
var parameters = {};
|
204 |
|
205 |
+
var icepayEditor = {
|
206 |
+
overlayShowEffectOptions: null,
|
207 |
+
overlayHideEffectOptions: null,
|
208 |
+
open: function(editorUrl, elementId) {
|
209 |
+
if (editorUrl && elementId) {
|
210 |
+
new Ajax.Request(editorUrl, {
|
211 |
+
parameters: {
|
212 |
+
element_id: '', //elementId+'_editor',
|
213 |
+
store_id: '0'
|
214 |
+
},
|
215 |
+
onSuccess: function(transport) {
|
216 |
+
try {
|
217 |
+
this.openDialogWindow(transport.responseText, elementId);
|
218 |
+
} catch (e) {
|
219 |
+
alert(e.message);
|
220 |
+
}
|
221 |
+
}.bind(this)
|
222 |
+
});
|
223 |
}
|
224 |
+
},
|
225 |
+
openDialogWindow: function(content, elementId) {
|
226 |
+
this.overlayShowEffectOptions = Windows.overlayShowEffectOptions;
|
227 |
+
this.overlayHideEffectOptions = Windows.overlayHideEffectOptions;
|
228 |
+
Windows.overlayShowEffectOptions = {duration: 0};
|
229 |
+
Windows.overlayHideEffectOptions = {duration: 0};
|
230 |
+
|
231 |
+
Dialog.confirm(content, {
|
232 |
+
draggable: true,
|
233 |
+
resizable: true,
|
234 |
+
closable: true,
|
235 |
+
className: "magento",
|
236 |
+
windowClassName: "popup-window",
|
237 |
+
title: '<?php echo $this->__('ICEPAY paymentmethod configuration'); ?>',
|
238 |
+
width: 750,
|
239 |
+
height: 555,
|
240 |
+
zIndex: 1000,
|
241 |
+
recenterAuto: false,
|
242 |
+
hideEffect: Element.hide,
|
243 |
+
showEffect: Element.show,
|
244 |
+
id: "catalog-wysiwyg-editor",
|
245 |
+
buttonClass: "form-button",
|
246 |
+
okLabel: "<?php echo $this->__('Save settings'); ?>",
|
247 |
+
cancelLabel: "<?php echo $this->__('Cancel'); ?>",
|
248 |
+
ok: this.saveDialogWindow.bind(this),
|
249 |
+
cancel: this.closeDialogWindow.bind(this),
|
250 |
+
onClose: this.closeDialogWindow.bind(this),
|
251 |
+
firedElementId: elementId
|
252 |
+
});
|
253 |
+
|
254 |
+
content.evalScripts.bind(content).defer();
|
255 |
+
|
256 |
+
},
|
257 |
+
saveDialogWindow: function(dialogWindow) {
|
258 |
+
|
259 |
+
var parameters = $('icepay_paymentmethod').serialize(true);
|
260 |
+
parameters.active_issuers = $('iceadvanced_generic_issuers').getValue().join(',');
|
261 |
+
parameters.specificcountry = $('iceadvanced_generic_specificcountry').getValue().join(',');
|
262 |
+
dialogWindow.hide();
|
263 |
+
|
264 |
+
new Ajax.Request(url, {
|
265 |
+
parameters: parameters,
|
266 |
+
onComplete: function(response) {
|
267 |
+
if (response.status == 200) {
|
268 |
+
|
269 |
+
}
|
270 |
+
},
|
271 |
+
onError: function(response) {
|
272 |
+
alert("error");
|
273 |
+
},
|
|
|
|
|
|
|
274 |
onSuccess: function(transport) {
|
275 |
+
alert(transport.responseText);
|
276 |
+
}
|
277 |
+
|
278 |
+
});
|
279 |
+
this.closeDialogWindow(dialogWindow);
|
280 |
+
|
281 |
+
},
|
282 |
+
okDialogWindow: function(dialogWindow) {
|
283 |
+
if (dialogWindow.options.firedElementId) {
|
284 |
+
wysiwygObj = eval('wysiwyg' + dialogWindow.options.firedElementId + '_editor');
|
285 |
+
wysiwygObj.turnOff();
|
286 |
+
if (tinyMCE.get(wysiwygObj.id)) {
|
287 |
+
$(dialogWindow.options.firedElementId).value = tinyMCE.get(wysiwygObj.id).getContent();
|
288 |
+
} else {
|
289 |
+
if ($(dialogWindow.options.firedElementId + '_editor')) {
|
290 |
+
$(dialogWindow.options.firedElementId).value = $(dialogWindow.options.firedElementId + '_editor').value;
|
291 |
+
}
|
292 |
}
|
293 |
+
}
|
294 |
+
this.closeDialogWindow(dialogWindow);
|
295 |
+
},
|
296 |
+
closeDialogWindow: function(dialogWindow) {
|
297 |
+
dialogWindow.close();
|
298 |
+
Windows.overlayShowEffectOptions = this.overlayShowEffectOptions;
|
299 |
+
Windows.overlayHideEffectOptions = this.overlayHideEffectOptions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
}
|
301 |
+
};
|
302 |
+
|
303 |
+
//]]>
|
304 |
+
</script>
|
305 |
+
</td></tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/icepayadvanced/paymentmethod.phtml
CHANGED
@@ -1,83 +1,85 @@
|
|
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 |
-
|
12 |
-
|
13 |
-
</tr>
|
14 |
-
<tr id="row_iceadvanced_generic_checkout_descr">
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
</tr>
|
20 |
-
<tr>
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
</tr>
|
33 |
-
<tr id="row_iceadvanced_generic_allowspecific">
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
</
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
<
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
83 |
</form>
|
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 |
+
}
|
51 |
+
;
|
52 |
+
Event.observe('iceadvanced_generic_allowspecific', 'change', function() {
|
53 |
+
checkDisplay();
|
54 |
+
});
|
55 |
+
</script>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
<tr id="row_iceadvanced_generic_specificcountry">
|
59 |
+
<td class="label"><label for="iceadvanced_generic_specificcountry"> <?php echo($this->__("Payment from Specific Countries")); ?></label></td>
|
60 |
+
<td class="value"><input name="groups[generic][fields][specificcountry][value]" value="" type="hidden">
|
61 |
+
<select id="iceadvanced_generic_specificcountry" name="specificcountry" class=" select multiselect" size="10" multiple="multiple">
|
62 |
+
<?php
|
63 |
+
foreach ($this->getViewData()->countryCollection as $country) {
|
64 |
+
$selected = (strstr($this->getViewData()->config['specificcountry'], $country['value'])) ? "selected" : "";
|
65 |
+
echo("<option value=\"{$country['value']}\" {$selected}>{$country['label']}</option>");
|
66 |
+
}
|
67 |
+
?>
|
68 |
+
</select>
|
69 |
+
<p class="note"><span><?php echo($this->__("Use CTRL to select specific countries")); ?></span></p>
|
70 |
+
</td>
|
71 |
+
</tr>
|
72 |
+
<tr id="row_iceadvanced_generic_min_order_total">
|
73 |
+
<td class="label"><label for="iceadvanced_generic_min_order_total"> <?php echo($this->__("Minimum Order Total")); ?></label></td>
|
74 |
+
<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>
|
75 |
+
</tr>
|
76 |
+
<tr id="row_iceadvanced_generic_max_order_total">
|
77 |
+
<td class="label"><label for="iceadvanced_generic_max_order_total"> <?php echo($this->__("Maximum Order Total")); ?></label></td>
|
78 |
+
<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>
|
79 |
+
</tr>
|
80 |
+
<tr id="row_iceadvanced_generic_sort_order">
|
81 |
+
<td class="label"><label for="iceadvanced_generic_sort_order"> <?php echo($this->__("Sort order")); ?></label></td>
|
82 |
+
<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>
|
83 |
+
</tr>
|
84 |
+
</tbody></table>
|
85 |
</form>
|
app/design/adminhtml/default/default/template/icepaycore/grid_modules.phtml
CHANGED
@@ -1,91 +1,80 @@
|
|
1 |
-
<?php $_htmlId
|
2 |
-
<?php $_htmlClass
|
3 |
-
<?php $_htmlName
|
4 |
-
|
5 |
-
|
6 |
|
7 |
<tr>
|
8 |
-
|
9 |
<td colspan="11" class="grid tier">
|
10 |
-
|
11 |
-
<
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
</
|
26 |
-
|
27 |
-
|
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
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
module_active_switch: '',
|
60 |
-
index: this.itemsCount++
|
61 |
-
};
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
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"
|
84 |
<?php endforeach; ?>
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
//]]>
|
89 |
-
</script>
|
90 |
-
|
91 |
-
</td></tr>
|
1 |
+
<?php $_htmlId = $this->getElement()->getHtmlId() ?>
|
2 |
+
<?php $_htmlClass = $this->getElement()->getClass() ?>
|
3 |
+
<?php $_htmlName = $this->getElement()->getName() ?>
|
|
|
|
|
4 |
|
5 |
<tr>
|
|
|
6 |
<td colspan="11" class="grid tier">
|
7 |
+
<table cellspacing="0" class="data border" id="modules_table" style="width:600px">
|
8 |
+
<col width="90" />
|
9 |
+
<col width="40" />
|
10 |
+
<col width="120" />
|
11 |
+
<col width="90" />
|
12 |
+
<col width="120" />
|
13 |
+
<thead>
|
14 |
+
<tr class="headings">
|
15 |
+
<th><?php echo Mage::helper('icecore')->__('Module') ?></th>
|
16 |
+
<th><?php echo Mage::helper('icecore')->__('Version') ?></th>
|
17 |
+
<th><?php echo Mage::helper('icecore')->__('Compatibility') ?></th>
|
18 |
+
<th><?php echo Mage::helper('icecore')->__('Active') ?></th>
|
19 |
+
</tr>
|
20 |
+
</thead>
|
21 |
+
<tbody id="<?php echo $_htmlId ?>_container"></tbody>
|
22 |
+
</table>
|
23 |
+
|
24 |
+
<script type="text/javascript">
|
25 |
+
//<![CDATA[
|
26 |
+
var ICEPAYModuleRowTemplate = '<tr>'
|
27 |
+
+ '<td>'
|
28 |
+
+ '{{module_name}}</td>'
|
29 |
+
+ '<td>{{module_version}}</td>'
|
30 |
+
+ '<td class="{{module_compatible}}">{{module_compatibility}}</td>'
|
31 |
+
+ '<td><select class="<?php echo $_htmlClass ?>" name="groups[{{module_namespace}}][fields][active][value]" id="icepay_module_row_{{index}}_enabled" {{module_active_switch}}>'
|
32 |
+
+ '<option value="1"><?php echo Mage::helper("icecore")->__("Enabled") ?></option>'
|
33 |
+
+ '<option value="0"><?php echo Mage::helper("icecore")->__("Disabled") ?></option>'
|
34 |
+
+ '</select></td>'
|
35 |
+
+ '</tr>';
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
var ICEPAYControl = {
|
39 |
+
template: new Template(ICEPAYModuleRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
|
40 |
+
itemsCount: 0,
|
41 |
+
addItem: function() {
|
42 |
|
43 |
+
var data = {
|
44 |
+
module_name: '',
|
45 |
+
module_version: '',
|
46 |
+
module_compatibility: '',
|
47 |
+
module_active: '',
|
48 |
+
module_serial: '',
|
49 |
+
module_compatible: '',
|
50 |
+
module_serialreq: '',
|
51 |
+
module_namespace: '',
|
52 |
+
module_active_switch: '',
|
53 |
+
index: this.itemsCount++
|
54 |
+
};
|
55 |
|
56 |
+
data.module_name = arguments[0];
|
57 |
+
data.module_version = arguments[1];
|
58 |
+
data.module_compatibility = arguments[2];
|
59 |
+
data.module_active = arguments[3];
|
60 |
+
data.module_serial = arguments[4];
|
61 |
+
data.module_compatible = arguments[5];
|
62 |
+
data.module_serialreq = arguments[6];
|
63 |
+
data.module_namespace = arguments[7];
|
64 |
+
data.module_active_switch = (data.module_namespace == "icecore") ? "disabled" : "";
|
|
|
|
|
|
|
65 |
|
66 |
+
Element.insert($('<?php echo $_htmlId ?>_container'), {
|
67 |
+
bottom: this.template.evaluate(data)
|
68 |
+
});
|
69 |
+
|
70 |
+
$('icepay_module_row_' + data.index + '_enabled').selectedIndex = (data.module_active == "1") ? 0 : 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
|
73 |
+
},
|
74 |
+
};
|
75 |
<?php foreach ($this->getModules() as $_item): ?>
|
76 |
+
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']) ?>');
|
77 |
<?php endforeach; ?>
|
78 |
+
//]]>
|
79 |
+
</script>
|
80 |
+
</td></tr>
|
|
|
|
|
|
|
|
app/locale/en_US/Icepay_IceAdvanced.csv
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*adminhtml*/
|
2 |
-
"Please read the advanced manual","<a href=
|
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]"
|
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]"
|
app/locale/en_US/Icepay_IceCore.csv
CHANGED
@@ -17,7 +17,7 @@
|
|
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=
|
21 |
|
22 |
/*comments*/
|
23 |
"Step 1.","Step 1."
|
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."
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Icepay_IceAdvanced</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>Commercial</license>
|
7 |
<channel>community</channel>
|
@@ -11,12 +11,16 @@ www.icepay.com</summary>
|
|
11 |
<description>Enables payments using payment service provider ICEPAY.
|
12 |
The Advanced extension includes webservice support
|
13 |
This package also contains the Icepay_IceCore extension.</description>
|
14 |
-
<notes>- Fixed
|
15 |
-
- Fixed
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
<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="5d1d00bd9add8b1fcb61cd10ee5fa2af"/></dir><dir name="de_DE"><file name="Icepay_IceAdvanced.csv" hash="3cae75009684ac7a1b4afb6667d6a477"/><file name="Icepay_IceCore.csv" hash="e8ad59c02f83d67b31e7bbef3ede043e"/></dir><dir name="es_ES"><file name="Icepay_IceAdvanced.csv" hash="f469c13d48a7361d0346fd29181c8370"/><file name="Icepay_IceCore.csv" hash="fa46bf1feedc31495401dfab9e4232d6"/></dir><dir name="fr_FR"><file name="Icepay_IceAdvanced.csv" hash="66ae26a1d9f20009878f19673d2d67b0"/><file name="Icepay_IceCore.csv" hash="5191576073b592b4285a983cc7fd17dc"/></dir><dir name="it_IT"><file name="Icepay_IceAdvanced.csv" hash="114d8290130a9f090efe210484eff1b9"/><file name="Icepay_IceCore.csv" hash="351fdc02d699cf65d763da8a44479f42"/></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="99929c3307825d5abbc9fcd015d486ee"/></dir><dir name="Model"><file name="Config.php" hash="952b1621e8df054150a357b11f4af177"/><dir name="Icepay"><file name="Postback.php" hash="a74d8f8fcfcf1fcca7af10966f4ac738"/><file name="Result.php" hash="4bfc63bf6d76d0ddf3045bd855ff9ccc"/><dir name="Webservice"><file name="Api.php" hash="0248c9464bea2e06c0fa77ca13ab1643"/></dir></dir><dir name="Mysql4"><file name="IceCore.php" hash="08fb084fac507e3caef381c3467db909"/></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="2071cc4fdc92ba6bb586b64d36165759"/><file name="system.xml" hash="13f9dd78dc575d5f3338d6ca142f2a0c"/></dir><dir name="sql"><dir name="icepaycore_setup"><file name="mysql4-install-1.0.0.php" hash="bc37063c45b48e52a7e12584daf82aef"/><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="47bb4bc67953abe8c70e131059b24743"/></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="190e50d33a187963e08e27938982a771"/></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="0a4eb475728203d20fab78061ab72bfb"/></dir><dir name="Extensions"><dir name="MS"><file name="Customerreward.php" hash="19de9518fca762eb13711fbdca0d5376"/></dir><dir name="MW"><file name="GiftWrap.php" hash="8bc1b0152f50ecec9353cf47d6eb5ded"/></dir></dir><dir name="Mysql4"><file name="IceAdvanced.php" hash="b41ddf849526fcc38e69c6431c613044"/></dir><file name="Observer.php" hash="22ba70cdcb42e81306122cffccf2ccdf"/><file name="Pay.php" hash="38b0397ec3dea35a1b4276975a5fe6a5"/><file name="Webservice.php" hash="f8f8109a7c89f97c8cbd17cce5d615fe"/><file name="icepay_api_order.php" hash="3a662ca53f2b8ea2a227ff35c1a55f91"/></dir><dir name="controllers"><file name="AjaxController.php" hash="5663eb36613923b2ccd9ede56787a0c9"/><file name="ConfigController.php" hash="9be40c50c69981034a9787a1f2e005f1"/><file name="ProcessingController.php" hash="5d77f6080bdd46bf5aa610e5c4db78e1"/></dir><dir name="etc"><file name="config.xml" hash="6b6b5d7c4ca73f07b53758415484242e"/><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="afterpay.png" hash="b9d37ce8c7daad7939f25d4f3f522d28"/><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="afterpay.png" hash="b9d37ce8c7daad7939f25d4f3f522d28"/><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="65865fc9d5d232853b37ec2188b01c8d"/><file name="general.css" hash="25fbd45dc203dce3f6bf907135a9f841"/><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="afterpay.png" hash="a3b02f6f3e53f548d58d2da794f4c900"/><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="afterpay.png" hash="a3b02f6f3e53f548d58d2da794f4c900"/><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="8bf6b91fd7438ffa1d64ee1f96dc0766"/><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>
|
|
|
|
|
|
|
|
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Icepay_IceAdvanced</name>
|
4 |
+
<version>1.1.9</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Commercial</license>
|
7 |
<channel>community</channel>
|
11 |
<description>Enables payments using payment service provider ICEPAY.
|
12 |
The Advanced extension includes webservice support
|
13 |
This package also contains the Icepay_IceCore extension.</description>
|
14 |
+
<notes>- Fixed Compilation bug
|
15 |
+
- Fixed UTF-8 Afterpay issue
|
16 |
+
- Fixed recurring payment issuers being shown during checkout
|
17 |
+
- Fixed broken manual buttons
|
18 |
+
- Started code cleanup
|
19 |
+
</notes>
|
20 |
+
<authors><author><name>ICEPAY</name><user>ICEPAY_PSP</user><email>wouter.vantilburg@icepay.com</email></author><author><name>Wouter van Tilburg</name><user>wvantilburg</user><email>wouter@icepay.eu</email></author></authors>
|
21 |
+
<date>2013-08-14</date>
|
22 |
+
<time>11:11:06</time>
|
23 |
+
<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="9092007f82d233320603de2e60e411ea"/><file name="Icepay_IceAdvanced.csv" hash="5f22cd45bb0f95e01cd8bcfa0b20420c"/></dir><dir name="nl_NL"><file name="Icepay_IceCore.csv" hash="becf356de17d63f4cd237e03b1d704e8"/><file name="Icepay_IceAdvanced.csv" hash="5d1d00bd9add8b1fcb61cd10ee5fa2af"/></dir><dir name="de_DE"><file name="Icepay_IceAdvanced.csv" hash="3cae75009684ac7a1b4afb6667d6a477"/><file name="Icepay_IceCore.csv" hash="e8ad59c02f83d67b31e7bbef3ede043e"/></dir><dir name="es_ES"><file name="Icepay_IceAdvanced.csv" hash="f469c13d48a7361d0346fd29181c8370"/><file name="Icepay_IceCore.csv" hash="fa46bf1feedc31495401dfab9e4232d6"/></dir><dir name="fr_FR"><file name="Icepay_IceAdvanced.csv" hash="66ae26a1d9f20009878f19673d2d67b0"/><file name="Icepay_IceCore.csv" hash="5191576073b592b4285a983cc7fd17dc"/></dir><dir name="it_IT"><file name="Icepay_IceAdvanced.csv" hash="114d8290130a9f090efe210484eff1b9"/><file name="Icepay_IceCore.csv" hash="351fdc02d699cf65d763da8a44479f42"/></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="16ee74a19916ce9f788d75c755d31a65"/></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="6ef8e2deb156159333742afe9c20a570"/></dir><dir name="Model"><file name="Config.php" hash="952b1621e8df054150a357b11f4af177"/><dir name="Icepay"><file name="Postback.php" hash="a74d8f8fcfcf1fcca7af10966f4ac738"/><file name="Result.php" hash="4bfc63bf6d76d0ddf3045bd855ff9ccc"/></dir><dir name="Mysql4"><file name="IceCore.php" hash="84960cbc0193bfd5261af3f0a3e213c3"/></dir><dir name="Webservice"><file name="Core.php" hash="04f8f3b25765e711a59b4bbbcd39c706"/></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="2071cc4fdc92ba6bb586b64d36165759"/><file name="system.xml" hash="424dcd8ca64f304c871326b749e0cc0f"/></dir><dir name="sql"><dir name="icepaycore_setup"><file name="mysql4-install-1.0.0.php" hash="bc37063c45b48e52a7e12584daf82aef"/><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="6e6ddc21f180a42a48ee80cc8846efbf"/></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="b94760499d65bdeb16e072bc83c2937c"/></dir><dir name="Model"><dir name="Checkout"><file name="PaymentObject.php" hash="8cee8b70324b37453d6263d209dd5fe3"/><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="1b1fc9e469da666c3e778027c28e04ec"/></dir><dir name="Extensions"><dir name="MS"><file name="Customerreward.php" hash="e39bc48c00621f299b83d012cc0d9464"/></dir><dir name="MW"><file name="GiftWrap.php" hash="49e31b11e5ec1d6669ba67efe7c073ae"/></dir></dir><dir name="Mysql4"><file name="IceAdvanced.php" hash="c519845e581a84aaaef93a7901ba5570"/></dir><file name="Observer.php" hash="33f5effabcb4834d628f3168438d2d80"/><file name="Order.php" hash="a7f88e2e19ced7081b1e7a426d420fbf"/><file name="Pay.php" hash="0e6a10d93be58af15587ff169a035112"/><file name="Paymentmethods.php" hash="9a4ea214394e1813609ee4166f2e0b98"/><dir name="Webservice"><file name="Advanced.php" hash="23cd1ca7bc75f28f7aaa50c27506f391"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="bf146cf2c715de9856d3d145819a1ac4"/><file name="ConfigController.php" hash="9be40c50c69981034a9787a1f2e005f1"/><file name="ProcessingController.php" hash="c73ee3217fe10bd0f86c189a60a05521"/></dir><dir name="etc"><file name="config.xml" hash="c6a1cc795704b9e6e50c97d2b793d9f4"/><file name="system.xml" hash="f930475b43e85496582d66c4a76a6ed9"/></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="afterpay.png" hash="b9d37ce8c7daad7939f25d4f3f522d28"/><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="afterpay.png" hash="b9d37ce8c7daad7939f25d4f3f522d28"/><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="773bb7d4f87f42214421960f4ccda8c3"/><file name="general.css" hash="25fbd45dc203dce3f6bf907135a9f841"/><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="afterpay.png" hash="a3b02f6f3e53f548d58d2da794f4c900"/><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="afterpay.png" hash="a3b02f6f3e53f548d58d2da794f4c900"/><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="b789718b178cd1df150caa35f54b48db"/></dir><dir name="icepayadvanced"><dir><dir name="form"><file name="default.phtml" hash="fdf9eb2d5c4a5ef8f43f6e9d8090ebd4"/></dir></dir><file name="grid_paymentmethods.phtml" hash="28f608b5e8c373b912bd5826424de840"/><file name="paymentmethod.phtml" hash="28dfbb959013471567d2db769516cb18"/></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>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
26 |
</package>
|
skin/adminhtml/default/default/icepay/admin.css
CHANGED
@@ -128,6 +128,6 @@
|
|
128 |
text-align: left;
|
129 |
}
|
130 |
|
131 |
-
.content-header h3 {
|
132 |
background:url(images/icepay-logo.png) no-repeat 0 0; height:0; padding: 25px 0 0 220px; width: 224px; height: 39px; display:block;
|
133 |
}
|
128 |
text-align: left;
|
129 |
}
|
130 |
|
131 |
+
.content-header h3.icepay-header {
|
132 |
background:url(images/icepay-logo.png) no-repeat 0 0; height:0; padding: 25px 0 0 220px; width: 224px; height: 39px; display:block;
|
133 |
}
|