Version Notes
Download this release
Release Info
Developer | Kassim Belghait |
Extension | Allopass_Hipay |
Version | 1.7.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.2 to 1.7.0
- app/code/community/Allopass/Hipay/Block/Adminhtml/Field/MappingCategory.php +137 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/Field/MappingShippingMethod.php +155 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/Field/Renderer/Label.php +18 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/Field/Renderer/List.php +44 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Expanded.php +23 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Information.php +34 -0
- app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Notice.php +43 -26
- app/code/community/Allopass/Hipay/Block/Form/Abstract.php +9 -0
- app/code/community/Allopass/Hipay/Helper/Collection.php +308 -0
- app/code/community/Allopass/Hipay/Helper/Data.php +345 -69
- app/code/community/Allopass/Hipay/Model/Config.php +308 -285
- app/code/community/Allopass/Hipay/Model/Field/CategoryMapping.php +5 -0
- app/code/community/Allopass/Hipay/Model/Field/MappingShippingMethod.php +27 -0
- app/code/community/Allopass/Hipay/Model/Method/Abstract.php +155 -98
- app/code/community/Allopass/Hipay/Model/Method/AbstractOrder.php +86 -0
- app/code/community/Allopass/Hipay/Model/Method/Astropay.php +51 -0
- app/code/community/Allopass/Hipay/Model/Method/Aura.php +8 -0
- app/code/community/Allopass/Hipay/Model/Method/Banamex.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Banco.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Bbva.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Boleto.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Bradesco.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Caixa.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Cc.php +30 -6
- app/code/community/Allopass/Hipay/Model/Method/Dexia.php +1 -1
- app/code/community/Allopass/Hipay/Model/Method/Discover.php +5 -0
- app/code/community/Allopass/Hipay/Model/Method/Facilipay3x.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Facilipay4x.php +8 -0
- app/code/community/Allopass/Hipay/Model/Method/Itau.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Oxxo.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/PaypalApi.php +1 -81
- app/code/community/Allopass/Hipay/Model/Method/PostfinancecardApi.php +4 -87
- app/code/community/Allopass/Hipay/Model/Method/PostfinanceefinanceApi.php +1 -84
- app/code/community/Allopass/Hipay/Model/Method/Przelewy24Api.php +1 -84
- app/code/community/Allopass/Hipay/Model/Method/Santander.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/Santandercash.php +7 -0
- app/code/community/Allopass/Hipay/Model/Method/SisalApi.php +1 -80
- app/code/community/Allopass/Hipay/Model/Method/SofortApi.php +1 -83
- app/code/community/Allopass/Hipay/Model/Method/WebmoneyApi.php +2 -84
- app/code/community/Allopass/Hipay/Model/Method/YandexApi.php +2 -84
- app/code/community/Allopass/Hipay/Model/Observer.php +87 -37
- app/code/community/Allopass/Hipay/Model/Source/Product/Facilipay3x.php +15 -0
- app/code/community/Allopass/Hipay/Model/Source/Product/Facilipay4x.php +15 -0
- app/code/community/Allopass/Hipay/Model/SplitPayment.php +23 -23
- app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentController.php +94 -114
- app/code/community/Allopass/Hipay/controllers/AuraController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/BanamexController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/BancoController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/BbvaController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/BoletoController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/BradescoController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/CaixaController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/DiscoverController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/Facilipay3xController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/Facilipay4xController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/ItauController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/OxxoController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/SantanderCashController.php +8 -0
- app/code/community/Allopass/Hipay/controllers/SantanderController.php +8 -0
- app/code/community/Allopass/Hipay/etc/config.xml +491 -20
- app/code/community/Allopass/Hipay/etc/system.xml +4769 -232
- app/design/adminhtml/default/default/layout/hipay.xml +3 -0
- app/design/adminhtml/default/default/template/hipay/mapping.phtml +130 -0
- app/design/adminhtml/default/default/template/hipay/system/config/form/field/information.phtml +13 -0
- app/design/adminhtml/default/default/template/hipay/system/config/form/field/notice.phtml +2 -8
- app/design/frontend/base/default/template/hipay/form/cc.phtml +41 -2
- app/locale/en_US/Allopass_Hipay.csv +2 -0
- app/locale/fr_FR/Allopass_Hipay.csv +4 -2
- package.xml +1 -1
- skin/adminhtml/base/default/hipay/css/hipay.css +50 -0
app/code/community/Allopass/Hipay/Block/Adminhtml/Field/MappingCategory.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Block_Adminhtml_Field_MappingCategory extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Renderer for List Category
|
7 |
+
*
|
8 |
+
* @var Allopass_Hipay_Block_Adminhtml_Field_Renderer_List
|
9 |
+
*/
|
10 |
+
protected $_listRenderer;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Renderer for Label
|
14 |
+
*
|
15 |
+
* @var Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
16 |
+
*/
|
17 |
+
protected $_labelRenderer;
|
18 |
+
|
19 |
+
/**
|
20 |
+
*
|
21 |
+
* @inheritdoc
|
22 |
+
*/
|
23 |
+
public function getArrayRows()
|
24 |
+
{
|
25 |
+
$options = array();
|
26 |
+
$categories = Mage::helper('hipay')->getMagentoCategories();
|
27 |
+
$mappingSaved = $this->getElement()->getValue();
|
28 |
+
|
29 |
+
// Add All Magento categories in Array Rows
|
30 |
+
if (!array_key_exists($mappingSaved[key($mappingSaved)], 'magento_code')) {
|
31 |
+
if (!empty($categories) && is_array($categories)) {
|
32 |
+
foreach ($categories as $code => $label) {
|
33 |
+
$mapping = $this->_getHipayCategoryMapping($code);
|
34 |
+
$options[$code] = array(
|
35 |
+
'magento_code' => $code,
|
36 |
+
'magento_label' => $label,
|
37 |
+
'hipay_category' => $this->_getHipayCategoryMapping($code),
|
38 |
+
'class' => empty($mapping) ? 'warning-mapping' : ''
|
39 |
+
);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
} else {
|
43 |
+
$options = $mappingSaved;
|
44 |
+
}
|
45 |
+
|
46 |
+
$this->getElement()->setValue($options);
|
47 |
+
return parent::getArrayRows();
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Prepare to render for Mapping category
|
53 |
+
*/
|
54 |
+
public function _prepareToRender()
|
55 |
+
{
|
56 |
+
$this->_addAfter = false;
|
57 |
+
$this->setTemplate('hipay/mapping.phtml');
|
58 |
+
$this->addColumn(
|
59 |
+
'magento_category',
|
60 |
+
array(
|
61 |
+
'label' => Mage::helper('hipay')->__('Magento category'),
|
62 |
+
'renderer' => $this->_getLabelRenderer()
|
63 |
+
)
|
64 |
+
);
|
65 |
+
|
66 |
+
$this->addColumn(
|
67 |
+
'hipay_category',
|
68 |
+
array(
|
69 |
+
'label' => Mage::helper('hipay')->__('Hipay category'),
|
70 |
+
'renderer' => $this->_getListOptionsRenderer()
|
71 |
+
)
|
72 |
+
);
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Get Label Renderer ( No input select )
|
78 |
+
*
|
79 |
+
* @return Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
80 |
+
*/
|
81 |
+
public function _getLabelRenderer()
|
82 |
+
{
|
83 |
+
if (!$this->_labelRenderer) {
|
84 |
+
$this->_labelRenderer = $this->getLayout()->createBlock('hipay/adminhtml_field_renderer_label', '');
|
85 |
+
}
|
86 |
+
return $this->_labelRenderer;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get List Renderer
|
91 |
+
*
|
92 |
+
* @return Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
93 |
+
*/
|
94 |
+
public function _getListOptionsRenderer()
|
95 |
+
{
|
96 |
+
$options = Mage::helper('hipay/collection')->getItemsCategory();
|
97 |
+
if (!$this->_listRenderer) {
|
98 |
+
$this->_listRenderer = $this->getLayout()->createBlock('hipay/adminhtml_field_renderer_list',
|
99 |
+
'',
|
100 |
+
array('is_render_to_js_template' => true));
|
101 |
+
$this->_listRenderer->setListOptions($options);
|
102 |
+
}
|
103 |
+
return $this->_listRenderer;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Extract hipay category from Mapping
|
108 |
+
*
|
109 |
+
* @param $codeMagentoCategory
|
110 |
+
* @return null|int
|
111 |
+
*/
|
112 |
+
protected function _getHipayCategoryMapping($codeMagentoCategory)
|
113 |
+
{
|
114 |
+
$mappingSaved = $this->getElement()->getValue();
|
115 |
+
$id_hipay_category = null;
|
116 |
+
foreach ($mappingSaved as $mapping) {
|
117 |
+
if ($mapping['magento_category'] == $codeMagentoCategory) {
|
118 |
+
$id_hipay_category = $mapping['hipay_category'];
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
return $id_hipay_category;
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
/**
|
127 |
+
* @inheritdoc
|
128 |
+
*/
|
129 |
+
protected function _prepareArrayRow(Varien_Object $row)
|
130 |
+
{
|
131 |
+
$row->setData(
|
132 |
+
'option_extra_attr_' . $this->_getListOptionsRenderer()
|
133 |
+
->calcOptionHash($row->getData('hipay_category')),
|
134 |
+
'selected="selected"'
|
135 |
+
);
|
136 |
+
}
|
137 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/Field/MappingShippingMethod.php
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Block_Adminhtml_Field_MappingShippingMethod extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Renderer for List Category
|
7 |
+
*
|
8 |
+
* @var Allopass_Hipay_Block_Adminhtml_Field_Renderer_List
|
9 |
+
*/
|
10 |
+
protected $_listRenderer;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Renderer for Label
|
14 |
+
*
|
15 |
+
* @var Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
16 |
+
*/
|
17 |
+
protected $_labelRenderer;
|
18 |
+
|
19 |
+
/**
|
20 |
+
*
|
21 |
+
* @inheritdoc
|
22 |
+
*/
|
23 |
+
public function getArrayRows()
|
24 |
+
{
|
25 |
+
$options = array();
|
26 |
+
$shippingMethod = Mage::helper('hipay')->getMagentoShippingMethods();
|
27 |
+
$mappingSaved = $this->getElement()->getValue();
|
28 |
+
|
29 |
+
// Add All Magento categories in Array Rows
|
30 |
+
if (!array_key_exists($mappingSaved[key($mappingSaved)], 'magento_code')) {
|
31 |
+
if (!empty($shippingMethod) && is_array($shippingMethod)) {
|
32 |
+
foreach ($shippingMethod as $code => $label) {
|
33 |
+
$mapping = $this->_getHipayDeliveryMapping($code);
|
34 |
+
$options[$code] =
|
35 |
+
array(
|
36 |
+
'magento_code' => $code,
|
37 |
+
'magento_label' => $label,
|
38 |
+
'hipay_delivery_method' => $mapping['hipay_delivery_method'],
|
39 |
+
'delay_preparation' => $mapping['delay_preparation'],
|
40 |
+
'delay_delivery' => $mapping['delay_delivery'],
|
41 |
+
'class' => empty($mapping) || (empty($mapping['hipay_delivery_method'])
|
42 |
+
|| empty($mapping['delay_preparation']) || empty($mapping['delay_delivery']) ) ? 'warning-mapping' : ''
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
} else {
|
47 |
+
$options = $mappingSaved;
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->getElement()->setValue($options);
|
51 |
+
return parent::getArrayRows();
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare to render for Shipping Method Mapping
|
57 |
+
*/
|
58 |
+
public function _prepareToRender()
|
59 |
+
{
|
60 |
+
$this->_addAfter = false;
|
61 |
+
$this->setTemplate('hipay/mapping.phtml');
|
62 |
+
$this->addColumn(
|
63 |
+
'magento_shipping_method',
|
64 |
+
array(
|
65 |
+
'label' => Mage::helper('hipay')->__('Magento shipping method'),
|
66 |
+
'style' => 'width: 400px;',
|
67 |
+
'renderer' => $this->_getLabelRenderer()
|
68 |
+
)
|
69 |
+
);
|
70 |
+
|
71 |
+
$this->addColumn(
|
72 |
+
'hipay_delivery_method',
|
73 |
+
array(
|
74 |
+
'label' => Mage::helper('hipay')->__('Hipay delivery method'),
|
75 |
+
'renderer' => $this->_getListOptionsRenderer()
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
$this->addColumn(
|
80 |
+
'delay_preparation',
|
81 |
+
array(
|
82 |
+
'label' => Mage::helper('hipay')->__('Order preparation delay'),
|
83 |
+
'style' => 'width: 50px;',
|
84 |
+
)
|
85 |
+
);
|
86 |
+
$this->addColumn(
|
87 |
+
'delay_delivery',
|
88 |
+
array(
|
89 |
+
'label' => Mage::helper('hipay')->__('Delivery delay'),
|
90 |
+
'style' => 'width: 50px;',
|
91 |
+
)
|
92 |
+
);
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Get Label Renderer ( No input select )
|
97 |
+
*
|
98 |
+
* @return Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
99 |
+
*/
|
100 |
+
public function _getLabelRenderer()
|
101 |
+
{
|
102 |
+
if (!$this->_labelRenderer) {
|
103 |
+
$this->_labelRenderer = $this->getLayout()->createBlock('hipay/adminhtml_field_renderer_label', '');
|
104 |
+
}
|
105 |
+
return $this->_labelRenderer;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Get List Renderer
|
110 |
+
*
|
111 |
+
* @return Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label
|
112 |
+
*/
|
113 |
+
public function _getListOptionsRenderer()
|
114 |
+
{
|
115 |
+
if (!$this->_listRenderer) {
|
116 |
+
$options = Mage::helper('hipay/collection')->getItemsDelivery();
|
117 |
+
$this->_listRenderer = $this->getLayout()->createBlock('hipay/adminhtml_field_renderer_list',
|
118 |
+
'',
|
119 |
+
array('is_render_to_js_template' => true));
|
120 |
+
$this->_listRenderer->setListOptions($options);
|
121 |
+
}
|
122 |
+
return $this->_listRenderer;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Extract hipay delivery method from Mapping
|
127 |
+
*
|
128 |
+
* @param $codeMagentoCategory
|
129 |
+
* @return null|int
|
130 |
+
*/
|
131 |
+
protected function _getHipayDeliveryMapping($codeMagentoCategory)
|
132 |
+
{
|
133 |
+
$mappingSaved = $this->getElement()->getValue();
|
134 |
+
foreach ($mappingSaved as $mapping) {
|
135 |
+
if ($mapping['magento_shipping_method'] == $codeMagentoCategory) {
|
136 |
+
return $mapping;
|
137 |
+
break;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
return null;
|
141 |
+
}
|
142 |
+
|
143 |
+
|
144 |
+
/**
|
145 |
+
* @inheritdoc
|
146 |
+
*/
|
147 |
+
protected function _prepareArrayRow(Varien_Object $row)
|
148 |
+
{
|
149 |
+
$row->setData(
|
150 |
+
'option_extra_attr_' . $this->_getListOptionsRenderer()
|
151 |
+
->calcOptionHash($row->getData('hipay_delivery_method')),
|
152 |
+
'selected="selected"'
|
153 |
+
);
|
154 |
+
}
|
155 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/Field/Renderer/Label.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Block_Adminhtml_Field_Renderer_Label extends Mage_Core_Block_Text
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Simple block to display just label with hidden input
|
7 |
+
*
|
8 |
+
* @return string
|
9 |
+
*/
|
10 |
+
protected function _toHtml()
|
11 |
+
{
|
12 |
+
$html = '<div style="width: 300px;" class="#{class}">';
|
13 |
+
$html .= '<input type="text" value="#{magento_code}" name="' . $this->inputName . '" style="visibility: hidden;width: 0px ;height: 0px">';
|
14 |
+
$html .= '#{magento_label}';
|
15 |
+
$html .= '</div>';
|
16 |
+
return $html;
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/Field/Renderer/List.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Block_Adminhtml_Field_Renderer_List extends Mage_Core_Block_Html_Select
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Original data source
|
7 |
+
*
|
8 |
+
* @var array
|
9 |
+
*/
|
10 |
+
protected $_listOptions;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Return block List with prepared select
|
14 |
+
*
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
public function _toHtml()
|
18 |
+
{
|
19 |
+
$this->setName($this->inputName);
|
20 |
+
|
21 |
+
switch ($this->column_name){
|
22 |
+
case "hipay_category":
|
23 |
+
$defaultValue = Mage::helper('hipay')->__('- Please select one category - ');
|
24 |
+
break;
|
25 |
+
case "hipay_delivery_method":
|
26 |
+
$defaultValue = Mage::helper('hipay')->__('- Please select one delivery method - ');
|
27 |
+
break;
|
28 |
+
}
|
29 |
+
$this->addOption('', $defaultValue);
|
30 |
+
foreach ($this->_listOptions as $key => $value) {
|
31 |
+
$this->addOption($key, $value);
|
32 |
+
}
|
33 |
+
return parent::_toHtml();
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Init initial list of options
|
38 |
+
*
|
39 |
+
* @param $options
|
40 |
+
*/
|
41 |
+
public function setListOptions($options){
|
42 |
+
$this->_listOptions = $options;
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Expanded.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Expanded
|
4 |
+
*/
|
5 |
+
class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Expanded
|
6 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* Return collapse state
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return bool
|
13 |
+
*/
|
14 |
+
protected function _getCollapseState($element)
|
15 |
+
{
|
16 |
+
$extra = Mage::getSingleton('admin/session')->getUser()->getExtra();
|
17 |
+
if (isset($extra['configState'][$element->getId()])) {
|
18 |
+
return $extra['configState'][$element->getId()];
|
19 |
+
}
|
20 |
+
|
21 |
+
return true;
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Information.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Notice
|
5 |
+
*/
|
6 |
+
class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Information extends Mage_Adminhtml_Block_System_Config_Form_Field
|
7 |
+
{
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Check if columns are defined, set template
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
parent::__construct();
|
16 |
+
|
17 |
+
if (!$this->getTemplate()) {
|
18 |
+
$this->setTemplate('hipay/system/config/form/field/information.phtml');
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Custom field
|
24 |
+
*
|
25 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
29 |
+
{
|
30 |
+
$element->setInformationsHipay($element->getData('tooltip'));
|
31 |
+
$this->setElement($element);
|
32 |
+
return $this->_toHtml();
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Notice.php
CHANGED
@@ -5,35 +5,52 @@
|
|
5 |
*/
|
6 |
class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Notice extends Mage_Adminhtml_Block_System_Config_Form_Field
|
7 |
{
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Check if columns are defined, set template
|
11 |
-
*
|
12 |
-
*/
|
13 |
-
public function __construct()
|
14 |
-
{
|
15 |
-
parent::__construct();
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
{
|
30 |
-
$notices = array();
|
31 |
-
if (!Mage::getStoreConfigFlag('hipay/hipay_basket/activate_basket', Mage::app()->getStore())) {
|
32 |
-
$notices[] = Mage::helper('adminhtml')->__('You have to activate and configuring the support of basket before activate the payment method klarna.');
|
33 |
}
|
34 |
|
35 |
$element->setNoticesHipay($notices);
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
}
|
5 |
*/
|
6 |
class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Notice extends Mage_Adminhtml_Block_System_Config_Form_Field
|
7 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
/**
|
10 |
+
* Set template
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
parent::__construct();
|
16 |
+
if (!$this->getTemplate()) {
|
17 |
+
$this->setTemplate('hipay/system/config/form/field/notice.phtml');
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Custom field
|
23 |
+
*
|
24 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
28 |
+
{
|
29 |
+
$notices = array();
|
30 |
+
$commonWarning = Mage::helper('hipay')->__('All mappings are not filled in, please check the information you entered.
|
31 |
+
If the mappings are not filled in, then Oney transactions will be denied.');
|
32 |
+
|
33 |
+
// Notice for block Mapping shipping method
|
34 |
+
if (preg_match('/mapping_shipping_method/', $element->getId())){
|
35 |
+
$nbMappingMissing = Mage::helper('hipay')->checkMappingShippingMethod();
|
36 |
+
if ($nbMappingMissing > 0) {
|
37 |
+
$notices[] = $commonWarning . '<div class="nb-mapping-missing">
|
38 |
+
' . $nbMappingMissing . ' '. Mage::helper('hipay')->__('mappings delivery method are actually missing.') .'</div>';
|
39 |
+
|
40 |
+
}
|
41 |
+
}
|
42 |
|
43 |
+
// Notice for block Category
|
44 |
+
if (preg_match('/mapping_category/', $element->getId())){
|
45 |
+
$nbMappingMissing = Mage::helper('hipay')->checkMappingCategoryMethod();
|
46 |
+
if ($nbMappingMissing > 0) {
|
47 |
+
$notices[] = $commonWarning . '<div class="nb-mapping-missing">
|
48 |
+
' . $nbMappingMissing . ' '. Mage::helper('hipay')->__('mappings categories are actually missing.') . '</div>';
|
49 |
+
}
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
$element->setNoticesHipay($notices);
|
53 |
+
$this->setElement($element);
|
54 |
+
return $this->_toHtml();
|
55 |
+
}
|
56 |
}
|
app/code/community/Allopass/Hipay/Block/Form/Abstract.php
CHANGED
@@ -161,4 +161,13 @@ abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_For
|
|
161 |
));
|
162 |
return parent::_toHtml();
|
163 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
161 |
));
|
162 |
return parent::_toHtml();
|
163 |
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Return the type for national identification number to BLOCK
|
167 |
+
* @return string
|
168 |
+
*/
|
169 |
+
public function getTypeNationalIdentification()
|
170 |
+
{
|
171 |
+
return $this->getMethod()->getTypeNationalIdentification();
|
172 |
+
}
|
173 |
}
|
app/code/community/Allopass/Hipay/Helper/Collection.php
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Helper_Collection extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
* @var string $_JSON Json collection
|
8 |
+
*/
|
9 |
+
private static $_JSON_CATEGORY = <<<EOT
|
10 |
+
|
11 |
+
[
|
12 |
+
{
|
13 |
+
"categoryCode":1,
|
14 |
+
"categoryName":"Home & Gardening"
|
15 |
+
},
|
16 |
+
{
|
17 |
+
"categoryCode":2,
|
18 |
+
"categoryName":"Clothing & Accessories"
|
19 |
+
},
|
20 |
+
{
|
21 |
+
"categoryCode":3,
|
22 |
+
"categoryName":"Home appliances"
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"categoryCode":4,
|
26 |
+
"categoryName":"Sports & Recreations"
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"categoryCode":5,
|
30 |
+
"categoryName":"Babies & Children"
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"categoryCode":6,
|
34 |
+
"categoryName":"Hi-Fi, Photo & Video equipment"
|
35 |
+
},
|
36 |
+
{
|
37 |
+
"categoryCode":7,
|
38 |
+
"categoryName":"IT equipment"
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"categoryCode":8,
|
42 |
+
"categoryName":"Phone & Internet services"
|
43 |
+
},
|
44 |
+
{
|
45 |
+
"categoryCode":9,
|
46 |
+
"categoryName":"Physical goods : Books, Media, Music & Movies"
|
47 |
+
},
|
48 |
+
{
|
49 |
+
"categoryCode":10,
|
50 |
+
"categoryName":"Digital goods : Books, Media, Music & Movies"
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"categoryCode":11,
|
54 |
+
"categoryName":"Consoles & Video games"
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"categoryCode":12,
|
58 |
+
"categoryName":"Gifts & Flowers"
|
59 |
+
},
|
60 |
+
{
|
61 |
+
"categoryCode":13,
|
62 |
+
"categoryName":"Health & Beauty"
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"categoryCode":14,
|
66 |
+
"categoryName":"Car & Motorcycle"
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"categoryCode":15,
|
70 |
+
"categoryName":"Traveling"
|
71 |
+
},
|
72 |
+
{
|
73 |
+
"categoryCode":16,
|
74 |
+
"categoryName":"Food & Gastronomy"
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"categoryCode":17,
|
78 |
+
"categoryName":"Auctions & Group buying"
|
79 |
+
},
|
80 |
+
{
|
81 |
+
"categoryCode":18,
|
82 |
+
"categoryName":"Services to professionals"
|
83 |
+
},
|
84 |
+
{
|
85 |
+
"categoryCode":19,
|
86 |
+
"categoryName":"Services to individuals"
|
87 |
+
},
|
88 |
+
{
|
89 |
+
"categoryCode":20,
|
90 |
+
"categoryName":"Culture & Entertainment"
|
91 |
+
},
|
92 |
+
{
|
93 |
+
"categoryCode":21,
|
94 |
+
"categoryName":"Games (digital goods)"
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"categoryCode":22,
|
98 |
+
"categoryName":"Games (physical goods)"
|
99 |
+
},
|
100 |
+
{
|
101 |
+
"categoryCode":23,
|
102 |
+
"categoryName":"Ticketing"
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"categoryCode":24,
|
106 |
+
"categoryName":"Opticians, Opticians Goods and Eyeglasses"
|
107 |
+
}
|
108 |
+
]
|
109 |
+
|
110 |
+
EOT;
|
111 |
+
|
112 |
+
/**
|
113 |
+
* JSON OBJECT for delivery method
|
114 |
+
*
|
115 |
+
* @var string $_JSON Json collection
|
116 |
+
*/
|
117 |
+
private static $_JSON_DELIVERY = <<<EOT
|
118 |
+
|
119 |
+
[
|
120 |
+
{
|
121 |
+
"code":1,
|
122 |
+
"mode":"STORE",
|
123 |
+
"shipping":"STANDARD"
|
124 |
+
},
|
125 |
+
{
|
126 |
+
"code":2,
|
127 |
+
"mode":"STORE",
|
128 |
+
"shipping":"EXPRESS"
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"code":3,
|
132 |
+
"mode":"STORE",
|
133 |
+
"shipping":"PRIORITY24H"
|
134 |
+
},
|
135 |
+
{
|
136 |
+
"code":4,
|
137 |
+
"mode":"STORE",
|
138 |
+
"shipping":"PRIORITY2H"
|
139 |
+
},
|
140 |
+
{
|
141 |
+
"code":5,
|
142 |
+
"mode":"STORE",
|
143 |
+
"shipping":"PRIORITY1H"
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"code":6,
|
147 |
+
"mode":"STORE",
|
148 |
+
"shipping":"INSTANT"
|
149 |
+
},
|
150 |
+
{
|
151 |
+
"code":7,
|
152 |
+
"mode":"CARRIER",
|
153 |
+
"shipping":"STANDARD"
|
154 |
+
},
|
155 |
+
{
|
156 |
+
"code":8,
|
157 |
+
"mode":"CARRIER",
|
158 |
+
"shipping":"EXPRESS"
|
159 |
+
},
|
160 |
+
{
|
161 |
+
"code":9,
|
162 |
+
"mode":"CARRIER",
|
163 |
+
"shipping":"PRIORITY24H"
|
164 |
+
},
|
165 |
+
{
|
166 |
+
"code":10,
|
167 |
+
"mode":"CARRIER",
|
168 |
+
"shipping":"PRIORITY2H"
|
169 |
+
},
|
170 |
+
{
|
171 |
+
"code":11,
|
172 |
+
"mode":"STORE",
|
173 |
+
"shipping":"PRIORITY1H"
|
174 |
+
},
|
175 |
+
{
|
176 |
+
"code":12,
|
177 |
+
"mode":"CARRIER",
|
178 |
+
"shipping":"INSTANT"
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"code":13,
|
182 |
+
"mode":"RELAYPOINT",
|
183 |
+
"shipping":"STANDARD"
|
184 |
+
},
|
185 |
+
{
|
186 |
+
"code":14,
|
187 |
+
"mode":"RELAYPOINT",
|
188 |
+
"shipping":"EXPRESS"
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"code":15,
|
192 |
+
"mode":"RELAYPOINT",
|
193 |
+
"shipping":"PRIORITY24H"
|
194 |
+
},
|
195 |
+
{
|
196 |
+
"code":16,
|
197 |
+
"mode":"RELAYPOINT",
|
198 |
+
"shipping":"PRIORITY2H"
|
199 |
+
},
|
200 |
+
{
|
201 |
+
"code":17,
|
202 |
+
"mode":"RELAYPOINT",
|
203 |
+
"shipping":"PRIORITY1H"
|
204 |
+
},
|
205 |
+
{
|
206 |
+
"code":18,
|
207 |
+
"mode":"RELAYPOINT",
|
208 |
+
"shipping":"INSTANT"
|
209 |
+
},
|
210 |
+
{
|
211 |
+
"code":19,
|
212 |
+
"mode":"ELECTRONIC",
|
213 |
+
"shipping":"STANDARD"
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"code":20,
|
217 |
+
"mode":"ELECTRONIC",
|
218 |
+
"shipping":"EXPRESS"
|
219 |
+
},
|
220 |
+
{
|
221 |
+
"code":21,
|
222 |
+
"mode":"ELECTRONIC",
|
223 |
+
"shipping":"PRIORITY24H"
|
224 |
+
},
|
225 |
+
{
|
226 |
+
"code":22,
|
227 |
+
"mode":"ELECTRONIC",
|
228 |
+
"shipping":"PRIORITY2H"
|
229 |
+
},
|
230 |
+
{
|
231 |
+
"code":23,
|
232 |
+
"mode":"ELECTRONIC",
|
233 |
+
"shipping":"PRIORITY1H"
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"code":24,
|
237 |
+
"mode":"ELECTRONIC",
|
238 |
+
"shipping":"INSTANT"
|
239 |
+
},
|
240 |
+
{
|
241 |
+
"code":25,
|
242 |
+
"mode":"TRAVEL",
|
243 |
+
"shipping":"STANDARD"
|
244 |
+
},
|
245 |
+
{
|
246 |
+
"code":26,
|
247 |
+
"mode":"TRAVEL",
|
248 |
+
"shipping":"EXPRESS"
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"code":27,
|
252 |
+
"mode":"TRAVEL",
|
253 |
+
"shipping":"PRIORITY24H"
|
254 |
+
},
|
255 |
+
{
|
256 |
+
"code":28,
|
257 |
+
"mode":"TRAVEL",
|
258 |
+
"shipping":"PRIORITY1H"
|
259 |
+
},
|
260 |
+
{
|
261 |
+
"code":29,
|
262 |
+
"mode":"TRAVEL",
|
263 |
+
"shipping":"INSTANT"
|
264 |
+
}
|
265 |
+
]
|
266 |
+
|
267 |
+
EOT;
|
268 |
+
/**
|
269 |
+
* Return HiPay's Category
|
270 |
+
*
|
271 |
+
* @return array
|
272 |
+
*/
|
273 |
+
public function getItemsCategory()
|
274 |
+
{
|
275 |
+
$jsonArr = json_decode(self::$_JSON_CATEGORY, true);
|
276 |
+
$collection = array();
|
277 |
+
foreach ($jsonArr as $item) {
|
278 |
+
$collection[$item['categoryCode']] = $item['categoryName'];
|
279 |
+
}
|
280 |
+
return $collection;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Return HiPay's delivery method Full json
|
285 |
+
*
|
286 |
+
* @return array
|
287 |
+
*/
|
288 |
+
public static function getFullItemsDelivery()
|
289 |
+
{
|
290 |
+
return json_decode(self::$_JSON_DELIVERY, true);
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Return HiPay's delivery method for listing
|
295 |
+
*
|
296 |
+
* @return array
|
297 |
+
*/
|
298 |
+
public static function getItemsDelivery()
|
299 |
+
{
|
300 |
+
$jsonArr = json_decode(self::$_JSON_DELIVERY, true);
|
301 |
+
$collection = array();
|
302 |
+
foreach ($jsonArr as $item) {
|
303 |
+
$collection[$item['code']] = $item['mode'] . '-' . $item['shipping'];
|
304 |
+
}
|
305 |
+
return $collection;
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
app/code/community/Allopass/Hipay/Helper/Data.php
CHANGED
@@ -26,6 +26,11 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
26 |
const STATE_AUTHORIZATION = '0';
|
27 |
const STATE_REFUND = '1';
|
28 |
const STATE_CAPTURE = '2';
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
/**
|
31 |
* Return to TPP Tax rate only if all products have the same tax
|
@@ -84,7 +89,7 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
84 |
* @param $capture
|
85 |
* @return array
|
86 |
*/
|
87 |
-
private function processDiscount($order
|
88 |
{
|
89 |
$coupon = $order->getCouponCode();
|
90 |
if (!empty($coupon)) {
|
@@ -96,6 +101,7 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
96 |
$item['total_amount'] = 0;
|
97 |
$item['quantity'] = '1';
|
98 |
$item['unit_price'] = '0';
|
|
|
99 |
$basket[] = $item;
|
100 |
}
|
101 |
|
@@ -110,35 +116,36 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
110 |
* @param $capture
|
111 |
* @return array
|
112 |
*/
|
113 |
-
private function processShipping($order, $action
|
114 |
{
|
115 |
-
|
116 |
-
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
117 |
-
|
118 |
-
$item = array();
|
119 |
-
$item['type'] = Allopass_Hipay_Helper_Data::TYPE_ITEM_BASKET_FEE;
|
120 |
-
$item['product_reference'] = $order->getShippingDescription();
|
121 |
-
$item['name'] = $order->getShippingDescription();
|
122 |
-
$item['quantity'] = '1';
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
$item['unit_price'] =round( $order->getShippingAmount(),3);
|
130 |
-
$item['total_amount'] = round($order->getShippingAmount(),3);
|
131 |
-
$item['tax_rate'] = round($order->getShippingTaxAmount() / $order->getShippingAmount() * 100 ,2);
|
132 |
-
}
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
-
|
|
|
|
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
142 |
return $basket;
|
143 |
}
|
144 |
|
@@ -148,12 +155,13 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
148 |
*@param $product
|
149 |
*@param $quantity
|
150 |
*/
|
151 |
-
private function returnUnitPrice($product
|
|
|
152 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
153 |
|
154 |
if (!$useOrderCurrency) {
|
155 |
return $product->getBasePrice() + $product->getBaseTaxAmount() / $quantity;
|
156 |
-
}else{
|
157 |
return $product->getPrice() + $product->getTaxAmount() / $quantity;
|
158 |
}
|
159 |
}
|
@@ -165,14 +173,14 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
165 |
* @param $product
|
166 |
* @param @action
|
167 |
*/
|
168 |
-
private function addItem($product, $action
|
169 |
{
|
170 |
$item = array();
|
171 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
|
|
172 |
|
173 |
// Select base Field according the action
|
174 |
-
switch ($action)
|
175 |
-
{
|
176 |
case Allopass_Hipay_Helper_Data::STATE_REFUND:
|
177 |
$base_discount = Allopass_Hipay_Helper_Data::FIELD_BASE_DISCOUNT_REFUNDED;
|
178 |
$base_hidden_tax = Allopass_Hipay_Helper_Data::FIELD_BASE_TAX_HIDDEN_REFUNDED;
|
@@ -192,32 +200,28 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
192 |
$taxPercent = $product->getData('tax_percent');
|
193 |
|
194 |
if (!$useOrderCurrency) {
|
195 |
-
$hidden_tax = $product->getData('base_'+ $base_hidden_tax);
|
196 |
-
$discount = $product->getData('base_'+ $base_discount);
|
197 |
$total_amount = $product->getBaseRowTotal() + $product->getBaseTaxAmount() + $product->getBaseHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($product) - $product->getBaseDiscountAmount();
|
198 |
-
}else{
|
199 |
-
$hidden_tax = $product->getData($base_hidden_tax);
|
200 |
-
$discount = $product->getData($base_discount);
|
201 |
$total_amount = $product->getRowTotal() + $product->getTaxAmount() + $product->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($product) - $product->getDiscountAmount();
|
202 |
}
|
203 |
// Add information in basket only if the product is simple
|
204 |
-
if ($item['quantity'] > 0 && $total_amount > 0
|
205 |
-
if ($action == Allopass_Hipay_Helper_Data::STATE_CAPTURE || $action == Allopass_Hipay_Helper_Data::STATE_REFUND){
|
206 |
// To avoid 0.001 between original authorization and capture
|
207 |
foreach ($products as $key => $original) {
|
208 |
-
if ($product->getSku() == $original->getSku()){
|
209 |
if ($original->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE && $original->isChildrenCalculated()) {
|
210 |
foreach ($original->getChildren() as $children) {
|
211 |
-
$unitPrice =
|
212 |
}
|
213 |
} else {
|
214 |
-
$unitPrice =
|
215 |
}
|
216 |
}
|
217 |
}
|
218 |
-
}else{
|
219 |
// Don't use unit price in product because we need a better precision
|
220 |
-
$unitPrice =
|
221 |
}
|
222 |
|
223 |
// if store support EAN ( Please set the attribute on hipay config )
|
@@ -225,7 +229,6 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
225 |
$attribute = Mage::getStoreConfig('hipay/hipay_basket/attribute_ean', Mage::app()->getStore());
|
226 |
|
227 |
if (Mage::getStoreConfig('hipay/hipay_basket/load_product_ean', Mage::app()->getStore())) {
|
228 |
-
$resource = Mage::getSingleton('catalog/product')->getResource();
|
229 |
$ean = $resource->getAttributeRawValue($product->getProductId(), $attribute,
|
230 |
Mage::app()->getStore());
|
231 |
} else {
|
@@ -248,11 +251,26 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
248 |
// According the configuration we use this trick to complete the discount with tax hidden
|
249 |
$item['discount'] = round($total_amount - ($unitPrice * $item['quantity']), 3);
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
return $item;
|
252 |
}
|
253 |
|
254 |
|
255 |
}
|
|
|
256 |
/**
|
257 |
* Return to TPP API basket informations
|
258 |
*
|
@@ -261,8 +279,11 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
261 |
* @return json
|
262 |
*
|
263 |
*/
|
264 |
-
public function getCartInformation(
|
265 |
-
|
|
|
|
|
|
|
266 |
$basket = array();
|
267 |
$products = $order->getAllVisibleItems();
|
268 |
|
@@ -270,10 +291,9 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
270 |
// Add each product in basket
|
271 |
// =============================================================== //
|
272 |
if ($action == Allopass_Hipay_Helper_Data::STATE_AUTHORIZATION) {
|
|
|
273 |
|
274 |
-
$basket = $this->
|
275 |
-
|
276 |
-
$basket = $this->processShipping($order, $action,$basket);
|
277 |
|
278 |
foreach ($products as $key => $product) {
|
279 |
if ($product->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
|
@@ -298,11 +318,11 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
298 |
// =============================================================== //
|
299 |
// Add Shipping in basket
|
300 |
// =============================================================== //
|
301 |
-
$basket = $this->processShipping($invoice, $action
|
302 |
|
303 |
foreach ($invoice->getAllItems() as $product) {
|
304 |
-
$item = $this->addItem($product, $action
|
305 |
-
if ($item){
|
306 |
$basket[] = $item;
|
307 |
}
|
308 |
}
|
@@ -316,10 +336,10 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
316 |
// =============================================================== //
|
317 |
// Add Shipping in basket
|
318 |
// =============================================================== //
|
319 |
-
$basket = $this->processShipping($creditMemo, $action
|
320 |
|
321 |
foreach ($creditMemo->getAllItems() as $product) {
|
322 |
-
$item = $this->addItem($product, $action
|
323 |
if ($item) {
|
324 |
$basket[] = $item;
|
325 |
}
|
@@ -455,7 +475,7 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
455 |
);
|
456 |
|
457 |
// First split is already paid
|
458 |
-
if ($numberSplit == 1){
|
459 |
$data['status'] = Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_COMPLETE;
|
460 |
}
|
461 |
|
@@ -489,21 +509,6 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
489 |
return false;
|
490 |
}
|
491 |
|
492 |
-
public function getHipayMethods()
|
493 |
-
{
|
494 |
-
$methods = array();
|
495 |
-
|
496 |
-
foreach (Mage::getStoreConfig('payment') as $code => $data) {
|
497 |
-
if (strpos($code, 'hipay') !== false) {
|
498 |
-
if (isset($data['model'])) {
|
499 |
-
$methods[$code] = $data['model'];
|
500 |
-
}
|
501 |
-
}
|
502 |
-
}
|
503 |
-
|
504 |
-
return $methods;
|
505 |
-
}
|
506 |
-
|
507 |
public function checkSignature(
|
508 |
$signature,
|
509 |
$fromNotification = false,
|
@@ -554,6 +559,21 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
554 |
return false;
|
555 |
}
|
556 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
public function checkIfCcExpDateIsValid(
|
558 |
$customer
|
559 |
) {
|
@@ -823,7 +843,7 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
823 |
|
824 |
/**
|
825 |
* Send email id payment is in Fraud status
|
826 |
-
* @param Mage_Customer_Model_Customer $receiver
|
827 |
* @param Mage_Sales_Model_Order $order
|
828 |
* @param string $message
|
829 |
* @return Mage_Checkout_Helper_Data
|
@@ -1143,4 +1163,260 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
|
|
1143 |
|
1144 |
return $this;
|
1145 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1146 |
}
|
26 |
const STATE_AUTHORIZATION = '0';
|
27 |
const STATE_REFUND = '1';
|
28 |
const STATE_CAPTURE = '2';
|
29 |
+
const EPSYLON = 0.00001;
|
30 |
+
|
31 |
+
const DEFAULT_CATEGORY_CODE = 1 ;
|
32 |
+
|
33 |
+
const LOG_INTERNAL_HIPAY = 'hipay_general_debug';
|
34 |
|
35 |
/**
|
36 |
* Return to TPP Tax rate only if all products have the same tax
|
89 |
* @param $capture
|
90 |
* @return array
|
91 |
*/
|
92 |
+
private function processDiscount($order, $action, $basket)
|
93 |
{
|
94 |
$coupon = $order->getCouponCode();
|
95 |
if (!empty($coupon)) {
|
101 |
$item['total_amount'] = 0;
|
102 |
$item['quantity'] = '1';
|
103 |
$item['unit_price'] = '0';
|
104 |
+
$item['product_category'] = self::DEFAULT_CATEGORY_CODE;
|
105 |
$basket[] = $item;
|
106 |
}
|
107 |
|
116 |
* @param $capture
|
117 |
* @return array
|
118 |
*/
|
119 |
+
private function processShipping($order, $action, $basket)
|
120 |
{
|
121 |
+
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
$item = array();
|
124 |
+
$item['type'] = Allopass_Hipay_Helper_Data::TYPE_ITEM_BASKET_FEE;
|
125 |
+
$item['product_reference'] = $order->getShippingDescription();
|
126 |
+
$item['name'] = $order->getShippingDescription();
|
127 |
+
$item['quantity'] = '1';
|
|
|
|
|
|
|
|
|
128 |
|
129 |
+
if (!$useOrderCurrency) {
|
130 |
+
$item['unit_price'] = round($order->getBaseShippingAmount(), 3);
|
131 |
+
$item['total_amount'] = round($order->getBaseShippingAmount(), 3);
|
132 |
+
$item['tax_rate'] = round($order->getBaseShippingTaxAmount() / $order->getBaseShippingAmount() * 100,
|
133 |
+
2);
|
134 |
+
} else {
|
135 |
+
$item['unit_price'] = round($order->getShippingAmount(), 3);
|
136 |
+
$item['total_amount'] = round($order->getShippingAmount(), 3);
|
137 |
+
$item['tax_rate'] = round($order->getShippingTaxAmount() / $order->getShippingAmount() * 100, 2);
|
138 |
+
}
|
139 |
|
140 |
+
if ($action == Allopass_Hipay_Helper_Data::STATE_CAPTURE || $action == Allopass_Hipay_Helper_Data::STATE_REFUND) {
|
141 |
+
$item['product_reference'] = $order->getOrder()->getShippingDescription();
|
142 |
+
$item['name'] = $order->getOrder()->getShippingDescription();
|
143 |
}
|
144 |
|
145 |
+
$item['product_category'] = self::DEFAULT_CATEGORY_CODE;
|
146 |
+
$basket[] = $item;
|
147 |
+
|
148 |
+
|
149 |
return $basket;
|
150 |
}
|
151 |
|
155 |
*@param $product
|
156 |
*@param $quantity
|
157 |
*/
|
158 |
+
private function returnUnitPrice($product, $quantity)
|
159 |
+
{
|
160 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
161 |
|
162 |
if (!$useOrderCurrency) {
|
163 |
return $product->getBasePrice() + $product->getBaseTaxAmount() / $quantity;
|
164 |
+
} else {
|
165 |
return $product->getPrice() + $product->getTaxAmount() / $quantity;
|
166 |
}
|
167 |
}
|
173 |
* @param $product
|
174 |
* @param @action
|
175 |
*/
|
176 |
+
private function addItem($product, $action, $products = null)
|
177 |
{
|
178 |
$item = array();
|
179 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
180 |
+
$resource = Mage::getSingleton('catalog/product')->getResource();
|
181 |
|
182 |
// Select base Field according the action
|
183 |
+
switch ($action) {
|
|
|
184 |
case Allopass_Hipay_Helper_Data::STATE_REFUND:
|
185 |
$base_discount = Allopass_Hipay_Helper_Data::FIELD_BASE_DISCOUNT_REFUNDED;
|
186 |
$base_hidden_tax = Allopass_Hipay_Helper_Data::FIELD_BASE_TAX_HIDDEN_REFUNDED;
|
200 |
$taxPercent = $product->getData('tax_percent');
|
201 |
|
202 |
if (!$useOrderCurrency) {
|
|
|
|
|
203 |
$total_amount = $product->getBaseRowTotal() + $product->getBaseTaxAmount() + $product->getBaseHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($product) - $product->getBaseDiscountAmount();
|
204 |
+
} else {
|
|
|
|
|
205 |
$total_amount = $product->getRowTotal() + $product->getTaxAmount() + $product->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($product) - $product->getDiscountAmount();
|
206 |
}
|
207 |
// Add information in basket only if the product is simple
|
208 |
+
if ($item['quantity'] > 0 && $total_amount > 0) {
|
209 |
+
if ($action == Allopass_Hipay_Helper_Data::STATE_CAPTURE || $action == Allopass_Hipay_Helper_Data::STATE_REFUND) {
|
210 |
// To avoid 0.001 between original authorization and capture
|
211 |
foreach ($products as $key => $original) {
|
212 |
+
if ($product->getSku() == $original->getSku()) {
|
213 |
if ($original->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE && $original->isChildrenCalculated()) {
|
214 |
foreach ($original->getChildren() as $children) {
|
215 |
+
$unitPrice = $this->returnUnitPrice($children, $item);
|
216 |
}
|
217 |
} else {
|
218 |
+
$unitPrice = $this->returnUnitPrice($original, $original->getData('qty_ordered'));
|
219 |
}
|
220 |
}
|
221 |
}
|
222 |
+
} else {
|
223 |
// Don't use unit price in product because we need a better precision
|
224 |
+
$unitPrice = $this->returnUnitPrice($product, $item['quantity']);
|
225 |
}
|
226 |
|
227 |
// if store support EAN ( Please set the attribute on hipay config )
|
229 |
$attribute = Mage::getStoreConfig('hipay/hipay_basket/attribute_ean', Mage::app()->getStore());
|
230 |
|
231 |
if (Mage::getStoreConfig('hipay/hipay_basket/load_product_ean', Mage::app()->getStore())) {
|
|
|
232 |
$ean = $resource->getAttributeRawValue($product->getProductId(), $attribute,
|
233 |
Mage::app()->getStore());
|
234 |
} else {
|
251 |
// According the configuration we use this trick to complete the discount with tax hidden
|
252 |
$item['discount'] = round($total_amount - ($unitPrice * $item['quantity']), 3);
|
253 |
|
254 |
+
// Process an product load if needed
|
255 |
+
$product = Mage::getModel('catalog/product')->load($product->getProductId());
|
256 |
+
|
257 |
+
// Load Mapping Category
|
258 |
+
$categoryIds = $product->getCategoryIds();
|
259 |
+
if (is_array($categoryIds) && !empty($categoryIds)) {
|
260 |
+
if (isset($categoryIds[0]) && $categoryIds[0]) {
|
261 |
+
$mapping = $this->getMappingCategory($categoryIds[0],Mage::app()->getStore());
|
262 |
+
if ($mapping){
|
263 |
+
$item['product_category'] = (int) $mapping['hipay_category'];
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
return $item;
|
269 |
}
|
270 |
|
271 |
|
272 |
}
|
273 |
+
|
274 |
/**
|
275 |
* Return to TPP API basket informations
|
276 |
*
|
279 |
* @return json
|
280 |
*
|
281 |
*/
|
282 |
+
public function getCartInformation(
|
283 |
+
$order,
|
284 |
+
$action = Allopass_Hipay_Helper_Data::STATE_AUTHORIZATION,
|
285 |
+
$payment = null
|
286 |
+
) {
|
287 |
$basket = array();
|
288 |
$products = $order->getAllVisibleItems();
|
289 |
|
291 |
// Add each product in basket
|
292 |
// =============================================================== //
|
293 |
if ($action == Allopass_Hipay_Helper_Data::STATE_AUTHORIZATION) {
|
294 |
+
$basket = $this->processDiscount($order, $action, $basket);
|
295 |
|
296 |
+
$basket = $this->processShipping($order, $action, $basket);
|
|
|
|
|
297 |
|
298 |
foreach ($products as $key => $product) {
|
299 |
if ($product->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
|
318 |
// =============================================================== //
|
319 |
// Add Shipping in basket
|
320 |
// =============================================================== //
|
321 |
+
$basket = $this->processShipping($invoice, $action, $basket);
|
322 |
|
323 |
foreach ($invoice->getAllItems() as $product) {
|
324 |
+
$item = $this->addItem($product, $action, $products);
|
325 |
+
if ($item) {
|
326 |
$basket[] = $item;
|
327 |
}
|
328 |
}
|
336 |
// =============================================================== //
|
337 |
// Add Shipping in basket
|
338 |
// =============================================================== //
|
339 |
+
$basket = $this->processShipping($creditMemo, $action, $basket);
|
340 |
|
341 |
foreach ($creditMemo->getAllItems() as $product) {
|
342 |
+
$item = $this->addItem($product, $action, $products);
|
343 |
if ($item) {
|
344 |
$basket[] = $item;
|
345 |
}
|
475 |
);
|
476 |
|
477 |
// First split is already paid
|
478 |
+
if ($numberSplit == 1) {
|
479 |
$data['status'] = Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_COMPLETE;
|
480 |
}
|
481 |
|
509 |
return false;
|
510 |
}
|
511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
public function checkSignature(
|
513 |
$signature,
|
514 |
$fromNotification = false,
|
559 |
return false;
|
560 |
}
|
561 |
|
562 |
+
public function getHipayMethods()
|
563 |
+
{
|
564 |
+
$methods = array();
|
565 |
+
|
566 |
+
foreach (Mage::getStoreConfig('payment') as $code => $data) {
|
567 |
+
if (strpos($code, 'hipay') !== false) {
|
568 |
+
if (isset($data['model'])) {
|
569 |
+
$methods[$code] = $data['model'];
|
570 |
+
}
|
571 |
+
}
|
572 |
+
}
|
573 |
+
|
574 |
+
return $methods;
|
575 |
+
}
|
576 |
+
|
577 |
public function checkIfCcExpDateIsValid(
|
578 |
$customer
|
579 |
) {
|
843 |
|
844 |
/**
|
845 |
* Send email id payment is in Fraud status
|
846 |
+
* @param Mage_Customer_Model_Customer|Mage_Core_Model_Abstract $receiver
|
847 |
* @param Mage_Sales_Model_Order $order
|
848 |
* @param string $message
|
849 |
* @return Mage_Checkout_Helper_Data
|
1163 |
|
1164 |
return $this;
|
1165 |
}
|
1166 |
+
|
1167 |
+
/**
|
1168 |
+
* Debug internal process ( For cron per exemple )
|
1169 |
+
*
|
1170 |
+
* @param $debugData
|
1171 |
+
*/
|
1172 |
+
public function debugInternalProcessHipay($debugData) {
|
1173 |
+
if ($this->getConfig()->isGeneralDebugEnabled()) {
|
1174 |
+
Mage::getModel('hipay/log_adapter', self::LOG_INTERNAL_HIPAY . '.log')->log($debugData);
|
1175 |
+
}
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
/**
|
1179 |
+
* Get All Magento Categories (Level 2)
|
1180 |
+
*
|
1181 |
+
* If Store ID in context, get Category from root ID
|
1182 |
+
*
|
1183 |
+
* @return array
|
1184 |
+
*/
|
1185 |
+
public function getMagentoCategories()
|
1186 |
+
{
|
1187 |
+
$options = array();
|
1188 |
+
$storeId = Mage::getSingleton('adminhtml/config_data')->getStore();
|
1189 |
+
$categories = Mage::getModel('catalog/category')
|
1190 |
+
->getCollection()
|
1191 |
+
->addAttributeToFilter('level', 2)
|
1192 |
+
->addAttributeToSelect('name')
|
1193 |
+
->addAttributeToSelect('id');
|
1194 |
+
|
1195 |
+
if ($storeId && !empty($storeId)) {
|
1196 |
+
$rootCategoryId = Mage::app()->getStore($storeId)->getRootCategoryId();
|
1197 |
+
$categories = $categories->addAttributeToFilter('path', array('like' => "1/$rootCategoryId/%"));
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
foreach ($categories as $category) {
|
1201 |
+
$options[$category->getId()] = $category->getName();
|
1202 |
+
}
|
1203 |
+
|
1204 |
+
return $options;
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
/**
|
1208 |
+
* Get All Magento Shipping method
|
1209 |
+
*
|
1210 |
+
* According current store
|
1211 |
+
*
|
1212 |
+
* @return array
|
1213 |
+
*/
|
1214 |
+
public function getMagentoShippingMethods()
|
1215 |
+
{
|
1216 |
+
$options = array();
|
1217 |
+
$store = Mage::getSingleton('adminhtml/config_data')->getStore();
|
1218 |
+
|
1219 |
+
// Get all carriers
|
1220 |
+
$carriers = Mage::getSingleton('shipping/config')->getAllCarriers($store);
|
1221 |
+
foreach ($carriers as $carrierCode => $carrierModel) {
|
1222 |
+
try {
|
1223 |
+
if (!$carrierModel->isActive()) {
|
1224 |
+
continue;
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
$carrierMethods = $carrierModel->getAllowedMethods();
|
1228 |
+
if (!$carrierMethods) {
|
1229 |
+
continue;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
$carrierTitle = Mage::getStoreConfig('carriers/' . $carrierCode . '/title');
|
1233 |
+
foreach ($carrierMethods as $methodCode => $methodTitle) {
|
1234 |
+
$options[$carrierCode . '_' . $methodCode] = '[' . $carrierTitle . '] - ' . $methodTitle;
|
1235 |
+
}
|
1236 |
+
} catch (Exception $e) {
|
1237 |
+
// Log error and continue process listing
|
1238 |
+
continue;
|
1239 |
+
}
|
1240 |
+
}
|
1241 |
+
return $options;
|
1242 |
+
}
|
1243 |
+
|
1244 |
+
/**
|
1245 |
+
* Return the mapping if exists for one category
|
1246 |
+
*
|
1247 |
+
* @param $idCategory
|
1248 |
+
* @param $store
|
1249 |
+
* @return string
|
1250 |
+
*/
|
1251 |
+
public function getMappingCategory($idCategory, $store = null)
|
1252 |
+
{
|
1253 |
+
$mappingCategories = unserialize($this->getConfig()->getConfigDataBasket('mapping_category',$store));
|
1254 |
+
if (is_array($mappingCategories) && !empty($mappingCategories)) {
|
1255 |
+
foreach ($mappingCategories as $key => $mapping) {
|
1256 |
+
if ($mapping['magento_category'] == $idCategory) {
|
1257 |
+
return $mapping['hipay_category'];
|
1258 |
+
}
|
1259 |
+
}
|
1260 |
+
$category = Mage::getModel('catalog/category')->load($idCategory);
|
1261 |
+
foreach ($mappingCategories as $key => $mapping ) {
|
1262 |
+
if (in_array($mapping['hipay_category'],$category->getParentIds())) {
|
1263 |
+
return $mapping;
|
1264 |
+
}
|
1265 |
+
}
|
1266 |
+
}
|
1267 |
+
return null;
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
/**
|
1271 |
+
* Return the mapping if exist for one category
|
1272 |
+
*
|
1273 |
+
* @param $delivery_method Code
|
1274 |
+
* @param $store
|
1275 |
+
* @return string
|
1276 |
+
*/
|
1277 |
+
public function getMappingShipping($codeShippingMethod, $store = null)
|
1278 |
+
{
|
1279 |
+
$mappingDeliveryMethod = unserialize($this->getConfig()->getConfigDataBasket('mapping_shipping_method',$store));
|
1280 |
+
if (is_array($mappingDeliveryMethod) && !empty($mappingDeliveryMethod)) {
|
1281 |
+
foreach ($mappingDeliveryMethod as $key => $mapping) {
|
1282 |
+
if ($mapping['magento_shipping_method'] == $codeShippingMethod) {
|
1283 |
+
return $mapping;
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
}
|
1287 |
+
return null;
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
/**
|
1291 |
+
* According the mapping, provide a approximated date delivery
|
1292 |
+
*
|
1293 |
+
* @return date format YYYY-MM-DD
|
1294 |
+
*/
|
1295 |
+
function calculateEstimatedDate($mapping){
|
1296 |
+
if (is_array($mapping)){
|
1297 |
+
$today = new \Datetime();
|
1298 |
+
$daysDelay = $mapping['delay_preparation'] + $mapping['delay_delivery'];
|
1299 |
+
$interval = new \DateInterval ("P{$daysDelay}D");
|
1300 |
+
return $today->add($interval)->format("Y-m-d");
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
return '';
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
/**
|
1307 |
+
* Provide a delivery Method compatible with gateway
|
1308 |
+
*
|
1309 |
+
* @param $mapping array Result of mapping
|
1310 |
+
* @return null|string JSON
|
1311 |
+
*/
|
1312 |
+
function calculateDeliveryMethod($mapping){
|
1313 |
+
if (is_array($mapping)) {
|
1314 |
+
$itemsDelivery = Mage::helper('hipay/collection')->getFullItemsDelivery();
|
1315 |
+
if ($itemsDelivery && is_array($itemsDelivery) && !empty($mapping['hipay_delivery_method'])) {
|
1316 |
+
return json_encode(array('mode' => $itemsDelivery[$mapping['hipay_delivery_method']]['mode'],
|
1317 |
+
'shipping' => $itemsDelivery[$mapping['hipay_delivery_method']]['shipping']));
|
1318 |
+
}
|
1319 |
+
}
|
1320 |
+
return '';
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
/**
|
1324 |
+
*
|
1325 |
+
* @param $codeShippingMethod
|
1326 |
+
* @param $store
|
1327 |
+
*/
|
1328 |
+
public function processDeliveryInformation($codeShippingMethod, $store, $method, &$params)
|
1329 |
+
{
|
1330 |
+
$mapping = $this->getMappingShipping($codeShippingMethod,$store);
|
1331 |
+
$params['delivery_method'] = $this->calculateDeliveryMethod($mapping);
|
1332 |
+
|
1333 |
+
if (empty($params['delivery_method'])) {
|
1334 |
+
Mage::helper('hipay')->debugInternalProcessHipay('### Method processDeliveryInformation');
|
1335 |
+
Mage::helper('hipay')->debugInternalProcessHipay('### WARNING : Mapping for ' . $codeShippingMethod . ' is missing.');
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
$params['delivery_date'] = $this->calculateEstimatedDate($mapping);
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
/**
|
1342 |
+
* Check if send cart items is required or of option is activated
|
1343 |
+
*
|
1344 |
+
* @param $product_code
|
1345 |
+
* @return boolean
|
1346 |
+
*/
|
1347 |
+
public function isSendCartItemsRequired($product_code)
|
1348 |
+
{
|
1349 |
+
if ($this->isCartItemsRequired($product_code) ||
|
1350 |
+
(Mage::getStoreConfigFlag('hipay/hipay_basket/activate_basket', Mage::app()->getStore()))){
|
1351 |
+
return true;
|
1352 |
+
}
|
1353 |
+
return false;
|
1354 |
+
}
|
1355 |
+
|
1356 |
+
/**
|
1357 |
+
* Delivery information and Cart Items are mandatory for some payment product
|
1358 |
+
*
|
1359 |
+
* @param string $product_code
|
1360 |
+
* @return boolean
|
1361 |
+
*/
|
1362 |
+
public function isDeliveryMethodAndCartItemsRequired($product_code)
|
1363 |
+
{
|
1364 |
+
return in_array($product_code, ['3xcb', '3xcb-no-fees', '4xcb-no-fees', '4xcb']);
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
/**
|
1368 |
+
* Cart Items are mandatory for some payment product
|
1369 |
+
*
|
1370 |
+
* @param string $product_code
|
1371 |
+
* @return boolean
|
1372 |
+
*/
|
1373 |
+
public function isCartItemsRequired($product_code)
|
1374 |
+
{
|
1375 |
+
return in_array($product_code, ['klarnainvoice','3xcb', '3xcb-no-fees', '4xcb-no-fees', '4xcb']);
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
/**
|
1379 |
+
* Check if all mapping Shipping are done
|
1380 |
+
*
|
1381 |
+
* @return int
|
1382 |
+
*/
|
1383 |
+
public function checkMappingShippingMethod ()
|
1384 |
+
{
|
1385 |
+
$mappings = unserialize($this->getConfig()->getConfigDataBasket('mapping_shipping_method',$store));
|
1386 |
+
$magentoShippingMethod = $this->getMagentoShippingMethods();
|
1387 |
+
$nbMappingMissing = count($magentoShippingMethod);
|
1388 |
+
if (is_array($magentoShippingMethod) && is_array($mappings) ){
|
1389 |
+
$nbMapping = 0;
|
1390 |
+
foreach ($mappings as $mapping ) {
|
1391 |
+
if (!empty($mapping['hipay_delivery_method'])){
|
1392 |
+
$nbMapping++;
|
1393 |
+
}
|
1394 |
+
}
|
1395 |
+
$nbMappingMissing = count($magentoShippingMethod) - $nbMapping;
|
1396 |
+
}
|
1397 |
+
return $nbMappingMissing;
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
/**
|
1401 |
+
* Check if all mapping Category are done
|
1402 |
+
*
|
1403 |
+
* @return int
|
1404 |
+
*/
|
1405 |
+
public function checkMappingCategoryMethod ()
|
1406 |
+
{
|
1407 |
+
$mappings = unserialize($this->getConfig()->getConfigDataBasket('mapping_category',$store));
|
1408 |
+
$magentoCategory = $this->getMagentoCategories();
|
1409 |
+
$nbMappingMissing = count($magentoCategory);
|
1410 |
+
|
1411 |
+
if (is_array($magentoCategory) && is_array($mappings)){
|
1412 |
+
$nbMapping = 0;
|
1413 |
+
foreach ($mappings as $mapping ) {
|
1414 |
+
if (!empty($mapping['hipay_category'])){
|
1415 |
+
$nbMapping++;
|
1416 |
+
}
|
1417 |
+
}
|
1418 |
+
$nbMappingMissing = count($magentoCategory) - $nbMapping;
|
1419 |
+
}
|
1420 |
+
return $nbMappingMissing;
|
1421 |
+
}
|
1422 |
}
|
app/code/community/Allopass/Hipay/Model/Config.php
CHANGED
@@ -1,274 +1,298 @@
|
|
1 |
<?php
|
|
|
2 |
class Allopass_Hipay_Model_Config extends Varien_Object
|
3 |
{
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
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 |
* Use as Helper
|
35 |
*
|
36 |
-
*
|
37 |
-
*
|
38 |
-
*
|
39 |
*/
|
40 |
public function getConfigData($key, $storeId = null)
|
41 |
{
|
42 |
-
return $this->getInternalConfig('hipay_api'
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
*
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
$index = 'hipay' . $key_api
|
56 |
if (!$this->hasData($index)) {
|
57 |
$value = Mage::getStoreConfig('hipay/' . $key_api . '/' . $key, $storeId);
|
58 |
$this->setData($index, $value);
|
59 |
}
|
60 |
return $this->getData($index);
|
61 |
-
|
62 |
|
63 |
/**
|
64 |
* Return config NORMAL ( HIPAY_API )
|
65 |
*
|
66 |
-
*
|
67 |
-
*
|
68 |
-
*
|
69 |
*/
|
70 |
public function getConfig($key, $storeId = null)
|
71 |
{
|
72 |
-
return $this->getInternalConfig('hipay_api'
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
-
* Return config MOTO (
|
77 |
*
|
78 |
-
*
|
79 |
-
*
|
80 |
-
*
|
81 |
*/
|
82 |
public function getConfigDataMoto($key, $storeId = null)
|
83 |
{
|
84 |
-
return $this->getInternalConfig('hipay_api_moto'
|
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 |
-
|
117 |
-
|
118 |
-
|
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 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
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 |
* Retrieve list of months translation
|
273 |
*
|
274 |
* @return array
|
@@ -277,53 +301,52 @@ class Allopass_Hipay_Model_Config extends Varien_Object
|
|
277 |
{
|
278 |
$data = Mage::app()->getLocale()->getTranslationList('month');
|
279 |
foreach ($data as $key => $value) {
|
280 |
-
$monthNum = ($key < 10) ? '0'
|
281 |
$data[$key] = $monthNum . ' - ' . $value;
|
282 |
}
|
283 |
return $data;
|
284 |
}
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
}
|
1 |
<?php
|
2 |
+
|
3 |
class Allopass_Hipay_Model_Config extends Varien_Object
|
4 |
{
|
5 |
+
const API_USERNAME = 'api_username';
|
6 |
+
|
7 |
+
const API_PASSWORD = 'api_password';
|
8 |
+
|
9 |
+
const API_TOKENJS_USERNAME = 'api_tokenjs_username';
|
10 |
+
|
11 |
+
const API_TOKENJS_PUBLICKEY = 'api_tokenjs_publickey';
|
12 |
+
|
13 |
+
const API_USERNAME_TEST = "api_username_test";
|
14 |
+
|
15 |
+
const API_PASSWORD_TEST = 'api_password_test';
|
16 |
+
|
17 |
+
const API_TOKENJS_USERNAME_TEST = 'api_tokenjs_username_test';
|
18 |
+
|
19 |
+
const API_TOKENJS_PUBLICKEY_TEST = 'api_tokenjs_publickey_test';
|
20 |
+
|
21 |
+
const SECRET_PASSPHRASE = 'secret_passphrase';
|
22 |
+
|
23 |
+
const SECRET_PASSPHRASE_TEST = 'secret_passphrase_test';
|
24 |
+
|
25 |
+
const VAULT_ENDPOINT_TEST = 'vault_endpoint_stage';
|
26 |
+
|
27 |
+
const VAULT_ENDPOINT = 'vault_endpoint_production';
|
28 |
+
|
29 |
+
const GATEWAY_ENDPOINT_TEST = 'gateway_endpoint_stage';
|
30 |
+
|
31 |
+
const GATEWAY_ENDPOINT = 'gateway_endpoint_production';
|
32 |
+
|
33 |
+
const DEBUG_MODE = 'debug';
|
34 |
|
35 |
|
36 |
/**
|
37 |
* Use as Helper
|
38 |
*
|
39 |
+
* @param string $key Var path key
|
40 |
+
* @param int $storeId Store View Id
|
41 |
+
* @return mixed
|
42 |
*/
|
43 |
public function getConfigData($key, $storeId = null)
|
44 |
{
|
45 |
+
return $this->getInternalConfig('hipay_api', $key, $storeId = null);
|
46 |
}
|
47 |
|
48 |
+
/**
|
49 |
+
* Internal to get config and cache it
|
50 |
+
*
|
51 |
+
* @param string $key context key
|
52 |
+
* @param string $key Var path key
|
53 |
+
* @param int $storeId Store View Id
|
54 |
+
* @return mixed
|
55 |
+
*/
|
56 |
+
private function getInternalConfig($key_api, $key, $storeId = null)
|
57 |
+
{
|
58 |
+
$index = 'hipay' . $key_api . $key . $storeId;
|
59 |
if (!$this->hasData($index)) {
|
60 |
$value = Mage::getStoreConfig('hipay/' . $key_api . '/' . $key, $storeId);
|
61 |
$this->setData($index, $value);
|
62 |
}
|
63 |
return $this->getData($index);
|
64 |
+
}
|
65 |
|
66 |
/**
|
67 |
* Return config NORMAL ( HIPAY_API )
|
68 |
*
|
69 |
+
* @param string $key Var path key
|
70 |
+
* @param int $storeId Store View Id
|
71 |
+
* @return mixed
|
72 |
*/
|
73 |
public function getConfig($key, $storeId = null)
|
74 |
{
|
75 |
+
return $this->getInternalConfig('hipay_api', $key, $storeId = null);
|
76 |
}
|
77 |
|
78 |
/**
|
79 |
+
* Return config MOTO ( HIPAY_MOTO)
|
80 |
*
|
81 |
+
* @param string $key Var path key
|
82 |
+
* @param int $storeId Store View Id
|
83 |
+
* @return mixed
|
84 |
*/
|
85 |
public function getConfigDataMoto($key, $storeId = null)
|
86 |
{
|
87 |
+
return $this->getInternalConfig('hipay_api_moto', $key, $storeId = null);
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Return config BASKET
|
92 |
+
*
|
93 |
+
* @param string $key Path key
|
94 |
+
* @param int $storeId Store View Id
|
95 |
+
* @return mixed
|
96 |
+
*/
|
97 |
+
public function getConfigDataBasket($key, $storeId = null)
|
98 |
+
{
|
99 |
+
return $this->getInternalConfig('hipay_basket', $key, $storeId = null);
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Return config var
|
104 |
+
*
|
105 |
+
* @param string $key Var path key
|
106 |
+
* @param int $storeId Store View Id
|
107 |
+
* @return mixed
|
108 |
+
*/
|
109 |
+
public function getConfigFlag($key, $storeId = null)
|
110 |
+
{
|
111 |
+
if (!$this->hasData($key)) {
|
112 |
+
$value = Mage::getStoreConfigFlag('hipay/hipay_api/' . $key, $storeId);
|
113 |
+
$this->setData($key, $value);
|
114 |
+
}
|
115 |
+
return $this->getData($key);
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getSecretPassphrase($storeId = null)
|
119 |
+
{
|
120 |
+
return $this->getConfigData(self::SECRET_PASSPHRASE, $storeId);
|
121 |
+
}
|
122 |
+
|
123 |
+
public function getSecretPassphraseTest($storeId = null)
|
124 |
+
{
|
125 |
+
return $this->getConfigData(self::SECRET_PASSPHRASE_TEST, $storeId);
|
126 |
+
}
|
127 |
+
|
128 |
+
public function getApiUsername($storeId = null)
|
129 |
+
{
|
130 |
+
return $this->getConfigData(self::API_USERNAME, $storeId);
|
131 |
+
}
|
132 |
+
|
133 |
+
public function getApiPassword($storeId = null)
|
134 |
+
{
|
135 |
+
return $this->getConfigData(self::API_PASSWORD, $storeId);
|
136 |
+
}
|
137 |
+
|
138 |
+
public function getApiTokenJSUsername($storeId = null)
|
139 |
+
{
|
140 |
+
return $this->getConfigData(self::API_TOKENJS_USERNAME, $storeId);
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getApiTokenJSPublickey($storeId = null)
|
144 |
+
{
|
145 |
+
return $this->getConfigData(self::API_TOKENJS_PUBLICKEY, $storeId);
|
146 |
+
}
|
147 |
+
|
148 |
+
public function getApiUsernameTest($storeId = null)
|
149 |
+
{
|
150 |
+
return $this->getConfigData(self::API_USERNAME_TEST, $storeId);
|
151 |
+
}
|
152 |
+
|
153 |
+
public function getApiPasswordTest($storeId = null)
|
154 |
+
{
|
155 |
+
return $this->getConfigData(self::API_PASSWORD_TEST, $storeId);
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getApiTokenJSUsernameTest($storeId = null)
|
159 |
+
{
|
160 |
+
return $this->getConfigData(self::API_TOKENJS_USERNAME_TEST, $storeId);
|
161 |
+
}
|
162 |
+
|
163 |
+
public function getApiTokenJSPublickeyTest($storeId = null)
|
164 |
+
{
|
165 |
+
return $this->getConfigData(self::API_TOKENJS_PUBLICKEY_TEST, $storeId);
|
166 |
+
}
|
167 |
+
|
168 |
+
public function getVaultEndpoint($storeId = null)
|
169 |
+
{
|
170 |
+
return $this->getConfigData(self::VAULT_ENDPOINT, $storeId);
|
171 |
+
}
|
172 |
+
|
173 |
+
public function getVaultEndpointTest($storeId = null)
|
174 |
+
{
|
175 |
+
return $this->getConfigData(self::VAULT_ENDPOINT_TEST, $storeId);
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getGatewayEndpoint($storeId = null)
|
179 |
+
{
|
180 |
+
return $this->getConfigData(self::GATEWAY_ENDPOINT, $storeId);
|
181 |
+
}
|
182 |
+
|
183 |
+
public function getGatewayEndpointTest($storeId = null)
|
184 |
+
{
|
185 |
+
return $this->getConfigData(self::GATEWAY_ENDPOINT_TEST, $storeId);
|
186 |
+
}
|
187 |
+
|
188 |
+
public function getApiUsernameMoto($storeId = null)
|
189 |
+
{
|
190 |
+
return $this->getConfigDataMoto(self::API_USERNAME, $storeId);
|
191 |
+
}
|
192 |
+
|
193 |
+
public function getApiPasswordMoto($storeId = null)
|
194 |
+
{
|
195 |
+
return $this->getConfigDataMoto(self::API_PASSWORD, $storeId);
|
196 |
+
}
|
197 |
+
|
198 |
+
public function getApiUsernameTestMoto($storeId = null)
|
199 |
+
{
|
200 |
+
return $this->getConfigDataMoto(self::API_USERNAME_TEST, $storeId);
|
201 |
+
}
|
202 |
+
|
203 |
+
public function getApiPasswordTestMoto($storeId = null)
|
204 |
+
{
|
205 |
+
return $this->getConfigDataMoto(self::API_PASSWORD_TEST, $storeId);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* General log level
|
210 |
+
*
|
211 |
+
* @param int $storeId
|
212 |
+
*
|
213 |
+
* @return mixed
|
214 |
+
*/
|
215 |
+
public function isGeneralDebugEnabled($storeId = null)
|
216 |
+
{
|
217 |
+
return $this->getConfigData(self::DEBUG_MODE, $storeId);
|
218 |
+
}
|
219 |
+
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Retrieve array of credit card types
|
223 |
+
*
|
224 |
+
* @return array
|
225 |
+
*/
|
226 |
+
public function getCcTypes()
|
227 |
+
{
|
228 |
+
$_types = Mage::getConfig()->getNode('global/payment_hipay/cc/types')->asArray();
|
229 |
+
|
230 |
+
uasort($_types, array('Allopass_Hipay_Model_Config', 'compareCcTypes'));
|
231 |
+
|
232 |
+
$types = array();
|
233 |
+
foreach ($_types as $data) {
|
234 |
+
if (isset($data['code']) && isset($data['name'])) {
|
235 |
+
$types[$data['code']] = $data['name'];
|
236 |
+
}
|
237 |
+
}
|
238 |
+
return $types;
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Retrieve array of credit card types to get code hipay equals to code Magento
|
243 |
+
*
|
244 |
+
* @return array
|
245 |
+
*/
|
246 |
+
public function getCcTypesHipay()
|
247 |
+
{
|
248 |
+
$_types = Mage::getConfig()->getNode('global/payment_hipay/hosted/types')->asArray();
|
249 |
+
|
250 |
+
$types = array();
|
251 |
+
foreach ($_types as $data) {
|
252 |
+
if (isset($data['code']) && isset($data['code_hipay'])) {
|
253 |
+
$types[$data['code']] = $data['code_hipay'];
|
254 |
+
}
|
255 |
+
}
|
256 |
+
return $types;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Retrieve array of template types to display in hosted page
|
261 |
+
*
|
262 |
+
* @return array
|
263 |
+
*/
|
264 |
+
public function getTemplateHosted()
|
265 |
+
{
|
266 |
+
$_templates = Mage::getConfig()->getNode('global/template_hipay/hosted')->asArray();
|
267 |
+
|
268 |
+
$templates = array();
|
269 |
+
foreach ($_templates as $data) {
|
270 |
+
if (isset($data['value']) && isset($data['label'])) {
|
271 |
+
$templates[$data['value']] = $data['label'];
|
272 |
+
}
|
273 |
+
}
|
274 |
+
return $templates;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Retrieve array of credit card types to get code hipay
|
279 |
+
*
|
280 |
+
* @return array
|
281 |
+
*/
|
282 |
+
public function getCcTypesCodeHipay()
|
283 |
+
{
|
284 |
+
$_types = Mage::getConfig()->getNode('global/payment_hipay/hosted/types')->asArray();
|
285 |
+
|
286 |
+
$types = array();
|
287 |
+
foreach ($_types as $data) {
|
288 |
+
if (isset($data['code_hipay']) && isset($data['name'])) {
|
289 |
+
$types[$data['code_hipay']] = $data['name'];
|
290 |
+
}
|
291 |
+
}
|
292 |
+
return $types;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
* Retrieve list of months translation
|
297 |
*
|
298 |
* @return array
|
301 |
{
|
302 |
$data = Mage::app()->getLocale()->getTranslationList('month');
|
303 |
foreach ($data as $key => $value) {
|
304 |
+
$monthNum = ($key < 10) ? '0' . $key : $key;
|
305 |
$data[$key] = $monthNum . ' - ' . $value;
|
306 |
}
|
307 |
return $data;
|
308 |
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Retrieve array of available years
|
312 |
+
*
|
313 |
+
* @return array
|
314 |
+
*/
|
315 |
+
public function getYears()
|
316 |
+
{
|
317 |
+
$years = array();
|
318 |
+
$first = date("Y");
|
319 |
+
|
320 |
+
for ($index = 0; $index <= 10; $index++) {
|
321 |
+
$year = $first + $index;
|
322 |
+
$years[$year] = $year;
|
323 |
+
}
|
324 |
+
return $years;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Statis Method for compare sort order of CC Types
|
329 |
+
*
|
330 |
+
* @param array $a
|
331 |
+
* @param array $b
|
332 |
+
* @return int
|
333 |
+
*/
|
334 |
+
public static function compareCcTypes($a, $b)
|
335 |
+
{
|
336 |
+
if (!isset($a['order'])) {
|
337 |
+
$a['order'] = 0;
|
338 |
+
}
|
339 |
+
|
340 |
+
if (!isset($b['order'])) {
|
341 |
+
$b['order'] = 0;
|
342 |
+
}
|
343 |
+
|
344 |
+
if ($a['order'] == $b['order']) {
|
345 |
+
return 0;
|
346 |
+
} elseif ($a['order'] > $b['order']) {
|
347 |
+
return 1;
|
348 |
+
} else {
|
349 |
+
return -1;
|
350 |
+
}
|
351 |
+
}
|
352 |
+
}
|
|
app/code/community/Allopass/Hipay/Model/Field/CategoryMapping.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Field_Field_CategoryMapping extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array
|
3 |
+
{
|
4 |
+
protected $_eventPrefix = 'hipay_field_category_mapping';
|
5 |
+
}
|
app/code/community/Allopass/Hipay/Model/Field/MappingShippingMethod.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Model_Field_MappingShippingMethod extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
* @return Mage_Core_Model_Abstract|void
|
8 |
+
*/
|
9 |
+
protected function _beforeSave()
|
10 |
+
{
|
11 |
+
$values = $this->getValue();
|
12 |
+
|
13 |
+
foreach ($values as $key => $value) {
|
14 |
+
if (empty($value)) {
|
15 |
+
continue;
|
16 |
+
}
|
17 |
+
|
18 |
+
if (!empty($value['delay_preparation']) && !is_numeric($value['delay_preparation'])) {
|
19 |
+
Mage::throwException(Mage::helper('hipay')->__('Delay delivery is not a correct value for %s', $key));
|
20 |
+
} else if (!empty($value['delay_delivery']) && !is_numeric($value['delay_preparation'])) {
|
21 |
+
Mage::throwException(Mage::helper('hipay')->__('Delay delivery is not a correct value for %s', $key));
|
22 |
+
}
|
23 |
+
}
|
24 |
+
$this->setValue($values);
|
25 |
+
return parent::_beforeSave();
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Abstract.php
CHANGED
@@ -95,6 +95,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
95 |
public function assignInfoData($info, $data)
|
96 |
{
|
97 |
$oneclickMode = $data->getData($this->getCode() . '_oneclick');
|
|
|
98 |
$oneclickCard = $data->getData($this->getCode() . '_oneclick_card');
|
99 |
$splitPaymentId = $data->getData($this->getCode() . '_split_payment_id');
|
100 |
$token = $data->getData($this->getCode() . '_cc_token');
|
@@ -110,7 +111,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
110 |
/**
|
111 |
* A request instructing the payment gateway to cancel a previously authorized transaction.
|
112 |
* Only authorized transactions can be cancelled, captured transactions must be refunded.
|
113 |
-
*
|
|
|
114 |
*/
|
115 |
public function cancelTransaction(Mage_Payment_Model_Info $payment)
|
116 |
{
|
@@ -156,7 +158,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
156 |
public function acceptPayment(Mage_Payment_Model_Info $payment)
|
157 |
{
|
158 |
parent::acceptPayment($payment);
|
159 |
-
$transactionId = $payment->getLastTransId();
|
160 |
$amount = $payment->getAmountAuthorized();
|
161 |
|
162 |
$transactionId = $payment->getLastTransId();
|
@@ -188,7 +189,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
188 |
|
189 |
/*@var $payment Mage_Sales_Model_Order_Payment */
|
190 |
parent::denyPayment($payment);
|
191 |
-
$transactionId = $payment->getLastTransId();
|
192 |
$amount = $payment->getAmountAuthorized();
|
193 |
|
194 |
$transactionId = $payment->getLastTransId();
|
@@ -218,11 +218,16 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
218 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
219 |
* @param Mage_Sales_Model_Order_Payment $payment
|
220 |
* @param float $amount
|
|
|
221 |
*/
|
222 |
public function processResponse($gatewayResponse, $payment, $amount)
|
223 |
{
|
|
|
224 |
$order = $payment->getOrder();
|
|
|
|
|
225 |
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
|
|
226 |
|
227 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
228 |
|
@@ -234,7 +239,14 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
234 |
$total = $order->getBaseGrandTotal();
|
235 |
}
|
236 |
|
237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
switch ($this->getConfigPaymentAction()) {
|
240 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
@@ -288,9 +300,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
288 |
$order->cancel();
|
289 |
}
|
290 |
|
291 |
-
$order->
|
292 |
$payment, self::OPERATION_AUTHORIZATION, null, $amount, true, $gatewayResponse->getMessage()
|
293 |
-
));
|
294 |
|
295 |
$order->save();
|
296 |
|
@@ -475,6 +487,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
475 |
|
476 |
|
477 |
break;
|
|
|
478 |
case 117: //Capture Requested
|
479 |
|
480 |
if ($order->getStatus() == 'capture' || $order->getStatus() == 'processing') {// for logic process
|
@@ -494,6 +507,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
494 |
|
495 |
$message = Mage::helper("hipay")->__('Capture Requested by Hipay.');
|
496 |
|
|
|
497 |
$order->setState(
|
498 |
Mage_Sales_Model_Order::STATE_PROCESSING, 'capture_requested', $message, null, false
|
499 |
);
|
@@ -507,6 +521,11 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
507 |
}
|
508 |
|
509 |
case 118: //Capture. There are 2 ways to enter in this case: 1. direct capture notification. 2. After 117 case, when it is configured for valid order with 117 status.
|
|
|
|
|
|
|
|
|
|
|
510 |
|
511 |
if ($order->getStatus() == $this->getConfigData('order_status_payment_accepted')) {
|
512 |
break;
|
@@ -523,7 +542,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
523 |
}
|
524 |
|
525 |
//Check if it is split payment and insert it
|
526 |
-
$profile = 0;
|
527 |
if (($profile = (int)$payment->getAdditionalInformation('split_payment_id')) && $customer->getId()) {
|
528 |
$token = isset($gatewayResponse->paymentMethod['token']) ? $gatewayResponse->paymentMethod['token'] : $gatewayResponse->getData('cardtoken');
|
529 |
$this->getHelper()->insertSplitPayment($order, $profile, $customer->getId(), $token);
|
@@ -535,26 +553,34 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
535 |
|
536 |
// Create invoice
|
537 |
if ($this->getConfigData('invoice_create', $order->getStoreId()) && !$order->hasInvoices()) {
|
538 |
-
|
539 |
-
if ($amount != $total && !$profile && $order->getState() != Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
|
540 |
$transactionId = $gatewayResponse->getTransactionReference();
|
541 |
-
$order->addStatusHistoryComment(Mage::helper('hipay')->__('Notification "Capture". Capture issued by merchant. Registered notification about captured amount of %s. Transaction ID: "%s".
|
542 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
break;
|
544 |
}
|
545 |
-
|
546 |
$invoice = $this->create_invoice($order, $gatewayResponse->getTransactionReference(),
|
547 |
false);
|
548 |
|
549 |
Mage::getModel('core/resource_transaction')
|
550 |
->addObject($invoice)->addObject($invoice->getOrder())
|
551 |
->save();
|
|
|
552 |
} elseif ($order->hasInvoices()) {
|
553 |
foreach ($order->getInvoiceCollection() as $invoice) {
|
554 |
if ($invoice->getState() == Mage_Sales_Model_Order_Invoice::STATE_OPEN && (round(($invoice->getBaseGrandTotal() + $order->getBaseTotalPaid()),
|
555 |
-
|
|
|
556 |
) {
|
557 |
$invoice->pay();
|
|
|
558 |
Mage::getModel('core/resource_transaction')
|
559 |
->addObject($invoice)->addObject($invoice->getOrder())
|
560 |
->save();
|
@@ -565,30 +591,10 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
565 |
if (($profile = (int)$payment->getAdditionalInformation('split_payment_id')) && $customer->getId()) {
|
566 |
$token = isset($gatewayResponse->paymentMethod['token']) ? $gatewayResponse->paymentMethod['token'] : $gatewayResponse->getData('cardtoken');
|
567 |
$this->getHelper()->insertSplitPayment($order, $profile, $customer->getId(), $token);
|
|
|
568 |
}
|
569 |
|
570 |
-
|
571 |
-
if (!$status = $this->getConfigData('order_status_payment_accepted')) {
|
572 |
-
$status = $order->getStatus();
|
573 |
-
}
|
574 |
-
|
575 |
-
$message = Mage::helper("hipay")->__('Payment accepted by Hipay.');
|
576 |
-
|
577 |
-
if ($status == Mage_Sales_Model_Order::STATE_PROCESSING) {
|
578 |
-
$order->setState(
|
579 |
-
Mage_Sales_Model_Order::STATE_PROCESSING, $status, $message
|
580 |
-
);
|
581 |
-
} else {
|
582 |
-
if ($status == Mage_Sales_Model_Order::STATE_COMPLETE) {
|
583 |
-
$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
|
584 |
-
$order->addStatusToHistory($status, $message, true);
|
585 |
-
/*$order->setState(
|
586 |
-
Mage_Sales_Model_Order::STATE_COMPLETE, $status, $message, null, false
|
587 |
-
);*/
|
588 |
-
} else {
|
589 |
-
$order->addStatusToHistory($status, $message, true);
|
590 |
-
}
|
591 |
-
}
|
592 |
|
593 |
$payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
|
594 |
$payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
|
@@ -612,6 +618,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
612 |
|
613 |
$message = Mage::helper("hipay")->__('Refund Requested by Hipay.');
|
614 |
|
|
|
615 |
$order->setState(
|
616 |
Mage_Sales_Model_Order::STATE_PROCESSING, 'refund_requested', $message, null, false
|
617 |
);
|
@@ -647,7 +654,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
647 |
|
648 |
$message = Mage::helper("hipay")->__('Refund accepted by Hipay.');
|
649 |
|
650 |
-
$order->
|
651 |
|
652 |
Mage::getModel('core/resource_transaction')
|
653 |
->addObject($creditmemo)->addObject($creditmemo->getOrder())
|
@@ -693,11 +700,10 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
693 |
default:
|
694 |
$message = Mage::helper("hipay")->__('Message Hipay: %s. Status: %s',
|
695 |
$gatewayResponse->getMessage(), $gatewayResponse->getStatus());
|
696 |
-
$order->
|
697 |
break;
|
698 |
}
|
699 |
|
700 |
-
|
701 |
if ($gatewayResponse->getState() == self::STATE_COMPLETED) {
|
702 |
if (in_array($gatewayResponse->getPaymentProduct(),
|
703 |
array('visa', 'american-express', 'mastercard', 'cb'))
|
@@ -769,34 +775,66 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
769 |
$this->_setFraudDetected($gatewayResponse, $customer, $payment, $amount, true);
|
770 |
}
|
771 |
|
772 |
-
|
773 |
if ($status == Mage_Sales_Model_Order::STATE_HOLDED && $order->canHold()) {
|
774 |
$order->hold();
|
775 |
} elseif ($status == Mage_Sales_Model_Order::STATE_CANCELED && $order->canCancel()) {
|
776 |
$order->cancel();
|
777 |
}
|
778 |
|
779 |
-
|
780 |
-
$order->addStatusToHistory($status, Mage::helper('hipay')->getTransactionMessage(
|
781 |
$payment, $this->getOperation(), null, $amount, true, $gatewayResponse->getMessage()
|
782 |
-
));
|
783 |
|
784 |
$order->save();
|
785 |
-
|
786 |
break;
|
787 |
|
788 |
case self::STATE_ERROR:
|
789 |
default:
|
|
|
|
|
790 |
Mage::throwException($defaultExceptionMessage);
|
791 |
break;
|
792 |
|
793 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
}
|
795 |
|
796 |
/**
|
797 |
*
|
798 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
|
|
799 |
* @param Mage_Sales_Model_Order_Payment $payment
|
|
|
|
|
800 |
*/
|
801 |
protected function _setFraudDetected($gatewayResponse, $customer, $payment, $amount, $addToHistory = false)
|
802 |
{
|
@@ -807,6 +845,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
807 |
|
808 |
if (defined('Mage_Sales_Model_Order::STATUS_FRAUD')) {
|
809 |
$status = Mage_Sales_Model_Order::STATUS_FRAUD;
|
|
|
|
|
810 |
}
|
811 |
|
812 |
$payment->setAdditionalInformation('fraud_type', $fraudScreening['result']);
|
@@ -814,9 +854,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
814 |
$payment->setAdditionalInformation('fraud_review', $fraudScreening['review']);
|
815 |
|
816 |
if ($addToHistory) {
|
817 |
-
$order->
|
818 |
$payment, $this->getOperation(), null, $amount, true, $gatewayResponse->getMessage()
|
819 |
-
));
|
820 |
}
|
821 |
|
822 |
$message = Mage::helper('hipay')->__($gatewayResponse->getMessage());
|
@@ -878,22 +918,19 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
878 |
*
|
879 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
880 |
* @param Mage_Sales_Model_Order_Payment $payment
|
881 |
-
* @
|
|
|
882 |
*/
|
883 |
-
public function processResponseToRedirect($gatewayResponse, $payment
|
884 |
{
|
885 |
$order = $payment->getOrder();
|
886 |
-
$
|
887 |
|
888 |
switch ($this->getConfigPaymentAction()) {
|
889 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
890 |
-
$requestType = self::OPERATION_AUTHORIZATION;
|
891 |
-
$newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
|
892 |
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment authorization error.');
|
893 |
break;
|
894 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE:
|
895 |
-
$requestType = self::OPERATION_SALE;
|
896 |
-
$newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE;
|
897 |
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
|
898 |
break;
|
899 |
}
|
@@ -903,7 +940,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
903 |
$urlAdmin = Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId()));
|
904 |
}
|
905 |
|
906 |
-
|
907 |
if ($gatewayResponse->getState()) {
|
908 |
switch ($gatewayResponse->getState()) {
|
909 |
case self::STATE_COMPLETED:
|
@@ -941,11 +977,12 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
941 |
|
942 |
}
|
943 |
}
|
|
|
944 |
}
|
945 |
|
946 |
/**
|
947 |
*
|
948 |
-
* @return Allopass_Hipay_Helper_Data
|
949 |
*/
|
950 |
protected function getHelper()
|
951 |
{
|
@@ -957,6 +994,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
957 |
*
|
958 |
* @param Mage_Customer_Model_Customer $customer
|
959 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $response
|
|
|
960 |
*/
|
961 |
protected function responseToCustomer($customer, $response)
|
962 |
{
|
@@ -967,9 +1005,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
967 |
|
968 |
/**
|
969 |
*
|
970 |
-
* @param Mage_Sales_Model_Order_Payment $payment
|
971 |
* @param float $amount
|
972 |
-
* @return @return Mage_Payment_Model_Abstract
|
973 |
*/
|
974 |
public function refund(Varien_Object $payment, $amount)
|
975 |
{
|
@@ -979,8 +1017,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
979 |
|
980 |
$gatewayParams = array('operation' => 'refund', 'amount' => $amount);
|
981 |
|
982 |
-
if (Mage::
|
983 |
-
$gatewayParams['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
|
|
984 |
}
|
985 |
|
986 |
/* @var $request Allopass_Hipay_Model_Api_Request */
|
@@ -989,12 +1028,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
989 |
|
990 |
|
991 |
$this->_debug($gatewayParams);
|
992 |
-
|
993 |
$gatewayResponse = $request->gatewayRequest($action, $gatewayParams, $payment->getOrder()->getStoreId());
|
994 |
-
|
995 |
$this->_debug($gatewayResponse->debug());
|
996 |
|
997 |
-
|
998 |
switch ($gatewayResponse->getStatus()) {
|
999 |
case "124":
|
1000 |
case "125":
|
@@ -1011,23 +1047,20 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1011 |
}
|
1012 |
|
1013 |
return $this;
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
$params = array();
|
1026 |
-
|
1027 |
$params['orderid'] = $payment->getOrder()->getIncrementId();
|
1028 |
-
|
1029 |
$paymentProduct = null;
|
1030 |
-
|
1031 |
$longDesc = "";
|
1032 |
|
1033 |
$taxAmount = $payment->getOrder()->getTaxAmount();
|
@@ -1041,7 +1074,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1041 |
$paymentsSplit = $this->getHelper()->splitPayment((int)$profile, $amount, $taxAmount);
|
1042 |
|
1043 |
$amount = $paymentsSplit[0]['amountToPay'];
|
1044 |
-
$taxAmount =
|
1045 |
}
|
1046 |
}
|
1047 |
|
@@ -1051,7 +1084,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1051 |
|
1052 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
1053 |
|
1054 |
-
|
1055 |
if ($useOrderCurrency) {
|
1056 |
$params['currency'] = $payment->getOrder()->getOrderCurrencyCode();
|
1057 |
} else {
|
@@ -1064,6 +1096,11 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1064 |
|
1065 |
$params['cid'] = $payment->getOrder()->getCustomerId();//CUSTOMER ID
|
1066 |
|
|
|
|
|
|
|
|
|
|
|
1067 |
$remoteIp = $payment->getOrder()->getRemoteIp();
|
1068 |
|
1069 |
//Check if it's forwarded and in this case, explode and retrieve the first part
|
@@ -1157,12 +1194,12 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1157 |
$customDataHipay = Mage::helper('hipay')->getCustomData($payment, $amount, $this, $split_number);
|
1158 |
|
1159 |
// Add custom data for transaction request
|
1160 |
-
if(file_exists(Mage::getModuleDir('','Allopass_Hipay')
|
1161 |
-
if (class_exists('Allopass_Hipay_Helper_CustomData',true)){
|
1162 |
-
if (method_exists(Mage::helper('hipay/customData'),'getCustomData')){
|
1163 |
-
$customData = Mage::helper('hipay/customData')->getCustomData($payment
|
1164 |
-
if (is_array($customData)){
|
1165 |
-
$customDataHipay = array_merge($customData
|
1166 |
}
|
1167 |
}
|
1168 |
}
|
@@ -1173,8 +1210,18 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1173 |
// Add device fingerprint for the transaction request (Token of device)
|
1174 |
$params['device_fingerprint'] = $payment->getAdditionalInformation('device_fingerprint');
|
1175 |
|
1176 |
-
if (Mage::
|
1177 |
-
$params['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1178 |
}
|
1179 |
|
1180 |
// Add Request resource (Informations module and cms)
|
@@ -1264,7 +1311,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1264 |
|
1265 |
/**
|
1266 |
*
|
1267 |
-
* @param
|
|
|
|
|
1268 |
*/
|
1269 |
public function paySplitPayment($splitPayment)
|
1270 |
{
|
@@ -1300,6 +1349,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1300 |
|
1301 |
return $gatewayResponse->getState();
|
1302 |
}
|
|
|
1303 |
}
|
1304 |
|
1305 |
protected function getCcTypeHipay($ccTypeMagento)
|
@@ -1345,6 +1395,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1345 |
*
|
1346 |
* @param Mage_Sales_Model_Order_Payment $payment
|
1347 |
* @param float $amount
|
|
|
1348 |
*/
|
1349 |
protected function _preauthorizeCapture($payment, $amount)
|
1350 |
{
|
@@ -1352,8 +1403,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1352 |
|
1353 |
$gatewayParams = array('operation' => 'capture', 'amount' => $amount);
|
1354 |
|
1355 |
-
if (Mage::
|
1356 |
-
$gatewayParams['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
|
|
1357 |
}
|
1358 |
|
1359 |
$this->_debug($gatewayParams);
|
@@ -1414,7 +1466,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1414 |
* @param string $transactionType
|
1415 |
* @param array $transactionDetails
|
1416 |
* @param array $transactionAdditionalInfo
|
1417 |
-
* @
|
|
|
1418 |
*/
|
1419 |
public function addTransaction(
|
1420 |
Mage_Sales_Model_Order_Payment $payment,
|
@@ -1472,7 +1525,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1472 |
* @param string $type
|
1473 |
* @param Mage_Sales_Model_Abstract $salesDocument
|
1474 |
* @param bool $failsafe
|
1475 |
-
* @return
|
1476 |
*/
|
1477 |
protected function _addTransaction($payment, $type, $salesDocument = null, $failsafe = false)
|
1478 |
{
|
@@ -1528,14 +1581,16 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1528 |
}
|
1529 |
return $transaction;
|
1530 |
}
|
|
|
1531 |
}
|
1532 |
|
1533 |
/**
|
1534 |
* Find one transaction by ID or type
|
1535 |
-
* @param
|
1536 |
* @param string $txnId
|
1537 |
-
* @param string $txnType
|
1538 |
-
* @return Mage_Sales_Model_Order_Payment_Transaction
|
|
|
1539 |
*/
|
1540 |
protected function _lookupTransaction($payment, $txnId, $txnType = false)
|
1541 |
{
|
@@ -1575,9 +1630,10 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1575 |
*/
|
1576 |
public function canUseForCurrency($currencyCode)
|
1577 |
{
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
|
|
1581 |
return true;
|
1582 |
}
|
1583 |
|
@@ -1608,7 +1664,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1608 |
|
1609 |
/**
|
1610 |
*
|
1611 |
-
* @return Mage_Checkout_Model_Session
|
1612 |
*/
|
1613 |
protected function _getCheckout()
|
1614 |
{
|
@@ -1620,7 +1676,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1620 |
*
|
1621 |
* @param mixed $debugData
|
1622 |
*/
|
1623 |
-
|
1624 |
{
|
1625 |
if ($this->getDebugFlag()) {
|
1626 |
Mage::getModel('hipay/log_adapter', 'payment_' . $this->getCode() . '.log')
|
@@ -1667,6 +1723,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
1667 |
/**
|
1668 |
* Return an id with informations to TPP
|
1669 |
*
|
|
|
1670 |
* @return string
|
1671 |
*/
|
1672 |
public function generateSplitOrderId($splitPayment)
|
95 |
public function assignInfoData($info, $data)
|
96 |
{
|
97 |
$oneclickMode = $data->getData($this->getCode() . '_oneclick');
|
98 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
99 |
$oneclickCard = $data->getData($this->getCode() . '_oneclick_card');
|
100 |
$splitPaymentId = $data->getData($this->getCode() . '_split_payment_id');
|
101 |
$token = $data->getData($this->getCode() . '_cc_token');
|
111 |
/**
|
112 |
* A request instructing the payment gateway to cancel a previously authorized transaction.
|
113 |
* Only authorized transactions can be cancelled, captured transactions must be refunded.
|
114 |
+
* @param Mage_Payment_Model_Info $payment
|
115 |
+
* @return bool
|
116 |
*/
|
117 |
public function cancelTransaction(Mage_Payment_Model_Info $payment)
|
118 |
{
|
158 |
public function acceptPayment(Mage_Payment_Model_Info $payment)
|
159 |
{
|
160 |
parent::acceptPayment($payment);
|
|
|
161 |
$amount = $payment->getAmountAuthorized();
|
162 |
|
163 |
$transactionId = $payment->getLastTransId();
|
189 |
|
190 |
/*@var $payment Mage_Sales_Model_Order_Payment */
|
191 |
parent::denyPayment($payment);
|
|
|
192 |
$amount = $payment->getAmountAuthorized();
|
193 |
|
194 |
$transactionId = $payment->getLastTransId();
|
218 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
219 |
* @param Mage_Sales_Model_Order_Payment $payment
|
220 |
* @param float $amount
|
221 |
+
* @return bool
|
222 |
*/
|
223 |
public function processResponse($gatewayResponse, $payment, $amount)
|
224 |
{
|
225 |
+
$logs = array();
|
226 |
$order = $payment->getOrder();
|
227 |
+
$newTransactionType = null;
|
228 |
+
$requestType = null;
|
229 |
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
230 |
+
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment error.');
|
231 |
|
232 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
233 |
|
239 |
$total = $order->getBaseGrandTotal();
|
240 |
}
|
241 |
|
242 |
+
// Process some logs if debug mode is enabled
|
243 |
+
$logs['HIPAY PROCESS RESPONSE START'] = '';
|
244 |
+
$logs['Gateway Status'] = $gatewayResponse->getStatus();
|
245 |
+
$logs['Order Status'] = $order->getStatus();
|
246 |
+
$logs['UseOrderCurrency'] = $useOrderCurrency;
|
247 |
+
$logs['Currency'] = $currency->getData("currency_code");
|
248 |
+
$logs['Total'] = $total;
|
249 |
+
$logs['Amount'] = $amount;
|
250 |
|
251 |
switch ($this->getConfigPaymentAction()) {
|
252 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
300 |
$order->cancel();
|
301 |
}
|
302 |
|
303 |
+
$order->addStatusHistoryComment(Mage::helper('hipay')->getTransactionMessage(
|
304 |
$payment, self::OPERATION_AUTHORIZATION, null, $amount, true, $gatewayResponse->getMessage()
|
305 |
+
),$status);
|
306 |
|
307 |
$order->save();
|
308 |
|
487 |
|
488 |
|
489 |
break;
|
490 |
+
/** @noinspection PhpMissingBreakStatementInspection */
|
491 |
case 117: //Capture Requested
|
492 |
|
493 |
if ($order->getStatus() == 'capture' || $order->getStatus() == 'processing') {// for logic process
|
507 |
|
508 |
$message = Mage::helper("hipay")->__('Capture Requested by Hipay.');
|
509 |
|
510 |
+
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
511 |
$order->setState(
|
512 |
Mage_Sales_Model_Order::STATE_PROCESSING, 'capture_requested', $message, null, false
|
513 |
);
|
521 |
}
|
522 |
|
523 |
case 118: //Capture. There are 2 ways to enter in this case: 1. direct capture notification. 2. After 117 case, when it is configured for valid order with 117 status.
|
524 |
+
$acceptMessage = Mage::helper("hipay")->__('Payment accepted by Hipay.');
|
525 |
+
|
526 |
+
if (!$status = $this->getConfigData('order_status_payment_accepted')) {
|
527 |
+
$status = $order->getStatus();
|
528 |
+
}
|
529 |
|
530 |
if ($order->getStatus() == $this->getConfigData('order_status_payment_accepted')) {
|
531 |
break;
|
542 |
}
|
543 |
|
544 |
//Check if it is split payment and insert it
|
|
|
545 |
if (($profile = (int)$payment->getAdditionalInformation('split_payment_id')) && $customer->getId()) {
|
546 |
$token = isset($gatewayResponse->paymentMethod['token']) ? $gatewayResponse->paymentMethod['token'] : $gatewayResponse->getData('cardtoken');
|
547 |
$this->getHelper()->insertSplitPayment($order, $profile, $customer->getId(), $token);
|
553 |
|
554 |
// Create invoice
|
555 |
if ($this->getConfigData('invoice_create', $order->getStoreId()) && !$order->hasInvoices()) {
|
556 |
+
if (abs($amount - $total) > Allopass_Hipay_Helper_Data::EPSYLON && !$profile && $order->getState() != Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
|
|
|
557 |
$transactionId = $gatewayResponse->getTransactionReference();
|
558 |
+
$order->addStatusHistoryComment(Mage::helper('hipay')->__('Notification "Capture". Capture issued by merchant. Registered notification about captured amount of %s. Transaction ID: "%s".
|
559 |
+
Invoice has not been created. Please create offline Invoice. ( Authorized amount was %s )',
|
560 |
+
$currency->formatTxt($amount), $transactionId, $currency->formatTxt($total)),
|
561 |
+
false);
|
562 |
+
|
563 |
+
// In case of 117 is disabled or not received
|
564 |
+
if ($order->getStatus() != Mage_Sales_Model_Order::STATE_PROCESSING) {
|
565 |
+
$this->processStatusOrder($order, $status, $acceptMessage);
|
566 |
+
}
|
567 |
break;
|
568 |
}
|
|
|
569 |
$invoice = $this->create_invoice($order, $gatewayResponse->getTransactionReference(),
|
570 |
false);
|
571 |
|
572 |
Mage::getModel('core/resource_transaction')
|
573 |
->addObject($invoice)->addObject($invoice->getOrder())
|
574 |
->save();
|
575 |
+
$logs['Create invoice'] = $invoice->getIncrementId();
|
576 |
} elseif ($order->hasInvoices()) {
|
577 |
foreach ($order->getInvoiceCollection() as $invoice) {
|
578 |
if ($invoice->getState() == Mage_Sales_Model_Order_Invoice::STATE_OPEN && (round(($invoice->getBaseGrandTotal() + $order->getBaseTotalPaid()),
|
579 |
+
2) == $gatewayResponse->getCapturedAmount() || round(($invoice->getBaseGrandTotal()),
|
580 |
+
2) == $gatewayResponse->getCapturedAmount())
|
581 |
) {
|
582 |
$invoice->pay();
|
583 |
+
$logs['Pay invoice'] = $invoice->invoice->getIncrementId() . ' ' . $invoice->getBaseGrandTotal();
|
584 |
Mage::getModel('core/resource_transaction')
|
585 |
->addObject($invoice)->addObject($invoice->getOrder())
|
586 |
->save();
|
591 |
if (($profile = (int)$payment->getAdditionalInformation('split_payment_id')) && $customer->getId()) {
|
592 |
$token = isset($gatewayResponse->paymentMethod['token']) ? $gatewayResponse->paymentMethod['token'] : $gatewayResponse->getData('cardtoken');
|
593 |
$this->getHelper()->insertSplitPayment($order, $profile, $customer->getId(), $token);
|
594 |
+
$logs['Insert Split Payment'] = 'Customer : ' . $customer->getId() . ' Split' . $payment->getAdditionalInformation('split_payment_id');
|
595 |
}
|
596 |
|
597 |
+
$this->processStatusOrder($order, $status, $acceptMessage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
|
599 |
$payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
|
600 |
$payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
|
618 |
|
619 |
$message = Mage::helper("hipay")->__('Refund Requested by Hipay.');
|
620 |
|
621 |
+
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
622 |
$order->setState(
|
623 |
Mage_Sales_Model_Order::STATE_PROCESSING, 'refund_requested', $message, null, false
|
624 |
);
|
654 |
|
655 |
$message = Mage::helper("hipay")->__('Refund accepted by Hipay.');
|
656 |
|
657 |
+
$order-> $order->addStatusHistoryComment($message,$status);
|
658 |
|
659 |
Mage::getModel('core/resource_transaction')
|
660 |
->addObject($creditmemo)->addObject($creditmemo->getOrder())
|
700 |
default:
|
701 |
$message = Mage::helper("hipay")->__('Message Hipay: %s. Status: %s',
|
702 |
$gatewayResponse->getMessage(), $gatewayResponse->getStatus());
|
703 |
+
$order->addStatusHistoryComment($message,$order->getStatus());
|
704 |
break;
|
705 |
}
|
706 |
|
|
|
707 |
if ($gatewayResponse->getState() == self::STATE_COMPLETED) {
|
708 |
if (in_array($gatewayResponse->getPaymentProduct(),
|
709 |
array('visa', 'american-express', 'mastercard', 'cb'))
|
775 |
$this->_setFraudDetected($gatewayResponse, $customer, $payment, $amount, true);
|
776 |
}
|
777 |
|
|
|
778 |
if ($status == Mage_Sales_Model_Order::STATE_HOLDED && $order->canHold()) {
|
779 |
$order->hold();
|
780 |
} elseif ($status == Mage_Sales_Model_Order::STATE_CANCELED && $order->canCancel()) {
|
781 |
$order->cancel();
|
782 |
}
|
783 |
|
784 |
+
$order->addStatusHistoryComment(Mage::helper('hipay')->getTransactionMessage(
|
|
|
785 |
$payment, $this->getOperation(), null, $amount, true, $gatewayResponse->getMessage()
|
786 |
+
),$status);
|
787 |
|
788 |
$order->save();
|
|
|
789 |
break;
|
790 |
|
791 |
case self::STATE_ERROR:
|
792 |
default:
|
793 |
+
$logs['HIPAY PROCESS RESPONSE ERROR '] = '';
|
794 |
+
$this->debugData($logs);
|
795 |
Mage::throwException($defaultExceptionMessage);
|
796 |
break;
|
797 |
|
798 |
}
|
799 |
+
$logs['HIPAY PROCESS RESPONSE END'] = '';
|
800 |
+
$this->debugData($logs);
|
801 |
+
|
802 |
+
return true;
|
803 |
+
}
|
804 |
+
|
805 |
+
/**
|
806 |
+
*Change Status of order when capture is done
|
807 |
+
*
|
808 |
+
* @param $order
|
809 |
+
* @param $status
|
810 |
+
* @param $message
|
811 |
+
*/
|
812 |
+
protected function processStatusOrder($order, $status, $message)
|
813 |
+
{
|
814 |
+
if ($status == Mage_Sales_Model_Order::STATE_PROCESSING) {
|
815 |
+
$order->setState(
|
816 |
+
Mage_Sales_Model_Order::STATE_PROCESSING, $status, $message
|
817 |
+
);
|
818 |
+
} else {
|
819 |
+
if ($status == Mage_Sales_Model_Order::STATE_COMPLETE) {
|
820 |
+
$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
|
821 |
+
$order->addStatusToHistory($status, $message, true);
|
822 |
+
/*$order->setState(
|
823 |
+
Mage_Sales_Model_Order::STATE_COMPLETE, $status, $message, null, false
|
824 |
+
);*/
|
825 |
+
} else {
|
826 |
+
$order->addStatusToHistory($status, $message, true);
|
827 |
+
}
|
828 |
+
}
|
829 |
}
|
830 |
|
831 |
/**
|
832 |
*
|
833 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
834 |
+
* @param $customer
|
835 |
* @param Mage_Sales_Model_Order_Payment $payment
|
836 |
+
* @param $amount
|
837 |
+
* @param bool $addToHistory
|
838 |
*/
|
839 |
protected function _setFraudDetected($gatewayResponse, $customer, $payment, $amount, $addToHistory = false)
|
840 |
{
|
845 |
|
846 |
if (defined('Mage_Sales_Model_Order::STATUS_FRAUD')) {
|
847 |
$status = Mage_Sales_Model_Order::STATUS_FRAUD;
|
848 |
+
}else{
|
849 |
+
$status = null;
|
850 |
}
|
851 |
|
852 |
$payment->setAdditionalInformation('fraud_type', $fraudScreening['result']);
|
854 |
$payment->setAdditionalInformation('fraud_review', $fraudScreening['review']);
|
855 |
|
856 |
if ($addToHistory) {
|
857 |
+
$order->addStatusHistoryComment(Mage::helper('hipay')->getTransactionMessage(
|
858 |
$payment, $this->getOperation(), null, $amount, true, $gatewayResponse->getMessage()
|
859 |
+
),$status);
|
860 |
}
|
861 |
|
862 |
$message = Mage::helper('hipay')->__($gatewayResponse->getMessage());
|
918 |
*
|
919 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
|
920 |
* @param Mage_Sales_Model_Order_Payment $payment
|
921 |
+
* @return bool|string
|
922 |
+
* @internal param float $amount
|
923 |
*/
|
924 |
+
public function processResponseToRedirect($gatewayResponse, $payment)
|
925 |
{
|
926 |
$order = $payment->getOrder();
|
927 |
+
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment error.');
|
928 |
|
929 |
switch ($this->getConfigPaymentAction()) {
|
930 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
|
|
|
|
931 |
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment authorization error.');
|
932 |
break;
|
933 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE:
|
|
|
|
|
934 |
$defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
|
935 |
break;
|
936 |
}
|
940 |
$urlAdmin = Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId()));
|
941 |
}
|
942 |
|
|
|
943 |
if ($gatewayResponse->getState()) {
|
944 |
switch ($gatewayResponse->getState()) {
|
945 |
case self::STATE_COMPLETED:
|
977 |
|
978 |
}
|
979 |
}
|
980 |
+
return true;
|
981 |
}
|
982 |
|
983 |
/**
|
984 |
*
|
985 |
+
* @return Allopass_Hipay_Helper_Data|Mage_Core_Helper_Abstract
|
986 |
*/
|
987 |
protected function getHelper()
|
988 |
{
|
994 |
*
|
995 |
* @param Mage_Customer_Model_Customer $customer
|
996 |
* @param Allopass_Hipay_Model_Api_Response_Gateway $response
|
997 |
+
* @return $this
|
998 |
*/
|
999 |
protected function responseToCustomer($customer, $response)
|
1000 |
{
|
1005 |
|
1006 |
/**
|
1007 |
*
|
1008 |
+
* @param Mage_Sales_Model_Order_Payment|Varien_Object $payment
|
1009 |
* @param float $amount
|
1010 |
+
* @return $this|Mage_Payment_Model_Abstract @return Mage_Payment_Model_Abstract
|
1011 |
*/
|
1012 |
public function refund(Varien_Object $payment, $amount)
|
1013 |
{
|
1017 |
|
1018 |
$gatewayParams = array('operation' => 'refund', 'amount' => $amount);
|
1019 |
|
1020 |
+
if (Mage::helper('hipay')->isSendCartItemsRequired($payment->getCcType())) {
|
1021 |
+
$gatewayParams['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
1022 |
+
Allopass_Hipay_Helper_Data::STATE_REFUND, $payment);
|
1023 |
}
|
1024 |
|
1025 |
/* @var $request Allopass_Hipay_Model_Api_Request */
|
1028 |
|
1029 |
|
1030 |
$this->_debug($gatewayParams);
|
|
|
1031 |
$gatewayResponse = $request->gatewayRequest($action, $gatewayParams, $payment->getOrder()->getStoreId());
|
|
|
1032 |
$this->_debug($gatewayResponse->debug());
|
1033 |
|
|
|
1034 |
switch ($gatewayResponse->getStatus()) {
|
1035 |
case "124":
|
1036 |
case "125":
|
1047 |
}
|
1048 |
|
1049 |
return $this;
|
1050 |
+
}
|
1051 |
+
|
1052 |
+
/**
|
1053 |
+
*
|
1054 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
1055 |
+
* @param float $amount
|
1056 |
+
* @param string|null $token
|
1057 |
+
* @return multitype:
|
1058 |
+
*/
|
1059 |
+
public function getGatewayParams($payment,$amount,$token=null)
|
1060 |
+
{
|
1061 |
$params = array();
|
|
|
1062 |
$params['orderid'] = $payment->getOrder()->getIncrementId();
|
|
|
1063 |
$paymentProduct = null;
|
|
|
1064 |
$longDesc = "";
|
1065 |
|
1066 |
$taxAmount = $payment->getOrder()->getTaxAmount();
|
1074 |
$paymentsSplit = $this->getHelper()->splitPayment((int)$profile, $amount, $taxAmount);
|
1075 |
|
1076 |
$amount = $paymentsSplit[0]['amountToPay'];
|
1077 |
+
$taxAmount = $paymentsSplit[0]['taxAmountToPay'];
|
1078 |
}
|
1079 |
}
|
1080 |
|
1084 |
|
1085 |
$useOrderCurrency = Mage::getStoreConfig('hipay/hipay_api/currency_transaction', Mage::app()->getStore());
|
1086 |
|
|
|
1087 |
if ($useOrderCurrency) {
|
1088 |
$params['currency'] = $payment->getOrder()->getOrderCurrencyCode();
|
1089 |
} else {
|
1096 |
|
1097 |
$params['cid'] = $payment->getOrder()->getCustomerId();//CUSTOMER ID
|
1098 |
|
1099 |
+
// Astropay needs National identification number
|
1100 |
+
if (!empty($payment->getAdditionalInformation('national_identification_number'))){
|
1101 |
+
$params['national_identification_number'] = $payment->getAdditionalInformation('national_identification_number');
|
1102 |
+
}
|
1103 |
+
|
1104 |
$remoteIp = $payment->getOrder()->getRemoteIp();
|
1105 |
|
1106 |
//Check if it's forwarded and in this case, explode and retrieve the first part
|
1194 |
$customDataHipay = Mage::helper('hipay')->getCustomData($payment, $amount, $this, $split_number);
|
1195 |
|
1196 |
// Add custom data for transaction request
|
1197 |
+
if (file_exists(Mage::getModuleDir('', 'Allopass_Hipay') . DS . 'Helper' . DS . 'CustomData.php')) {
|
1198 |
+
if (class_exists('Allopass_Hipay_Helper_CustomData', true)) {
|
1199 |
+
if (method_exists(Mage::helper('hipay/customData'), 'getCustomData')) {
|
1200 |
+
$customData = Mage::helper('hipay/customData')->getCustomData($payment, $amount);
|
1201 |
+
if (is_array($customData)) {
|
1202 |
+
$customDataHipay = array_merge($customData, $customDataHipay);
|
1203 |
}
|
1204 |
}
|
1205 |
}
|
1210 |
// Add device fingerprint for the transaction request (Token of device)
|
1211 |
$params['device_fingerprint'] = $payment->getAdditionalInformation('device_fingerprint');
|
1212 |
|
1213 |
+
if (Mage::helper('hipay')->isSendCartItemsRequired($payment->getCcType())) {
|
1214 |
+
$params['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
1215 |
+
Allopass_Hipay_Helper_Data::STATE_AUTHORIZATION);
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
// Check if delivery method is required for the payment method
|
1219 |
+
if (Mage::helper('hipay')->isDeliveryMethodAndCartItemsRequired($payment->getCcType())) {
|
1220 |
+
if (!empty($payment->getOrder()->getShippingMethod()) && !$payment->getOrder()->getIsVirtual()) {
|
1221 |
+
Mage::helper('hipay')->processDeliveryInformation($payment->getOrder()->getShippingMethod(), Mage::app()->getStore(),$this, $params);
|
1222 |
+
} else{
|
1223 |
+
//TODO
|
1224 |
+
}
|
1225 |
}
|
1226 |
|
1227 |
// Add Request resource (Informations module and cms)
|
1311 |
|
1312 |
/**
|
1313 |
*
|
1314 |
+
* @param $splitPayment
|
1315 |
+
* @return bool
|
1316 |
+
* @internal param Allopass_Hipay_Model_SplitPayment $spiltPayment
|
1317 |
*/
|
1318 |
public function paySplitPayment($splitPayment)
|
1319 |
{
|
1349 |
|
1350 |
return $gatewayResponse->getState();
|
1351 |
}
|
1352 |
+
return false;
|
1353 |
}
|
1354 |
|
1355 |
protected function getCcTypeHipay($ccTypeMagento)
|
1395 |
*
|
1396 |
* @param Mage_Sales_Model_Order_Payment $payment
|
1397 |
* @param float $amount
|
1398 |
+
* @return $this
|
1399 |
*/
|
1400 |
protected function _preauthorizeCapture($payment, $amount)
|
1401 |
{
|
1403 |
|
1404 |
$gatewayParams = array('operation' => 'capture', 'amount' => $amount);
|
1405 |
|
1406 |
+
if (Mage::helper('hipay')->isSendCartItemsRequired($payment->getCcType())) {
|
1407 |
+
$gatewayParams['basket'] = Mage::helper('hipay')->getCartInformation($payment->getOrder(),
|
1408 |
+
Allopass_Hipay_Helper_Data::STATE_CAPTURE);
|
1409 |
}
|
1410 |
|
1411 |
$this->_debug($gatewayParams);
|
1466 |
* @param string $transactionType
|
1467 |
* @param array $transactionDetails
|
1468 |
* @param array $transactionAdditionalInfo
|
1469 |
+
* @param bool $message
|
1470 |
+
* @return Mage_Sales_Model_Order_Payment_Transaction|null
|
1471 |
*/
|
1472 |
public function addTransaction(
|
1473 |
Mage_Sales_Model_Order_Payment $payment,
|
1525 |
* @param string $type
|
1526 |
* @param Mage_Sales_Model_Abstract $salesDocument
|
1527 |
* @param bool $failsafe
|
1528 |
+
* @return bool|Mage_Sales_Model_Order_Payment_Transaction|null
|
1529 |
*/
|
1530 |
protected function _addTransaction($payment, $type, $salesDocument = null, $failsafe = false)
|
1531 |
{
|
1581 |
}
|
1582 |
return $transaction;
|
1583 |
}
|
1584 |
+
return false;
|
1585 |
}
|
1586 |
|
1587 |
/**
|
1588 |
* Find one transaction by ID or type
|
1589 |
+
* @param $payment
|
1590 |
* @param string $txnId
|
1591 |
+
* @param bool|string $txnType
|
1592 |
+
* @return false|Mage_Sales_Model_Order_Payment_Transaction
|
1593 |
+
* @internal param $Mage_Sales_Model_Order_Payment
|
1594 |
*/
|
1595 |
protected function _lookupTransaction($payment, $txnId, $txnType = false)
|
1596 |
{
|
1630 |
*/
|
1631 |
public function canUseForCurrency($currencyCode)
|
1632 |
{
|
1633 |
+
if (empty( $this->getConfigData('currency')) || $currencyCode == $this->getConfigData('currency')
|
1634 |
+
|| in_array($currencyCode, $this->getConfigData('currency'))) {
|
1635 |
+
return true;
|
1636 |
+
}
|
1637 |
return true;
|
1638 |
}
|
1639 |
|
1664 |
|
1665 |
/**
|
1666 |
*
|
1667 |
+
* @return Mage_Checkout_Model_Session|Mage_Core_Model_Abstract
|
1668 |
*/
|
1669 |
protected function _getCheckout()
|
1670 |
{
|
1676 |
*
|
1677 |
* @param mixed $debugData
|
1678 |
*/
|
1679 |
+
public function _debug($debugData)
|
1680 |
{
|
1681 |
if ($this->getDebugFlag()) {
|
1682 |
Mage::getModel('hipay/log_adapter', 'payment_' . $this->getCode() . '.log')
|
1723 |
/**
|
1724 |
* Return an id with informations to TPP
|
1725 |
*
|
1726 |
+
* @param $splitPayment
|
1727 |
* @return string
|
1728 |
*/
|
1729 |
public function generateSplitOrderId($splitPayment)
|
app/code/community/Allopass/Hipay/Model/Method/AbstractOrder.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Model_Method_AbstractOrder extends Allopass_Hipay_Model_Method_Cc
|
4 |
+
{
|
5 |
+
protected $_formBlockType = 'hipay/form_hosted';
|
6 |
+
protected $_infoBlockType = 'hipay/info_hosted';
|
7 |
+
|
8 |
+
|
9 |
+
public function getOrderPlaceRedirectUrl()
|
10 |
+
{
|
11 |
+
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Assign data to info model instance
|
16 |
+
*
|
17 |
+
* @param mixed $data
|
18 |
+
* @return Mage_Payment_Model_Info
|
19 |
+
*/
|
20 |
+
public function assignData($data)
|
21 |
+
{
|
22 |
+
if (!($data instanceof Varien_Object)) {
|
23 |
+
$data = new Varien_Object($data);
|
24 |
+
}
|
25 |
+
$info = $this->getInfoInstance();
|
26 |
+
$info->setCcType($this->getConfigData('cctypes'));
|
27 |
+
|
28 |
+
$this->assignInfoData($info, $data);
|
29 |
+
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function initialize($paymentAction, $stateObject)
|
34 |
+
{
|
35 |
+
/* @var $payment Mage_Sales_Model_Order_Payment */
|
36 |
+
$payment = $this->getInfoInstance();
|
37 |
+
$order = $payment->getOrder();
|
38 |
+
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
39 |
+
|
40 |
+
|
41 |
+
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
42 |
+
{
|
43 |
+
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
44 |
+
$card = Mage::getModel('hipay/card')->load($cardId);
|
45 |
+
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
46 |
+
$token = $card->getCcToken();
|
47 |
+
else
|
48 |
+
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
49 |
+
|
50 |
+
$payment->setAdditionalInformation('token',$token);
|
51 |
+
}
|
52 |
+
|
53 |
+
return $this;
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
protected function getCcTypeHipay($ccTypeMagento)
|
59 |
+
{
|
60 |
+
return $ccTypeMagento;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Validate payment method information object
|
65 |
+
*
|
66 |
+
* @param Mage_Payment_Model_Info $info
|
67 |
+
* @return Mage_Payment_Model_Abstract
|
68 |
+
*/
|
69 |
+
public function validate()
|
70 |
+
{
|
71 |
+
/**
|
72 |
+
* to validate payment method is allowed for billing country or not
|
73 |
+
*/
|
74 |
+
$paymentInfo = $this->getInfoInstance();
|
75 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
76 |
+
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
77 |
+
} else {
|
78 |
+
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
79 |
+
}
|
80 |
+
if (!$this->canUseForCountry($billingCountry)) {
|
81 |
+
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
82 |
+
}
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Astropay.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Astropay extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
+
{
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Validate payment method information object
|
7 |
+
*
|
8 |
+
* @param Mage_Payment_Model_Info $info
|
9 |
+
* @return Mage_Payment_Model_Abstract
|
10 |
+
*/
|
11 |
+
public function validate()
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* to validate payment method is allowed for billing country or not
|
15 |
+
*/
|
16 |
+
$paymentInfo = $this->getInfoInstance();
|
17 |
+
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
18 |
+
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
19 |
+
} else {
|
20 |
+
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
21 |
+
}
|
22 |
+
if (!$this->canUseForCountry($billingCountry)) {
|
23 |
+
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
24 |
+
}
|
25 |
+
|
26 |
+
// Validate CPF format
|
27 |
+
if ($this->_typeIdentification == 'cpf'){
|
28 |
+
if (!preg_match("/(\d{2}[.]?\d{3}[.]?\d{3}[\/]?\d{4}[-]?\d{2})|(\d{3}[.]?\d{3}[.]?\d{3}[-]?\d{2})$/",$paymentInfo->getAdditionalInformation('national_identification_number'))){
|
29 |
+
Mage::throwException(Mage::helper('payment')->__('CPF is not valid.' . $paymentInfo->getAdditionalInformation('national_identification_number')));
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
// Validate CPN format
|
34 |
+
if ($this->_typeIdentification == 'cpn'){
|
35 |
+
if (!preg_match("/^[a-zA-Z]{4}\d{6}[a-zA-Z]{6}\d{2}$/",$paymentInfo->getAdditionalInformation('national_identification_number'))){
|
36 |
+
Mage::throwException(Mage::helper('payment')->__('CPN is incorrect.'));
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Return the type for national identification number
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getTypeNationalIdentification(){
|
49 |
+
return $this->_typeIdentification;
|
50 |
+
}
|
51 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Aura.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Aura extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_aura';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
|
8 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Banamex.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Banamex extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_banamex';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpn';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Banco.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Banco extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_banco';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Bbva.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Bbva extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_bbva';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpn';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Boleto.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Boleto extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_boleto';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Bradesco.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Bradesco extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_bradesco';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Caixa.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Caixa extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_caixa';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Cc.php
CHANGED
@@ -179,8 +179,7 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
|
|
179 |
$gatewayParams = $this->getGatewayParams($payment, $amount,$token);
|
180 |
|
181 |
$gatewayParams['operation'] =$this->getOperation();
|
182 |
-
|
183 |
-
$paymentProduct = null;
|
184 |
if($payment->getAdditionalInformation('use_oneclick'))
|
185 |
{
|
186 |
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
@@ -192,9 +191,10 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
|
|
192 |
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
193 |
|
194 |
}
|
195 |
-
else
|
196 |
-
|
197 |
-
|
|
|
198 |
$gatewayParams['payment_product'] = $paymentProduct ;
|
199 |
$this->_debug($gatewayParams);
|
200 |
|
@@ -208,8 +208,32 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
|
|
208 |
return $redirectUrl;
|
209 |
|
210 |
}
|
211 |
-
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
/**
|
215 |
* Validate payment method information object
|
179 |
$gatewayParams = $this->getGatewayParams($payment, $amount,$token);
|
180 |
|
181 |
$gatewayParams['operation'] =$this->getOperation();
|
182 |
+
|
|
|
183 |
if($payment->getAdditionalInformation('use_oneclick'))
|
184 |
{
|
185 |
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
191 |
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
192 |
|
193 |
}
|
194 |
+
else{
|
195 |
+
$paymentProduct = $this->getSpecifiedPaymentProduct($payment);
|
196 |
+
}
|
197 |
+
|
198 |
$gatewayParams['payment_product'] = $paymentProduct ;
|
199 |
$this->_debug($gatewayParams);
|
200 |
|
208 |
return $redirectUrl;
|
209 |
|
210 |
}
|
|
|
211 |
|
212 |
+
/**
|
213 |
+
* Some payments method need product code with fees or no fees
|
214 |
+
*
|
215 |
+
* @return string|bool
|
216 |
+
*/
|
217 |
+
private function getPaymentProductFees()
|
218 |
+
{
|
219 |
+
$paymentFees = $this->getConfigData('payment_product_fees');
|
220 |
+
if (!empty($paymentFees)) {
|
221 |
+
return $paymentFees;
|
222 |
+
}
|
223 |
+
return false;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Return payment product
|
228 |
+
*
|
229 |
+
* If Payment requires specified option ( With Fees or without Fees return it otherwhise normal payment product)
|
230 |
+
*
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
private function getSpecifiedPaymentProduct($payment)
|
234 |
+
{
|
235 |
+
return ($this->getPaymentProductFees()) ? $this->getPaymentProductFees() : $this->getCcTypeHipay($payment->getCcType());
|
236 |
+
}
|
237 |
|
238 |
/**
|
239 |
* Validate payment method information object
|
app/code/community/Allopass/Hipay/Model/Method/Dexia.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_Dexia extends
|
3 |
{
|
4 |
protected $_code = 'hipay_dexia';
|
5 |
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Dexia extends Allopass_Hipay_Model_Method_Astropay
|
3 |
{
|
4 |
protected $_code = 'hipay_dexia';
|
5 |
|
app/code/community/Allopass/Hipay/Model/Method/Discover.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Discover extends Allopass_Hipay_Model_Method_Hosted
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_discover';
|
5 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Facilipay3x.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Facilipay3x extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_facilipay3x';
|
5 |
+
protected $_formBlockType = 'hipay/form_hosted';
|
6 |
+
protected $_infoBlockType = 'hipay/info_hosted';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Facilipay4x.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Facilipay4x extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_facilipay4x';
|
5 |
+
|
6 |
+
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
+
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Itau.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Itau extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_itau';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Oxxo.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Oxxo extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_oxxo';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpn';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/PaypalApi.php
CHANGED
@@ -1,88 +1,8 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_PaypalApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_paypalapi';
|
5 |
|
6 |
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
-
|
10 |
-
public function getOrderPlaceRedirectUrl()
|
11 |
-
{
|
12 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Assign data to info model instance
|
18 |
-
*
|
19 |
-
* @param mixed $data
|
20 |
-
* @return Mage_Payment_Model_Info
|
21 |
-
*/
|
22 |
-
public function assignData($data)
|
23 |
-
{
|
24 |
-
if (!($data instanceof Varien_Object)) {
|
25 |
-
$data = new Varien_Object($data);
|
26 |
-
}
|
27 |
-
$info = $this->getInfoInstance();
|
28 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
29 |
-
|
30 |
-
$this->assignInfoData($info, $data);
|
31 |
-
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function initialize($paymentAction, $stateObject)
|
36 |
-
{
|
37 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
38 |
-
$payment = $this->getInfoInstance();
|
39 |
-
$order = $payment->getOrder();
|
40 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
41 |
-
|
42 |
-
|
43 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
44 |
-
{
|
45 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
46 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
47 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
48 |
-
$token = $card->getCcToken();
|
49 |
-
else
|
50 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
51 |
-
$payment->setAdditionalInformation('token',$token);
|
52 |
-
}
|
53 |
-
|
54 |
-
return $this;
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
60 |
-
{
|
61 |
-
return $ccTypeMagento;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Validate payment method information object
|
67 |
-
*
|
68 |
-
* @param Mage_Payment_Model_Info $info
|
69 |
-
* @return Mage_Payment_Model_Abstract
|
70 |
-
*/
|
71 |
-
public function validate()
|
72 |
-
{
|
73 |
-
/**
|
74 |
-
* to validate payment method is allowed for billing country or not
|
75 |
-
*/
|
76 |
-
$paymentInfo = $this->getInfoInstance();
|
77 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
78 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
79 |
-
} else {
|
80 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
81 |
-
}
|
82 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
83 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
84 |
-
}
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_PaypalApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_paypalapi';
|
5 |
|
6 |
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
protected $_infoBlockType = 'hipay/info_hosted';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
app/code/community/Allopass/Hipay/Model/Method/PostfinancecardApi.php
CHANGED
@@ -1,88 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_PostfinancecardApi extends
|
3 |
-
{
|
4 |
-
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
-
|
10 |
-
public function getOrderPlaceRedirectUrl()
|
11 |
-
{
|
12 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Assign data to info model instance
|
18 |
-
*
|
19 |
-
* @param mixed $data
|
20 |
-
* @return Mage_Payment_Model_Info
|
21 |
-
*/
|
22 |
-
public function assignData($data)
|
23 |
-
{
|
24 |
-
if (!($data instanceof Varien_Object)) {
|
25 |
-
$data = new Varien_Object($data);
|
26 |
-
}
|
27 |
-
$info = $this->getInfoInstance();
|
28 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
29 |
-
|
30 |
-
$this->assignInfoData($info, $data);
|
31 |
-
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function initialize($paymentAction, $stateObject)
|
36 |
-
{
|
37 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
38 |
-
$payment = $this->getInfoInstance();
|
39 |
-
$order = $payment->getOrder();
|
40 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
41 |
-
|
42 |
-
|
43 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
44 |
-
{
|
45 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
46 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
47 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
48 |
-
$token = $card->getCcToken();
|
49 |
-
else
|
50 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
51 |
-
$payment->setAdditionalInformation('token',$token);
|
52 |
-
}
|
53 |
-
|
54 |
-
return $this;
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
60 |
-
{
|
61 |
-
return $ccTypeMagento;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Validate payment method information object
|
67 |
-
*
|
68 |
-
* @param Mage_Payment_Model_Info $info
|
69 |
-
* @return Mage_Payment_Model_Abstract
|
70 |
-
*/
|
71 |
-
public function validate()
|
72 |
-
{
|
73 |
-
/**
|
74 |
-
* to validate payment method is allowed for billing country or not
|
75 |
-
*/
|
76 |
-
$paymentInfo = $this->getInfoInstance();
|
77 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
78 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
79 |
-
} else {
|
80 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
81 |
-
}
|
82 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
83 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
84 |
-
}
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
-
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_PostfinancecardApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_postfinancecardapi';
|
5 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Allopass/Hipay/Model/Method/PostfinanceefinanceApi.php
CHANGED
@@ -1,88 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_PostfinanceefinanceApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_postfinanceefinanceapi';
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
-
|
10 |
-
public function getOrderPlaceRedirectUrl()
|
11 |
-
{
|
12 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Assign data to info model instance
|
18 |
-
*
|
19 |
-
* @param mixed $data
|
20 |
-
* @return Mage_Payment_Model_Info
|
21 |
-
*/
|
22 |
-
public function assignData($data)
|
23 |
-
{
|
24 |
-
if (!($data instanceof Varien_Object)) {
|
25 |
-
$data = new Varien_Object($data);
|
26 |
-
}
|
27 |
-
$info = $this->getInfoInstance();
|
28 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
29 |
-
|
30 |
-
$this->assignInfoData($info, $data);
|
31 |
-
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function initialize($paymentAction, $stateObject)
|
36 |
-
{
|
37 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
38 |
-
$payment = $this->getInfoInstance();
|
39 |
-
$order = $payment->getOrder();
|
40 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
41 |
-
|
42 |
-
|
43 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
44 |
-
{
|
45 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
46 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
47 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
48 |
-
$token = $card->getCcToken();
|
49 |
-
else
|
50 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
51 |
-
$payment->setAdditionalInformation('token',$token);
|
52 |
-
}
|
53 |
-
|
54 |
-
return $this;
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
60 |
-
{
|
61 |
-
return $ccTypeMagento;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Validate payment method information object
|
67 |
-
*
|
68 |
-
* @param Mage_Payment_Model_Info $info
|
69 |
-
* @return Mage_Payment_Model_Abstract
|
70 |
-
*/
|
71 |
-
public function validate()
|
72 |
-
{
|
73 |
-
/**
|
74 |
-
* to validate payment method is allowed for billing country or not
|
75 |
-
*/
|
76 |
-
$paymentInfo = $this->getInfoInstance();
|
77 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
78 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
79 |
-
} else {
|
80 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
81 |
-
}
|
82 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
83 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
84 |
-
}
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_PostfinanceefinanceApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_postfinanceefinanceapi';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
app/code/community/Allopass/Hipay/Model/Method/Przelewy24Api.php
CHANGED
@@ -1,88 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_Przelewy24Api extends
|
3 |
{
|
4 |
protected $_code = 'hipay_przelewy24api';
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
-
|
10 |
-
public function getOrderPlaceRedirectUrl()
|
11 |
-
{
|
12 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Assign data to info model instance
|
18 |
-
*
|
19 |
-
* @param mixed $data
|
20 |
-
* @return Mage_Payment_Model_Info
|
21 |
-
*/
|
22 |
-
public function assignData($data)
|
23 |
-
{
|
24 |
-
if (!($data instanceof Varien_Object)) {
|
25 |
-
$data = new Varien_Object($data);
|
26 |
-
}
|
27 |
-
$info = $this->getInfoInstance();
|
28 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
29 |
-
|
30 |
-
$this->assignInfoData($info, $data);
|
31 |
-
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function initialize($paymentAction, $stateObject)
|
36 |
-
{
|
37 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
38 |
-
$payment = $this->getInfoInstance();
|
39 |
-
$order = $payment->getOrder();
|
40 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
41 |
-
|
42 |
-
|
43 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
44 |
-
{
|
45 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
46 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
47 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
48 |
-
$token = $card->getCcToken();
|
49 |
-
else
|
50 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
51 |
-
|
52 |
-
$payment->setAdditionalInformation('token',$token);
|
53 |
-
}
|
54 |
-
|
55 |
-
return $this;
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
61 |
-
{
|
62 |
-
return $ccTypeMagento;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Validate payment method information object
|
67 |
-
*
|
68 |
-
* @param Mage_Payment_Model_Info $info
|
69 |
-
* @return Mage_Payment_Model_Abstract
|
70 |
-
*/
|
71 |
-
public function validate()
|
72 |
-
{
|
73 |
-
/**
|
74 |
-
* to validate payment method is allowed for billing country or not
|
75 |
-
*/
|
76 |
-
$paymentInfo = $this->getInfoInstance();
|
77 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
78 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
79 |
-
} else {
|
80 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
81 |
-
}
|
82 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
83 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
84 |
-
}
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Przelewy24Api extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_przelewy24api';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
app/code/community/Allopass/Hipay/Model/Method/Santander.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Santander extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_santander';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpf';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/Santandercash.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_Santandercash extends Allopass_Hipay_Model_Method_Astropay
|
3 |
+
{
|
4 |
+
protected $_code = 'hipay_santandercash';
|
5 |
+
|
6 |
+
protected $_typeIdentification = 'cpn';
|
7 |
+
}
|
app/code/community/Allopass/Hipay/Model/Method/SisalApi.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_SisalApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_sisalapi';
|
5 |
|
@@ -8,83 +8,4 @@ class Allopass_Hipay_Model_Method_SisalApi extends Allopass_Hipay_Model_Method_C
|
|
8 |
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
11 |
-
|
12 |
-
|
13 |
-
public function getOrderPlaceRedirectUrl()
|
14 |
-
{
|
15 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
16 |
-
}
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Assign data to info model instance
|
21 |
-
*
|
22 |
-
* @param mixed $data
|
23 |
-
* @return Mage_Payment_Model_Info
|
24 |
-
*/
|
25 |
-
public function assignData($data)
|
26 |
-
{
|
27 |
-
if (!($data instanceof Varien_Object)) {
|
28 |
-
$data = new Varien_Object($data);
|
29 |
-
}
|
30 |
-
$info = $this->getInfoInstance();
|
31 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
32 |
-
|
33 |
-
$this->assignInfoData($info, $data);
|
34 |
-
|
35 |
-
return $this;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function initialize($paymentAction, $stateObject)
|
39 |
-
{
|
40 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
41 |
-
$payment = $this->getInfoInstance();
|
42 |
-
$order = $payment->getOrder();
|
43 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
44 |
-
|
45 |
-
|
46 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
47 |
-
{
|
48 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
49 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
50 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
51 |
-
$token = $card->getCcToken();
|
52 |
-
else
|
53 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
54 |
-
$payment->setAdditionalInformation('token',$token);
|
55 |
-
}
|
56 |
-
|
57 |
-
return $this;
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
63 |
-
{
|
64 |
-
return $ccTypeMagento;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Validate payment method information object
|
69 |
-
*
|
70 |
-
* @param Mage_Payment_Model_Info $info
|
71 |
-
* @return Mage_Payment_Model_Abstract
|
72 |
-
*/
|
73 |
-
public function validate()
|
74 |
-
{
|
75 |
-
/**
|
76 |
-
* to validate payment method is allowed for billing country or not
|
77 |
-
*/
|
78 |
-
$paymentInfo = $this->getInfoInstance();
|
79 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
80 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
81 |
-
} else {
|
82 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
83 |
-
}
|
84 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
85 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
86 |
-
}
|
87 |
-
return $this;
|
88 |
-
}
|
89 |
-
|
90 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_SisalApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_sisalapi';
|
5 |
|
8 |
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
app/code/community/Allopass/Hipay/Model/Method/SofortApi.php
CHANGED
@@ -1,87 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_SofortApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_sofortapi';
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
-
|
10 |
-
public function getOrderPlaceRedirectUrl()
|
11 |
-
{
|
12 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
13 |
-
}
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Assign data to info model instance
|
18 |
-
*
|
19 |
-
* @param mixed $data
|
20 |
-
* @return Mage_Payment_Model_Info
|
21 |
-
*/
|
22 |
-
public function assignData($data)
|
23 |
-
{
|
24 |
-
if (!($data instanceof Varien_Object)) {
|
25 |
-
$data = new Varien_Object($data);
|
26 |
-
}
|
27 |
-
$info = $this->getInfoInstance();
|
28 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
29 |
-
|
30 |
-
$this->assignInfoData($info, $data);
|
31 |
-
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function initialize($paymentAction, $stateObject)
|
36 |
-
{
|
37 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
38 |
-
$payment = $this->getInfoInstance();
|
39 |
-
$order = $payment->getOrder();
|
40 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
41 |
-
|
42 |
-
|
43 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
44 |
-
{
|
45 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
46 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
47 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
48 |
-
$token = $card->getCcToken();
|
49 |
-
else
|
50 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
51 |
-
$payment->setAdditionalInformation('token',$token);
|
52 |
-
}
|
53 |
-
|
54 |
-
return $this;
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
60 |
-
{
|
61 |
-
return $ccTypeMagento;
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Validate payment method information object
|
66 |
-
*
|
67 |
-
* @param Mage_Payment_Model_Info $info
|
68 |
-
* @return Mage_Payment_Model_Abstract
|
69 |
-
*/
|
70 |
-
public function validate()
|
71 |
-
{
|
72 |
-
/**
|
73 |
-
* to validate payment method is allowed for billing country or not
|
74 |
-
*/
|
75 |
-
$paymentInfo = $this->getInfoInstance();
|
76 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
77 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
78 |
-
} else {
|
79 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
80 |
-
}
|
81 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
82 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
83 |
-
}
|
84 |
-
return $this;
|
85 |
-
}
|
86 |
-
|
87 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_SofortApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_sofortapi';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
app/code/community/Allopass/Hipay/Model/Method/WebmoneyApi.php
CHANGED
@@ -1,90 +1,8 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_WebmoneyApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_webmoneyapi';
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
11 |
-
|
12 |
-
|
13 |
-
public function getOrderPlaceRedirectUrl()
|
14 |
-
{
|
15 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
16 |
-
}
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Assign data to info model instance
|
21 |
-
*
|
22 |
-
* @param mixed $data
|
23 |
-
* @return Mage_Payment_Model_Info
|
24 |
-
*/
|
25 |
-
public function assignData($data)
|
26 |
-
{
|
27 |
-
if (!($data instanceof Varien_Object)) {
|
28 |
-
$data = new Varien_Object($data);
|
29 |
-
}
|
30 |
-
$info = $this->getInfoInstance();
|
31 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
32 |
-
|
33 |
-
$this->assignInfoData($info, $data);
|
34 |
-
|
35 |
-
return $this;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function initialize($paymentAction, $stateObject)
|
39 |
-
{
|
40 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
41 |
-
$payment = $this->getInfoInstance();
|
42 |
-
$order = $payment->getOrder();
|
43 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
44 |
-
|
45 |
-
|
46 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
47 |
-
{
|
48 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
49 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
50 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
51 |
-
$token = $card->getCcToken();
|
52 |
-
else
|
53 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
54 |
-
$payment->setAdditionalInformation('token',$token);
|
55 |
-
}
|
56 |
-
|
57 |
-
return $this;
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
63 |
-
{
|
64 |
-
return $ccTypeMagento;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Validate payment method information object
|
69 |
-
*
|
70 |
-
* @param Mage_Payment_Model_Info $info
|
71 |
-
* @return Mage_Payment_Model_Abstract
|
72 |
-
*/
|
73 |
-
public function validate()
|
74 |
-
{
|
75 |
-
/**
|
76 |
-
* to validate payment method is allowed for billing country or not
|
77 |
-
*/
|
78 |
-
$paymentInfo = $this->getInfoInstance();
|
79 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
80 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
81 |
-
} else {
|
82 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
83 |
-
}
|
84 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
85 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
86 |
-
}
|
87 |
-
return $this;
|
88 |
-
}
|
89 |
-
|
90 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_WebmoneyApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_webmoneyapi';
|
5 |
+
|
|
|
|
|
|
|
6 |
protected $_canRefund = false;
|
7 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
app/code/community/Allopass/Hipay/Model/Method/YandexApi.php
CHANGED
@@ -1,90 +1,8 @@
|
|
1 |
<?php
|
2 |
-
class Allopass_Hipay_Model_Method_YandexApi extends
|
3 |
{
|
4 |
protected $_code = 'hipay_yandexapi';
|
5 |
-
|
6 |
-
protected $_formBlockType = 'hipay/form_hosted';
|
7 |
-
protected $_infoBlockType = 'hipay/info_hosted';
|
8 |
-
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
11 |
-
|
12 |
-
|
13 |
-
public function getOrderPlaceRedirectUrl()
|
14 |
-
{
|
15 |
-
return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
|
16 |
-
}
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Assign data to info model instance
|
21 |
-
*
|
22 |
-
* @param mixed $data
|
23 |
-
* @return Mage_Payment_Model_Info
|
24 |
-
*/
|
25 |
-
public function assignData($data)
|
26 |
-
{
|
27 |
-
if (!($data instanceof Varien_Object)) {
|
28 |
-
$data = new Varien_Object($data);
|
29 |
-
}
|
30 |
-
$info = $this->getInfoInstance();
|
31 |
-
$info->setCcType($this->getConfigData('cctypes'));
|
32 |
-
|
33 |
-
$this->assignInfoData($info, $data);
|
34 |
-
|
35 |
-
return $this;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function initialize($paymentAction, $stateObject)
|
39 |
-
{
|
40 |
-
/* @var $payment Mage_Sales_Model_Order_Payment */
|
41 |
-
$payment = $this->getInfoInstance();
|
42 |
-
$order = $payment->getOrder();
|
43 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
44 |
-
|
45 |
-
|
46 |
-
if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
|
47 |
-
{
|
48 |
-
$cardId = $payment->getAdditionalInformation('selected_oneclick_card');
|
49 |
-
$card = Mage::getModel('hipay/card')->load($cardId);
|
50 |
-
if($card->getId() && $card->getCustomerId() == $customer->getId())
|
51 |
-
$token = $card->getCcToken();
|
52 |
-
else
|
53 |
-
Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
|
54 |
-
$payment->setAdditionalInformation('token',$token);
|
55 |
-
}
|
56 |
-
|
57 |
-
return $this;
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
protected function getCcTypeHipay($ccTypeMagento)
|
63 |
-
{
|
64 |
-
return $ccTypeMagento;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Validate payment method information object
|
69 |
-
*
|
70 |
-
* @param Mage_Payment_Model_Info $info
|
71 |
-
* @return Mage_Payment_Model_Abstract
|
72 |
-
*/
|
73 |
-
public function validate()
|
74 |
-
{
|
75 |
-
/**
|
76 |
-
* to validate payment method is allowed for billing country or not
|
77 |
-
*/
|
78 |
-
$paymentInfo = $this->getInfoInstance();
|
79 |
-
if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
|
80 |
-
$billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
|
81 |
-
} else {
|
82 |
-
$billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
|
83 |
-
}
|
84 |
-
if (!$this->canUseForCountry($billingCountry)) {
|
85 |
-
Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
|
86 |
-
}
|
87 |
-
return $this;
|
88 |
-
}
|
89 |
-
|
90 |
}
|
1 |
<?php
|
2 |
+
class Allopass_Hipay_Model_Method_YandexApi extends Allopass_Hipay_Model_Method_AbstractOrder
|
3 |
{
|
4 |
protected $_code = 'hipay_yandexapi';
|
5 |
+
|
|
|
|
|
|
|
6 |
protected $_canRefund = false;
|
7 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
app/code/community/Allopass/Hipay/Model/Observer.php
CHANGED
@@ -36,6 +36,15 @@ class Allopass_Hipay_Model_Observer
|
|
36 |
->join(array('op' => 'sales/order_payment'), 'main_table.entity_id=op.parent_id', array('method'));
|
37 |
|
38 |
/* @var $order Mage_Sales_Model_Order */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
foreach ($collection as $order) {
|
40 |
if ($order->canCancel()) {
|
41 |
try {
|
@@ -46,33 +55,42 @@ class Allopass_Hipay_Model_Observer
|
|
46 |
$delayMinutes));
|
47 |
|
48 |
$order->save();
|
|
|
49 |
} catch (Exception $e) {
|
|
|
50 |
Mage::logException($e);
|
51 |
}
|
|
|
|
|
52 |
}
|
53 |
}
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
-
|
56 |
return $this;
|
57 |
}
|
58 |
-
|
59 |
public function manageOrdersInPendingCapture()
|
60 |
{
|
61 |
$methods = array('hipay_cc','hipay_hosted');
|
62 |
/* @var $collection Mage_Sales_Model_Resource_Order_Collection */
|
63 |
$collection = Mage::getResourceModel('sales/order_collection');
|
64 |
$collection->addFieldToFilter('status', 'pending_capture');
|
65 |
-
|
66 |
/* @var $order Mage_Sales_Model_Order */
|
67 |
foreach ($collection as $order) {
|
68 |
if (!in_array($order->getPayment()->getMethod(), $methods)) {
|
69 |
continue;
|
70 |
}
|
71 |
-
|
72 |
$orderDate = "";
|
73 |
}
|
74 |
}
|
75 |
-
|
76 |
public function displaySectionCheckoutIframe($observer)
|
77 |
{
|
78 |
$payment = Mage::getSingleton('checkout/session')->getQuote()->getPayment();
|
@@ -81,9 +99,9 @@ class Allopass_Hipay_Model_Observer
|
|
81 |
}
|
82 |
/* @var $controller Mage_Checkout_OnepageController */
|
83 |
$controller = $observer->getControllerAction();
|
84 |
-
|
85 |
$result = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
|
86 |
-
|
87 |
//TODO check if payment method is hosted and iframe active and is success
|
88 |
$methodInstance = $payment->getMethodInstance();
|
89 |
if ($result['success']
|
@@ -91,52 +109,81 @@ class Allopass_Hipay_Model_Observer
|
|
91 |
&& $methodInstance->getConfigData('display_iframe')) {
|
92 |
$result['iframeUrl'] = $result['redirect'];
|
93 |
}
|
94 |
-
|
95 |
$controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
96 |
-
|
97 |
return $this;
|
98 |
}
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
->addFieldToFilter('status', array('in'=>array(Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_PENDING,
|
107 |
-
Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_FAILED)))
|
108 |
-
->addFieldTofilter('date_to_pay', array('to' => $date->toString('Y-MM-dd 00:00:00')))
|
109 |
-
->addFieldTofilter('attempts', array('lteq' => 3));
|
110 |
-
|
111 |
-
|
112 |
foreach ($splitPayments as $splitPayment) {
|
|
|
113 |
try {
|
|
|
114 |
$splitPayment->pay();
|
|
|
115 |
} catch (Exception $e) {
|
|
|
116 |
$splitPayment->sendErrorEmail();
|
117 |
Mage::logException($e);
|
118 |
}
|
119 |
}
|
120 |
}
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
public function arrangeOrderView($observer)
|
123 |
{
|
124 |
/* @var $block Mage_Adminhtml_Block_Sales_Order_View|Mage_Adminhtml_Block_Sales_Transactions_Detail */
|
125 |
$block = $observer->getBlock();
|
126 |
-
|
127 |
/* @var $order Mage_Sales_Model_Order */
|
128 |
if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
|
129 |
$isAllowedAction = Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/review_payment');
|
130 |
if (!$isAllowedAction) {
|
131 |
return $this;
|
132 |
}
|
133 |
-
|
134 |
$order = $block->getOrder();
|
135 |
-
|
136 |
if (strpos($order->getPayment()->getMethod(), "hipay") === false) {
|
137 |
return $this;
|
138 |
}
|
139 |
-
|
140 |
if ($order->canReviewPayment()) {
|
141 |
$url = $block->getUrl("*/payment/reviewCapturePayment");
|
142 |
$message = Mage::helper('sales')->__('Are you sure you want to accept this payment?');
|
@@ -148,8 +195,8 @@ class Allopass_Hipay_Model_Observer
|
|
148 |
} elseif ($block instanceof Mage_Adminhtml_Block_Sales_Transactions_Detail) {
|
149 |
$txnId = $block->getTxnIdHtml();
|
150 |
$orderIncrementId = $block->getOrderIncrementIdHtml();
|
151 |
-
|
152 |
-
|
153 |
$order = Mage::getModel('sales/order')->loadByIncrementId(trim($orderIncrementId));
|
154 |
if ($order->getId() && strpos($order->getPayment()->getMethod(), 'hipay') !== false) {
|
155 |
$link = '<a href="https://merchant.hipay-tpp.com//transaction/detail/index/trxid/'.$txnId.'" target="_blank">'.$txnId.'</a>';
|
@@ -166,7 +213,7 @@ class Allopass_Hipay_Model_Observer
|
|
166 |
{
|
167 |
/* @var $order Mage_Sales_Model_Order */
|
168 |
$order = $observer->getOrder();
|
169 |
-
|
170 |
if ($order->getStatus() == Allopass_Hipay_Model_Method_Abstract::STATUS_CAPTURE_REQUESTED) {
|
171 |
$order->setForcedCanCreditmemo(false);
|
172 |
$order->setForcedCanCreditmemoFromHipay(true);
|
@@ -174,7 +221,7 @@ class Allopass_Hipay_Model_Observer
|
|
174 |
$order->setForcedCanCreditmemo(false);
|
175 |
$order->setForcedCanCreditmemoFromHipay(true);
|
176 |
} elseif ($order->getPayment() && strpos($order->getPayment()->getMethod(), 'hipay') !== false) {
|
177 |
-
|
178 |
//If configuration validate order with status 117 (capture requested) and Notification 118 (Captured) is not received
|
179 |
// we disallow refund
|
180 |
if (((int)$order->getPayment()->getMethodInstance()->getConfigData('hipay_status_validate_order') == 117) === true) {
|
@@ -187,7 +234,7 @@ class Allopass_Hipay_Model_Observer
|
|
187 |
// for old order
|
188 |
array('like'=>'%: 118 Message: %')
|
189 |
));
|
190 |
-
|
191 |
if ($histories->count() < 1) {
|
192 |
$order->setForcedCanCreditmemo(false);
|
193 |
$order->setForcedCanCreditmemoFromHipay(true);
|
@@ -195,7 +242,7 @@ class Allopass_Hipay_Model_Observer
|
|
195 |
}
|
196 |
}
|
197 |
}
|
198 |
-
|
199 |
/**
|
200 |
* Used to unset ForcedCanCreditmemo attributs from the order
|
201 |
* Without restore order status is set to "C"
|
@@ -205,15 +252,18 @@ class Allopass_Hipay_Model_Observer
|
|
205 |
{
|
206 |
/* @var $order Mage_Sales_Model_Order */
|
207 |
$order = $observer->getOrder();
|
208 |
-
|
209 |
if ($order->getForcedCanCreditmemoFromHipay()) {
|
210 |
$order->unsetData('forced_can_creditmemo');
|
211 |
$order->unsetData('forced_can_creditmemo_from_hipay');
|
212 |
}
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
217 |
}
|
218 |
}
|
219 |
}
|
36 |
->join(array('op' => 'sales/order_payment'), 'main_table.entity_id=op.parent_id', array('method'));
|
37 |
|
38 |
/* @var $order Mage_Sales_Model_Order */
|
39 |
+
|
40 |
+
if (count($collection) > 1) {
|
41 |
+
Mage::helper('hipay')->debugInternalProcessHipay('##########################################');
|
42 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Start process "cancelOrdersInPending"');
|
43 |
+
Mage::helper('hipay')->debugInternalProcessHipay(count($collection) . ' orders to cancel ');
|
44 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Method : ' . $key);
|
45 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Created at : ' . $date->subMinute($delayMinutes)->toString('Y-MM-dd HH:mm:ss'));
|
46 |
+
}
|
47 |
+
|
48 |
foreach ($collection as $order) {
|
49 |
if ($order->canCancel()) {
|
50 |
try {
|
55 |
$delayMinutes));
|
56 |
|
57 |
$order->save();
|
58 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Order is canceled :' . $order->getIncrementId() );
|
59 |
} catch (Exception $e) {
|
60 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Error in cancel process for order :' . $order->getIncrementId() .' ' .$e->getMessage() );
|
61 |
Mage::logException($e);
|
62 |
}
|
63 |
+
}else{
|
64 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Order is not cancelable for order : ' . $order->getIncrementId());
|
65 |
}
|
66 |
}
|
67 |
+
|
68 |
+
if (count($collection) > 1) {
|
69 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# End process "cancelOrdersInPending"');
|
70 |
+
Mage::helper('hipay')->debugInternalProcessHipay('##########################################');
|
71 |
+
}
|
72 |
}
|
73 |
+
|
74 |
return $this;
|
75 |
}
|
76 |
+
|
77 |
public function manageOrdersInPendingCapture()
|
78 |
{
|
79 |
$methods = array('hipay_cc','hipay_hosted');
|
80 |
/* @var $collection Mage_Sales_Model_Resource_Order_Collection */
|
81 |
$collection = Mage::getResourceModel('sales/order_collection');
|
82 |
$collection->addFieldToFilter('status', 'pending_capture');
|
83 |
+
|
84 |
/* @var $order Mage_Sales_Model_Order */
|
85 |
foreach ($collection as $order) {
|
86 |
if (!in_array($order->getPayment()->getMethod(), $methods)) {
|
87 |
continue;
|
88 |
}
|
89 |
+
|
90 |
$orderDate = "";
|
91 |
}
|
92 |
}
|
93 |
+
|
94 |
public function displaySectionCheckoutIframe($observer)
|
95 |
{
|
96 |
$payment = Mage::getSingleton('checkout/session')->getQuote()->getPayment();
|
99 |
}
|
100 |
/* @var $controller Mage_Checkout_OnepageController */
|
101 |
$controller = $observer->getControllerAction();
|
102 |
+
|
103 |
$result = Mage::helper('core')->jsonDecode($controller->getResponse()->getBody());
|
104 |
+
|
105 |
//TODO check if payment method is hosted and iframe active and is success
|
106 |
$methodInstance = $payment->getMethodInstance();
|
107 |
if ($result['success']
|
109 |
&& $methodInstance->getConfigData('display_iframe')) {
|
110 |
$result['iframeUrl'] = $result['redirect'];
|
111 |
}
|
112 |
+
|
113 |
$controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
114 |
+
|
115 |
return $this;
|
116 |
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Process Payment for collection of split payment
|
120 |
+
*
|
121 |
+
* @param Mage_Core_Model_Resource_Db_Collection_Abstract
|
122 |
+
*/
|
123 |
+
private function processSplitPayment($splitPayments){
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
foreach ($splitPayments as $splitPayment) {
|
125 |
+
$splitInfo = $splitPayment->getSplitNumber() . ' for order ' . $splitPayment->getOrderId() . ' with amount ' . $splitPayment->getAmountToPay();
|
126 |
try {
|
127 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Pay ' . $splitInfo );
|
128 |
$splitPayment->pay();
|
129 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Pay Success ' . $splitInfo );
|
130 |
} catch (Exception $e) {
|
131 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Pay Error with ' . $splitInfo . ' : ' . $e->getMessage());
|
132 |
$splitPayment->sendErrorEmail();
|
133 |
Mage::logException($e);
|
134 |
}
|
135 |
}
|
136 |
}
|
137 |
+
|
138 |
+
/*
|
139 |
+
* Check pending and failed payment and pay them
|
140 |
+
*
|
141 |
+
*/
|
142 |
+
public function paySplitPayments()
|
143 |
+
{
|
144 |
+
$date = new Zend_Date();
|
145 |
+
Mage::helper('hipay')->debugInternalProcessHipay('###################################');
|
146 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# Start process "paySplitPayments"');
|
147 |
+
|
148 |
+
$splitPaymentsFailed = Mage::getModel('hipay/splitPayment')->getCollection()
|
149 |
+
->addFieldToFilter('status', array('eq'=> Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_FAILED))
|
150 |
+
->addFieldTofilter('attempts', array('lteq' => 3));
|
151 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# ' . count($splitPaymentsFailed) . ' splits in failed to pay ');
|
152 |
+
$this->processSplitPayment($splitPaymentsFailed);
|
153 |
+
|
154 |
+
$splitPaymentsPending = Mage::getModel('hipay/splitPayment')->getCollection()
|
155 |
+
->addFieldToFilter('status', array('eq'=> Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_PENDING))
|
156 |
+
->addFieldTofilter('date_to_pay', array('to' => $date->toString('Y-MM-dd 00:00:00')))
|
157 |
+
->addFieldTofilter('attempts', array('lteq' => 3));
|
158 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# ' . count($splitPaymentsPending) . ' splits in pending to pay ');
|
159 |
+
$this->processSplitPayment($splitPaymentsPending);
|
160 |
+
|
161 |
+
Mage::helper('hipay')->debugInternalProcessHipay('# End process "paySplitPayments"');
|
162 |
+
Mage::helper('hipay')->debugInternalProcessHipay('###################################');
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* @param $observer
|
167 |
+
* @return $this
|
168 |
+
*/
|
169 |
public function arrangeOrderView($observer)
|
170 |
{
|
171 |
/* @var $block Mage_Adminhtml_Block_Sales_Order_View|Mage_Adminhtml_Block_Sales_Transactions_Detail */
|
172 |
$block = $observer->getBlock();
|
173 |
+
|
174 |
/* @var $order Mage_Sales_Model_Order */
|
175 |
if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
|
176 |
$isAllowedAction = Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/review_payment');
|
177 |
if (!$isAllowedAction) {
|
178 |
return $this;
|
179 |
}
|
180 |
+
|
181 |
$order = $block->getOrder();
|
182 |
+
|
183 |
if (strpos($order->getPayment()->getMethod(), "hipay") === false) {
|
184 |
return $this;
|
185 |
}
|
186 |
+
|
187 |
if ($order->canReviewPayment()) {
|
188 |
$url = $block->getUrl("*/payment/reviewCapturePayment");
|
189 |
$message = Mage::helper('sales')->__('Are you sure you want to accept this payment?');
|
195 |
} elseif ($block instanceof Mage_Adminhtml_Block_Sales_Transactions_Detail) {
|
196 |
$txnId = $block->getTxnIdHtml();
|
197 |
$orderIncrementId = $block->getOrderIncrementIdHtml();
|
198 |
+
|
199 |
+
|
200 |
$order = Mage::getModel('sales/order')->loadByIncrementId(trim($orderIncrementId));
|
201 |
if ($order->getId() && strpos($order->getPayment()->getMethod(), 'hipay') !== false) {
|
202 |
$link = '<a href="https://merchant.hipay-tpp.com//transaction/detail/index/trxid/'.$txnId.'" target="_blank">'.$txnId.'</a>';
|
213 |
{
|
214 |
/* @var $order Mage_Sales_Model_Order */
|
215 |
$order = $observer->getOrder();
|
216 |
+
|
217 |
if ($order->getStatus() == Allopass_Hipay_Model_Method_Abstract::STATUS_CAPTURE_REQUESTED) {
|
218 |
$order->setForcedCanCreditmemo(false);
|
219 |
$order->setForcedCanCreditmemoFromHipay(true);
|
221 |
$order->setForcedCanCreditmemo(false);
|
222 |
$order->setForcedCanCreditmemoFromHipay(true);
|
223 |
} elseif ($order->getPayment() && strpos($order->getPayment()->getMethod(), 'hipay') !== false) {
|
224 |
+
|
225 |
//If configuration validate order with status 117 (capture requested) and Notification 118 (Captured) is not received
|
226 |
// we disallow refund
|
227 |
if (((int)$order->getPayment()->getMethodInstance()->getConfigData('hipay_status_validate_order') == 117) === true) {
|
234 |
// for old order
|
235 |
array('like'=>'%: 118 Message: %')
|
236 |
));
|
237 |
+
|
238 |
if ($histories->count() < 1) {
|
239 |
$order->setForcedCanCreditmemo(false);
|
240 |
$order->setForcedCanCreditmemoFromHipay(true);
|
242 |
}
|
243 |
}
|
244 |
}
|
245 |
+
|
246 |
/**
|
247 |
* Used to unset ForcedCanCreditmemo attributs from the order
|
248 |
* Without restore order status is set to "C"
|
252 |
{
|
253 |
/* @var $order Mage_Sales_Model_Order */
|
254 |
$order = $observer->getOrder();
|
255 |
+
|
256 |
if ($order->getForcedCanCreditmemoFromHipay()) {
|
257 |
$order->unsetData('forced_can_creditmemo');
|
258 |
$order->unsetData('forced_can_creditmemo_from_hipay');
|
259 |
}
|
260 |
|
261 |
+
if ($order->getPayment()->getMethodInstance() &&
|
262 |
+
$order->getPayment()->getMethodInstance() instanceof Allopass_Hipay_Model_Method_Abstract ) {
|
263 |
+
// Cancel transaction in TPP if state is cancel
|
264 |
+
if ($order->getStatus() == Mage_Sales_Model_Order::STATE_CANCELED) {
|
265 |
+
$order->getPayment()->getMethodInstance()->cancelTransaction($order->getPayment());
|
266 |
+
}
|
267 |
}
|
268 |
}
|
269 |
}
|
app/code/community/Allopass/Hipay/Model/Source/Product/Facilipay3x.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Model_Source_Product_Facilipay3x
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @return array
|
7 |
+
*/
|
8 |
+
public function toOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
array('value' => '3xcb', 'label' => Mage::helper('hipay')->__('With fees')),
|
12 |
+
array('value' => '3xcb-no-fees', 'label' => Mage::helper('hipay')->__('Without fees')),
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Allopass/Hipay/Model/Source/Product/Facilipay4x.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Allopass_Hipay_Model_Source_Product_Facilipay4x
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @return array
|
7 |
+
*/
|
8 |
+
public function toOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
array('value' => '4xcb', 'label' => Mage::helper('hipay')->__('With fees')),
|
12 |
+
array('value' => '4xcb-no-fees', 'label' => Mage::helper('hipay')->__('Without fees')),
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Allopass/Hipay/Model/SplitPayment.php
CHANGED
@@ -1,46 +1,46 @@
|
|
1 |
<?php
|
2 |
class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
3 |
{
|
4 |
-
|
5 |
const SPLIT_PAYMENT_STATUS_PENDING = 'pending';
|
6 |
const SPLIT_PAYMENT_STATUS_FAILED = 'failed';
|
7 |
const SPLIT_PAYMENT_STATUS_COMPLETE = 'complete';
|
8 |
-
|
9 |
protected function _construct()
|
10 |
{
|
11 |
parent::_construct();
|
12 |
$this->_init('hipay/splitPayment');
|
13 |
$this->setIdFieldName('split_payment_id');
|
14 |
}
|
15 |
-
|
16 |
-
|
17 |
static function getStatues()
|
18 |
{
|
19 |
$statues = array(self::SPLIT_PAYMENT_STATUS_PENDING=>Mage::helper('sales')->__('Pending'),
|
20 |
self::SPLIT_PAYMENT_STATUS_FAILED=>Mage::helper('sales')->__('Failed'),
|
21 |
self::SPLIT_PAYMENT_STATUS_COMPLETE=>Mage::helper('sales')->__('Complete')
|
22 |
);
|
23 |
-
|
24 |
return $statues;
|
25 |
}
|
26 |
-
|
27 |
/**
|
28 |
-
*
|
29 |
* @return boolean|string
|
30 |
*/
|
31 |
public function pay()
|
32 |
{
|
33 |
-
|
34 |
if(!$this->canPay())
|
35 |
Mage::throwException("This split payment is already paid!");
|
36 |
-
|
37 |
if(!$this->getId())
|
38 |
{
|
39 |
Mage::throwException("Split Payment not found!");
|
40 |
}
|
41 |
-
|
42 |
try {
|
43 |
-
|
44 |
$state = $this->getMethodInstance()->paySplitPayment($this);
|
45 |
switch ($state)
|
46 |
{
|
@@ -55,11 +55,11 @@ class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
|
55 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_FAILED);
|
56 |
$this->sendErrorEmail();
|
57 |
break;
|
58 |
-
|
59 |
}
|
60 |
-
|
61 |
} catch (Exception $e) {
|
62 |
-
|
63 |
if($e->getMessage() != 'Code: 3010004. Message: This order has already been paid'){
|
64 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_FAILED);
|
65 |
$this->setAttempts($this->getAttempts() + 1);
|
@@ -69,15 +69,15 @@ class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
|
69 |
else{ //Order is already paid, so we set complete status
|
70 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_COMPLETE);
|
71 |
}
|
72 |
-
|
73 |
}
|
74 |
-
|
75 |
$this->setAttempts($this->getAttempts() + 1);
|
76 |
$this->save();
|
77 |
return $this;
|
78 |
-
|
79 |
}
|
80 |
-
|
81 |
public function sendErrorEmail()
|
82 |
{
|
83 |
/* @var $helperCheckout Mage_Checkout_Helper_Data */
|
@@ -86,7 +86,7 @@ class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
|
86 |
$message = Mage::helper('hipay')->__("Error on request split Payment HIPAY. Split Payment Id: ".$this->getSplitPaymentId());
|
87 |
$helperCheckout->sendPaymentFailedEmail($order, $message,'Split Payment Hipay');
|
88 |
}
|
89 |
-
|
90 |
/**
|
91 |
* @return Allopass_Hipay_Model_Method_Abstract
|
92 |
*/
|
@@ -100,12 +100,12 @@ class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
|
100 |
}
|
101 |
return Mage::getSingleton($moduleName . "/method_" . $methodClass );
|
102 |
}
|
103 |
-
|
104 |
public function canPay()
|
105 |
{
|
106 |
return $this->getStatus() == self::SPLIT_PAYMENT_STATUS_FAILED || $this->getStatus() == self::SPLIT_PAYMENT_STATUS_PENDING;
|
107 |
}
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
}
|
1 |
<?php
|
2 |
class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
|
3 |
{
|
4 |
+
|
5 |
const SPLIT_PAYMENT_STATUS_PENDING = 'pending';
|
6 |
const SPLIT_PAYMENT_STATUS_FAILED = 'failed';
|
7 |
const SPLIT_PAYMENT_STATUS_COMPLETE = 'complete';
|
8 |
+
|
9 |
protected function _construct()
|
10 |
{
|
11 |
parent::_construct();
|
12 |
$this->_init('hipay/splitPayment');
|
13 |
$this->setIdFieldName('split_payment_id');
|
14 |
}
|
15 |
+
|
16 |
+
|
17 |
static function getStatues()
|
18 |
{
|
19 |
$statues = array(self::SPLIT_PAYMENT_STATUS_PENDING=>Mage::helper('sales')->__('Pending'),
|
20 |
self::SPLIT_PAYMENT_STATUS_FAILED=>Mage::helper('sales')->__('Failed'),
|
21 |
self::SPLIT_PAYMENT_STATUS_COMPLETE=>Mage::helper('sales')->__('Complete')
|
22 |
);
|
23 |
+
|
24 |
return $statues;
|
25 |
}
|
26 |
+
|
27 |
/**
|
28 |
+
*
|
29 |
* @return boolean|string
|
30 |
*/
|
31 |
public function pay()
|
32 |
{
|
33 |
+
|
34 |
if(!$this->canPay())
|
35 |
Mage::throwException("This split payment is already paid!");
|
36 |
+
|
37 |
if(!$this->getId())
|
38 |
{
|
39 |
Mage::throwException("Split Payment not found!");
|
40 |
}
|
41 |
+
|
42 |
try {
|
43 |
+
|
44 |
$state = $this->getMethodInstance()->paySplitPayment($this);
|
45 |
switch ($state)
|
46 |
{
|
55 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_FAILED);
|
56 |
$this->sendErrorEmail();
|
57 |
break;
|
58 |
+
|
59 |
}
|
60 |
+
|
61 |
} catch (Exception $e) {
|
62 |
+
|
63 |
if($e->getMessage() != 'Code: 3010004. Message: This order has already been paid'){
|
64 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_FAILED);
|
65 |
$this->setAttempts($this->getAttempts() + 1);
|
69 |
else{ //Order is already paid, so we set complete status
|
70 |
$this->setStatus(self::SPLIT_PAYMENT_STATUS_COMPLETE);
|
71 |
}
|
72 |
+
|
73 |
}
|
74 |
+
|
75 |
$this->setAttempts($this->getAttempts() + 1);
|
76 |
$this->save();
|
77 |
return $this;
|
78 |
+
|
79 |
}
|
80 |
+
|
81 |
public function sendErrorEmail()
|
82 |
{
|
83 |
/* @var $helperCheckout Mage_Checkout_Helper_Data */
|
86 |
$message = Mage::helper('hipay')->__("Error on request split Payment HIPAY. Split Payment Id: ".$this->getSplitPaymentId());
|
87 |
$helperCheckout->sendPaymentFailedEmail($order, $message,'Split Payment Hipay');
|
88 |
}
|
89 |
+
|
90 |
/**
|
91 |
* @return Allopass_Hipay_Model_Method_Abstract
|
92 |
*/
|
100 |
}
|
101 |
return Mage::getSingleton($moduleName . "/method_" . $methodClass );
|
102 |
}
|
103 |
+
|
104 |
public function canPay()
|
105 |
{
|
106 |
return $this->getStatus() == self::SPLIT_PAYMENT_STATUS_FAILED || $this->getStatus() == self::SPLIT_PAYMENT_STATUS_PENDING;
|
107 |
}
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
}
|
app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentController.php
CHANGED
@@ -7,18 +7,6 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
7 |
*/
|
8 |
protected $_order = null;
|
9 |
|
10 |
-
|
11 |
-
/**
|
12 |
-
*
|
13 |
-
* @return Allopass_Hipay_Model_Method_Abstract $methodInstance
|
14 |
-
*/
|
15 |
-
protected function _getMethodInstance()
|
16 |
-
{
|
17 |
-
$modelName = Mage::getStoreConfig('payment/'.$this->getCheckout()->getMethod()."/model");
|
18 |
-
return Mage::getSingleton($modelName);
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
public function reviewCapturePaymentAction()
|
23 |
{
|
24 |
/* @var $order Mage_Sales_Model_Order */
|
@@ -35,9 +23,8 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
35 |
Mage::register('current_order', $order);
|
36 |
|
37 |
try {
|
38 |
-
|
39 |
$order->getPayment()->accept();
|
40 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,Allopass_Hipay_Model_Method_Cc::STATUS_PENDING_CAPTURE);
|
41 |
$message = $this->__('The payment has been accepted.');
|
42 |
$order->save();
|
43 |
$this->_getSession()->addSuccess($message);
|
@@ -73,7 +60,6 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
73 |
|
74 |
$message = $this->__('You must reload the page to see new status.');
|
75 |
$this->_getSession()->addSuccess($message);
|
76 |
-
|
77 |
} catch (Mage_Core_Exception $e) {
|
78 |
$this->_getSession()->addError($e->getMessage());
|
79 |
} catch (Exception $e) {
|
@@ -90,12 +76,9 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
90 |
|
91 |
$methodInstance = $this->_getMethodInstance();
|
92 |
|
93 |
-
try
|
94 |
-
|
95 |
-
|
96 |
-
}
|
97 |
-
catch (Exception $e)
|
98 |
-
{
|
99 |
Mage::logException($e);
|
100 |
$this->_getSession()->addError($e->getMessage());
|
101 |
$this->_redirect('adminhtml/sales_order/index');
|
@@ -104,7 +87,7 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
104 |
|
105 |
// Send Mail to customer with payment information
|
106 |
$url = $payment ->getAdditionalInformation('redirectUrl');
|
107 |
-
if($url && (strpos($order->getPayment()->getMethod(),'hipay_hosted') !== false)){
|
108 |
$receiver = Mage::getModel('customer/customer')->load($payment->getOrder()->getCustomerId());
|
109 |
Mage::helper('hipay')->sendLinkPaymentEmail($receiver, $payment->getOrder());
|
110 |
}
|
@@ -112,24 +95,85 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
112 |
$this->_redirectUrl($redirectUrl);
|
113 |
|
114 |
return $this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
public function acceptAction()
|
120 |
{
|
121 |
-
if(($profileIds = Mage::getSingleton('checkout/session')->getLastRecurringProfileIds()))
|
122 |
-
|
123 |
-
if(is_array($profileIds))
|
124 |
-
{
|
125 |
/* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
|
126 |
-
$gatewayResponse = Mage::getSingleton('hipay/api_response_gateway'
|
127 |
$collection = Mage::getModel('sales/recurring_profile')->getCollection()
|
128 |
->addFieldToFilter('profile_id', array('in' => $profileIds))
|
129 |
;
|
130 |
$profiles = array();
|
131 |
foreach ($collection as $profile) {
|
132 |
-
|
133 |
$additionalInfo = array();
|
134 |
$additionalInfo['ccType'] = $gatewayResponse->getBrand();
|
135 |
$additionalInfo['ccExpMonth'] = $gatewayResponse->getCardExpiryMonth() ;
|
@@ -157,6 +201,17 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
157 |
return $this;
|
158 |
}
|
159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
public function pendingAction()
|
161 |
{
|
162 |
$this->processResponse();
|
@@ -173,7 +228,6 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
173 |
return $this;
|
174 |
}
|
175 |
|
176 |
-
|
177 |
public function exceptionAction()
|
178 |
{
|
179 |
//$this->_redirect('checkout/onepage/failure');
|
@@ -181,7 +235,6 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
181 |
return $this;
|
182 |
}
|
183 |
|
184 |
-
|
185 |
public function cancelAction()
|
186 |
{
|
187 |
$this->processResponse();
|
@@ -190,111 +243,38 @@ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controll
|
|
190 |
return $this;
|
191 |
}
|
192 |
|
193 |
-
protected function processResponse()
|
194 |
-
{
|
195 |
-
$order = $this->getOrder();
|
196 |
-
$payment = $order->getPayment();
|
197 |
-
|
198 |
-
/* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
|
199 |
-
$gatewayResponse = Mage::getSingleton('hipay/api_response_gateway',$this->getRequest()->getParams());
|
200 |
-
|
201 |
-
$this->_getMethodInstance()->processResponseToRedirect($gatewayResponse, $payment, $order->getBaseTotalDue());
|
202 |
-
}
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
/**
|
207 |
-
*
|
208 |
-
* @return Mage_Sales_Model_Order
|
209 |
-
*/
|
210 |
-
protected function getOrder()
|
211 |
-
{
|
212 |
-
if(is_null($this->_order))
|
213 |
-
{
|
214 |
-
|
215 |
-
if(($profileIds = $this->getCheckout()->getLastRecurringProfileIds()))
|
216 |
-
{
|
217 |
-
|
218 |
-
if (is_array($profileIds)) {
|
219 |
-
|
220 |
-
foreach ($profileIds as $profileId)
|
221 |
-
{
|
222 |
-
/* @var $profile Mage_Sales_Model_Recurring_Profile */
|
223 |
-
$profile = Mage::getModel('sales/recurring_profile')->load($profileId);
|
224 |
-
/* @var $_helperRecurring Allopass_Hipayrecurring_Helper_Data */
|
225 |
-
$_helperRecurring = Mage::helper('hipayrecurring');
|
226 |
-
|
227 |
-
if($_helperRecurring->isInitialProfileOrder($profile))
|
228 |
-
$this->_order = $_helperRecurring->createOrderFromProfile($profile);
|
229 |
-
else
|
230 |
-
{
|
231 |
-
$orderId = current($profile->getChildOrderIds());
|
232 |
-
$this->_order = Mage::getModel('sales/order')->load($orderId);
|
233 |
-
|
234 |
-
$additionalInfo = $profile->getAdditionalInfo();
|
235 |
-
|
236 |
-
$this->_order->getPayment()->setCcType(isset($additionalInfo['ccType']) ? $additionalInfo['ccType'] : "");
|
237 |
-
$this->_order->getPayment()->setCcExpMonth(isset($additionalInfo['ccExpMonth']) ? $additionalInfo['ccExpMonth'] : "");
|
238 |
-
$this->_order->getPayment()->setCcExpYear(isset($additionalInfo['ccExpYear']) ? $additionalInfo['ccExpYear'] : "");
|
239 |
-
$this->_order->getPayment()->setAdditionalInformation('token',isset($additionalInfo['token']) ? $additionalInfo['token'] : "");
|
240 |
-
$this->_order->getPayment()->setAdditionalInformation('create_oneclick',isset($additionalInfo['create_oneclick']) ? $additionalInfo['create_oneclick'] : 1);
|
241 |
-
$this->_order->getPayment()->setAdditionalInformation('use_oneclick',isset($additionalInfo['use_oneclick']) ? $additionalInfo['use_oneclick'] : 0);
|
242 |
-
$this->_order->getPayment()->setAdditionalInformation('selected_oneclick_card',isset($additionalInfo['selected_oneclick_card']) ? $additionalInfo['selected_oneclick_card'] : 0);
|
243 |
-
}
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
|
248 |
-
}
|
249 |
-
|
250 |
-
|
251 |
-
}
|
252 |
-
|
253 |
-
Mage::throwException("An error occured. Profile Ids not present!");
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
}
|
258 |
-
else
|
259 |
-
{
|
260 |
-
$this->_order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
|
261 |
-
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
return $this->_order;
|
266 |
-
}
|
267 |
-
|
268 |
/**
|
269 |
* Add method to calculate amount from recurring profile
|
270 |
* @param Mage_Sales_Model_Recurring_Profile $profile
|
271 |
* @return int $amount
|
272 |
**/
|
273 |
-
public function getAmountFromProfile(Mage_Sales_Model_Recurring_Profile $profile)
|
|
|
274 |
$amount = $profile->getBillingAmount() + $profile->getTaxAmount() + $profile->getShippingAmount();
|
275 |
|
276 |
-
if($this->isInitialProfileOrder($profile))
|
277 |
$amount += $profile->getInitAmount() ;
|
|
|
278 |
|
279 |
return $amount;
|
280 |
}
|
281 |
|
282 |
protected function isInitialProfileOrder(Mage_Sales_Model_Recurring_Profile $profile)
|
283 |
{
|
284 |
-
if(count($profile->getChildOrderIds()) && current($profile->getChildOrderIds()) == "-1")
|
285 |
return true;
|
|
|
286 |
|
287 |
return false;
|
288 |
}
|
289 |
|
290 |
-
|
291 |
/**
|
|
|
292 |
*
|
293 |
-
* @return
|
294 |
*/
|
295 |
-
protected function
|
296 |
{
|
297 |
-
return Mage::getSingleton('
|
298 |
}
|
299 |
-
|
300 |
-
}
|
7 |
*/
|
8 |
protected $_order = null;
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
public function reviewCapturePaymentAction()
|
11 |
{
|
12 |
/* @var $order Mage_Sales_Model_Order */
|
23 |
Mage::register('current_order', $order);
|
24 |
|
25 |
try {
|
|
|
26 |
$order->getPayment()->accept();
|
27 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Allopass_Hipay_Model_Method_Cc::STATUS_PENDING_CAPTURE);
|
28 |
$message = $this->__('The payment has been accepted.');
|
29 |
$order->save();
|
30 |
$this->_getSession()->addSuccess($message);
|
60 |
|
61 |
$message = $this->__('You must reload the page to see new status.');
|
62 |
$this->_getSession()->addSuccess($message);
|
|
|
63 |
} catch (Mage_Core_Exception $e) {
|
64 |
$this->_getSession()->addError($e->getMessage());
|
65 |
} catch (Exception $e) {
|
76 |
|
77 |
$methodInstance = $this->_getMethodInstance();
|
78 |
|
79 |
+
try {
|
80 |
+
$redirectUrl = $methodInstance->place($payment, $order->getBaseTotalDue());
|
81 |
+
} catch (Exception $e) {
|
|
|
|
|
|
|
82 |
Mage::logException($e);
|
83 |
$this->_getSession()->addError($e->getMessage());
|
84 |
$this->_redirect('adminhtml/sales_order/index');
|
87 |
|
88 |
// Send Mail to customer with payment information
|
89 |
$url = $payment ->getAdditionalInformation('redirectUrl');
|
90 |
+
if ($url && (strpos($order->getPayment()->getMethod(), 'hipay_hosted') !== false)) {
|
91 |
$receiver = Mage::getModel('customer/customer')->load($payment->getOrder()->getCustomerId());
|
92 |
Mage::helper('hipay')->sendLinkPaymentEmail($receiver, $payment->getOrder());
|
93 |
}
|
95 |
$this->_redirectUrl($redirectUrl);
|
96 |
|
97 |
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
*
|
102 |
+
* @return Mage_Sales_Model_Order
|
103 |
+
*/
|
104 |
+
protected function getOrder()
|
105 |
+
{
|
106 |
+
if (is_null($this->_order)) {
|
107 |
+
if (($profileIds = $this->getCheckout()->getLastRecurringProfileIds())) {
|
108 |
+
if (is_array($profileIds)) {
|
109 |
+
foreach ($profileIds as $profileId) {
|
110 |
+
/* @var $profile Mage_Sales_Model_Recurring_Profile */
|
111 |
+
$profile = Mage::getModel('sales/recurring_profile')->load($profileId);
|
112 |
+
/* @var $_helperRecurring Allopass_Hipayrecurring_Helper_Data */
|
113 |
+
$_helperRecurring = Mage::helper('hipayrecurring');
|
114 |
+
|
115 |
+
if ($_helperRecurring->isInitialProfileOrder($profile)) {
|
116 |
+
$this->_order = $_helperRecurring->createOrderFromProfile($profile);
|
117 |
+
} else {
|
118 |
+
$orderId = current($profile->getChildOrderIds());
|
119 |
+
$this->_order = Mage::getModel('sales/order')->load($orderId);
|
120 |
+
|
121 |
+
$additionalInfo = $profile->getAdditionalInfo();
|
122 |
+
|
123 |
+
$this->_order->getPayment()->setCcType(isset($additionalInfo['ccType']) ? $additionalInfo['ccType'] : "");
|
124 |
+
$this->_order->getPayment()->setCcExpMonth(isset($additionalInfo['ccExpMonth']) ? $additionalInfo['ccExpMonth'] : "");
|
125 |
+
$this->_order->getPayment()->setCcExpYear(isset($additionalInfo['ccExpYear']) ? $additionalInfo['ccExpYear'] : "");
|
126 |
+
$this->_order->getPayment()->setAdditionalInformation('token', isset($additionalInfo['token']) ? $additionalInfo['token'] : "");
|
127 |
+
$this->_order->getPayment()->setAdditionalInformation('create_oneclick', isset($additionalInfo['create_oneclick']) ? $additionalInfo['create_oneclick'] : 1);
|
128 |
+
$this->_order->getPayment()->setAdditionalInformation('use_oneclick', isset($additionalInfo['use_oneclick']) ? $additionalInfo['use_oneclick'] : 0);
|
129 |
+
$this->_order->getPayment()->setAdditionalInformation('selected_oneclick_card', isset($additionalInfo['selected_oneclick_card']) ? $additionalInfo['selected_oneclick_card'] : 0);
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
|
134 |
+
return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
Mage::throwException("An error occured. Profile Ids not present!");
|
139 |
+
} else {
|
140 |
+
$this->_order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
return $this->_order;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
*
|
149 |
+
* @return Mage_Checkout_Model_Session
|
150 |
+
*/
|
151 |
+
protected function getCheckout()
|
152 |
+
{
|
153 |
+
return Mage::getSingleton('checkout/session');
|
154 |
}
|
155 |
|
156 |
+
/**
|
157 |
+
*
|
158 |
+
* @return Allopass_Hipay_Model_Method_Abstract $methodInstance
|
159 |
+
*/
|
160 |
+
protected function _getMethodInstance()
|
161 |
+
{
|
162 |
+
$modelName = Mage::getStoreConfig('payment/'.$this->getCheckout()->getMethod()."/model");
|
163 |
+
return Mage::getSingleton($modelName);
|
164 |
+
}
|
165 |
|
166 |
public function acceptAction()
|
167 |
{
|
168 |
+
if (($profileIds = Mage::getSingleton('checkout/session')->getLastRecurringProfileIds())) {
|
169 |
+
if (is_array($profileIds)) {
|
|
|
|
|
170 |
/* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
|
171 |
+
$gatewayResponse = Mage::getSingleton('hipay/api_response_gateway', $this->getRequest()->getParams());
|
172 |
$collection = Mage::getModel('sales/recurring_profile')->getCollection()
|
173 |
->addFieldToFilter('profile_id', array('in' => $profileIds))
|
174 |
;
|
175 |
$profiles = array();
|
176 |
foreach ($collection as $profile) {
|
|
|
177 |
$additionalInfo = array();
|
178 |
$additionalInfo['ccType'] = $gatewayResponse->getBrand();
|
179 |
$additionalInfo['ccExpMonth'] = $gatewayResponse->getCardExpiryMonth() ;
|
201 |
return $this;
|
202 |
}
|
203 |
|
204 |
+
protected function processResponse()
|
205 |
+
{
|
206 |
+
$order = $this->getOrder();
|
207 |
+
$payment = $order->getPayment();
|
208 |
+
|
209 |
+
/* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
|
210 |
+
$gatewayResponse = Mage::getSingleton('hipay/api_response_gateway', $this->getRequest()->getParams());
|
211 |
+
|
212 |
+
$this->_getMethodInstance()->processResponseToRedirect($gatewayResponse, $payment, $order->getBaseTotalDue());
|
213 |
+
}
|
214 |
+
|
215 |
public function pendingAction()
|
216 |
{
|
217 |
$this->processResponse();
|
228 |
return $this;
|
229 |
}
|
230 |
|
|
|
231 |
public function exceptionAction()
|
232 |
{
|
233 |
//$this->_redirect('checkout/onepage/failure');
|
235 |
return $this;
|
236 |
}
|
237 |
|
|
|
238 |
public function cancelAction()
|
239 |
{
|
240 |
$this->processResponse();
|
243 |
return $this;
|
244 |
}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
/**
|
247 |
* Add method to calculate amount from recurring profile
|
248 |
* @param Mage_Sales_Model_Recurring_Profile $profile
|
249 |
* @return int $amount
|
250 |
**/
|
251 |
+
public function getAmountFromProfile(Mage_Sales_Model_Recurring_Profile $profile)
|
252 |
+
{
|
253 |
$amount = $profile->getBillingAmount() + $profile->getTaxAmount() + $profile->getShippingAmount();
|
254 |
|
255 |
+
if ($this->isInitialProfileOrder($profile)) {
|
256 |
$amount += $profile->getInitAmount() ;
|
257 |
+
}
|
258 |
|
259 |
return $amount;
|
260 |
}
|
261 |
|
262 |
protected function isInitialProfileOrder(Mage_Sales_Model_Recurring_Profile $profile)
|
263 |
{
|
264 |
+
if (count($profile->getChildOrderIds()) && current($profile->getChildOrderIds()) == "-1") {
|
265 |
return true;
|
266 |
+
}
|
267 |
|
268 |
return false;
|
269 |
}
|
270 |
|
|
|
271 |
/**
|
272 |
+
* Check if user is allowed to use this controller
|
273 |
*
|
274 |
+
* @return boolean
|
275 |
*/
|
276 |
+
protected function _isAllowed()
|
277 |
{
|
278 |
+
return Mage::getSingleton('admin/session')->isAllowed('sales/order');
|
279 |
}
|
280 |
+
}
|
|
app/code/community/Allopass/Hipay/controllers/AuraController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_AuraController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_aura');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/BanamexController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_BanamexController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_banamex');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/BancoController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_BancoController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_banco');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/BbvaController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_BbvaController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_bbva');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/BoletoController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_BoletoController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_boleto');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/BradescoController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_BradescoController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_bradesco');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/CaixaController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_CaixaController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_caixa');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/DiscoverController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_DiscoverController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_boleto');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/Facilipay3xController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Facilipay3xController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_facilipay3x');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/Facilipay4xController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_Facilipay4xController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_facilipay4x');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/ItauController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_ItauController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_itau');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/OxxoController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_OxxoController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_oxxo');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/SantanderCashController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_SantanderCashController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_santandercash');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/controllers/SantanderController.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Allopass_Hipay_SantanderController extends Allopass_Hipay_Controller_Payment
|
3 |
+
{
|
4 |
+
protected function _getMethodInstance()
|
5 |
+
{
|
6 |
+
return Mage::getSingleton('hipay/method_santander');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Allopass/Hipay/etc/config.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Allopass_Hipay>
|
4 |
-
<version>1.
|
5 |
</Allopass_Hipay>
|
6 |
</modules>
|
7 |
<global>
|
@@ -385,7 +385,7 @@
|
|
385 |
<payment>
|
386 |
<hipay_cc>
|
387 |
<active>0</active>
|
388 |
-
<title>Credit Card</title>
|
389 |
<payment_action>authorize_capture</payment_action>
|
390 |
<cctypes>VI,MC,AE,SDD</cctypes>
|
391 |
<display_card_owner>0</display_card_owner>
|
@@ -413,7 +413,7 @@
|
|
413 |
</hipay_cc>
|
414 |
<hipay_ccxtimes>
|
415 |
<active>0</active>
|
416 |
-
<title>Credit Card Split Payment</title>
|
417 |
<payment_action>authorize_capture</payment_action>
|
418 |
<cctypes>VI,MC,AE</cctypes>
|
419 |
<display_card_owner>0</display_card_owner>
|
@@ -441,7 +441,7 @@
|
|
441 |
</hipay_ccxtimes>
|
442 |
<hipay_hosted>
|
443 |
<active>0</active>
|
444 |
-
<title>Credit Card</title>
|
445 |
<payment_action>authorize_capture</payment_action>
|
446 |
<cctypes>american-express,visa,mastercard</cctypes>
|
447 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
@@ -474,7 +474,7 @@
|
|
474 |
</hipay_hosted>
|
475 |
<hipay_hostedxtimes>
|
476 |
<active>0</active>
|
477 |
-
<title>Credit Card Split Payment</title>
|
478 |
<payment_action>authorize_capture</payment_action>
|
479 |
<cctypes>american-express,visa,mastercard</cctypes>
|
480 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
@@ -507,7 +507,7 @@
|
|
507 |
</hipay_hostedxtimes>
|
508 |
<hipay_sofortapi>
|
509 |
<active>0</active> <!-- Activé ou non -->
|
510 |
-
<title>HiPay Sofort</title> <!-- Titre par défaut modifiable en admin -->
|
511 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
512 |
<cctypes>sofort-uberweisung</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
513 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -535,7 +535,7 @@
|
|
535 |
</hipay_sofortapi>
|
536 |
<hipay_ideal>
|
537 |
<active>0</active> <!-- Activé ou non -->
|
538 |
-
<title>HiPay iDeal</title> <!-- Titre par défaut modifiable en admin -->
|
539 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
540 |
<cctypes>ideal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
541 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -595,7 +595,7 @@
|
|
595 |
</hipay_ing>
|
596 |
<hipay_dexia>
|
597 |
<active>0</active> <!-- Activé ou non -->
|
598 |
-
<title>HiPay Belfius / Dexia Direct Net</title> <!-- Titre par défaut modifiable en admin -->
|
599 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
600 |
<cctypes>dexia-directnet</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
601 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -683,7 +683,7 @@
|
|
683 |
<!-- </hipay_kbc> -->
|
684 |
<hipay_giropay>
|
685 |
<active>0</active> <!-- Activé ou non -->
|
686 |
-
<title>HiPay Giropay</title> <!-- Titre par défaut modifiable en admin -->
|
687 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
688 |
<cctypes>giropay</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
689 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -713,7 +713,7 @@
|
|
713 |
</hipay_giropay>
|
714 |
<hipay_przelewy24api>
|
715 |
<active>0</active> <!-- Activé ou non -->
|
716 |
-
<title>HiPay Przelewy24</title> <!-- Titre par défaut modifiable en admin -->
|
717 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
718 |
<cctypes>przelewy24</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
719 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -743,7 +743,7 @@
|
|
743 |
</hipay_przelewy24api>
|
744 |
<hipay_sisalapi>
|
745 |
<active>0</active> <!-- Activé ou non -->
|
746 |
-
<title>HiPay Sisal</title> <!-- Titre par défaut modifiable en admin -->
|
747 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
748 |
<cctypes>sisal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
749 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -771,7 +771,7 @@
|
|
771 |
</hipay_sisalapi>
|
772 |
<hipay_qiwi>
|
773 |
<active>0</active> <!-- Activé ou non -->
|
774 |
-
<title>HiPay Visa Qiwi Wallet</title> <!-- Titre par défaut modifiable en admin -->
|
775 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
776 |
<cctypes>qiwi-wallet</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
777 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -801,7 +801,7 @@
|
|
801 |
</hipay_qiwi>
|
802 |
<hipay_webmoneyapi>
|
803 |
<active>0</active> <!-- Activé ou non -->
|
804 |
-
<title>HiPay WebMoney Transfer</title> <!-- Titre par défaut modifiable en admin -->
|
805 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
806 |
<cctypes>webmoney-transfer</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
807 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -831,7 +831,7 @@
|
|
831 |
</hipay_webmoneyapi>
|
832 |
<hipay_yandexapi>
|
833 |
<active>0</active> <!-- Activé ou non -->
|
834 |
-
<title>HiPay Yandex.Money</title> <!-- Titre par défaut modifiable en admin -->
|
835 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
836 |
<cctypes>yandex</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
837 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -861,7 +861,7 @@
|
|
861 |
</hipay_yandexapi>
|
862 |
<hipay_paypalapi>
|
863 |
<active>0</active> <!-- Activé ou non -->
|
864 |
-
<title>HiPay PayPal</title> <!-- Titre par défaut modifiable en admin -->
|
865 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
866 |
<cctypes>paypal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
867 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -889,7 +889,7 @@
|
|
889 |
</hipay_paypalapi>
|
890 |
<hipay_sdd>
|
891 |
<active>0</active>
|
892 |
-
<title>HiPay SEPA Direct Debit</title>
|
893 |
<payment_action>authorize_capture</payment_action>
|
894 |
<cctypes>SDD</cctypes>
|
895 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
@@ -914,9 +914,9 @@
|
|
914 |
<electronic_signature>1</electronic_signature>
|
915 |
<send_fraud_payment_email>0</send_fraud_payment_email>
|
916 |
</hipay_sdd>
|
917 |
-
|
918 |
<active>0</active> <!-- Activé ou non -->
|
919 |
-
<title>HiPay PostFinance Card</title> <!-- Titre par défaut modifiable en admin -->
|
920 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
921 |
<cctypes>postfinance-card</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
922 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -944,7 +944,7 @@
|
|
944 |
</hipay_postfinancecardapi>
|
945 |
<hipay_postfinanceefinanceapi>
|
946 |
<active>0</active> <!-- Activé ou non -->
|
947 |
-
<title>HiPay PostFinance E-Finance</title> <!-- Titre par défaut modifiable en admin -->
|
948 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
949 |
<cctypes>postfinance-efinance</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
950 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
@@ -972,7 +972,7 @@
|
|
972 |
</hipay_postfinanceefinanceapi>
|
973 |
<hipay_klarna>
|
974 |
<active>0</active>
|
975 |
-
<title>Klarna invoice</title>
|
976 |
<payment_action>authorize_capture</payment_action>
|
977 |
<cctypes>klarnainvoice</cctypes>
|
978 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
@@ -1001,6 +1001,477 @@
|
|
1001 |
<specificcountry>DE</specificcountry>
|
1002 |
<currency>EUR</currency>
|
1003 |
</hipay_klarna>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1004 |
</payment>
|
1005 |
</default>
|
1006 |
<crontab>
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Allopass_Hipay>
|
4 |
+
<version>1.7.0</version>
|
5 |
</Allopass_Hipay>
|
6 |
</modules>
|
7 |
<global>
|
385 |
<payment>
|
386 |
<hipay_cc>
|
387 |
<active>0</active>
|
388 |
+
<title>HiPay Enterprise Credit Card</title>
|
389 |
<payment_action>authorize_capture</payment_action>
|
390 |
<cctypes>VI,MC,AE,SDD</cctypes>
|
391 |
<display_card_owner>0</display_card_owner>
|
413 |
</hipay_cc>
|
414 |
<hipay_ccxtimes>
|
415 |
<active>0</active>
|
416 |
+
<title>HiPay Enterprise Credit Card Split Payment</title>
|
417 |
<payment_action>authorize_capture</payment_action>
|
418 |
<cctypes>VI,MC,AE</cctypes>
|
419 |
<display_card_owner>0</display_card_owner>
|
441 |
</hipay_ccxtimes>
|
442 |
<hipay_hosted>
|
443 |
<active>0</active>
|
444 |
+
<title>HiPay Enterprise Credit Card</title>
|
445 |
<payment_action>authorize_capture</payment_action>
|
446 |
<cctypes>american-express,visa,mastercard</cctypes>
|
447 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
474 |
</hipay_hosted>
|
475 |
<hipay_hostedxtimes>
|
476 |
<active>0</active>
|
477 |
+
<title>HiPay Enterprise Credit Card Split Payment</title>
|
478 |
<payment_action>authorize_capture</payment_action>
|
479 |
<cctypes>american-express,visa,mastercard</cctypes>
|
480 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
507 |
</hipay_hostedxtimes>
|
508 |
<hipay_sofortapi>
|
509 |
<active>0</active> <!-- Activé ou non -->
|
510 |
+
<title>HiPay Enterprise Sofort</title> <!-- Titre par défaut modifiable en admin -->
|
511 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
512 |
<cctypes>sofort-uberweisung</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
513 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
535 |
</hipay_sofortapi>
|
536 |
<hipay_ideal>
|
537 |
<active>0</active> <!-- Activé ou non -->
|
538 |
+
<title>HiPay Enterprise iDeal</title> <!-- Titre par défaut modifiable en admin -->
|
539 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
540 |
<cctypes>ideal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
541 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
595 |
</hipay_ing>
|
596 |
<hipay_dexia>
|
597 |
<active>0</active> <!-- Activé ou non -->
|
598 |
+
<title>HiPay Enterprise Belfius / Dexia Direct Net</title> <!-- Titre par défaut modifiable en admin -->
|
599 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
600 |
<cctypes>dexia-directnet</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
601 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
683 |
<!-- </hipay_kbc> -->
|
684 |
<hipay_giropay>
|
685 |
<active>0</active> <!-- Activé ou non -->
|
686 |
+
<title>HiPay Enterprise Giropay</title> <!-- Titre par défaut modifiable en admin -->
|
687 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
688 |
<cctypes>giropay</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
689 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
713 |
</hipay_giropay>
|
714 |
<hipay_przelewy24api>
|
715 |
<active>0</active> <!-- Activé ou non -->
|
716 |
+
<title>HiPay Enterprise Przelewy24</title> <!-- Titre par défaut modifiable en admin -->
|
717 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
718 |
<cctypes>przelewy24</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
719 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
743 |
</hipay_przelewy24api>
|
744 |
<hipay_sisalapi>
|
745 |
<active>0</active> <!-- Activé ou non -->
|
746 |
+
<title>HiPay Enterprise Sisal</title> <!-- Titre par défaut modifiable en admin -->
|
747 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
748 |
<cctypes>sisal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
749 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
771 |
</hipay_sisalapi>
|
772 |
<hipay_qiwi>
|
773 |
<active>0</active> <!-- Activé ou non -->
|
774 |
+
<title>HiPay Enterprise Visa Qiwi Wallet</title> <!-- Titre par défaut modifiable en admin -->
|
775 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
776 |
<cctypes>qiwi-wallet</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
777 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
801 |
</hipay_qiwi>
|
802 |
<hipay_webmoneyapi>
|
803 |
<active>0</active> <!-- Activé ou non -->
|
804 |
+
<title>HiPay Enterprise WebMoney Transfer</title> <!-- Titre par défaut modifiable en admin -->
|
805 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
806 |
<cctypes>webmoney-transfer</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
807 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
831 |
</hipay_webmoneyapi>
|
832 |
<hipay_yandexapi>
|
833 |
<active>0</active> <!-- Activé ou non -->
|
834 |
+
<title>HiPay Enterprise Yandex.Money</title> <!-- Titre par défaut modifiable en admin -->
|
835 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
836 |
<cctypes>yandex</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
837 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
861 |
</hipay_yandexapi>
|
862 |
<hipay_paypalapi>
|
863 |
<active>0</active> <!-- Activé ou non -->
|
864 |
+
<title>HiPay Enterprise PayPal</title> <!-- Titre par défaut modifiable en admin -->
|
865 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
866 |
<cctypes>paypal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
867 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
889 |
</hipay_paypalapi>
|
890 |
<hipay_sdd>
|
891 |
<active>0</active>
|
892 |
+
<title>HiPay Enterprise SEPA Direct Debit</title>
|
893 |
<payment_action>authorize_capture</payment_action>
|
894 |
<cctypes>SDD</cctypes>
|
895 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
914 |
<electronic_signature>1</electronic_signature>
|
915 |
<send_fraud_payment_email>0</send_fraud_payment_email>
|
916 |
</hipay_sdd>
|
917 |
+
<hipay_postfinancecardapi>
|
918 |
<active>0</active> <!-- Activé ou non -->
|
919 |
+
<title>HiPay Enterprise PostFinance Card</title> <!-- Titre par défaut modifiable en admin -->
|
920 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
921 |
<cctypes>postfinance-card</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
922 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
944 |
</hipay_postfinancecardapi>
|
945 |
<hipay_postfinanceefinanceapi>
|
946 |
<active>0</active> <!-- Activé ou non -->
|
947 |
+
<title>HiPay Enterprise PostFinance E-Finance</title> <!-- Titre par défaut modifiable en admin -->
|
948 |
<payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
|
949 |
<cctypes>postfinance-efinance</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
|
950 |
<!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
|
972 |
</hipay_postfinanceefinanceapi>
|
973 |
<hipay_klarna>
|
974 |
<active>0</active>
|
975 |
+
<title>HiPay Enterprise Klarna invoice</title>
|
976 |
<payment_action>authorize_capture</payment_action>
|
977 |
<cctypes>klarnainvoice</cctypes>
|
978 |
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1001 |
<specificcountry>DE</specificcountry>
|
1002 |
<currency>EUR</currency>
|
1003 |
</hipay_klarna>
|
1004 |
+
<hipay_boleto>
|
1005 |
+
<active>0</active>
|
1006 |
+
<title>HiPay Enterprise Boleto bancario</title>
|
1007 |
+
<payment_action>authorize_capture</payment_action>
|
1008 |
+
<cctypes>boleto-bancario</cctypes>
|
1009 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1010 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1011 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1012 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1013 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1014 |
+
<display_selector>1</display_selector>
|
1015 |
+
<template>basic</template>
|
1016 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1017 |
+
<invoice_create>1</invoice_create>
|
1018 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1019 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1020 |
+
<display_iframe>0</display_iframe>
|
1021 |
+
<iframe_width>485px</iframe_width>
|
1022 |
+
<iframe_height>450px</iframe_height>
|
1023 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1024 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1025 |
+
<is_test_mode>0</is_test_mode>
|
1026 |
+
<debug>0</debug>
|
1027 |
+
<model>hipay/method_boleto</model>
|
1028 |
+
<accept_url>hipay/boleto/accept</accept_url>
|
1029 |
+
<pending_url>hipay/boleto/pending</pending_url>
|
1030 |
+
<decline_url>hipay/boleto/decline</decline_url>
|
1031 |
+
<exception_url>hipay/boleto/exception</exception_url>
|
1032 |
+
<cancel_url>hipay/boleto/cancel</cancel_url>
|
1033 |
+
<use_3d_secure>1</use_3d_secure>
|
1034 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1035 |
+
<allowspecific>1</allowspecific>
|
1036 |
+
<specificcountry>BR</specificcountry>
|
1037 |
+
<currency>BRL</currency>
|
1038 |
+
</hipay_boleto>
|
1039 |
+
<hipay_itau>
|
1040 |
+
<active>0</active>
|
1041 |
+
<title>HiPay Enterprise Itau</title>
|
1042 |
+
<payment_action>authorize_capture</payment_action>
|
1043 |
+
<cctypes>itau</cctypes>
|
1044 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1045 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1046 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1047 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1048 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1049 |
+
<display_selector>1</display_selector>
|
1050 |
+
<template>basic</template>
|
1051 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1052 |
+
<invoice_create>1</invoice_create>
|
1053 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1054 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1055 |
+
<display_iframe>0</display_iframe>
|
1056 |
+
<iframe_width>485px</iframe_width>
|
1057 |
+
<iframe_height>450px</iframe_height>
|
1058 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1059 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1060 |
+
<is_test_mode>0</is_test_mode>
|
1061 |
+
<debug>0</debug>
|
1062 |
+
<model>hipay/method_itau</model>
|
1063 |
+
<accept_url>hipay/itau/accept</accept_url>
|
1064 |
+
<pending_url>hipay/itau/pending</pending_url>
|
1065 |
+
<decline_url>hipay/itau/decline</decline_url>
|
1066 |
+
<exception_url>hipay/itau/exception</exception_url>
|
1067 |
+
<cancel_url>hipay/itau/cancel</cancel_url>
|
1068 |
+
<use_3d_secure>1</use_3d_secure>
|
1069 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1070 |
+
<allowspecific>1</allowspecific>
|
1071 |
+
<specificcountry>BR</specificcountry>
|
1072 |
+
<currency>BRL</currency>
|
1073 |
+
</hipay_itau>
|
1074 |
+
<hipay_bradesco>
|
1075 |
+
<active>0</active>
|
1076 |
+
<title>HiPay Enterprise Bradesco</title>
|
1077 |
+
<payment_action>authorize_capture</payment_action>
|
1078 |
+
<cctypes>bradesco</cctypes>
|
1079 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1080 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1081 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1082 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1083 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1084 |
+
<display_selector>1</display_selector>
|
1085 |
+
<template>basic</template>
|
1086 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1087 |
+
<invoice_create>1</invoice_create>
|
1088 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1089 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1090 |
+
<display_iframe>0</display_iframe>
|
1091 |
+
<iframe_width>485px</iframe_width>
|
1092 |
+
<iframe_height>450px</iframe_height>
|
1093 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1094 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1095 |
+
<is_test_mode>0</is_test_mode>
|
1096 |
+
<debug>0</debug>
|
1097 |
+
<model>hipay/method_bradesco</model>
|
1098 |
+
<accept_url>hipay/bradesco/accept</accept_url>
|
1099 |
+
<pending_url>hipay/bradesco/pending</pending_url>
|
1100 |
+
<decline_url>hipay/bradesco/decline</decline_url>
|
1101 |
+
<exception_url>hipay/bradesco/exception</exception_url>
|
1102 |
+
<cancel_url>hipay/bradesco/cancel</cancel_url>
|
1103 |
+
<use_3d_secure>1</use_3d_secure>
|
1104 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1105 |
+
<allowspecific>1</allowspecific>
|
1106 |
+
<specificcountry>BR</specificcountry>
|
1107 |
+
<currency>BRL</currency>
|
1108 |
+
</hipay_bradesco>
|
1109 |
+
<hipay_banco>
|
1110 |
+
<active>0</active>
|
1111 |
+
<title>HiPay Enterprise Banco do brazil</title>
|
1112 |
+
<payment_action>authorize_capture</payment_action>
|
1113 |
+
<cctypes>banco-do-brasil</cctypes>
|
1114 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1115 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1116 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1117 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1118 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1119 |
+
<display_selector>1</display_selector>
|
1120 |
+
<template>basic</template>
|
1121 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1122 |
+
<invoice_create>1</invoice_create>
|
1123 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1124 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1125 |
+
<display_iframe>0</display_iframe>
|
1126 |
+
<iframe_width>485px</iframe_width>
|
1127 |
+
<iframe_height>450px</iframe_height>
|
1128 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1129 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1130 |
+
<is_test_mode>0</is_test_mode>
|
1131 |
+
<debug>0</debug>
|
1132 |
+
<model>hipay/method_banco</model>
|
1133 |
+
<accept_url>hipay/banco/accept</accept_url>
|
1134 |
+
<pending_url>hipay/banco/pending</pending_url>
|
1135 |
+
<decline_url>hipay/banco/decline</decline_url>
|
1136 |
+
<exception_url>hipay/banco/exception</exception_url>
|
1137 |
+
<cancel_url>hipay/banco/cancel</cancel_url>
|
1138 |
+
<use_3d_secure>1</use_3d_secure>
|
1139 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1140 |
+
<allowspecific>1</allowspecific>
|
1141 |
+
<specificcountry>BR</specificcountry>
|
1142 |
+
<currency>BRL</currency>
|
1143 |
+
</hipay_banco>
|
1144 |
+
<hipay_santander>
|
1145 |
+
<active>0</active>
|
1146 |
+
<title>HiPay Enterprise Santander HomeBanking</title>
|
1147 |
+
<payment_action>authorize_capture</payment_action>
|
1148 |
+
<cctypes>santander-home-banking</cctypes>
|
1149 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1150 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1151 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1152 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1153 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1154 |
+
<display_selector>1</display_selector>
|
1155 |
+
<template>basic</template>
|
1156 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1157 |
+
<invoice_create>1</invoice_create>
|
1158 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1159 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1160 |
+
<display_iframe>0</display_iframe>
|
1161 |
+
<iframe_width>485px</iframe_width>
|
1162 |
+
<iframe_height>450px</iframe_height>
|
1163 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1164 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1165 |
+
<is_test_mode>0</is_test_mode>
|
1166 |
+
<debug>0</debug>
|
1167 |
+
<model>hipay/method_santander</model>
|
1168 |
+
<accept_url>hipay/santander/accept</accept_url>
|
1169 |
+
<pending_url>hipay/santander/pending</pending_url>
|
1170 |
+
<decline_url>hipay/santander/decline</decline_url>
|
1171 |
+
<exception_url>hipay/santander/exception</exception_url>
|
1172 |
+
<cancel_url>hipay/santander/cancel</cancel_url>
|
1173 |
+
<use_3d_secure>1</use_3d_secure>
|
1174 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1175 |
+
<allowspecific>1</allowspecific>
|
1176 |
+
<specificcountry>BR</specificcountry>
|
1177 |
+
<currency>BRL</currency>
|
1178 |
+
</hipay_santander>
|
1179 |
+
<hipay_aura>
|
1180 |
+
<active>0</active>
|
1181 |
+
<title>HiPay Enterprise Aura</title>
|
1182 |
+
<payment_action>authorize_capture</payment_action>
|
1183 |
+
<cctypes>aura</cctypes>
|
1184 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1185 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1186 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1187 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1188 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1189 |
+
<display_selector>1</display_selector>
|
1190 |
+
<template>basic</template>
|
1191 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1192 |
+
<invoice_create>1</invoice_create>
|
1193 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1194 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1195 |
+
<display_iframe>0</display_iframe>
|
1196 |
+
<iframe_width>485px</iframe_width>
|
1197 |
+
<iframe_height>450px</iframe_height>
|
1198 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1199 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1200 |
+
<is_test_mode>0</is_test_mode>
|
1201 |
+
<debug>0</debug>
|
1202 |
+
<model>hipay/method_aura</model>
|
1203 |
+
<accept_url>hipay/aura/accept</accept_url>
|
1204 |
+
<pending_url>hipay/aura/pending</pending_url>
|
1205 |
+
<decline_url>hipay/aura/decline</decline_url>
|
1206 |
+
<exception_url>hipay/aura/exception</exception_url>
|
1207 |
+
<cancel_url>hipay/aura/cancel</cancel_url>
|
1208 |
+
<use_3d_secure>1</use_3d_secure>
|
1209 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1210 |
+
<allowspecific>1</allowspecific>
|
1211 |
+
<specificcountry>BR</specificcountry>
|
1212 |
+
<currency>BRL</currency>
|
1213 |
+
</hipay_aura>
|
1214 |
+
<hipay_caixa>
|
1215 |
+
<active>0</active>
|
1216 |
+
<title>HiPay Enterprise Caixa</title>
|
1217 |
+
<payment_action>authorize_capture</payment_action>
|
1218 |
+
<cctypes>caixa</cctypes>
|
1219 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1220 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1221 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1222 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1223 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1224 |
+
<display_selector>1</display_selector>
|
1225 |
+
<template>basic</template>
|
1226 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1227 |
+
<invoice_create>1</invoice_create>
|
1228 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1229 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1230 |
+
<display_iframe>0</display_iframe>
|
1231 |
+
<iframe_width>485px</iframe_width>
|
1232 |
+
<iframe_height>450px</iframe_height>
|
1233 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1234 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1235 |
+
<is_test_mode>0</is_test_mode>
|
1236 |
+
<debug>0</debug>
|
1237 |
+
<model>hipay/method_caixa</model>
|
1238 |
+
<accept_url>hipay/caixa/accept</accept_url>
|
1239 |
+
<pending_url>hipay/caixa/pending</pending_url>
|
1240 |
+
<decline_url>hipay/caixa/decline</decline_url>
|
1241 |
+
<exception_url>hipay/caixa/exception</exception_url>
|
1242 |
+
<cancel_url>hipay/caixa/cancel</cancel_url>
|
1243 |
+
<use_3d_secure>1</use_3d_secure>
|
1244 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1245 |
+
<allowspecific>1</allowspecific>
|
1246 |
+
<specificcountry>BR</specificcountry>
|
1247 |
+
<currency>BRL</currency>
|
1248 |
+
</hipay_caixa>
|
1249 |
+
<!--<hipay_discover>
|
1250 |
+
<active>0</active>
|
1251 |
+
<title>Discover</title>
|
1252 |
+
<payment_action>authorize_capture</payment_action>
|
1253 |
+
<cctypes>discover</cctypes>
|
1254 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1255 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1256 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1257 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1258 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1259 |
+
<display_selector>1</display_selector>
|
1260 |
+
<template>basic</template>
|
1261 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1262 |
+
<invoice_create>1</invoice_create>
|
1263 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1264 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1265 |
+
<display_iframe>0</display_iframe>
|
1266 |
+
<iframe_width>485px</iframe_width>
|
1267 |
+
<iframe_height>450px</iframe_height>
|
1268 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1269 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1270 |
+
<is_test_mode>0</is_test_mode>
|
1271 |
+
<debug>0</debug>
|
1272 |
+
<model>hipay/method_discover</model>
|
1273 |
+
<accept_url>hipay/discover/accept</accept_url>
|
1274 |
+
<pending_url>hipay/discover/pending</pending_url>
|
1275 |
+
<decline_url>hipay/discover/decline</decline_url>
|
1276 |
+
<exception_url>hipay/discover/exception</exception_url>
|
1277 |
+
<cancel_url>hipay/discover/cancel</cancel_url>
|
1278 |
+
<use_3d_secure>1</use_3d_secure>
|
1279 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1280 |
+
</hipay_discover>-->
|
1281 |
+
<hipay_oxxo>
|
1282 |
+
<active>0</active>
|
1283 |
+
<title>HiPay Enterprise Oxxo</title>
|
1284 |
+
<payment_action>authorize_capture</payment_action>
|
1285 |
+
<cctypes>oxxo</cctypes>
|
1286 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1287 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1288 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1289 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1290 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1291 |
+
<display_selector>1</display_selector>
|
1292 |
+
<template>basic</template>
|
1293 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1294 |
+
<invoice_create>1</invoice_create>
|
1295 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1296 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1297 |
+
<display_iframe>0</display_iframe>
|
1298 |
+
<iframe_width>485px</iframe_width>
|
1299 |
+
<iframe_height>450px</iframe_height>
|
1300 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1301 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1302 |
+
<is_test_mode>0</is_test_mode>
|
1303 |
+
<debug>0</debug>
|
1304 |
+
<model>hipay/method_oxxo</model>
|
1305 |
+
<accept_url>hipay/oxxo/accept</accept_url>
|
1306 |
+
<pending_url>hipay/oxxo/pending</pending_url>
|
1307 |
+
<decline_url>hipay/oxxo/decline</decline_url>
|
1308 |
+
<exception_url>hipay/oxxo/exception</exception_url>
|
1309 |
+
<cancel_url>hipay/oxxo/cancel</cancel_url>
|
1310 |
+
<use_3d_secure>1</use_3d_secure>
|
1311 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1312 |
+
<allowspecific>1</allowspecific>
|
1313 |
+
<specificcountry>MX</specificcountry>
|
1314 |
+
<currency>MXN</currency>
|
1315 |
+
</hipay_oxxo>
|
1316 |
+
<hipay_bbva>
|
1317 |
+
<active>0</active>
|
1318 |
+
<title>HiPay Enterprise BBVA Bancomer</title>
|
1319 |
+
<payment_action>authorize_capture</payment_action>
|
1320 |
+
<cctypes>bbva-bancomer</cctypes>
|
1321 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1322 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1323 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1324 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1325 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1326 |
+
<display_selector>1</display_selector>
|
1327 |
+
<template>basic</template>
|
1328 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1329 |
+
<invoice_create>1</invoice_create>
|
1330 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1331 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1332 |
+
<display_iframe>0</display_iframe>
|
1333 |
+
<iframe_width>485px</iframe_width>
|
1334 |
+
<iframe_height>450px</iframe_height>
|
1335 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1336 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1337 |
+
<is_test_mode>0</is_test_mode>
|
1338 |
+
<debug>0</debug>
|
1339 |
+
<model>hipay/method_bbva</model>
|
1340 |
+
<accept_url>hipay/bbva/accept</accept_url>
|
1341 |
+
<pending_url>hipay/bbva/pending</pending_url>
|
1342 |
+
<decline_url>hipay/bbva/decline</decline_url>
|
1343 |
+
<exception_url>hipay/bbva/exception</exception_url>
|
1344 |
+
<cancel_url>hipay/bbva/cancel</cancel_url>
|
1345 |
+
<use_3d_secure>1</use_3d_secure>
|
1346 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1347 |
+
<allowspecific>1</allowspecific>
|
1348 |
+
<specificcountry>MX</specificcountry>
|
1349 |
+
<currency>MXN</currency>
|
1350 |
+
</hipay_bbva>
|
1351 |
+
<hipay_banamex>
|
1352 |
+
<active>0</active>
|
1353 |
+
<title>HiPay Enterprise Banamex</title>
|
1354 |
+
<payment_action>authorize_capture</payment_action>
|
1355 |
+
<cctypes>banamex</cctypes>
|
1356 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1357 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1358 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1359 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1360 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1361 |
+
<display_selector>1</display_selector>
|
1362 |
+
<template>basic</template>
|
1363 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1364 |
+
<invoice_create>1</invoice_create>
|
1365 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1366 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1367 |
+
<display_iframe>0</display_iframe>
|
1368 |
+
<iframe_width>485px</iframe_width>
|
1369 |
+
<iframe_height>450px</iframe_height>
|
1370 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1371 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1372 |
+
<is_test_mode>0</is_test_mode>
|
1373 |
+
<debug>0</debug>
|
1374 |
+
<model>hipay/method_banamex</model>
|
1375 |
+
<accept_url>hipay/banamex/accept</accept_url>
|
1376 |
+
<pending_url>hipay/banamex/pending</pending_url>
|
1377 |
+
<decline_url>hipay/banamex/decline</decline_url>
|
1378 |
+
<exception_url>hipay/banamex/exception</exception_url>
|
1379 |
+
<cancel_url>hipay/banamex/cancel</cancel_url>
|
1380 |
+
<use_3d_secure>1</use_3d_secure>
|
1381 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1382 |
+
<allowspecific>1</allowspecific>
|
1383 |
+
<specificcountry>MX</specificcountry>
|
1384 |
+
<currency>MXN</currency>
|
1385 |
+
</hipay_banamex>
|
1386 |
+
<hipay_santandercash>
|
1387 |
+
<active>0</active>
|
1388 |
+
<title>HiPay Enterprise Santader cash</title>
|
1389 |
+
<payment_action>authorize_capture</payment_action>
|
1390 |
+
<cctypes>santader-cash</cctypes>
|
1391 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1392 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1393 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1394 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1395 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1396 |
+
<display_selector>1</display_selector>
|
1397 |
+
<template>basic</template>
|
1398 |
+
<allow_use_oneclick>0</allow_use_oneclick>
|
1399 |
+
<invoice_create>1</invoice_create>
|
1400 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1401 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1402 |
+
<display_iframe>0</display_iframe>
|
1403 |
+
<iframe_width>485px</iframe_width>
|
1404 |
+
<iframe_height>450px</iframe_height>
|
1405 |
+
<iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
|
1406 |
+
<iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
|
1407 |
+
<is_test_mode>0</is_test_mode>
|
1408 |
+
<debug>0</debug>
|
1409 |
+
<model>hipay/method_santandercash</model>
|
1410 |
+
<accept_url>hipay/santadercash/accept</accept_url>
|
1411 |
+
<pending_url>hipay/santadercash/pending</pending_url>
|
1412 |
+
<decline_url>hipay/santadercash/decline</decline_url>
|
1413 |
+
<exception_url>hipay/santadercash/exception</exception_url>
|
1414 |
+
<cancel_url>hipay/santadercash/cancel</cancel_url>
|
1415 |
+
<use_3d_secure>1</use_3d_secure>
|
1416 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1417 |
+
<allowspecific>1</allowspecific>
|
1418 |
+
<specificcountry>MX</specificcountry>
|
1419 |
+
<currency>MXN</currency>
|
1420 |
+
</hipay_santandercash>
|
1421 |
+
<hipay_facilipay3x>
|
1422 |
+
<active>0</active>
|
1423 |
+
<title>HiPay Enterprise Oney Facily pay 3X</title>
|
1424 |
+
<payment_action>authorize_capture</payment_action>
|
1425 |
+
<cctypes>3xcb</cctypes>
|
1426 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1427 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1428 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1429 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1430 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1431 |
+
<invoice_create>1</invoice_create>
|
1432 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1433 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1434 |
+
<is_test_mode>0</is_test_mode>
|
1435 |
+
<debug>0</debug>
|
1436 |
+
<model>hipay/method_facilipay3x</model>
|
1437 |
+
<accept_url>hipay/facilipay3x/accept</accept_url>
|
1438 |
+
<pending_url>hipay/facilipay3x/pending</pending_url>
|
1439 |
+
<decline_url>hipay/facilipay3x/decline</decline_url>
|
1440 |
+
<exception_url>hipay/facilipay3x/exception</exception_url>
|
1441 |
+
<cancel_url>hipay/facilipay3x/cancel</cancel_url>
|
1442 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1443 |
+
<allowspecific>1</allowspecific>
|
1444 |
+
<specificcountry>FR</specificcountry>
|
1445 |
+
<currency>EUR</currency>
|
1446 |
+
<min_order_total>100</min_order_total>
|
1447 |
+
</hipay_facilipay3x>
|
1448 |
+
<hipay_facilipay4x>
|
1449 |
+
<active>0</active>
|
1450 |
+
<title>HiPay Enterprise Oney Facily Pay 4X</title>
|
1451 |
+
<payment_action>authorize_capture</payment_action>
|
1452 |
+
<cctypes>4xcb</cctypes>
|
1453 |
+
<order_status_payment_accepted>processing</order_status_payment_accepted>
|
1454 |
+
<order_status_payment_refused>canceled</order_status_payment_refused>
|
1455 |
+
<order_status_payment_canceled>canceled</order_status_payment_canceled>
|
1456 |
+
<hipay_status_validate_order>118</hipay_status_validate_order>
|
1457 |
+
<pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
|
1458 |
+
<invoice_create>1</invoice_create>
|
1459 |
+
<re_add_to_cart>0</re_add_to_cart>
|
1460 |
+
<cancel_pending_order>1</cancel_pending_order>
|
1461 |
+
<is_test_mode>0</is_test_mode>
|
1462 |
+
<debug>0</debug>
|
1463 |
+
<model>hipay/method_facilipay4x</model>
|
1464 |
+
<accept_url>hipay/facilipay4x/accept</accept_url>
|
1465 |
+
<pending_url>hipay/facilipay4x/pending</pending_url>
|
1466 |
+
<decline_url>hipay/facilipay4x/decline</decline_url>
|
1467 |
+
<exception_url>hipay/facilipay4x/exception</exception_url>
|
1468 |
+
<cancel_url>hipay/facilipay4x/cancel</cancel_url>
|
1469 |
+
<send_fraud_payment_email>0</send_fraud_payment_email>
|
1470 |
+
<allowspecific>1</allowspecific>
|
1471 |
+
<specificcountry>FR</specificcountry>
|
1472 |
+
<currency>EUR</currency>
|
1473 |
+
<min_order_total>100</min_order_total>
|
1474 |
+
</hipay_facilipay4x>
|
1475 |
</payment>
|
1476 |
</default>
|
1477 |
<crontab>
|
app/code/community/Allopass/Hipay/etc/system.xml
CHANGED
@@ -156,11 +156,21 @@
|
|
156 |
<label>Device fingerprint</label>
|
157 |
<frontend_type>select</frontend_type>
|
158 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
159 |
-
<sort_order>
|
160 |
<show_in_default>1</show_in_default>
|
161 |
<show_in_website>1</show_in_website>
|
162 |
<show_in_store>1</show_in_store>
|
163 |
</fingerprint>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
</fields>
|
165 |
</hipay_api>
|
166 |
<hipay_api_moto>
|
@@ -256,7 +266,7 @@
|
|
256 |
</fields>
|
257 |
</hipay_api_moto>
|
258 |
<hipay_basket>
|
259 |
-
<label>
|
260 |
<frontend_type>text</frontend_type>
|
261 |
<comment></comment>
|
262 |
<sort_order>12</sort_order>
|
@@ -265,9 +275,9 @@
|
|
265 |
<show_in_store>1</show_in_store>
|
266 |
<fields>
|
267 |
<activate_basket translate="label comment">
|
268 |
-
<label>
|
269 |
<frontend_type>select</frontend_type>
|
270 |
-
<comment>
|
271 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
272 |
<sort_order>110</sort_order>
|
273 |
<show_in_default>1</show_in_default>
|
@@ -294,6 +304,80 @@
|
|
294 |
<show_in_website>1</show_in_website>
|
295 |
<show_in_store>1</show_in_store>
|
296 |
</load_product_ean>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
</fields>
|
298 |
</hipay_basket>
|
299 |
<fraud_payment translate="label">
|
@@ -445,7 +529,7 @@
|
|
445 |
<hipay_cc translate="label" module="hipay">
|
446 |
<label>HiPay Enterprise Credit Card</label>
|
447 |
<frontend_type>text</frontend_type>
|
448 |
-
<sort_order>
|
449 |
<show_in_default>1</show_in_default>
|
450 |
<show_in_website>1</show_in_website>
|
451 |
<show_in_store>1</show_in_store>
|
@@ -755,7 +839,7 @@
|
|
755 |
<hipay_ccxtimes translate="label" module="hipay">
|
756 |
<label>HiPay Enterprise Credit Card Split Payment</label>
|
757 |
<frontend_type>text</frontend_type>
|
758 |
-
<sort_order>
|
759 |
<show_in_default>1</show_in_default>
|
760 |
<show_in_website>1</show_in_website>
|
761 |
<show_in_store>1</show_in_store>
|
@@ -1046,7 +1130,7 @@
|
|
1046 |
<hipay_hosted translate="label" module="hipay">
|
1047 |
<label>HiPay Enterprise Hosted Page</label>
|
1048 |
<frontend_type>text</frontend_type>
|
1049 |
-
<sort_order>
|
1050 |
<show_in_default>1</show_in_default>
|
1051 |
<show_in_website>1</show_in_website>
|
1052 |
<show_in_store>1</show_in_store>
|
@@ -1405,7 +1489,7 @@
|
|
1405 |
<hipay_hostedxtimes translate="label" module="hipay">
|
1406 |
<label>HiPay Enterprise Hosted Page Split Payment</label>
|
1407 |
<frontend_type>text</frontend_type>
|
1408 |
-
<sort_order>
|
1409 |
<show_in_default>1</show_in_default>
|
1410 |
<show_in_website>1</show_in_website>
|
1411 |
<show_in_store>1</show_in_store>
|
@@ -1745,7 +1829,7 @@
|
|
1745 |
<hipay_ideal translate="label" module="hipay">
|
1746 |
<label>HiPay Enterprise iDeal</label>
|
1747 |
<frontend_type>text</frontend_type>
|
1748 |
-
<sort_order>
|
1749 |
<show_in_default>1</show_in_default>
|
1750 |
<show_in_website>1</show_in_website>
|
1751 |
<show_in_store>1</show_in_store>
|
@@ -1957,7 +2041,7 @@
|
|
1957 |
<hipay_ing translate="label" module="hipay">
|
1958 |
<label>HiPay Enterprise ING Home'Pay</label>
|
1959 |
<frontend_type>text</frontend_type>
|
1960 |
-
<sort_order>
|
1961 |
<show_in_default>1</show_in_default>
|
1962 |
<show_in_website>1</show_in_website>
|
1963 |
<show_in_store>1</show_in_store>
|
@@ -2169,7 +2253,7 @@
|
|
2169 |
<hipay_dexia translate="label" module="hipay">
|
2170 |
<label>HiPay Enterprise Belfius / Dexia Direct Net</label>
|
2171 |
<frontend_type>text</frontend_type>
|
2172 |
-
<sort_order>
|
2173 |
<show_in_default>1</show_in_default>
|
2174 |
<show_in_website>1</show_in_website>
|
2175 |
<show_in_store>1</show_in_store>
|
@@ -2745,7 +2829,7 @@
|
|
2745 |
<hipay_giropay translate="label" module="hipay">
|
2746 |
<label>HiPay Enterprise Giropay</label>
|
2747 |
<frontend_type>text</frontend_type>
|
2748 |
-
<sort_order>
|
2749 |
<show_in_default>1</show_in_default>
|
2750 |
<show_in_website>1</show_in_website>
|
2751 |
<show_in_store>1</show_in_store>
|
@@ -2957,7 +3041,7 @@
|
|
2957 |
<hipay_przelewy24api translate="label" module="hipay">
|
2958 |
<label>HiPay Enterprise Przelewy24</label>
|
2959 |
<frontend_type>text</frontend_type>
|
2960 |
-
<sort_order>
|
2961 |
<show_in_default>1</show_in_default>
|
2962 |
<show_in_website>1</show_in_website>
|
2963 |
<show_in_store>1</show_in_store>
|
@@ -3169,7 +3253,7 @@
|
|
3169 |
<hipay_qiwi translate="label" module="hipay">
|
3170 |
<label>HiPay Enterprise Visa Qiwi Wallet</label>
|
3171 |
<frontend_type>text</frontend_type>
|
3172 |
-
<sort_order>
|
3173 |
<show_in_default>1</show_in_default>
|
3174 |
<show_in_website>1</show_in_website>
|
3175 |
<show_in_store>1</show_in_store>
|
@@ -3381,7 +3465,7 @@
|
|
3381 |
<hipay_webmoneyapi translate="label" module="hipay">
|
3382 |
<label>HiPay Enterprise WebMoney Transfer</label>
|
3383 |
<frontend_type>text</frontend_type>
|
3384 |
-
<sort_order>
|
3385 |
<show_in_default>1</show_in_default>
|
3386 |
<show_in_website>1</show_in_website>
|
3387 |
<show_in_store>1</show_in_store>
|
@@ -3593,7 +3677,7 @@
|
|
3593 |
<hipay_yandexapi translate="label" module="hipay">
|
3594 |
<label>HiPay Enterprise Yandex.Money</label>
|
3595 |
<frontend_type>text</frontend_type>
|
3596 |
-
<sort_order>
|
3597 |
<show_in_default>1</show_in_default>
|
3598 |
<show_in_website>1</show_in_website>
|
3599 |
<show_in_store>1</show_in_store>
|
@@ -3805,7 +3889,7 @@
|
|
3805 |
<hipay_sofortapi translate="label" module="hipay">
|
3806 |
<label>HiPay Enterprise Sofort Überweisung</label>
|
3807 |
<frontend_type>text</frontend_type>
|
3808 |
-
<sort_order>
|
3809 |
<show_in_default>1</show_in_default>
|
3810 |
<show_in_website>1</show_in_website>
|
3811 |
<show_in_store>1</show_in_store>
|
@@ -4001,7 +4085,7 @@
|
|
4001 |
<hipay_sisalapi translate="label" module="hipay">
|
4002 |
<label>HiPay Enterprise Sisal</label>
|
4003 |
<frontend_type>text</frontend_type>
|
4004 |
-
<sort_order>
|
4005 |
<show_in_default>1</show_in_default>
|
4006 |
<show_in_website>1</show_in_website>
|
4007 |
<show_in_store>1</show_in_store>
|
@@ -4195,7 +4279,7 @@
|
|
4195 |
<hipay_paypalapi translate="label" module="hipay">
|
4196 |
<label>HiPay Enterprise PayPal</label>
|
4197 |
<frontend_type>text</frontend_type>
|
4198 |
-
<sort_order>
|
4199 |
<show_in_default>1</show_in_default>
|
4200 |
<show_in_website>1</show_in_website>
|
4201 |
<show_in_store>1</show_in_store>
|
@@ -4384,33 +4468,33 @@
|
|
4384 |
<show_in_website>1</show_in_website>
|
4385 |
<show_in_store>1</show_in_store>
|
4386 |
</is_test_mode>
|
4387 |
-
|
4388 |
-
|
4389 |
<hipay_sdd translate="label" module="hipay">
|
4390 |
<label>HiPay Enterprise SEPA Direct Debit</label>
|
4391 |
<frontend_type>text</frontend_type>
|
4392 |
-
<sort_order>
|
4393 |
<show_in_default>1</show_in_default>
|
4394 |
<show_in_website>1</show_in_website>
|
4395 |
<show_in_store>1</show_in_store>
|
4396 |
<fields>
|
4397 |
-
|
4398 |
-
|
4399 |
-
|
4400 |
-
|
4401 |
-
|
4402 |
-
|
4403 |
-
|
4404 |
-
|
4405 |
-
|
4406 |
-
|
4407 |
-
|
4408 |
-
|
4409 |
-
|
4410 |
-
|
4411 |
-
|
4412 |
-
|
4413 |
-
|
4414 |
<order_status_payment_accepted translate="label">
|
4415 |
<label>Order status when payment accepted</label>
|
4416 |
<frontend_type>select</frontend_type>
|
@@ -4438,7 +4522,7 @@
|
|
4438 |
<show_in_website>1</show_in_website>
|
4439 |
<show_in_store>0</show_in_store>
|
4440 |
</order_status_payment_canceled>
|
4441 |
-
|
4442 |
<label>Hipay status to validate order</label>
|
4443 |
<frontend_type>select</frontend_type>
|
4444 |
<source_model>hipay/source_order_hipayStatusValidate</source_model>
|
@@ -4449,56 +4533,26 @@
|
|
4449 |
</hipay_status_validate_order>
|
4450 |
<success_redirect_page translate="label">
|
4451 |
<label>Redirect page success</label>
|
4452 |
-
<comment>Page to redirect when transaction is successful, leave empty for
|
4453 |
-
checkout/onepage/success
|
4454 |
-
</comment>
|
4455 |
<frontend_type>text</frontend_type>
|
4456 |
-
<sort_order>
|
4457 |
<show_in_default>1</show_in_default>
|
4458 |
<show_in_website>1</show_in_website>
|
4459 |
<show_in_store>0</show_in_store>
|
4460 |
</success_redirect_page>
|
4461 |
-
|
4462 |
-
<label>Redirect page failure</label>
|
4463 |
-
<comment>Page to redirect when transaction fails, leave empty for checkout/onepage/failure
|
4464 |
-
</comment>
|
4465 |
-
<frontend_type>text</frontend_type>
|
4466 |
-
<sort_order>28</sort_order>
|
4467 |
-
<show_in_default>1</show_in_default>
|
4468 |
-
<show_in_website>1</show_in_website>
|
4469 |
-
<show_in_store>0</show_in_store>
|
4470 |
-
</failure_redirect_page>
|
4471 |
-
<pending_redirect_page translate="label">
|
4472 |
<label>Redirect page pending status</label>
|
4473 |
<comment>Page to redirect when transaction is in pending status</comment>
|
4474 |
<frontend_type>select</frontend_type>
|
4475 |
<source_model>hipay/source_pendingredirect</source_model>
|
4476 |
-
<sort_order>
|
4477 |
<show_in_default>1</show_in_default>
|
4478 |
<show_in_website>1</show_in_website>
|
4479 |
<show_in_store>0</show_in_store>
|
4480 |
</pending_redirect_page>
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
4484 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4485 |
-
<sort_order>60</sort_order>
|
4486 |
-
<show_in_default>1</show_in_default>
|
4487 |
-
<show_in_website>1</show_in_website>
|
4488 |
-
<show_in_store>0</show_in_store>
|
4489 |
-
</electronic_signature>
|
4490 |
-
<send_fraud_payment_email translate="label">
|
4491 |
-
<label>Send fraud payment email</label>
|
4492 |
-
<frontend_type>select</frontend_type>
|
4493 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4494 |
-
<sort_order>63</sort_order>
|
4495 |
-
<show_in_default>1</show_in_default>
|
4496 |
-
<show_in_website>1</show_in_website>
|
4497 |
-
<show_in_store>1</show_in_store>
|
4498 |
-
</send_fraud_payment_email>
|
4499 |
-
<re_add_to_cart translate="label comment">
|
4500 |
-
<label>Add product to cart</label>
|
4501 |
-
<comment>Fill cart when payment canceled or refused</comment>
|
4502 |
<frontend_type>select</frontend_type>
|
4503 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4504 |
<sort_order>95</sort_order>
|
@@ -4507,34 +4561,25 @@
|
|
4507 |
<show_in_store>0</show_in_store>
|
4508 |
</re_add_to_cart>
|
4509 |
<cancel_pending_order translate="label comment">
|
4510 |
-
|
4511 |
-
|
4512 |
<frontend_type>select</frontend_type>
|
4513 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4514 |
<sort_order>97</sort_order>
|
4515 |
<show_in_default>1</show_in_default>
|
4516 |
<show_in_website>1</show_in_website>
|
4517 |
<show_in_store>0</show_in_store>
|
4518 |
-
|
4519 |
-
|
4520 |
-
|
4521 |
-
|
4522 |
-
|
4523 |
-
|
4524 |
-
|
4525 |
-
|
4526 |
-
|
4527 |
-
|
4528 |
-
|
4529 |
-
<label>Send fraud payment email</label>
|
4530 |
-
<frontend_type>select</frontend_type>
|
4531 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4532 |
-
<sort_order>99</sort_order>
|
4533 |
-
<show_in_default>1</show_in_default>
|
4534 |
-
<show_in_website>1</show_in_website>
|
4535 |
-
<show_in_store>1</show_in_store>
|
4536 |
-
</send_fraud_payment_email>
|
4537 |
-
<allowspecific translate="label">
|
4538 |
<label>Payment from applicable countries</label>
|
4539 |
<frontend_type>allowspecific</frontend_type>
|
4540 |
<sort_order>100</sort_order>
|
@@ -4576,9 +4621,18 @@
|
|
4576 |
<show_in_website>1</show_in_website>
|
4577 |
<show_in_store>1</show_in_store>
|
4578 |
</sort_order>
|
4579 |
-
<
|
4580 |
-
<label>Enable
|
4581 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4582 |
<frontend_type>select</frontend_type>
|
4583 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4584 |
<sort_order>150</sort_order>
|
@@ -4586,9 +4640,9 @@
|
|
4586 |
<show_in_website>1</show_in_website>
|
4587 |
<show_in_store>0</show_in_store>
|
4588 |
</debug>
|
4589 |
-
|
4590 |
-
|
4591 |
-
|
4592 |
<frontend_type>select</frontend_type>
|
4593 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4594 |
<sort_order>200</sort_order>
|
@@ -4596,12 +4650,12 @@
|
|
4596 |
<show_in_website>1</show_in_website>
|
4597 |
<show_in_store>1</show_in_store>
|
4598 |
</is_test_mode>
|
4599 |
-
|
4600 |
-
|
4601 |
<hipay_postfinancecardapi translate="label" module="hipay">
|
4602 |
-
|
4603 |
<frontend_type>text</frontend_type>
|
4604 |
-
<sort_order>
|
4605 |
<show_in_default>1</show_in_default>
|
4606 |
<show_in_website>1</show_in_website>
|
4607 |
<show_in_store>1</show_in_store>
|
@@ -4622,7 +4676,7 @@
|
|
4622 |
<show_in_default>1</show_in_default>
|
4623 |
<show_in_website>1</show_in_website>
|
4624 |
<show_in_store>1</show_in_store>
|
4625 |
-
|
4626 |
<order_status_payment_accepted translate="label">
|
4627 |
<label>Order status when payment accepted</label>
|
4628 |
<frontend_type>select</frontend_type>
|
@@ -4650,7 +4704,7 @@
|
|
4650 |
<show_in_website>1</show_in_website>
|
4651 |
<show_in_store>0</show_in_store>
|
4652 |
</order_status_payment_canceled>
|
4653 |
-
|
4654 |
<label>Hipay status to validate order</label>
|
4655 |
<frontend_type>select</frontend_type>
|
4656 |
<source_model>hipay/source_order_hipayStatusValidate</source_model>
|
@@ -4690,17 +4744,26 @@
|
|
4690 |
<show_in_website>1</show_in_website>
|
4691 |
<show_in_store>0</show_in_store>
|
4692 |
</pending_redirect_page>
|
4693 |
-
<
|
4694 |
-
<label>
|
4695 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4696 |
<frontend_type>select</frontend_type>
|
4697 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4698 |
<sort_order>95</sort_order>
|
4699 |
<show_in_default>1</show_in_default>
|
4700 |
<show_in_website>1</show_in_website>
|
4701 |
<show_in_store>0</show_in_store>
|
4702 |
-
|
4703 |
-
|
4704 |
<label>Cancel pending order</label>
|
4705 |
<comment>Cancel orders stayed in pending because customer not validated payment</comment>
|
4706 |
<frontend_type>select</frontend_type>
|
@@ -4709,16 +4772,7 @@
|
|
4709 |
<show_in_default>1</show_in_default>
|
4710 |
<show_in_website>1</show_in_website>
|
4711 |
<show_in_store>0</show_in_store>
|
4712 |
-
|
4713 |
-
<delay_cancel_pending_order translate="label">
|
4714 |
-
<label>Delay before cancel order</label>
|
4715 |
-
<comment>In Hours</comment>
|
4716 |
-
<frontend_type>text</frontend_type>
|
4717 |
-
<sort_order>98</sort_order>
|
4718 |
-
<show_in_default>1</show_in_default>
|
4719 |
-
<show_in_website>1</show_in_website>
|
4720 |
-
<show_in_store>1</show_in_store>
|
4721 |
-
</delay_cancel_pending_order>
|
4722 |
<delay_cancel_pending_order translate="label">
|
4723 |
<label>Delay before cancel order</label>
|
4724 |
<comment>In Hours</comment>
|
@@ -4737,7 +4791,7 @@
|
|
4737 |
<show_in_website>1</show_in_website>
|
4738 |
<show_in_store>1</show_in_store>
|
4739 |
</send_fraud_payment_email>
|
4740 |
-
|
4741 |
<label>Payment from applicable countries</label>
|
4742 |
<frontend_type>allowspecific</frontend_type>
|
4743 |
<sort_order>100</sort_order>
|
@@ -4779,9 +4833,9 @@
|
|
4779 |
<show_in_website>1</show_in_website>
|
4780 |
<show_in_store>1</show_in_store>
|
4781 |
</sort_order>
|
4782 |
-
<debug
|
4783 |
-
|
4784 |
-
|
4785 |
<frontend_type>select</frontend_type>
|
4786 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4787 |
<sort_order>150</sort_order>
|
@@ -4789,9 +4843,9 @@
|
|
4789 |
<show_in_website>1</show_in_website>
|
4790 |
<show_in_store>0</show_in_store>
|
4791 |
</debug>
|
4792 |
-
|
4793 |
-
|
4794 |
-
|
4795 |
<frontend_type>select</frontend_type>
|
4796 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4797 |
<sort_order>200</sort_order>
|
@@ -4799,12 +4853,12 @@
|
|
4799 |
<show_in_website>1</show_in_website>
|
4800 |
<show_in_store>1</show_in_store>
|
4801 |
</is_test_mode>
|
4802 |
-
|
4803 |
</hipay_postfinancecardapi>
|
4804 |
-
<
|
4805 |
-
<label>HiPay Enterprise
|
4806 |
<frontend_type>text</frontend_type>
|
4807 |
-
<sort_order>
|
4808 |
<show_in_default>1</show_in_default>
|
4809 |
<show_in_website>1</show_in_website>
|
4810 |
<show_in_store>1</show_in_store>
|
@@ -4864,91 +4918,231 @@
|
|
4864 |
</hipay_status_validate_order>
|
4865 |
<success_redirect_page translate="label">
|
4866 |
<label>Redirect page success</label>
|
4867 |
-
<comment>Page to redirect when transaction is successful, leave empty for
|
4868 |
-
checkout/onepage/success
|
4869 |
-
</comment>
|
4870 |
<frontend_type>text</frontend_type>
|
4871 |
-
<sort_order>
|
4872 |
<show_in_default>1</show_in_default>
|
4873 |
<show_in_website>1</show_in_website>
|
4874 |
<show_in_store>0</show_in_store>
|
4875 |
</success_redirect_page>
|
4876 |
-
<failure_redirect_page translate="label">
|
4877 |
-
<label>Redirect page failure</label>
|
4878 |
-
<comment>Page to redirect when transaction fails, leave empty for checkout/onepage/failure
|
4879 |
-
</comment>
|
4880 |
-
<frontend_type>text</frontend_type>
|
4881 |
-
<sort_order>28</sort_order>
|
4882 |
-
<show_in_default>1</show_in_default>
|
4883 |
-
<show_in_website>1</show_in_website>
|
4884 |
-
<show_in_store>0</show_in_store>
|
4885 |
-
</failure_redirect_page>
|
4886 |
<pending_redirect_page translate="label">
|
4887 |
<label>Redirect page pending status</label>
|
4888 |
<comment>Page to redirect when transaction is in pending status</comment>
|
4889 |
<frontend_type>select</frontend_type>
|
4890 |
<source_model>hipay/source_pendingredirect</source_model>
|
4891 |
-
<sort_order>
|
4892 |
<show_in_default>1</show_in_default>
|
4893 |
<show_in_website>1</show_in_website>
|
4894 |
<show_in_store>0</show_in_store>
|
4895 |
</pending_redirect_page>
|
4896 |
-
<
|
4897 |
-
<label>
|
4898 |
-
<comment>Fill cart when payment canceled or refused</comment>
|
4899 |
<frontend_type>select</frontend_type>
|
4900 |
-
<source_model>
|
4901 |
-
<sort_order>
|
4902 |
<show_in_default>1</show_in_default>
|
4903 |
<show_in_website>1</show_in_website>
|
4904 |
<show_in_store>0</show_in_store>
|
4905 |
-
</
|
4906 |
-
<
|
4907 |
-
<label>
|
4908 |
-
<comment>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4909 |
<frontend_type>select</frontend_type>
|
4910 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
4911 |
-
<sort_order>
|
4912 |
<show_in_default>1</show_in_default>
|
4913 |
<show_in_website>1</show_in_website>
|
4914 |
<show_in_store>0</show_in_store>
|
4915 |
-
</
|
4916 |
-
<
|
4917 |
-
<label>
|
4918 |
-
<comment>In Hours</comment>
|
4919 |
<frontend_type>text</frontend_type>
|
4920 |
-
<sort_order>
|
4921 |
<show_in_default>1</show_in_default>
|
4922 |
<show_in_website>1</show_in_website>
|
4923 |
<show_in_store>1</show_in_store>
|
4924 |
-
</
|
4925 |
-
<
|
4926 |
-
<label>
|
4927 |
-
<frontend_type>
|
4928 |
-
<
|
4929 |
-
<sort_order>99</sort_order>
|
4930 |
<show_in_default>1</show_in_default>
|
4931 |
<show_in_website>1</show_in_website>
|
4932 |
<show_in_store>1</show_in_store>
|
4933 |
-
</
|
4934 |
-
<
|
4935 |
-
<label>
|
4936 |
-
<frontend_type>
|
4937 |
-
<sort_order>
|
4938 |
-
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
4939 |
<show_in_default>1</show_in_default>
|
4940 |
<show_in_website>1</show_in_website>
|
4941 |
<show_in_store>1</show_in_store>
|
4942 |
-
</
|
4943 |
-
<
|
4944 |
-
<label>
|
4945 |
-
<frontend_type>
|
4946 |
-
<sort_order>
|
4947 |
-
<
|
4948 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4949 |
<show_in_website>1</show_in_website>
|
4950 |
<show_in_store>1</show_in_store>
|
4951 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4952 |
<min_order_total translate="label">
|
4953 |
<label>Minimum Order Total</label>
|
4954 |
<frontend_type>text</frontend_type>
|
@@ -4994,22 +5188,15 @@
|
|
4994 |
<show_in_store>1</show_in_store>
|
4995 |
</is_test_mode>
|
4996 |
</fields>
|
4997 |
-
</
|
4998 |
-
<
|
4999 |
-
<label>HiPay
|
5000 |
<frontend_type>text</frontend_type>
|
5001 |
-
<sort_order>
|
5002 |
<show_in_default>1</show_in_default>
|
5003 |
<show_in_website>1</show_in_website>
|
5004 |
<show_in_store>1</show_in_store>
|
5005 |
<fields>
|
5006 |
-
<notice translate="label" module="hipay">
|
5007 |
-
<frontend_model>hipay/adminhtml_system_config_form_field_Notice</frontend_model>
|
5008 |
-
<sort_order>1</sort_order>
|
5009 |
-
<show_in_default>1</show_in_default>
|
5010 |
-
<show_in_website>1</show_in_website>
|
5011 |
-
<show_in_store>1</show_in_store>
|
5012 |
-
</notice>
|
5013 |
<active translate="label">
|
5014 |
<label>Enabled</label>
|
5015 |
<frontend_type>select</frontend_type>
|
@@ -5065,31 +5252,19 @@
|
|
5065 |
</hipay_status_validate_order>
|
5066 |
<success_redirect_page translate="label">
|
5067 |
<label>Redirect page success</label>
|
5068 |
-
<comment>Page to redirect when transaction is successful, leave empty for
|
5069 |
-
checkout/onepage/success
|
5070 |
-
</comment>
|
5071 |
<frontend_type>text</frontend_type>
|
5072 |
-
<sort_order>
|
5073 |
<show_in_default>1</show_in_default>
|
5074 |
<show_in_website>1</show_in_website>
|
5075 |
<show_in_store>0</show_in_store>
|
5076 |
</success_redirect_page>
|
5077 |
-
<failure_redirect_page translate="label">
|
5078 |
-
<label>Redirect page failure</label>
|
5079 |
-
<comment>Page to redirect when transaction fails, leave empty for checkout/onepage/failure
|
5080 |
-
</comment>
|
5081 |
-
<frontend_type>text</frontend_type>
|
5082 |
-
<sort_order>28</sort_order>
|
5083 |
-
<show_in_default>1</show_in_default>
|
5084 |
-
<show_in_website>1</show_in_website>
|
5085 |
-
<show_in_store>0</show_in_store>
|
5086 |
-
</failure_redirect_page>
|
5087 |
<pending_redirect_page translate="label">
|
5088 |
<label>Redirect page pending status</label>
|
5089 |
<comment>Page to redirect when transaction is in pending status</comment>
|
5090 |
<frontend_type>select</frontend_type>
|
5091 |
<source_model>hipay/source_pendingredirect</source_model>
|
5092 |
-
<sort_order>
|
5093 |
<show_in_default>1</show_in_default>
|
5094 |
<show_in_website>1</show_in_website>
|
5095 |
<show_in_store>0</show_in_store>
|
@@ -5098,7 +5273,7 @@
|
|
5098 |
<label>Payment Action</label>
|
5099 |
<frontend_type>select</frontend_type>
|
5100 |
<source_model>hipay/source_paymentAction</source_model>
|
5101 |
-
<sort_order>
|
5102 |
<show_in_default>1</show_in_default>
|
5103 |
<show_in_website>1</show_in_website>
|
5104 |
<show_in_store>0</show_in_store>
|
@@ -5107,7 +5282,7 @@
|
|
5107 |
<label>Css Url</label>
|
5108 |
<comment>Important, HTTPS protocol is required</comment>
|
5109 |
<frontend_type>text</frontend_type>
|
5110 |
-
<sort_order>
|
5111 |
<show_in_default>1</show_in_default>
|
5112 |
<show_in_website>1</show_in_website>
|
5113 |
<show_in_store>1</show_in_store>
|
@@ -5119,8 +5294,49 @@
|
|
5119 |
<sort_order>35</sort_order>
|
5120 |
<show_in_default>1</show_in_default>
|
5121 |
<show_in_website>1</show_in_website>
|
5122 |
-
<show_in_store>
|
5123 |
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5124 |
<display_selector translate="label">
|
5125 |
<label>Display card selector</label>
|
5126 |
<frontend_type>select</frontend_type>
|
@@ -5158,6 +5374,34 @@
|
|
5158 |
<show_in_website>1</show_in_website>
|
5159 |
<show_in_store>1</show_in_store>
|
5160 |
</send_fraud_payment_email>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5161 |
<allow_use_oneclick translate="label">
|
5162 |
<label>Use Oneclick</label>
|
5163 |
<frontend_type>select</frontend_type>
|
@@ -5197,15 +5441,6 @@
|
|
5197 |
<show_in_website>1</show_in_website>
|
5198 |
<show_in_store>0</show_in_store>
|
5199 |
</cancel_pending_order>
|
5200 |
-
<delay_cancel_pending_order translate="label">
|
5201 |
-
<label>Delay before cancel order</label>
|
5202 |
-
<comment>In Hours</comment>
|
5203 |
-
<frontend_type>text</frontend_type>
|
5204 |
-
<sort_order>98</sort_order>
|
5205 |
-
<show_in_default>1</show_in_default>
|
5206 |
-
<show_in_website>1</show_in_website>
|
5207 |
-
<show_in_store>1</show_in_store>
|
5208 |
-
</delay_cancel_pending_order>
|
5209 |
<send_fraud_payment_email translate="label">
|
5210 |
<label>Send fraud payment email</label>
|
5211 |
<frontend_type>select</frontend_type>
|
@@ -5215,11 +5450,4080 @@
|
|
5215 |
<show_in_website>1</show_in_website>
|
5216 |
<show_in_store>1</show_in_store>
|
5217 |
</send_fraud_payment_email>
|
5218 |
-
<
|
5219 |
-
<label>
|
5220 |
-
<frontend_type>
|
5221 |
-
<sort_order>
|
5222 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|