Hipay - Version 1.0.0

Version Notes

Release Candidate 1 (testing only, not for productive use)

Download this release

Release Info

Developer Magento Core Team
Extension Hipay
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (83) hide show
  1. app/code/local/HimediaPayments/Hipay/Block/Adminarray.php +91 -0
  2. app/code/local/HimediaPayments/Hipay/Block/Adminhtml/System/Config/Fieldset/Commentbox.php +36 -0
  3. app/code/local/HimediaPayments/Hipay/Block/Adminhtml/System/Config/Fieldset/Hint.php +62 -0
  4. app/code/local/HimediaPayments/Hipay/Block/Commentbox.php +67 -0
  5. app/code/local/HimediaPayments/Hipay/Block/Form.php +50 -0
  6. app/code/local/HimediaPayments/Hipay/Helper/Data.php +576 -0
  7. app/code/local/HimediaPayments/Hipay/Mapi/mapi_affiliate.php +270 -0
  8. app/code/local/HimediaPayments/Hipay/Mapi/mapi_comm_xml.php +171 -0
  9. app/code/local/HimediaPayments/Hipay/Mapi/mapi_defs.php +127 -0
  10. app/code/local/HimediaPayments/Hipay/Mapi/mapi_defs_ext.php +52 -0
  11. app/code/local/HimediaPayments/Hipay/Mapi/mapi_exception.php +167 -0
  12. app/code/local/HimediaPayments/Hipay/Mapi/mapi_installment.php +249 -0
  13. app/code/local/HimediaPayments/Hipay/Mapi/mapi_item.php +77 -0
  14. app/code/local/HimediaPayments/Hipay/Mapi/mapi_lockable.php +64 -0
  15. app/code/local/HimediaPayments/Hipay/Mapi/mapi_multiplepayment.php +85 -0
  16. app/code/local/HimediaPayments/Hipay/Mapi/mapi_order.php +411 -0
  17. app/code/local/HimediaPayments/Hipay/Mapi/mapi_package.php +64 -0
  18. app/code/local/HimediaPayments/Hipay/Mapi/mapi_payment.php +488 -0
  19. app/code/local/HimediaPayments/Hipay/Mapi/mapi_paymentparams.php +1087 -0
  20. app/code/local/HimediaPayments/Hipay/Mapi/mapi_product.php +315 -0
  21. app/code/local/HimediaPayments/Hipay/Mapi/mapi_send_xml.php +123 -0
  22. app/code/local/HimediaPayments/Hipay/Mapi/mapi_simplepayment.php +61 -0
  23. app/code/local/HimediaPayments/Hipay/Mapi/mapi_tax.php +209 -0
  24. app/code/local/HimediaPayments/Hipay/Mapi/mapi_utf8.php +108 -0
  25. app/code/local/HimediaPayments/Hipay/Mapi/mapi_utils.php +158 -0
  26. app/code/local/HimediaPayments/Hipay/Mapi/mapi_xml.php +112 -0
  27. app/code/local/HimediaPayments/Hipay/Model/Accountmode.php +58 -0
  28. app/code/local/HimediaPayments/Hipay/Model/Age.php +60 -0
  29. app/code/local/HimediaPayments/Hipay/Model/Category.php +124 -0
  30. app/code/local/HimediaPayments/Hipay/Model/Currencies.php +22 -0
  31. app/code/local/HimediaPayments/Hipay/Model/Currency.php +62 -0
  32. app/code/local/HimediaPayments/Hipay/Model/Method/Dummy.php +115 -0
  33. app/code/local/HimediaPayments/Hipay/Model/Method/Hipay.php +205 -0
  34. app/code/local/HimediaPayments/Hipay/Model/Rating.php +20 -0
  35. app/code/local/HimediaPayments/Hipay/controllers/MapiController.php +584 -0
  36. app/code/local/HimediaPayments/Hipay/controllers/MapiHelper.php +200 -0
  37. app/code/local/HimediaPayments/Hipay/etc/adminhtml.xml +25 -0
  38. app/code/local/HimediaPayments/Hipay/etc/config.xml +89 -0
  39. app/code/local/HimediaPayments/Hipay/etc/system.xml +288 -0
  40. app/design/adminhtml/default/default/layout/hipaybase.xml +12 -0
  41. app/design/adminhtml/default/default/template/himediapayments/array.phtml +164 -0
  42. app/design/adminhtml/default/default/template/himediapayments/commentbox.phtml +66 -0
  43. app/design/adminhtml/default/default/template/himediapayments/system/config/fieldset/commentbox.phtml +9 -0
  44. app/design/adminhtml/default/default/template/himediapayments/system/config/fieldset/hint.phtml +49 -0
  45. app/design/frontend/base/default/layout/hipay.xml +16 -0
  46. app/design/frontend/base/default/template/himediapayments/hipay/form.phtml +190 -0
  47. app/design/frontend/base/default/template/himediapayments/hipay/payment.phtml +110 -0
  48. app/etc/modules/HimediaPayments_Hipay.xml +9 -0
  49. app/locale/de_AT/HimediaPayments_Hipay.csv +87 -0
  50. app/locale/de_CH/HimediaPayments_Hipay.csv +87 -0
  51. app/locale/de_DE/HimediaPayments_Hipay.csv +87 -0
  52. app/locale/en_US/HimediaPayments_Hipay.csv +87 -0
  53. package.xml +18 -0
  54. skin/adminhtml/base/default/css/himediapayments/files/Hipay-Payment-Extension_german.pdf +0 -0
  55. skin/adminhtml/base/default/css/himediapayments/hipay.css +86 -0
  56. skin/adminhtml/base/default/css/himediapayments/images/hipay_section_logo.png +0 -0
  57. skin/adminhtml/base/default/css/himediapayments/images/hipay_section_logo_hover.png +0 -0
  58. skin/adminhtml/base/default/css/himediapayments/images/pdf_16x16.png +0 -0
  59. skin/adminhtml/base/default/css/himediapayments/images/pdf_22x22.png +0 -0
  60. skin/adminhtml/base/default/css/himediapayments/images/pdf_32x32.png +0 -0
  61. skin/adminhtml/base/default/css/himediapayments/images/tabs_link_over_bg.gif +0 -0
  62. skin/adminhtml/base/default/css/himediapayments/images/tabs_span_bg.gif +0 -0
  63. skin/frontend/default/default/images/himediapayments/hipay/hipay-frame-bottom.png +0 -0
  64. skin/frontend/default/default/images/himediapayments/hipay/hipay-frame-top.png +0 -0
  65. skin/frontend/default/default/images/himediapayments/hipay/hipay_logo.png +0 -0
  66. skin/frontend/default/default/images/himediapayments/hipay/hipay_redirect_frame_bottom.png +0 -0
  67. skin/frontend/default/default/images/himediapayments/hipay/hipay_redirect_frame_top.png +0 -0
  68. skin/frontend/default/default/images/himediapayments/hipay/hr_1x1.png +0 -0
  69. skin/frontend/default/default/images/himediapayments/hipay/loader.gif +0 -0
  70. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_amex.png +0 -0
  71. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_aurora.png +0 -0
  72. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_bcmc.png +0 -0
  73. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cb.png +0 -0
  74. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cbc.png +0 -0
  75. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cofidis.png +0 -0
  76. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_dexia.png +0 -0
  77. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_giropay.png +0 -0
  78. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_ing.png +0 -0
  79. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_maestro.png +0 -0
  80. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_mastercard.png +0 -0
  81. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_sofort-lastschrift.png +0 -0
  82. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_sofort-ueberweisung.png +0 -0
  83. skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_visa.png +0 -0
app/code/local/HimediaPayments/Hipay/Block/Adminarray.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HimediaPayments_Hipay_Block_Adminarray extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
43
+ {
44
+ protected $magentoAttributes;
45
+
46
+ public function __construct()
47
+ {
48
+ $this->addColumn('accountmode', array(
49
+ 'label' => Mage::helper('adminhtml')->__('Accountmode'),
50
+ 'size' => 28,
51
+ ));
52
+ // $this->addColumn('colour', array(
53
+ // 'label' => Mage::helper('adminhtml')->__('Colour'),
54
+ // 'size' => 28
55
+ // ));
56
+ $this->_addAfter = false;
57
+ $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add new coloured animal');
58
+
59
+ parent::__construct();
60
+ //$this->setTemplate('example/array_dropdown.phtml');
61
+ $this->setTemplate('himediapayments/array.phtml');
62
+ }
63
+
64
+ protected function _renderCellTemplate($columnName)
65
+ {
66
+ if (empty($this->_columns[$columnName])) {
67
+ throw new Exception('Wrong column name specified.');
68
+ }
69
+ $column = $this->_columns[$columnName];
70
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
71
+
72
+
73
+ $rendered = '<select name="'.$inputName.'">';
74
+ if($columnName == 'accountmode')
75
+ {
76
+ $rendered .= '<option value="test">Test Mode</option>';
77
+ $rendered .= '<option value="productive">Production Mode</option>';
78
+ }
79
+ // else
80
+ // {
81
+ // $rendered .= '<option value="red">Red</option>';
82
+ // $rendered .= '<option value="blue">Blue</option>';
83
+ // $rendered .= '<option value="yellow">Yellow</option>';
84
+ // $rendered .= '<option value="green">Green</option>';
85
+ // }
86
+ $rendered .= '</select>';
87
+
88
+ return $rendered;
89
+ }
90
+ }
91
+ ?>
app/code/local/HimediaPayments/Hipay/Block/Adminhtml/System/Config/Fieldset/Commentbox.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Renderer for tab comment boxes in the hipay section
5
+ */
6
+ class HimediaPayments_Block_Adminhtml_System_Config_Fieldset_Comments extends Mage_Adminhtml_Block_Abstract
7
+ implements Varien_Data_Form_Element_Renderer_Interface
8
+ {
9
+ protected $_template = 'himediapayments/system/config/fieldset/commentbox.phtml';
10
+
11
+ /**
12
+ * Render fieldset html
13
+ *
14
+ * @param Varien_Data_Form_Element_Abstract $element
15
+ * @return string
16
+ */
17
+ public function render(Varien_Data_Form_Element_Abstract $element)
18
+ {
19
+ return $this->toHtml();
20
+ }
21
+
22
+ // protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
23
+ // {
24
+ // $this->setElement($element);
25
+ // $url = $this->getUrl('catalog/product'); //
26
+ //
27
+ // $html = $this->getLayout()->createBlock('adminhtml/widget_button')
28
+ // ->setType('button')
29
+ // ->setClass('scalable')
30
+ // ->setLabel('Run Now !')
31
+ // ->setOnClick("setLocation('$url')")
32
+ // ->toHtml();
33
+ //
34
+ // return $html;
35
+ // }
36
+ }
app/code/local/HimediaPayments/Hipay/Block/Adminhtml/System/Config/Fieldset/Hint.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ /**
44
+ * Renderer for Hi-media Payments banner in Hipay section
45
+ */
46
+ class HimediaPayments_Block_Adminhtml_System_Config_Fieldset_Hint
47
+ extends Mage_Adminhtml_Block_Abstract
48
+ implements Varien_Data_Form_Element_Renderer_Interface
49
+ {
50
+ protected $_template = 'himediapayments/system/config/fieldset/hint.phtml';
51
+
52
+ /**
53
+ * Render fieldset html
54
+ *
55
+ * @param Varien_Data_Form_Element_Abstract $element
56
+ * @return string
57
+ */
58
+ public function render(Varien_Data_Form_Element_Abstract $element)
59
+ {
60
+ return $this->toHtml();
61
+ }
62
+ }
app/code/local/HimediaPayments/Hipay/Block/Commentbox.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ /**
44
+ * Renderer for tab comment boxes in the hipay section
45
+ */
46
+ class HimediaPayments_Hipay_Block_Commentbox extends Mage_Adminhtml_Block_System_Config_Form_Field
47
+ {
48
+ protected $_template = 'himediapayments/commentbox.phtml'; // => design/adminhtml/default/default/template/himediapayments/commentbox.phtml
49
+
50
+ /**
51
+ * Render fieldset html
52
+ *
53
+ * @param Varien_Data_Form_Element_Abstract $element
54
+ * @return string
55
+ */
56
+ public function render(Varien_Data_Form_Element_Abstract $element)
57
+ {
58
+ if(isset($element)) {
59
+ Mage::log("Element ID: " . $element->getId()); //e.g. hipay_howto_groupcomment -> [section]_[group]_[field]
60
+ }
61
+ else {
62
+ Mage::log("Element is null");
63
+ }
64
+
65
+ return $this->assign("element",$element)->toHtml();
66
+ }
67
+ }
app/code/local/HimediaPayments/Hipay/Block/Form.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ class HimediaPayments_Hipay_Block_Form extends Mage_Payment_Block_Form
44
+ {
45
+ protected function _construct()
46
+ {
47
+ $this->setTemplate('himediapayments/hipay/form.phtml');
48
+ parent::_construct();
49
+ }
50
+ }
app/code/local/HimediaPayments/Hipay/Helper/Data.php ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ require_once 'HimediaPayments/Hipay/Mapi/mapi_package.php';
44
+
45
+ class HimediaPayments_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
46
+ {
47
+ /*
48
+ * Da alle benötigten Methoden von Mage_Core_Helper_Data geerbt werden,
49
+ * kann diese Klasse leer bleiben oder bei Bedarf durch eigene Implentierungen
50
+ * erweitert werden.
51
+ */
52
+
53
+ /**
54
+ * Returns a payment URL based on the given order object
55
+ *
56
+ * @param Mage_Sales_Model_Order $order
57
+ */
58
+ public function getSinglePaymentUrl(Mage_Sales_Model_Order $order, $token)
59
+ {
60
+ $orderCategory = Mage::getStoreConfig('hipay/accountsettings/ordercategory');
61
+ $accountmode = Mage::getStoreConfig('hipay/extendedaccountsettings/accountmode');
62
+
63
+ // ## Base params ##
64
+ $params = $this->setupParams($order, $token);
65
+ if($params == null) {
66
+ exit;
67
+ }
68
+
69
+ // ## Taxes ##
70
+ // $tax1 = $this->createTax("TVA 19.6", 19.6, true);
71
+ // $tax2 = $this->createTax("Taxe fixe", 3.5, false);
72
+ // $tax3 = $this->createTax("TVA 5.5", 5.5, true);
73
+ //
74
+ // if(($tax1 == null) || ($tax2 == null) || ($tax3 == null)) {
75
+ // exit;
76
+ // }
77
+
78
+
79
+ // // ## Affiliates ##
80
+ // // Affiliate who will receive 10% of all the items in the order
81
+ // $aff1 = $this->createAffiliate(331, 59704, 10.4, HIPAY_MAPI_TTARGET_ALL);
82
+ // // Affiliate who will receive 15% of the amount of the products, insurance and delivery amounts
83
+ // $aff2 = $this->createAffiliate(332, 59705, 15.0, HIPAY_MAPI_TTARGET_ITEM | HIPAY_MAPI_TTARGET_INSURANCE | HIPAY_MAPI_TTARGET_SHIPPING);
84
+ //
85
+ // if(($aff1 == null) || ($aff2 == null)) {
86
+ // exit;
87
+ // }
88
+
89
+ // ## Products (order lines) ##
90
+ $orderInfo = Mage::helper("hipaymod")->__("Order") . " '" . $order->getRealOrderId() . "' "
91
+ . Mage::helper("hipaymod")->__("at") . " " . $order->getStore()->getFrontendName();
92
+ $productName = Mage::helper("hipaymod")->__('Items of order') . " " . $order->getRealOrderId();
93
+ $productInfo = "";
94
+ $quantity = 1;
95
+ $productSKU = "";
96
+ $totalOrderAmount = $order->getTotalDue();
97
+ $shippingAmount = $order->getShippingAmount();
98
+ $reducedOrderAmount = $totalOrderAmount - $shippingAmount;
99
+
100
+ $item = $this->createProduct($productName, // product name
101
+ $productInfo, // product info
102
+ $quantity, // quantity
103
+ $productSKU, // product reference (merchant)
104
+ 965, // hipay category - TODO: richtige Kategorie ermitteln
105
+ $reducedOrderAmount, // amount
106
+ array() // tax(es) - TODO: Steuern ermitteln
107
+ );
108
+ if($item == null) {
109
+ exit;
110
+ }
111
+
112
+ $items = array($item);
113
+ // $no = 0;
114
+ // $orderItems = $order->getAllVisibleItems();//getAllItems();
115
+ // foreach ($orderItems as $orderItem)
116
+ // {
117
+ // $no++;
118
+ // Mage::log("count : " .$no);
119
+ //
120
+ // $productOptions = ($orderItem->getProductOptions());
121
+ // $productId = $productOptions["info_buyRequest"]["product"];
122
+ // $quantity = $productOptions["info_buyRequest"]["qty"];
123
+ //
124
+ // // Liste zusätzlicher Attribute als Produktinfo erstellen (z.B. "Size: Large")
125
+ // $productInfo = "";
126
+ // if(array_key_exists("attributes_info", $productOptions))
127
+ // {
128
+ // $attributesInfoArray = $productOptions["attributes_info"];
129
+ // foreach ($attributesInfoArray as $attribute)
130
+ // {
131
+ // if(!empty($productInfo)) {
132
+ // $productInfo .= ", ";
133
+ // }
134
+ // $productInfo .= $attribute["label"].": ".$attribute["value"];
135
+ // }
136
+ // }
137
+ //
138
+ // $product = Mage::getModel('catalog/product')->load($productId); // Mage_Catalog_Model_Product
139
+ //
140
+ //// Mage::log($product);
141
+ //
142
+ // $item = $this->createProduct($product->getName(), // product name
143
+ // $productInfo, // product info
144
+ // $quantity, // quantity
145
+ // $product->getSKU(), // product reference (merchant)
146
+ // 5, // hipay category - TODO: richtige Kategorie ermitteln
147
+ // $product->getPrice(), // amount
148
+ // array() // tax(es) - TODO: Steuern ermitteln
149
+ // );
150
+ // if($item == null) {
151
+ // exit;
152
+ // }
153
+ // $items[] = $item;
154
+ // }
155
+ // Mage::log($items);
156
+ //
157
+ //
158
+ // //Mage::log( serialize($order) );
159
+ //
160
+ // Mage::log("Total Due :" . $order->getTotalDue());
161
+ // Mage::log("Base Total Due :" . $order->getBaseTotalDue());
162
+ //
163
+ // Mage::log($order->getFullTaxInfo());
164
+ // Mage::log( $order->getShippingTaxAmount() );
165
+ //
166
+ // $baseTax = $order->getBaseShippingTaxAmount();
167
+ // $tax = $order->getShippingTaxAmount();
168
+ // $shippingBaseAmount = $order->getBaseShippingAmount();
169
+ // $shippingAmount = $order->getShippingAmount();
170
+ //
171
+ // Mage::log("Base Tax :" . $baseTax);
172
+ // Mage::log("Tax :" . $tax);
173
+ // Mage::log("Shipping Base Amount :" . $shippingBaseAmount);
174
+ // Mage::log("Shipping Amount :" . $shippingAmount);
175
+
176
+
177
+ // ## Order object ##
178
+ $hipayorder = $this->createOrder(
179
+ $orderInfo, // Order title
180
+ '', // Order information - TODO: Bestellinfo hinzufügen
181
+ $orderCategory, // The order category
182
+ $shippingAmount, // The shipping costs
183
+ array (), // The shipping taxes - TODO: Steuern ?
184
+ 0, // The insurance costs - Versicherungen?
185
+ array (), // The insurance taxes - Steuern?
186
+ 0.0, // The fix costs - Zusatzkosten?
187
+ array (), // The fix costs taxes - Steuern?
188
+ array () // affiliates
189
+ );
190
+
191
+ if($hipayorder == null) {
192
+ exit;
193
+ }
194
+
195
+ // ## Payment object ##
196
+ $payment = $this->createSimplePayment($params, $hipayorder, $items);
197
+
198
+ // ## XML representation of this order and sending the feed to the Hipay platform ##
199
+ $xml = $payment->getXML();
200
+ $response = HIPAY_MAPI_SEND_XML::sendXML($xml, $this->getHipayUrl($accountmode));
201
+
202
+ // ## Processing the platform's response ##
203
+ $result = HIPAY_MAPI_COMM_XML::analyzeResponseXML($response, $url, $err_msg);
204
+
205
+ if($result === false) {
206
+ Mage::log($err_msg);
207
+ }
208
+
209
+ $resultArray = array("paymentUrl" => $url,
210
+ "errorMsg" => $err_msg);
211
+
212
+ return $resultArray;
213
+ }
214
+
215
+ /**
216
+ * Erzeugt die Basisparameter für den Bezahlvorgang
217
+ *
218
+ * @param HIPAY_MAPI_PaymentParams $params
219
+ * @param string token
220
+ */
221
+ protected function setupParams(Mage_Sales_Model_Order $order, $token)
222
+ {
223
+ $accountId = Mage::getStoreConfig('hipay/accountsettings/accountid');
224
+ $merchantPassword = Mage::getStoreConfig('hipay/accountsettings/merchantpassword');
225
+ $merchantSiteId = Mage::getStoreConfig('hipay/accountsettings/merchantsiteid');
226
+ //$accountCurrency = Mage::getStoreConfig('hipay/accountsettings/accountcurrency');
227
+ $orderCurrency = $order->getOrderCurrency()->getData("currency_code");
228
+ $ageClassification = Mage::getStoreConfig('hipay/accountsettings/ageclassification');
229
+ $notificationEmail = Mage::getStoreConfig('hipay/accountsettings/notificationemail');
230
+
231
+ $logoUrl = Mage::getStoreConfig('hipay/extendedaccountsettings/logourl');
232
+
233
+ $itemAccountId = Mage::getStoreConfig('hipay/extendedaccountsettings/itemaccountid');
234
+ $taxAccountId = ""; //Mage::getStoreConfig('hipay/extendedaccountsettings/taxaccountid');
235
+ $insuranceAccountId = ""; //Mage::getStoreConfig('hipay/extendedaccountsettings/insuranceaccountid');
236
+ $fixcostAccountId = ""; //Mage::getStoreConfig('hipay/extendedaccountsettings/fixcostaccountid');
237
+ $shippingAccountId = Mage::getStoreConfig('hipay/extendedaccountsettings/shippingaccountid');
238
+
239
+ $itemAccountId = (empty($itemAccountId) ? $accountId : $itemAccountId);
240
+ $taxAccountId = (empty($taxAccountId) ? $itemAccountId : $taxAccountId);
241
+ $insuranceAccountId = (empty($insuranceAccountId) ? $itemAccountId : $insuranceAccountId);
242
+ $fixcostAccountId = (empty($fixcostAccountId) ? $itemAccountId : $fixcostAccountId);
243
+ $shippingAccountId = (empty($shippingAccountId) ? $itemAccountId : $shippingAccountId);
244
+
245
+ // ## REMOVE TEST ##
246
+ // echo "<hr>"
247
+ // ."accound id:" . $accountId . ",<br />"
248
+ // ."pw:" . $merchantPassword . ",<br />"
249
+ // ."site:" . $merchantSiteId . ",<br />"
250
+ // ."min age:" . $ageClassification . ",<br />"
251
+ // ."currency:" . $accountCurrency . ",<br />"
252
+ // ."ack email:" . $notificationEmail . ",<br />"
253
+ // ."logo url:" . $logoUrl . ",<br />"
254
+ //
255
+ // ."item account:" . $itemAccountId . ",<br />"
256
+ // ."tax account:" . $taxAccountId . ",<br />"
257
+ // ."insurance account:" . $insuranceAccountId . ",<br />"
258
+ // ."fixcost account:" . $fixcostAccountId . ",<br />"
259
+ // ."shipping account:" . $shippingAccountId . "<br />"
260
+ // ."<hr>";
261
+ // ## REMOVE TEST - END ##
262
+
263
+ $params = new HIPAY_MAPI_PaymentParams();
264
+
265
+ //The Hipay platform connection parameters. This is not the information used to connect to your Hipay
266
+ //account, but the specific login and password used to connect to the payment platform.
267
+ //The login is the ID of the hipay merchant account receiving the payment, and the password is
268
+ //the « merchant password » set within your Hipay account (site info).
269
+ $params->setLogin($accountId, $merchantPassword);
270
+
271
+ // The amounts will be credited to the defined accounts
272
+ $params->setAccounts($itemAccountId, $taxAccountId, $insuranceAccountId, $fixcostAccountId, $shippingAccountId);
273
+
274
+ // The payment interface will be in German by default
275
+ $params->setDefaultLang('de_DE');
276
+
277
+ // The interface will be the Web interface
278
+ $params->setMedia('WEB');
279
+
280
+ //The order content is intended for people at least (ALL, 12+, 16+, 18+) years old.
281
+ $params->setRating($ageClassification);
282
+
283
+ // This is a single payment
284
+ $params->setPaymentMethod(HIPAY_MAPI_METHOD_SIMPLE);
285
+
286
+ // The capture take place immediately (HIPAY_MAPI_CAPTURE_IMMEDIATE), manually (HIPAY_MAPI_CAPTURE_MANUAL)
287
+ // or delayed (0-7 -> number of days before capture)
288
+ $params->setCaptureDay(HIPAY_MAPI_CAPTURE_IMMEDIATE);
289
+
290
+ // The amounts are expressed in Euros, this has to be the same currency as the merchant's account.
291
+ $params->setCurrency($orderCurrency);
292
+
293
+ // The merchant-selected identifier for this order
294
+ $params->setIdForMerchant($order->getRealOrderId());
295
+
296
+ // Two data elements of type key=value are declared and will be returned to the merchant after the payment in the
297
+ // notification data feed [C].
298
+ // $params->setMerchantDatas('id_client','2000');
299
+ // $params->setMerchantDatas('credit','10');
300
+
301
+ // This order relates to the web site which the merchant declared in the Hipay platform.
302
+ $params->setMerchantSiteId($merchantSiteId);
303
+
304
+ // Set buyer email
305
+ $params->setIssuerAccountLogin($order->getCustomerEmail());
306
+
307
+ // If the payment is accepted, the user will be redirected to this page
308
+ $urlOk = Mage::getUrl('hipay/mapi/success/'); // creates URL 'http://www.mywebsite.com/hipay/mapi/success/'
309
+ $params->setURLOk($urlOk . $token); // add security-token
310
+
311
+ // If the payment is refused, the user will be redirected to this page
312
+ $urlNok = Mage::getUrl('hipay/mapi/failed'); // creates URL 'http://www.mywebsite.com/hipay/mapi/failed/'
313
+ $params->setUrlNok($urlNok . $token); // add security-token
314
+
315
+ // If the user cancels the payment, he will be redirected to this page
316
+ $urlCancel = Mage::getUrl('hipay/mapi/cancel'); // creates URL 'http://www.mywebsite.com/hipay/mapi/failed/'
317
+ $params->setUrlCancel($urlCancel . $token); // add security-token
318
+
319
+ // The email address used to send the notifications, on top of the http notifications.
320
+ $params->setEmailAck($notificationEmail);
321
+
322
+ // The merchant's site will be notified of the result of the payment by a call to the script
323
+ // "listen_hipay_notification.php"
324
+ $urlAck = Mage::getUrl('hipay/mapi/notification'); // creates URL 'http://www.mywebsite.com/hipay/mapi/notfication'
325
+ $params->setUrlAck($urlAck);
326
+
327
+ // The background color of the interface will be #FFFFFF (default color recommended)
328
+ $params->setBackgroundColor('#FFFFFF');
329
+
330
+ //The merchant’s logo URL, this logo will be displayed on the payment pages.
331
+ $params->setLogoUrl($logoUrl);
332
+
333
+ if (!$params->check())
334
+ {
335
+ $errorTxt = "Hipay: An error occurred while creating the HIPAY_MAPI_PaymentParams object";
336
+ Mage::log($errorTxt);
337
+ return null;
338
+ }
339
+ return $params;
340
+ }
341
+
342
+ /**
343
+ * Creates a HIPAY_MAPI_Tax object, returns null if creation fails
344
+ * @param string $taxName
345
+ * @param float $taxValue
346
+ * @param boolean $taxIsPercentage
347
+ */
348
+ protected function createTax($taxName, $taxValue, $taxIsPercentage)
349
+ {
350
+ $tax = new HIPAY_MAPI_Tax();
351
+ $tax->setTaxName($taxName);
352
+ $tax->setTaxVal($taxValue,$taxIsPercentage);
353
+
354
+ if (!$tax->check())
355
+ {
356
+ $errorTxt = "Hipay: An error occurred while creating a HIPAY_MAPI_Tax object";
357
+ Mage::log($errorTxt);
358
+ return null;
359
+ }
360
+ return $tax;
361
+ }
362
+
363
+ /**
364
+ * Creates a HIPAY_MAPI_Affiliate object, returns null if creation fails
365
+ * @param int $customerId
366
+ * @param int $accountId
367
+ * @param float $value
368
+ * @param int $percentageTarget
369
+ */
370
+ protected function createAffiliate($customerId, $accountId, $value, $percentageTarget)
371
+ {
372
+ $aff = new HIPAY_MAPI_Affiliate();
373
+ $aff->setCustomerId($customerId);
374
+ $aff->setAccountId($accountId);
375
+ $aff->setValue($value, $percentageTarget);
376
+
377
+ if (!$aff->check())
378
+ {
379
+ $errorTxt = "Hipay: An error occurred while creating an HIPAY_MAPI_Affiliate object";
380
+ Mage::log($errorTxt);
381
+ return null;
382
+ }
383
+ return aff;
384
+ }
385
+
386
+ /**
387
+ * Creates a HIPAY_MAPI_Product object, returns null if creation fails
388
+ * @param string $name
389
+ * @param string $info
390
+ * @param int $quantity
391
+ * @param string $reference
392
+ * @param int $category
393
+ * @param float $price
394
+ * @param array $taxes
395
+ */
396
+ protected function createProduct($name, $info, $quantity, $reference, $category, $price, $taxes)
397
+ {
398
+ $item = new HIPAY_MAPI_Product();
399
+ $item->setName($name);
400
+ $item->setInfo($info);
401
+ $item->setquantity($quantity);
402
+ $item->setRef($reference);
403
+ $item->setCategory($category);
404
+ $item->setPrice($price);
405
+ $item->setTax($taxes);
406
+
407
+ if (!$item->check())
408
+ {
409
+ $errorTxt = "Hipay: An error occurred while creating a HIPAY_MAPI_Product object";
410
+ Mage::log($errorTxt);
411
+ return null;
412
+ }
413
+ return $item;
414
+ }
415
+
416
+
417
+ /**
418
+ * Creates a HIPAY_MAPI_Order() object, returns null if creation fails
419
+ *
420
+ * @param string $orderTitle Order title
421
+ * @param string $orderInfo Order information
422
+ * @param int $orderCategory The order category - e.g. 3 (Books). Refer to annex 7 in the merchant kit doc to see how to find out what category your site belongs to.
423
+ * @param float $shippingAmount The shipping costs
424
+ * @param array $shippingTaxes The shipping taxes
425
+ * @param float $insuranceAmount The insurance costs
426
+ * @param array $insuranceTaxes The insurance taxes
427
+ * @param float $fixCostAmount The fix costs
428
+ * @param array $fixCostTaxes The fix taxes
429
+ * @param array $affiliates Affiliates
430
+ */
431
+ protected function createOrder($orderTitle, $orderInfo, $orderCategory, $shippingAmount, $shippingTaxes, $insuranceAmount, $insuranceTaxes, $fixCostAmount, $fixCostTaxes, $affiliates)
432
+ {
433
+ $order = new HIPAY_MAPI_Order();
434
+ $order->setOrderTitle($orderTitle);
435
+ $order->setOrderInfo($orderInfo);
436
+ $order->setOrderCategory($orderCategory);
437
+ $order->setShipping($shippingAmount, $shippingTaxes);
438
+ $order->setInsurance($insuranceAmount, $insuranceTaxes);
439
+ $order->setFixedCost($fixCostAmount, $fixCostTaxes);
440
+ $order->setAffiliate($affiliates);
441
+
442
+ if (!$order->check())
443
+ {
444
+ $errorTxt = "Hipay: An error occurred while creating a HIPAY_MAPI_Order object";
445
+ Mage::log($errorTxt);
446
+ return null;
447
+ }
448
+ return $order;
449
+ }
450
+
451
+
452
+ /**
453
+ * Creates a HIPAY_MAPI_SimplePayment object, return null if creation fails
454
+ *
455
+ * @param HIPAY_MAPI_PaymentParams $params
456
+ * @param HIPAY_MAPI_Order $order
457
+ * @param array $items
458
+ */
459
+ protected function createSimplePayment($params, $order, $items)
460
+ {
461
+ try {
462
+ $payment = new HIPAY_MAPI_SimplePayment($params,$order,$items);
463
+ }
464
+ catch (Exception $ex)
465
+ {
466
+ $errorTxt = "Hipay: Error" . $ex->getMessage();
467
+ Mage::log($errorTxt);
468
+ return null;
469
+ }
470
+ return $payment;
471
+ }
472
+
473
+ /**
474
+ * Returns the current Hipay URL
475
+ * @param unknown_type $accountmode
476
+ */
477
+ protected function getHipayUrl($accountmode)
478
+ {
479
+ if($accountmode == 'HIPAY_GATEWAY_TEST_URL') {
480
+ return HIPAY_GATEWAY_TEST_URL;
481
+ }
482
+ else if($accountmode == 'HIPAY_GATEWAY_URL') {
483
+ return HIPAY_GATEWAY_URL;
484
+ }
485
+ Mage::log("Hipay: Undefined account mode: '".$accountmode."'");
486
+ return '';
487
+ }
488
+
489
+ /**
490
+ * Returns the current Hipay category URL
491
+ * @param unknown_type $accountmode
492
+ */
493
+ public function getHipayCategoryUrl($accountmode)
494
+ {
495
+ if($accountmode == 'HIPAY_GATEWAY_TEST_URL') {
496
+ return HIPAY_CATEGORY_TEST_URL;
497
+ }
498
+ else if($accountmode == 'HIPAY_GATEWAY_URL') {
499
+ return HIPAY_CATEGORY_URL;
500
+ }
501
+ Mage::log("Hipay: Undefined account mode: '".$accountmode."'");
502
+ return '';
503
+ }
504
+
505
+ /**
506
+ * Returns REST call response
507
+ *
508
+ * @param string $url
509
+ */
510
+ public static function sendRestCall($url="")
511
+ {
512
+ if ($url=="") {
513
+ return false;
514
+ } else {
515
+ $turl=parse_url($url);
516
+ }
517
+
518
+ // if (!isset($turl['path']))
519
+ // $turl['path']='/';
520
+
521
+ $curl = curl_init();
522
+ curl_setopt($curl,CURLOPT_TIMEOUT, HIPAY_MAPI_CURL_TIMEOUT);
523
+ curl_setopt($curl,CURLOPT_POST,1);
524
+ curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
525
+ curl_setopt($curl,CURLOPT_USERAGENT,"HIPAY");
526
+ curl_setopt($curl,CURLOPT_URL, $turl['scheme'].'://'.$turl['host'].$turl['path']);
527
+ // curl_setopt($curl,CURLOPT_POSTFIELDS,'xml='.urlencode($xml));
528
+
529
+ if(HIPAY_MAPI_CURL_PROXY_ON === true)
530
+ {
531
+ curl_setopt($curl, CURLOPT_PROXY, HIPAY_MAPI_CURL_PROXY);
532
+ curl_setopt($curl, CURLOPT_PROXYPORT, HIPAY_MAPI_CURL_PROXYPORT);
533
+ }
534
+
535
+ if(HIPAY_MAPI_CURL_LOG_ON === true)
536
+ {
537
+ $errorFileLog = fopen(HIPAY_MAPI_CURL_LOGFILE, "a+");
538
+ curl_setopt($curl, CURLOPT_VERBOSE, true);
539
+ curl_setopt($curl, CURLOPT_STDERR, $errorFileLog);
540
+ }
541
+
542
+ curl_setopt($curl, CURLOPT_HEADER, 0);
543
+
544
+ ob_start();
545
+ if (curl_exec($curl) !== true)
546
+ {
547
+ $output = $turl['scheme'].'://'.$turl['host'].$turl['path'].' is not reachable';
548
+ $output .= '<br />Network problem ? Verify your proxy configuration in mapi_defs.php';
549
+ }
550
+ else {
551
+ $output = ob_get_contents();
552
+ }
553
+
554
+ ob_end_clean();
555
+ curl_close($curl);
556
+ if(HIPAY_MAPI_CURL_LOG_ON === true)
557
+ {
558
+ fclose($errorFileLog);
559
+ }
560
+ return $output;
561
+ }
562
+
563
+ /**
564
+ * Erzeugt einen Token
565
+ */
566
+ public function generateToken()
567
+ {
568
+ $seed = crc32(uniqid(sha1(microtime(true) . getmypid()), true));
569
+ mt_srand($seed);
570
+ $n = mt_rand(1, 200);
571
+ for ($i = 0; $i < $n; $i++) {
572
+ $token = mt_rand();
573
+ }
574
+ return $token;
575
+ }
576
+ }
app/code/local/HimediaPayments/Hipay/Mapi/mapi_affiliate.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Objet représentant un affilié
44
+ * montant de base : montant à partir duquel est calculé le montant qui sera distribué à l'affilié
45
+ * cible : si l'affiliation est un piurcentage, la cible indique sur quels montant de la transaction
46
+ * s'applique ce pourcentage
47
+ * montant calculé : montant reversé à l'affilié
48
+ *
49
+ *
50
+ */
51
+ class HIPAY_MAPI_Affiliate extends HIPAY_MAPI_lockable {
52
+ /**
53
+ * Numéro de client
54
+ *
55
+ * @var int
56
+ */
57
+ protected $customerId;
58
+
59
+ /**
60
+ * Numéro de compte
61
+ *
62
+ * @var unknown_type
63
+ */
64
+ protected $accountId;
65
+
66
+ /**
67
+ * Valeur de l'affiliation (montant fixe ou pourcentage)
68
+ *
69
+ * @var float
70
+ */
71
+ protected $val;
72
+
73
+ /**
74
+ * Si >0, $val est un pourcentage et $percentageTarget détermine
75
+ * sur quels montants appliquer le pourcentage
76
+ *
77
+ * @var unknown_type
78
+ */
79
+ protected $percentageTarget;
80
+
81
+ /**
82
+ * Montant à reversé à l'affilié
83
+ *
84
+ * @var unknown_type
85
+ */
86
+ protected $_amount;
87
+
88
+ /**
89
+ * Montant de base sur lequel est calculé le montant
90
+ * reversé à l'affilié
91
+ *
92
+ * @var unknown_type
93
+ */
94
+ protected $_baseAmount;
95
+
96
+
97
+ /**
98
+ * Assigne le numéro de client
99
+ *
100
+ * @param int $customerId
101
+ * @return boolean
102
+ */
103
+ public function setCustomerId($customerId) {
104
+ if ($this->_locked)
105
+ return false;
106
+
107
+ $customerId = (int)$customerId;
108
+ if ($customerId<=0)
109
+ return false;
110
+ $this->customerId = $customerId;
111
+ return true;
112
+ }
113
+
114
+ /**
115
+ * Retourne le numéro de client
116
+ *
117
+ * @return int
118
+ */
119
+ public function getCustomerId() {
120
+ return $this->customerId;
121
+ }
122
+
123
+ /**
124
+ * Assigne le numéro de compte
125
+ *
126
+ * @param int $accountId
127
+ * @return boolean
128
+ */
129
+ public function setAccountId($accountId) {
130
+ if ($this->_locked)
131
+ return false;
132
+
133
+ $accountId = (int)$accountId;
134
+ if ($accountId<=0)
135
+ return false;
136
+ $this->accountId = $accountId;
137
+ return true;
138
+ }
139
+
140
+ /**
141
+ * Retourne le numéro de compte
142
+ *
143
+ * @return int
144
+ */
145
+ public function getAccountId() {
146
+ return $this->accountId;
147
+ }
148
+
149
+ /**
150
+ * Assigne le valeur de l'affiliation, qui est un montant fixe ou un pourcentage
151
+ * S'il s'agit d'un pourcentage, $percentageTarget représente la cible, c'est à dire sur quels
152
+ * montants est basé le montant de l'affiliation
153
+ *
154
+ * @param float $val
155
+ * @param int $percentageTarget
156
+ * @return boolean
157
+ */
158
+ public function setValue($val,$percentageTarget=0) {
159
+ if ($this->_locked)
160
+ return false;
161
+
162
+ $val = sprintf('%.02f',(float)$val);
163
+ $percentageTarget = (int)$percentageTarget;
164
+ if ($val<=0 || $percentageTarget<0)
165
+ return false;
166
+ if ($percentageTarget>0 && $val>100)
167
+ return false;
168
+ if ($percentageTarget>0 && $percentageTarget>HIPAY_MAPI_TTARGET_ALL)
169
+ return false;
170
+ $this->val = $val;
171
+ $this->percentageTarget = $percentageTarget;
172
+ $this->setAmount();
173
+ return true;
174
+ }
175
+
176
+ /**
177
+ * Retourne la valeur de l'affiliation
178
+ *
179
+ * @return float
180
+ */
181
+ public function getValue() {
182
+ return $this->val;
183
+ }
184
+
185
+ /**
186
+ * Retourne sur quoi s'applique le pourcentage
187
+ *
188
+ * @return int
189
+ */
190
+ public function getPercentageTarget() {
191
+ return $this->percentageTarget;
192
+ }
193
+
194
+ /**
195
+ * Assigne le montant sur lequel sera calculé l'affiliation
196
+ *
197
+ * @param float $baseAmount
198
+ * @return boolean
199
+ */
200
+ public function setBaseAmount($baseAmount) {
201
+ if ($this->_locked)
202
+ return false;
203
+
204
+ $baseAmount = sprintf('%.02f',(float)$baseAmount);
205
+
206
+ if ($baseAmount<0)
207
+ return false;
208
+ $this->_baseAmount = $baseAmount;
209
+ $this->setAmount();
210
+ return true;
211
+ }
212
+
213
+ /**
214
+ * Retourne le montant sur lequel sera calculé l'affiliation
215
+ *
216
+ * @return int
217
+ */
218
+ public function getBaseAmount() {
219
+ return $this->_baseAmount;
220
+ }
221
+
222
+
223
+ /**
224
+ * Retourne le montant calculé de l'affiliation
225
+ *
226
+ * @return float
227
+ */
228
+ public function getAmount() {
229
+ return $this->_amount;
230
+ }
231
+
232
+ /**
233
+ * Assigne le montant calculé de l'affiliation
234
+ *
235
+ */
236
+ protected function setAmount() {
237
+ if ($this->percentageTarget>0) {
238
+ $this->_amount = sprintf('%.02f',($this->_baseAmount/100)*$this->val);
239
+ } else {
240
+ $this->_amount = sprintf('%.02f',$this->_baseAmount);
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Vérifie que l'objet est bien initialisé
246
+ *
247
+ * @return boolean
248
+ */
249
+ public function check() {
250
+ if ($this->customerId<=0 || $this->accountId<=0 || $this->val<=0 || $this->percentageTarget<0)
251
+ throw new Exception('Numéro de client, numéro de compte, valeur ou cible incorrects');
252
+ return true;
253
+ }
254
+
255
+ protected function init() {
256
+ $this->customerId = 0;
257
+ $this->accountId = 0;
258
+ $this->_amount = 0;
259
+ $this->_baseAmount = 0;
260
+ $this->val = 0;
261
+ $this->percentageTarget = 0;
262
+ }
263
+
264
+
265
+ function __construct() {
266
+ $this->init();
267
+ parent::__construct();
268
+ }
269
+ }
270
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_comm_xml.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_COMM_XML
43
+ {
44
+ /**
45
+ * Traitement de la réponse de la plateforme après l'envoi du
46
+ * flux représentant un paiement
47
+ *
48
+ * @param string $xml
49
+ * @param string $url
50
+ * @param string $err_msg
51
+ * @return boolean
52
+ */
53
+ public static function analyzeResponseXML($xml, &$url, &$err_msg)
54
+ {
55
+ $url='';
56
+ $err_msg='';
57
+ try {
58
+ $obj = @new SimpleXMLElement(trim($xml));
59
+ } catch (Exception $e) {
60
+ return false;
61
+ }
62
+ if (isset($obj->result[0]->url)) {
63
+ $url = $obj->result[0]->url;
64
+ return true;
65
+ }
66
+ if (isset($obj->result[0]->message))
67
+ $err_msg = $obj->result[0]->message;
68
+
69
+ return false;
70
+
71
+ }
72
+
73
+ /**
74
+ * Traitement du flux XML envoyé par HiPay notifiant le résultat d'une action sur une transaction
75
+ *
76
+ * @param string $xml
77
+ * @param string $status
78
+ * @param string $date
79
+ * @param string $time
80
+ * @param string $transid
81
+ * @param string $origAmount
82
+ * @param string $origCurrency
83
+ * @param string $idformerchant
84
+ * @param array $merchantdatas
85
+ * @param string $emailClient
86
+ * @param string $subscriptionId
87
+ * @param array $refProduct
88
+ * @return boolean
89
+ */
90
+ public static function analyzeNotificationXML($xml,&$operation,&$status,&$date,&$time,&$transid,&$origAmount,&$origCurrency,&$idformerchant,&$merchantdatas,&$emailClient,&$subscriptionId,&$refProduct)
91
+ {
92
+ $operation='';
93
+ $status='';
94
+ $date='';
95
+ $time='';
96
+ $transid='';
97
+ $origAmount='';
98
+ $origCurrency='';
99
+ $idformerchant='';
100
+ $merchantdatas=array();
101
+ $emailClient='';
102
+ $subscriptionId='';
103
+ $refProduct=array();
104
+ try {
105
+ $obj = new SimpleXMLElement(trim($xml));
106
+ } catch (Exception $e) {
107
+ return false;
108
+ }
109
+ if (isset($obj->result[0]->operation))
110
+ $operation=$obj->result[0]->operation;
111
+ else return false;
112
+
113
+ if (isset($obj->result[0]->status))
114
+ $status=$obj->result[0]->status;
115
+ else return false;
116
+
117
+ if (isset($obj->result[0]->date))
118
+ $date=$obj->result[0]->date;
119
+ else return false;
120
+
121
+ if (isset($obj->result[0]->time))
122
+ $time=$obj->result[0]->time;
123
+ else return false;
124
+
125
+ if (isset($obj->result[0]->transid))
126
+ $transid=$obj->result[0]->transid;
127
+ else return false;
128
+
129
+ if (isset($obj->result[0]->origAmount))
130
+ $origAmount=$obj->result[0]->origAmount;
131
+ else return false;
132
+
133
+ if (isset($obj->result[0]->origCurrency))
134
+ $origCurrency=$obj->result[0]->origCurrency;
135
+ else return false;
136
+
137
+ if (isset($obj->result[0]->idForMerchant))
138
+ $idformerchant=$obj->result[0]->idForMerchant;
139
+ else return false;
140
+
141
+ if (isset($obj->result[0]->merchantDatas)) {
142
+ $d = $obj->result[0]->merchantDatas->children();
143
+ foreach($d as $xml2) {
144
+ if (preg_match('#^_aKey_#i',$xml2->getName())) {
145
+ $indice = substr($xml2->getName(),6);
146
+ $xml2 = (array)$xml2;
147
+ $valeur = (string)$xml2[0];
148
+ $merchantdatas[$indice]=$valeur;
149
+ }
150
+ }
151
+
152
+ }
153
+
154
+ if (isset($obj->result[0]->emailClient))
155
+ $emailClient=$obj->result[0]->emailClient;
156
+ else return false;
157
+
158
+ if (isset($obj->result[0]->subscriptionId))
159
+ $subscriptionId=$obj->result[0]->subscriptionId;
160
+
161
+ foreach($obj->result[0] as $key=>$value)
162
+ {
163
+ if(preg_match('#^refProduct[\d]#', $key)) {
164
+ $refProduct[] = (string)$value;
165
+ }
166
+ }
167
+
168
+ return true;
169
+ }
170
+ }
171
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_defs.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ /**
44
+ * Définition des montants sur lesquels s'appliquent les taxes
45
+ *
46
+ */
47
+ define('HIPAY_MAPI_TTARGET_TAX', 1);
48
+ define('HIPAY_MAPI_TTARGET_INSURANCE', 2);
49
+ define('HIPAY_MAPI_TTARGET_FCOST', 4);
50
+ define('HIPAY_MAPI_TTARGET_SHIPPING', 8);
51
+ define('HIPAY_MAPI_TTARGET_ITEM', 16);
52
+ define('HIPAY_MAPI_TTARGET_ALL',HIPAY_MAPI_TTARGET_TAX+HIPAY_MAPI_TTARGET_INSURANCE+HIPAY_MAPI_TTARGET_FCOST+HIPAY_MAPI_TTARGET_SHIPPING+HIPAY_MAPI_TTARGET_ITEM);
53
+
54
+ /**
55
+ * Type de paiements possibles
56
+ *
57
+ */
58
+ define('HIPAY_MAPI_METHOD_SIMPLE',0);
59
+ define('HIPAY_MAPI_METHOD_MULTI',1);
60
+
61
+ /**
62
+ * Valeurs par défaut
63
+ *
64
+ */
65
+ define('HIPAY_MAPI_DEFLANG','fr_FR');
66
+ define('HIPAY_MAPI_DEFMEDIA','WEB');
67
+
68
+ define('HIPAY_MAPI_MAX_INFO_LENGTH',200);
69
+ define('HIPAY_MAPI_MAX_TITLE_LENGTH',80);
70
+
71
+ define('HIPAY_MAPI_MAX_LOGIN_LENGTH',20);
72
+ define('HIPAY_MAPI_MAX_PASSWORD_LENGTH',20);
73
+
74
+ define('HIPAY_MAPI_MAX_RATING_LENGTH',8);
75
+
76
+ define('HIPAY_MAPI_MAX_MDATAS_LENGTH',200);
77
+
78
+ define('HIPAY_MAPI_MAX_ACKWD_LENGTH',8);
79
+
80
+ define('HIPAY_MAPI_MAX_ACKMAIL_LENGTH',64);
81
+
82
+ define('HIPAY_MAPI_MAX_PRODUCT_NAME_LENGTH',100);
83
+
84
+ define('HIPAY_MAPI_MAX_PRODUCT_INFO_LENGTH',100);
85
+
86
+ define('HIPAY_MAPI_MAX_PRODUCT_REF_LENGTH',35);
87
+
88
+ define('HIPAY_MAPI_MAX_TAX_NAME_LENGTH',32);
89
+
90
+ /**
91
+ * Valeurs particulières pour le délai de capture
92
+ *
93
+ */
94
+ define('HIPAY_MAPI_CAPTURE_MANUAL',-1);
95
+ define('HIPAY_MAPI_CAPTURE_IMMEDIATE',0);
96
+ define('HIPAY_MAPI_CAPTURE_MAX_DAYS',7);
97
+
98
+ define('HIPAY_MAPI_OPE_AUTH','authorization');
99
+ define('HIPAY_MAPI_OPE_CANCEL','cancellation');
100
+ define('HIPAY_MAPI_OPE_REFUND','refund');
101
+ define('HIPAY_MAPI_OPE_CAPTURE','capture');
102
+ define('HIPAY_MAPI_OPE_REJECT','rejet');
103
+
104
+ define('HIPAY_MAPI_STATUS_OK','ok');
105
+ define('HIPAY_MAPI_STATUS_NOK','nok');
106
+
107
+ // Nombre de secondes avant le timeout de curl avec le serveur Hipay
108
+ // A régler en fonction de votre rapidité d'accès à la plate forme hipay
109
+ define('HIPAY_MAPI_CURL_TIMEOUT', 30);
110
+
111
+ // Configuration d'un serveur proxy
112
+ // activer cette option a true pour demander au curl de passer par un proxy
113
+ define('HIPAY_MAPI_CURL_PROXY_ON', false);
114
+ // Adresse du proxy
115
+ define('HIPAY_MAPI_CURL_PROXY', 'http://');
116
+ // port du proxy
117
+ define('HIPAY_MAPI_CURL_PROXYPORT','');
118
+
119
+ // Configuration d'un fichier de log pour curl en cas de pb de connexion avec le serveur Hipay
120
+ define('HIPAY_MAPI_CURL_LOG_ON', false);
121
+ // fichier de log de curl (sous environnement windows, le chemin du fichier pourra être de type C:\tmp\mapicurl.log)
122
+ define('HIPAY_MAPI_CURL_LOGFILE', '/tmp/curl.log');
123
+
124
+ define('MAPI_VERSION','1.0');
125
+
126
+ define('HIPAY_GATEWAY_URL','https://payment.hipay.com/order/');
127
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_defs_ext.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ /**
44
+ * Extended MAPI definitions
45
+ *
46
+ */
47
+ define('HIPAY_GATEWAY_TEST_URL','https://test-payment.hipay.com/order/');
48
+
49
+ define('HIPAY_CATEGORY_TEST_URL','https://test.payment.hipay.com/order/list-categories/id/');
50
+ define('HIPAY_CATEGORY_URL','https://payment.hipay.com/order/list-categories/id/');
51
+
52
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_exception.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ define('MAPI_EXCEPTION_AFFILIATE_BASE_ERROR',101);
43
+ define('MAPI_EXCEPTION_AFFILIATE_UNKNOWN_AFFILIATE',102);
44
+ define('MAPI_EXCEPTION_AFFILIATE_INCORRECT_EU',103);
45
+ define('MAPI_EXCEPTION_AFFILIATE_CUSTOMER_ID_ERROR',104);
46
+ define('MAPI_EXCEPTION_AFFILIATE_ACCOUNT_ID_ERROR',105);
47
+ define('MAPI_EXCEPTION_AFFILIATE_VALUE_ERROR',106);
48
+ define('MAPI_EXCEPTION_AFFILIATE_INCORRECT_TAG',107);
49
+
50
+
51
+ define('MAPI_EXCEPTION_INSTALLMENT_BASE_ERROR',201);
52
+ define('MAPI_EXCEPTION_INSTALLMENT_SETFIRST_ERROR',202);
53
+ define('MAPI_EXCEPTION_INSTALLMENT_FIRST_BOOLEAN',203);
54
+ define('MAPI_EXCEPTION_INSTALLMENT_PRICE_ERROR',204);
55
+ define('MAPI_EXCEPTION_INSTALLMENT_INCORRECT_TAG',205);
56
+ define('MAPI_EXCEPTION_INSTALLMENT_TAX_ERROR',206);
57
+
58
+
59
+ define('MAPI_EXCEPTION_MULTIPLEP_ORDER_TAG_CONTENT_ERROR',301);
60
+ define('MAPI_EXCEPTION_MULTIPLEP_ORDER_TAG_TOO_MANY_OBJECTS',302);
61
+ define('MAPI_EXCEPTION_MULTIPLEP_ITEMS_TAG_CONTENT_ERROR',303);
62
+ define('MAPI_EXCEPTION_MULTIPLEP_ITEMS_TAG_TOO_MANY_OBJECTS',304);
63
+ define('MAPI_EXCEPTION_MULTIPLEP_INCORRECT_TAG',305);
64
+ define('MAPI_EXCEPTION_MULTIPLEP_CONSTRUCT_ERROR',306);
65
+
66
+
67
+ define('MAPI_EXCEPTION_ORDER_BASE_ERROR',401);
68
+ define('MAPI_EXCEPTION_ORDER_UNKNOWN_CATEGORY',402);
69
+ define('MAPI_EXCEPTION_ORDER_TITLE_ERROR',403);
70
+ define('MAPI_EXCEPTION_ORDER_INFO_ERROR',404);
71
+ define('MAPI_EXCEPTION_ORDER_UNKNOWN_TAG',405);
72
+ define('MAPI_EXCEPTION_ORDER_SHIPPING_ERROR',406);
73
+ define('MAPI_EXCEPTION_ORDER_INSURANCE_ERROR',407);
74
+ define('MAPI_EXCEPTION_ORDER_FCOST_ERROR',408);
75
+ define('MAPI_EXCEPTION_ORDER_AFFILIATE_ERROR',409);
76
+
77
+
78
+ define('MAPI_EXCEPTION_SIMPLEP_ORDER_TAG_CONTENT_ERROR',501);
79
+ define('MAPI_EXCEPTION_SIMPLEP_ITEMS_TAG_CONTENT_ERROR',502);
80
+ define('MAPI_EXCEPTION_SIMPLEP_INCORRECT_TAG',503);
81
+ define('MAPI_EXCEPTION_SIMPLEP_CONSTRUCT_ERROR',504);
82
+
83
+ define('MAPI_EXCEPTION_PARAMS_BASE_ERROR',601);
84
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_LOGIN',602);
85
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_PASSWORD',603);
86
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_LOGIN_2',604);
87
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_ITEM_ACCT',605);
88
+ define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_ITEM_ACCT',606);
89
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_ITEM_ACCT_2',607);
90
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAX_ACCT',608);
91
+ define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_TAX_ACCT',609);
92
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAX_ACCT_2',610);
93
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_INS_ACCT',611);
94
+ define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_INS_ACCT',612);
95
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_INS_ACCT_2',613);
96
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_FCOST_ACCT',614);
97
+ define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_FCOST_ACCT',615);
98
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_FCOST_ACCT_2',616);
99
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_SHIP_ACCT',617);
100
+ define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_SHIP_ACCT',618);
101
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_SHIP_ACCT_2',619);
102
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_EU_ID',620);
103
+ define('MAPI_EXCEPTION_PARAMS_NO_LANG_AVAILABLE',621);
104
+ define('MAPI_EXCEPTION_PARAMS_LANG_NOT_SUPPORTED',622);
105
+ define('MAPI_EXCEPTION_PARAMS_NO_MEDIA_AVAILABLE',623);
106
+ define('MAPI_EXCEPTION_PARAMS_MEDIA_NOT_SUPPORTED',624);
107
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_RATING',625);
108
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_PAYMENT_METHOD',626);
109
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_CURRENCY',627);
110
+ define('MAPI_EXCEPTION_PARAMS_INCORRECT_MERCH_SITE_ID',628);
111
+ define('MAPI_EXCEPTION_PARAMS_LANG_ERROR',629);
112
+ define('MAPI_EXCEPTION_PARAMS_MEDIA_ERROR',630);
113
+ define('MAPI_EXCEPTION_PARAMS_RATING_ERROR',631);
114
+ define('MAPI_EXCEPTION_PARAMS_METHOD_ERROR',632);
115
+ define('MAPI_EXCEPTION_PARAMS_CAPTURE_DAY_ERROR',633);
116
+ define('MAPI_EXCEPTION_PARAMS_CURRENCY_ERROR',634);
117
+ define('MAPI_EXCEPTION_PARAMS_ID_MERCHANT_ERROR',635);
118
+ define('MAPI_EXCEPTION_PARAMS_SITE_ID_ERROR',636);
119
+ define('MAPI_EXCEPTION_PARAMS_URLOK_ERROR',637);
120
+ define('MAPI_EXCEPTION_PARAMS_URLNOK_ERROR',638);
121
+ define('MAPI_EXCEPTION_PARAMS_URLCAN_ERROR',639);
122
+ define('MAPI_EXCEPTION_PARAMS_URLACK_ERROR',640);
123
+ define('MAPI_EXCEPTION_PARAMS_ACKWD_ERROR',641);
124
+ define('MAPI_EXCEPTION_PARAMS_EMAILACK_ERROR',642);
125
+ define('MAPI_EXCEPTION_PARAMS_BGCOLOR_ERROR',643);
126
+ define('MAPI_EXCEPTION_PARAMS_URLLOGO_ERROR',644);
127
+ define('MAPI_EXCEPTION_PARAMS_MDATAS_ERROR',645);
128
+ define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAG',646);
129
+ define('MAPI_EXCEPTION_PARAMS_LOGIN_ERROR',647);
130
+ define('MAPI_EXCEPTION_PARAMS_ACCTS_ERROR',648);
131
+ define('MAPI_EXCEPTION_PARAMS_ID_GROUP_ERROR',649);
132
+
133
+
134
+ define('MAPI_EXCEPTION_PRODUCT_BASE_ERROR',701);
135
+ define('MAPI_EXCEPTION_PRODUCT_NAME_ERROR',702);
136
+ define('MAPI_EXCEPTION_PRODUCT_INFO_ERROR',703);
137
+ define('MAPI_EXCEPTION_PRODUCT_QUANTITY_ERROR',704);
138
+ define('MAPI_EXCEPTION_PRODUCT_REF_ERROR',705);
139
+ define('MAPI_EXCEPTION_PRODUCT_CATEGORY_ERROR',706);
140
+ define('MAPI_EXCEPTION_PRODUCT_PRICE_ERROR',707);
141
+ define('MAPI_EXCEPTION_PRODUCT_INCORRECT_TAG',708);
142
+ define('MAPI_EXCEPTION_PRODUCT_TAX_ERROR',709);
143
+
144
+ define('MAPI_EXCEPTION_TAX_BASE_ERROR',801);
145
+ define('MAPI_EXCEPTION_TAX_NAME_ERROR',802);
146
+ define('MAPI_EXCEPTION_TAX_ACCOUNT_ERROR',803);
147
+ define('MAPI_EXCEPTION_TAX_PERCENTAGE_NOT_BOOLEAN_ERROR',804);
148
+ define('MAPI_EXCEPTION_TAX_VALUE_ERROR',805);
149
+ define('MAPI_EXCEPTION_TAX_INCORRECT_TAG',806);
150
+
151
+ class MAPI_Exception extends Exception {
152
+ private $keyword;
153
+ private $value;
154
+ function __construct($keyword,$value,$msg,$code=0) {
155
+ $this->keyword=$keyword;
156
+ $this->value=$value;
157
+ parent::__construct($msg,$code);
158
+ }
159
+
160
+ public function getKeyword() {
161
+ return $this->keyword;
162
+ }
163
+ public function getValue() {
164
+ return $this->value;
165
+ }
166
+ }
167
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_installment.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente la ligne de la commande pour un paiement récurrent
44
+ *
45
+ */
46
+ class HIPAY_MAPI_Installment extends HIPAY_MAPI_Item {
47
+
48
+ /**
49
+ * Montant HT
50
+ *
51
+ * @var float
52
+ */
53
+ protected $price;
54
+
55
+ /**
56
+ * Taxes s'appliquant à ce paiement
57
+ *
58
+ * @var array
59
+ */
60
+ protected $tax;
61
+
62
+ /**
63
+ * Indique s'il s'agit du premier paiement (true) ou des suivants (false)
64
+ *
65
+ * @var boolean
66
+ */
67
+ protected $first;
68
+
69
+ /**
70
+ * Délai avant le déclenchement du premier paiement (si $first=true),
71
+ * ou interval entre les paiements suivants (si $first=false)
72
+ *
73
+ * @var string
74
+ */
75
+ protected $paymentDelay;
76
+
77
+ /**
78
+ * timestamp du premier paiement ou des paiements récurrents
79
+ *
80
+ * @var integer
81
+ */
82
+ protected $_delayTS;
83
+
84
+
85
+ /**
86
+ * Assigne le montant HT
87
+ *
88
+ * @param float $price
89
+ * @return boolean
90
+ */
91
+ public function setPrice($price) {
92
+ if ($this->_locked)
93
+ return false;
94
+
95
+ $price = sprintf('%.02f',(float)$price);
96
+ if ($price<0)
97
+ return false;
98
+ $this->price=$price;
99
+ return true;
100
+ }
101
+
102
+ /**
103
+ * Retourne le montant HT
104
+ *
105
+ * @return float
106
+ */
107
+ public function getPrice() {
108
+ return $this->price;
109
+ }
110
+
111
+ /**
112
+ * Défini s'il s'agit du premier paiement ou des suivants et le délai de déclenchement
113
+ *
114
+ * @param boolean $first
115
+ * @param string $paymentDelay
116
+ * @return boolean
117
+ */
118
+ public function setFirst($first,$paymentDelay) {
119
+ if ($this->_locked)
120
+ return false;
121
+ if (!is_bool($first))
122
+ return false;
123
+ $paymentDelay=trim($paymentDelay);
124
+ if ($first) {
125
+ if (!preg_match("#[0-9]+[HDM]#",$paymentDelay))
126
+ {
127
+ return false;
128
+ }
129
+ } else {
130
+ if (!preg_match("#[0-9]+[DM]#",$paymentDelay)) {
131
+ return false;
132
+ }
133
+ }
134
+ $num = (int)substr($paymentDelay,0,strlen($paymentDelay)-1);
135
+ if (($num<1 && !$first) || ($num<0 && $first) || $num>365) {
136
+ return false;
137
+ }
138
+ $this->first=$first;
139
+ $this->paymentDelay=$paymentDelay;
140
+ return true;
141
+ }
142
+
143
+ /**
144
+ * Assigne les taxes s'appliquant à ce paiement
145
+ *
146
+ * @param array $tax
147
+ * @return boolean
148
+ */
149
+ public function setTax($tax) {
150
+ if ($this->_locked)
151
+ return false;
152
+
153
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax'))
154
+ return false;
155
+ foreach ($tax as $obj)
156
+ $this->tax[]= clone $obj;
157
+ return true;
158
+ }
159
+
160
+ /**
161
+ * assigne le timestamp du premier paiement ou des paiements récurrents
162
+ *
163
+ */
164
+ public function setDelayTS( $baseTS=0 )
165
+ {
166
+ if( (int)$baseTS <= 0 ) {
167
+ $baseTS = time();
168
+ }
169
+
170
+ switch( substr($this->paymentDelay, -1, 1) ) {
171
+ case 'd': case 'D': $unit='day'; break;
172
+ case 'm': case 'M': $unit='month'; break;
173
+ case 'h': case 'H':
174
+ default : $unit='hour'; break;
175
+ }
176
+
177
+ $this->_delayTS = strtotime( '+'.substr($this->paymentDelay, 0, -1).' '.$unit, $baseTS );
178
+ }
179
+
180
+ /**
181
+ * Retourne les taxes s'appliquant à ce paiement
182
+ *
183
+ * @return array
184
+ */
185
+ public function getTax() {
186
+ return $this->tax;
187
+ }
188
+
189
+ /**
190
+ * Retourne s'il s'agit du premier paiement
191
+ *
192
+ * @return boolean
193
+ */
194
+ public function getFirst() {
195
+ return $this->first;
196
+ }
197
+
198
+ /**
199
+ * Retourne le délai de déclenchement
200
+ *
201
+ * @return string
202
+ */
203
+ public function getPaymentDelay() {
204
+ return $this->paymentDelay;
205
+ }
206
+
207
+ /**
208
+ * retourne le timestamp du premier paiement
209
+ *
210
+ */
211
+ public function getDelayTS()
212
+ {
213
+ return $this->_delayTS;
214
+ }
215
+
216
+ /**
217
+ * Vérifie si l'objet est correctement initialisé
218
+ *
219
+ * @return float
220
+ */
221
+ public function check() {
222
+ if ($this->price<0)
223
+ throw new Exception('Montant invalide ou pas initilisé');
224
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax'))
225
+ throw new Exception('Taxes invalides ou pas initialisées');
226
+ foreach($this->tax as $obj) {
227
+ if (!$obj->check())
228
+ return false;
229
+ }
230
+ if (!is_bool($this->first))
231
+ throw new Exception('Premier paiement ou suivant n\'est pas initialisé');
232
+ return true;
233
+ }
234
+
235
+ protected function init()
236
+ {
237
+ $this->price = -1;
238
+ $this->tax = array();
239
+ $this->first = '';
240
+ $this->paymentDelay = '';
241
+ $this->_delayTS = '';
242
+ }
243
+
244
+ function __construct() {
245
+ $this->init();
246
+ parent::__construct();
247
+ }
248
+ }
249
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_item.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente une ligne de la commande
44
+ *
45
+ */
46
+ class HIPAY_MAPI_Item extends HIPAY_MAPI_lockable {
47
+ function __construct() {
48
+ parent::__construct();
49
+ }
50
+
51
+ public function getName() {
52
+ return '';
53
+ }
54
+ public function getInfo() {
55
+ return '';
56
+ }
57
+ public function getQuantity() {
58
+ return 1;
59
+ }
60
+ public function getRef() {
61
+ return '';
62
+ }
63
+ public function getCategory() {
64
+ return 1;
65
+ }
66
+ public function getPrice() {
67
+ return 0;
68
+ }
69
+ public function getTax() {
70
+ return array();
71
+ }
72
+ public function check() {
73
+ return false;
74
+ }
75
+
76
+ }
77
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_lockable.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_lockable extends HIPAY_MAPI_XML {
43
+ /**
44
+ * Etat du vérou
45
+ *
46
+ * @var boolean
47
+ */
48
+ protected $_locked;
49
+
50
+ /**
51
+ * Vérouille l'objet
52
+ *
53
+ */
54
+ public function lock() {
55
+ $this->_locked=true;
56
+ }
57
+
58
+ function __construct() {
59
+ $this->_locked=false;
60
+ }
61
+
62
+
63
+ }
64
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_multiplepayment.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente un paiement récurrent
44
+ * Un paiement simple contient :
45
+ * - 1 objet paramètres HIPAY_MAPI_PaymentParams
46
+ * - 1 objet order pour le premier paiement HIPAY_MAPI_Order
47
+ * - 1 objet installment pour le premier paiement HIPAY_MAPI_Installment
48
+ * - 1 objet order pour le second paiement HIPAY_MAPI_Order
49
+ * - 1 objet installment pour le second paiement HIPAY_MAPI_Installment
50
+ *
51
+ */
52
+
53
+ class HIPAY_MAPI_MultiplePayment extends HIPAY_MAPI_Payment {
54
+ function __construct(HIPAY_MAPI_PaymentParams $paymentParams,HIPAY_MAPI_Order $firstOrder,HIPAY_MAPI_Installment $firstInstallment,HIPAY_MAPI_Order $nextOrder,HIPAY_MAPI_Installment $nextInstallment) {
55
+ if ($firstInstallment->getFirst()===$nextInstallment->getFirst() || !$firstInstallment->getFirst()) {
56
+ throw new Exception('Vous devez définir un objet installment pour le premier et les paiements suivants');
57
+ }
58
+ $firstInstallment->setDelayTS();
59
+ $nextInstallment->setDelayTS( $firstInstallment->getDelayTS() );
60
+ try {
61
+ parent::__construct($paymentParams,array($firstOrder,$nextOrder),array($firstInstallment,$nextInstallment));
62
+ } catch(Exception $e) {
63
+ throw new Exception($e->getMessage());
64
+ }
65
+
66
+ }
67
+
68
+ /**
69
+ * Retourne le montant total de la somme devant être
70
+ * distribuée aux affiliés
71
+ */
72
+ protected function _getTotalAmountForAffiliates($installement_nr) {
73
+ $affiliates=$this->order[0]->getAffiliate();
74
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliates,'HIPAY_MAPI_Affiliate'))
75
+ return false;
76
+ $total_aff = 0;
77
+ foreach($affiliates as $aff) {
78
+ $total_aff+=$aff->getAmount();
79
+ }
80
+ return $total_aff;
81
+ }
82
+
83
+
84
+ }
85
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_order.php ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Objet représentant les informations de la commande
44
+ *
45
+ */
46
+ class HIPAY_MAPI_Order extends HIPAY_MAPI_lockable {
47
+
48
+ /**
49
+ * Montant des frais de livraison
50
+ *
51
+ * @var float
52
+ */
53
+ protected $shippingAmount;
54
+
55
+ /**
56
+ * Taxes s'appliquants aux frais de livraison
57
+ *
58
+ * @var array
59
+ */
60
+ protected $shippingTax;
61
+
62
+ /**
63
+ * Montant des assurances
64
+ *
65
+ * @var float
66
+ */
67
+ protected $insuranceAmount;
68
+
69
+ /**
70
+ * Taxes s'appliquants aux assurances
71
+ *
72
+ * @var array
73
+ */
74
+ protected $insuranceTax;
75
+
76
+ /**
77
+ * Montant des coûts fixes
78
+ *
79
+ * @var float
80
+ */
81
+ protected $fixedCostAmount;
82
+
83
+ /**
84
+ * Taxes s'appliquants aux coûts fixes
85
+ *
86
+ * @var array
87
+ */
88
+ protected $fixedCostTax;
89
+
90
+ /**
91
+ * Affiliés
92
+ *
93
+ * @var array
94
+ */
95
+ protected $affiliate;
96
+
97
+ /**
98
+ * Intitulé de la commande
99
+ *
100
+ * @var string
101
+ */
102
+ protected $orderTitle;
103
+
104
+ /**
105
+ * Informations sur la commande
106
+ *
107
+ * @var string
108
+ */
109
+ protected $orderInfo;
110
+
111
+ /**
112
+ * Catégorie de la commande
113
+ *
114
+ * @var int
115
+ */
116
+ protected $orderCategory;
117
+
118
+
119
+
120
+ /**
121
+ * Défini le montant des frais d'envoi et les taxes s'y appliquant
122
+ *
123
+ * @param float $shippingAmount
124
+ * @param array $shippingTax
125
+ * @return boolean
126
+ */
127
+ public function setShipping($shippingAmount,$shippingTax) {
128
+ if ($this->_locked)
129
+ return false;
130
+
131
+ $shippingAmount = sprintf('%.02f',(float)$shippingAmount);
132
+ if ($shippingAmount<0) {
133
+ return false;
134
+ }
135
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($shippingTax,'HIPAY_MAPI_Tax')) {
136
+ return false;
137
+ }
138
+ $this->shippingAmount=$shippingAmount;
139
+ foreach ($shippingTax as $obj)
140
+ $this->shippingTax[]= clone $obj;
141
+ return true;
142
+ }
143
+
144
+ /**
145
+ * Retourne le montant des frais d'envoi
146
+ *
147
+ * @return float
148
+ */
149
+ public function getShippingAmount() {
150
+ return $this->shippingAmount;
151
+ }
152
+
153
+ /**
154
+ * Retourne les taxes s'appliquants aux frais d'envoi
155
+ *
156
+ * @return array
157
+ */
158
+ public function &getShippingTax() {
159
+ return $this->shippingTax;
160
+ }
161
+
162
+ /**
163
+ * Défini le montant des assurances
164
+ *
165
+ * @param float $insuranceAmount
166
+ * @param array $insuranceTax
167
+ * @return boolean
168
+ */
169
+ public function setInsurance($insuranceAmount,$insuranceTax) {
170
+ if ($this->_locked)
171
+ return false;
172
+
173
+ $insuranceAmount = sprintf('%.02f',(float)$insuranceAmount);
174
+ if ($insuranceAmount<0)
175
+ return false;
176
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($insuranceTax,'HIPAY_MAPI_Tax'))
177
+ return false;
178
+ $this->insuranceAmount=$insuranceAmount;
179
+ foreach ($insuranceTax as $obj)
180
+ $this->insuranceTax[]= clone $obj;
181
+ return true;
182
+ }
183
+
184
+ /**
185
+ * Retourne le montant des assurances
186
+ *
187
+ * @return float
188
+ */
189
+ public function getInsuranceAmount() {
190
+ return $this->insuranceAmount;
191
+ }
192
+
193
+ /**
194
+ * Retourne les taxes s'appliquants aux assurances
195
+ *
196
+ * @return array
197
+ */
198
+ public function &getInsuranceTax() {
199
+ return $this->insuranceTax;
200
+ }
201
+
202
+ /**
203
+ * Défini le montant des coûts fixes et les taxes s'y appliquant
204
+ *
205
+ * @param float $fixedCostAmount
206
+ * @param array $fixedCostTax
207
+ * @return boolean
208
+ */
209
+ public function setFixedCost($fixedCostAmount,$fixedCostTax) {
210
+ if ($this->_locked)
211
+ return false;
212
+
213
+ $fixedCostAmount = sprintf('%.02f',(float)$fixedCostAmount);
214
+ if ($fixedCostAmount<0)
215
+ return false;
216
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($fixedCostTax,'HIPAY_MAPI_Tax'))
217
+ return false;
218
+ $this->fixedCostAmount=$fixedCostAmount;
219
+ foreach ($fixedCostTax as $obj)
220
+ $this->fixedCostTax[]= clone $obj;
221
+ return true;
222
+ }
223
+
224
+ /**
225
+ * Retourne le montant des coûts fixes
226
+ *
227
+ * @return float
228
+ */
229
+ public function getFixedCostAmount() {
230
+ return $this->fixedCostAmount;
231
+ }
232
+
233
+ /**
234
+ * Retourne les taxes s'appliquant aux coûts fixes
235
+ *
236
+ * @return array
237
+ */
238
+ public function &getFixedCostTax() {
239
+ return $this->fixedCostTax;
240
+ }
241
+
242
+ /**
243
+ * Défini les affiliés qui recevront une rétribution pour cette commande
244
+ *
245
+ * @param array $affiliate
246
+ * @return boolean
247
+ */
248
+ public function setAffiliate($affiliate) {
249
+ if ($this->_locked)
250
+ return false;
251
+
252
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliate,'HIPAY_MAPI_Affiliate'))
253
+ return false;
254
+ foreach ($affiliate as $obj)
255
+ $this->affiliate[]= clone $obj;
256
+ return true;
257
+ }
258
+
259
+ /**
260
+ * Retourne la liste des affiliés de cette commande
261
+ *
262
+ * @return array
263
+ */
264
+ public function &getAffiliate() {
265
+ return $this->affiliate;
266
+ }
267
+
268
+ /**
269
+ * Assigne l'intitulé de la commande
270
+ *
271
+ * @param string $orderTitle
272
+ * @return boolean
273
+ */
274
+ public function setOrderTitle($orderTitle) {
275
+ if ($this->_locked)
276
+ return false;
277
+
278
+ $orderTitle = HIPAY_MAPI_UTF8::forceUTF8($orderTitle);
279
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($orderTitle);
280
+ if ($len<1 || $len>HIPAY_MAPI_MAX_TITLE_LENGTH)
281
+ return false;
282
+ $this->orderTitle=$orderTitle;
283
+ return true;
284
+ }
285
+
286
+ /**
287
+ * Retourne l'intitulé de la commande
288
+ *
289
+ * @return string
290
+ */
291
+ public function getOrderTitle() {
292
+ return $this->orderTitle;
293
+ }
294
+
295
+ /**
296
+ * Assigne les infos sur la commande
297
+ *
298
+ * @param string $orderInfo
299
+ * @return boolean
300
+ */
301
+ public function setOrderInfo($orderInfo) {
302
+ if ($this->_locked)
303
+ return false;
304
+
305
+ $orderInfo = HIPAY_MAPI_UTF8::forceUTF8($orderInfo);
306
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($orderInfo);
307
+ if ($len>HIPAY_MAPI_MAX_INFO_LENGTH)
308
+ return false;
309
+ $this->orderInfo=$orderInfo;
310
+ return true;
311
+ }
312
+
313
+ /**
314
+ * Retourne les infos sur la commande
315
+ *
316
+ * @return string
317
+ */
318
+ public function getOrderInfo() {
319
+ return $this->orderInfo;
320
+ }
321
+
322
+
323
+ /**
324
+ * Assigne la catégorie de la commande
325
+ *
326
+ * @param int $orderCategory
327
+ * @return boolean
328
+ */
329
+ public function setOrderCategory($orderCategory) {
330
+ if ($this->_locked)
331
+ return false;
332
+
333
+ $orderCategory = (int)$orderCategory;
334
+ if ($orderCategory<1)
335
+ return false;
336
+ $this->orderCategory=$orderCategory;
337
+ return true;
338
+ }
339
+
340
+ /**
341
+ * Retourne la catégorie de la commande
342
+ *
343
+ * @return int
344
+ */
345
+ public function getOrderCategory() {
346
+ return $this->orderCategory;
347
+ }
348
+
349
+
350
+ /**
351
+ * Vérifie si l'objet est correctement initialisé
352
+ *
353
+ * @return boolean
354
+ */
355
+ public function check() {
356
+ if ($this->orderTitle=='' || $this->orderCategory<0)
357
+ throw new Exception('L\'intitulé et/ou la catégorie de la commande sont manquants');
358
+
359
+ foreach($this->affiliate as $obj) {
360
+ try {
361
+ $obj->check();
362
+ } catch (Exception $e) {
363
+ throw new Exception($e->getMessage());
364
+ }
365
+
366
+ }
367
+ foreach($this->shippingTax as $obj) {
368
+ try {
369
+ $obj->check();
370
+ } catch (Exception $e) {
371
+ throw new Exception($e->getMessage());
372
+ }
373
+ }
374
+ foreach($this->insuranceTax as $obj) {
375
+ try {
376
+ $obj->check();
377
+ } catch (Exception $e) {
378
+ throw new Exception($e->getMessage());
379
+ }
380
+ }
381
+ foreach($this->fixedCostTax as $obj) {
382
+ try {
383
+ $obj->check();
384
+ } catch (Exception $e) {
385
+ throw new Exception($e->getMessage());
386
+ }
387
+ }
388
+ return true;
389
+ }
390
+
391
+ protected function init() {
392
+ $this->shippingAmount=0;
393
+ $this->shippingTax=array();
394
+ $this->insuranceAmount=0;
395
+ $this->insuranceTax=array();
396
+ $this->fixedCostAmount=0;
397
+ $this->fixedCostTax=array();
398
+ $this->affiliate=array();
399
+ $this->orderTitle='';
400
+ $this->orderInfo='';
401
+ $this->orderCategory=-1;
402
+
403
+ }
404
+
405
+
406
+ function __construct() {
407
+ $this->init();
408
+ parent::__construct();
409
+ }
410
+ }
411
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_package.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ $_mapi_dir=dirname(__FILE__);
43
+ require_once($_mapi_dir.'/mapi_defs.php');
44
+
45
+ require_once($_mapi_dir.'/mapi_defs_ext.php');
46
+
47
+ require_once($_mapi_dir.'/mapi_utils.php');
48
+ require_once($_mapi_dir.'/mapi_utf8.php');
49
+ require_once($_mapi_dir.'/mapi_xml.php');
50
+ require_once($_mapi_dir.'/mapi_send_xml.php');
51
+ require_once($_mapi_dir.'/mapi_comm_xml.php');
52
+ require_once($_mapi_dir.'/mapi_lockable.php');
53
+
54
+ require_once($_mapi_dir.'/mapi_tax.php');
55
+ require_once($_mapi_dir.'/mapi_affiliate.php');
56
+ require_once($_mapi_dir.'/mapi_item.php');
57
+ require_once($_mapi_dir.'/mapi_installment.php');
58
+ require_once($_mapi_dir.'/mapi_product.php');
59
+ require_once($_mapi_dir.'/mapi_paymentparams.php');
60
+ require_once($_mapi_dir.'/mapi_order.php');
61
+ require_once($_mapi_dir.'/mapi_payment.php');
62
+ require_once($_mapi_dir.'/mapi_multiplepayment.php');
63
+ require_once($_mapi_dir.'/mapi_simplepayment.php');
64
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_payment.php ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente un paiement.
44
+ * N'est pas utilisé directement
45
+ *
46
+ */
47
+ class HIPAY_MAPI_Payment extends HIPAY_MAPI_XML {
48
+
49
+ /**
50
+ * Paramètres du paiement
51
+ *
52
+ * @var HIPAY_MAPI_PaymentParams
53
+ */
54
+ protected $paymentParams;
55
+
56
+ /**
57
+ * Objets HIPAY_MAPI_Order
58
+ *
59
+ * @var array
60
+ */
61
+ protected $order;
62
+
63
+ /**
64
+ * Objets HIPAY_MAPI_Item
65
+ *
66
+ * @var array
67
+ */
68
+ protected $items;
69
+
70
+ /**
71
+ * Total des taxes sur les produits
72
+ *
73
+ * @var array
74
+ */
75
+ protected $_taxItemsAmount;
76
+
77
+ /**
78
+ * Total des taxes sur les frais d'envoi
79
+ *
80
+ * @var array
81
+ */
82
+ protected $_taxShippingAmount;
83
+ /**
84
+ * Total des taxes sur les assurances
85
+ *
86
+ * @var array
87
+ */
88
+ protected $_taxInsuranceAmount;
89
+
90
+ /**
91
+ * Total des taxes sur les coûts fixes
92
+ *
93
+ * @var array
94
+ */
95
+ protected $_taxFixedCostAmount;
96
+
97
+ /**
98
+ * Total du montant HT des produits
99
+ *
100
+ * @var array
101
+ */
102
+ protected $_itemsTotalAmount;
103
+
104
+ /**
105
+ * Total des taxes
106
+ *
107
+ * @var array
108
+ */
109
+ public $_taxTotalAmount;
110
+
111
+ /**
112
+ * Total de la commande hors taxes
113
+ *
114
+ * @var array
115
+ */
116
+ protected $_orderTotalAmountHT;
117
+
118
+ /**
119
+ * Total de la commande
120
+ *
121
+ * @var array
122
+ */
123
+ protected $_orderTotalAmount;
124
+
125
+
126
+ /**
127
+ * Total des affilies
128
+ *
129
+ * @var array
130
+ */
131
+ protected $_affiliateTotalAmount;
132
+
133
+
134
+ public function __construct($paymentParams,$order,$items) {
135
+ try {
136
+ $this->init($paymentParams,$order,$items);
137
+ } catch(Exception $e) {
138
+ throw new Exception($e->getMessage());
139
+ }
140
+ }
141
+
142
+ protected function init($paymentParams,$order,$items) {
143
+ if (!($paymentParams instanceof HIPAY_MAPI_PaymentParams)
144
+ || !HIPAY_MAPI_UTILS::is_an_array_of($order,'HIPAY_MAPI_Order')
145
+ || !HIPAY_MAPI_UTILS::is_an_array_of($items,'HIPAY_MAPI_Item')
146
+ || count($items)<1)
147
+ throw new Exception('Wrong parameters');
148
+
149
+ try {
150
+ $paymentParams->check();
151
+ } catch (Exception $e) {
152
+ throw new Exception($e->getMessage());
153
+ }
154
+ foreach($order as $orderObj) {
155
+ try {
156
+ $orderObj->check();
157
+ } catch (Exception $e) {
158
+ throw new Exception($e->getMessage());
159
+ }
160
+ }
161
+
162
+ foreach($items as $obj)
163
+ try {
164
+ $obj->check();
165
+ } catch (Exception $e) {
166
+ throw new Exception($e->getMessage());
167
+ }
168
+
169
+ $this->paymentParams= clone $paymentParams;
170
+ $this->paymentParams->lock();
171
+
172
+
173
+ foreach($order as $obj) {
174
+ $this->order[]= clone $obj;
175
+ end($this->order)->lock();
176
+ $this->_taxItemsAmount[]=0;
177
+ $this->_taxShippingAmount[]=0;
178
+ $this->_taxInsuranceAmount[]=0;
179
+ $this->_taxFixedCostAmount[]=0;
180
+ $this->_itemsTotalAmount[]=0;
181
+ $this->_taxTotalAmount[]=0;
182
+ $this->_orderTotalAmount[]=0;
183
+ $this->_affiliateTotalAmount[]=0;
184
+
185
+ }
186
+ foreach($items as $obj) {
187
+ $this->items[]= clone $obj;
188
+ end($this->items)->lock();
189
+ }
190
+ try {
191
+ $this->compute();
192
+ } catch(Exception $e) {
193
+ throw new Exception($e->getMessage());
194
+ }
195
+ }
196
+
197
+ /**
198
+ * Calcul les différents montants (taxes, affiliés, totaux) de la commande
199
+ *
200
+ */
201
+ protected function compute() {
202
+
203
+ // Mise à jour du montant total des taxes pour chaque item du tableau _taxItemsAmount
204
+ // Mise à jour du montant total des taxes de livraison pour chaque order du tableau _taxShippingAmount
205
+ // Mise à jour du montant total des taxes d'assurances pour chaque order du tableau _taxInsuranceAmount
206
+ // Mise à jour du montant total des taxes de couts fixes pour chaque order du tableau _taxFixedCostAmount
207
+ $this->computeTaxes();
208
+ // Mise a jour du montant total HT des produits pour chaque item du tableau _itemsTotalAmount
209
+ $this->computeItemsAmount();
210
+ // Pour chaque commande
211
+ foreach($this->order as $key=>$order) {
212
+ $this->_taxTotalAmount[$key] = $this->_taxItemsAmount[$key] + $this->_taxShippingAmount[$key] + $this->_taxInsuranceAmount[$key] + $this->_taxFixedCostAmount[$key];
213
+ $this->_orderTotalAmountHT[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key];
214
+ $this->_orderTotalAmount[$key] = $this->_orderTotalAmountHT[$key] + $this->_taxTotalAmount[$key];
215
+ // $this->_orderTotalAmount[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key] +
216
+ // $this->_taxItemsAmount[$key] +
217
+ // $this->_taxShippingAmount[$key] +
218
+ // $this->_taxInsuranceAmount[$key] +
219
+ // $this->_taxFixedCostAmount[$key];
220
+ }
221
+ try {
222
+ $this->computeAffiliates();
223
+ } catch(Exception $e) {
224
+ throw new Exception($e->getMessage());
225
+ }
226
+ }
227
+
228
+
229
+ /**
230
+ * Calcul le montant des taxes
231
+ *
232
+ */
233
+ protected function computeTaxes() {
234
+
235
+ // Taxes sur les produits au niveau de l'item (ligne de commande)
236
+ // @FIXME bug et confusion entre indice d'item et indice d'order ?
237
+ $cur=0;
238
+ // pour chaque ligne de commande
239
+ foreach($this->items as $item) {
240
+ // Liste des taxes de la ligne
241
+ $itemTaxes= $item->getTax();
242
+ $tItemsAmount=0;
243
+ // pour chaque taxe appliquée sur cette ligne
244
+ foreach($itemTaxes as $tax) {
245
+ $amount=HIPAY_MAPI_UTILS::computeTax($item->getPrice(),$tax);
246
+ $tax->setTaxAmount($amount);
247
+ $tax->lock();
248
+ // mise a jour du montant total des taxes pour cet item (ligne de commande)
249
+ $tItemsAmount+=$amount;
250
+ }
251
+ if (!isset($this->order[$cur]))
252
+ $cur=0;
253
+ if (!isset($this->_taxItemsAmount[$cur]))
254
+ $this->_taxItemsAmount[$cur]=0;
255
+ // mise a jour du montant total des taxes pour cette ligne de commande
256
+ // avec prise en compte du nombre de produits dans l'indice numLigneCommande
257
+ // du tableau _taxItemsAmount de cette commande
258
+ $this->_taxItemsAmount[$cur]+=($tItemsAmount*$item->getQuantity());
259
+ $item->lock();
260
+ $cur++;
261
+ }
262
+
263
+ // Taxes sur frais d'envoi, assurances, coûts fixes
264
+ // au niveau des commandes
265
+ $cur=0;
266
+ foreach($this->order as $order) {
267
+ // Taxes sur frais d'envoi
268
+ $taxArr =& $order->getShippingTax();
269
+ foreach($taxArr as $key=>$tax) {
270
+ $amount=HIPAY_MAPI_UTILS::computeTax($order->getShippingAmount(),$tax);
271
+ $taxArr[$key]->setTaxAmount($amount);
272
+ $taxArr[$key]->lock();
273
+
274
+ if (!isset($this->_taxShippingAmount[$cur]))
275
+ $this->_taxShippingAmount[$cur]=0;
276
+ $this->_taxShippingAmount[$cur]+=$amount;
277
+ }
278
+ // Taxes sur assurances
279
+ $taxArr =& $order->getInsuranceTax();
280
+ foreach($taxArr as $key=>$tax) {
281
+ $amount=HIPAY_MAPI_UTILS::computeTax($order->getInsuranceAmount(),$tax);
282
+ $taxArr[$key]->setTaxAmount($amount);
283
+ $taxArr[$key]->lock();
284
+ if (!isset($this->_taxInsuranceAmount[$cur]))
285
+ $this->_taxInsuranceAmount[$cur]=0;
286
+ $this->_taxInsuranceAmount[$cur]+=$amount;
287
+ }
288
+ // Taxes sur coûts fixes
289
+ $taxArr =& $order->getFixedCostTax();
290
+ foreach($taxArr as $key=>$tax) {
291
+ $amount=HIPAY_MAPI_UTILS::computeTax($order->getFixedCostAmount(),$tax);
292
+ $taxArr[$key]->setTaxAmount($amount);
293
+ $taxArr[$key]->lock();
294
+ if (!isset($this->_taxFixedCostAmount[$cur]))
295
+ $this->_taxFixedCostAmount[$cur]=0;
296
+ $this->_taxFixedCostAmount[$cur]+=$amount;
297
+ }
298
+ $cur++;
299
+ }
300
+ }
301
+
302
+ /**
303
+ * Calcul le montant total HT des produits
304
+ *
305
+ */
306
+ protected function computeItemsAmount() {
307
+ $itemsAmount=0;
308
+ $cur=0;
309
+ foreach($this->items as $item) {
310
+ $mt=sprintf("%.02f",$item->getPrice()*$item->getQuantity());
311
+
312
+ if (!isset($this->order[$cur]))
313
+ $cur=0;
314
+ if (!isset($this->_itemsTotalAmount[$cur]))
315
+ $this->_itemsTotalAmount[$cur]=0;
316
+ $this->_itemsTotalAmount[$cur]+=$mt;
317
+ $cur++;
318
+ }
319
+ }
320
+
321
+ /**
322
+ * Retourne le montant total des taxes
323
+ *
324
+ * @param array $tItemsAmount
325
+ * @param array $tShippingAmount
326
+ * @param array $tInsuranceAmount
327
+ * @param array $tFixedCostAmount
328
+ */
329
+ public function getTotalTaxes(&$tItemsAmount,&$tShippingAmount,&$tInsuranceAmount,&$tFixedCostAmount) {
330
+ $tItemsAmount=$this->getItemsTaxes();;
331
+ $tShippingAmount=$this->getShippingTaxes();
332
+ $tInsuranceAmount=$this->getInsuranceTaxes();
333
+ $tFixedCostAmount=$this->getFixedCostTaxes();
334
+ }
335
+
336
+ /**
337
+ * Retourne le montant des taxes sur les articles
338
+ *
339
+ * @return float
340
+ */
341
+ public function getItemsTaxes() {
342
+ return $this->_taxItemsAmount;
343
+ }
344
+
345
+ /**
346
+ * Retourne le montant des taxes sur les frais de port
347
+ *
348
+ * @return float
349
+ */
350
+ public function getShippingTaxes() {
351
+ return $this->_taxShippingAmount;
352
+ }
353
+
354
+ /**
355
+ * Retourne le montant des taxes sur les assurances
356
+ *
357
+ * @return float
358
+ */
359
+ public function getInsuranceTaxes() {
360
+ return $this->_taxInsuranceAmount;
361
+ }
362
+
363
+ /**
364
+ * Retourne le montant des taxes sur les couts fixes
365
+ *
366
+ * @return float
367
+ */
368
+ public function getFixedCostTaxes() {
369
+ return $this->_taxFixedCostAmount;
370
+ }
371
+
372
+ /**
373
+ * Retourne le montant total des produits
374
+ *
375
+ * @return array
376
+ */
377
+ public function getItemsTotalAmount() {
378
+ return $this->_itemsTotalAmount;
379
+ }
380
+
381
+ /**
382
+ * Retourne le montant total des taxes
383
+ *
384
+ * @return array
385
+ */
386
+ public function getTaxesTotalAmount() {
387
+ return $this->_taxTotalAmount;
388
+ }
389
+
390
+ /**
391
+ * Retourne le montant total hors taxes de la commande
392
+ *
393
+ * @return array
394
+ */
395
+ public function getOrderTotalAmountHT() {
396
+ return $this->_orderTotalAmountHT;
397
+ }
398
+
399
+ /**
400
+ * Retourne le montant total TTC de la commande
401
+ *
402
+ * @return array
403
+ */
404
+ public function getOrderTotalAmount() {
405
+ return $this->_orderTotalAmount;
406
+ }
407
+
408
+ /**
409
+ * Retourne le montant total des affiliés
410
+ *
411
+ * @return array
412
+ */
413
+ public function getAffiliateTotalAmount() {
414
+ return $this->_affiliateTotalAmount;
415
+ }
416
+
417
+ /**
418
+ * Retourne les objets order
419
+ *
420
+ * @return array
421
+ */
422
+ public function getOrder() {
423
+ return $this->order;
424
+ }
425
+
426
+ /**
427
+ * Retourne les objets items
428
+ *
429
+ * @return array
430
+ */
431
+ public function getItems() {
432
+ return $this->items;
433
+ }
434
+
435
+ /**
436
+ * Retourne l'objet paramètre
437
+ *
438
+ * @return HIPAY_MAPI_PaymentParams
439
+ */
440
+ public function getPaymentParams() {
441
+ return $this->paymentParams;
442
+ }
443
+
444
+
445
+ /**
446
+ * Calcul les montants à redistribuer aux affiliés
447
+ *
448
+ */
449
+ protected function computeAffiliates() {
450
+
451
+
452
+ foreach($this->order as $k=>$order) {
453
+ $totalAmount=0;
454
+ $tAffiliate = $order->getAffiliate();
455
+ foreach($tAffiliate as $key=>$affiliate) {
456
+ $baseAmount=0;
457
+ $percentageTarget= $affiliate->getPercentageTarget();
458
+ if ($percentageTarget>0) {
459
+ if ($percentageTarget & HIPAY_MAPI_TTARGET_ITEM)
460
+ $baseAmount+=$this->_itemsTotalAmount[$k];
461
+ if ($percentageTarget & HIPAY_MAPI_TTARGET_TAX)
462
+ $baseAmount+=$this->_taxItemsAmount[$k]+$this->_taxFixedCostAmount[$k]+$this->_taxInsuranceAmount[$k]+$this->_taxShippingAmount[$k];
463
+ if ($percentageTarget& HIPAY_MAPI_TTARGET_INSURANCE)
464
+ $baseAmount+=$order->getInsuranceAmount();
465
+ if ($percentageTarget & HIPAY_MAPI_TTARGET_FCOST)
466
+ $baseAmount+=$order->getFixedCostAmount();
467
+ if ($percentageTarget & HIPAY_MAPI_TTARGET_SHIPPING)
468
+ $baseAmount+=$order->getShippingAmount();
469
+ $tAffiliate[$key]->setBaseAmount($baseAmount);
470
+ } else {
471
+ $baseAmount = $affiliate->getValue();
472
+ $tAffiliate[$key]->setBaseAmount($baseAmount);
473
+ }
474
+ $totalAmount+=$tAffiliate[$key]->getAmount();
475
+ $tAffiliate[$key]->lock();
476
+ }
477
+ $this->_affiliateTotalAmount[$k]=$totalAmount;
478
+ if ($totalAmount > $this->_orderTotalAmount[$k]) {
479
+ throw new Exception('Le montant à redistribuer est supérieur au montant de la transaction ('.$totalAmount.'/'.$this->_orderTotalAmount.')');
480
+ }
481
+ }
482
+
483
+ }
484
+
485
+
486
+
487
+ }
488
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_paymentparams.php ADDED
@@ -0,0 +1,1087 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Paramètres
44
+ *
45
+ */
46
+ class HIPAY_MAPI_PaymentParams extends HIPAY_MAPI_lockable {
47
+
48
+ /**
49
+ * Nom d'utilisateur pour se connecter à la plateforme
50
+ *
51
+ * @var string
52
+ */
53
+ protected $login;
54
+
55
+ /**
56
+ * Mot de passe de connexion
57
+ *
58
+ * @var string
59
+ */
60
+ protected $password;
61
+
62
+ /**
63
+ * Compte sur lequel verser le montant HT des produits
64
+ *
65
+ * @var int
66
+ */
67
+ protected $itemAccount;
68
+
69
+ /**
70
+ * Compte sur lequel verser le montant des taxes
71
+ *
72
+ * @var int
73
+ */
74
+ protected $taxAccount;
75
+
76
+ /**
77
+ * Compte sur lequel verser le montant des assurances
78
+ *
79
+ * @var int
80
+ */
81
+ protected $insuranceAccount;
82
+
83
+ /**
84
+ * Compte sur lequel verser le montant des coûts fixes
85
+ *
86
+ * @var int
87
+ */
88
+ protected $fixedCostAccount;
89
+
90
+ /**
91
+ * Compte sur lequel verser le montant des frais de livraison
92
+ *
93
+ * @var int
94
+ */
95
+ protected $shippingCostAccount;
96
+
97
+ /**
98
+ * Langue par défaut de l'interface de paiement
99
+ *
100
+ * @var string
101
+ */
102
+ protected $defaultLang;
103
+
104
+ /**
105
+ * Type d'interface de paiement
106
+ *
107
+ * @var string
108
+ */
109
+ protected $media;
110
+
111
+ /**
112
+ * Classe d'age à laquelle s'applique cette vente
113
+ *
114
+ * @var string
115
+ */
116
+ protected $rating;
117
+
118
+ /**
119
+ * Type du paiement (simple ou récurrent)
120
+ *
121
+ * @var int
122
+ */
123
+ protected $paymentMethod;
124
+
125
+ /**
126
+ * Délai de capture
127
+ *
128
+ * @var int
129
+ */
130
+ protected $captureDay;
131
+
132
+ /**
133
+ * Devise dans laquelle sont exprimés les montants
134
+ *
135
+ * @var string
136
+ */
137
+ protected $currency;
138
+
139
+ /**
140
+ * Identifiant de cette vente pour le marchant
141
+ *
142
+ * @var int
143
+ */
144
+ protected $idForMerchant;
145
+
146
+ /**
147
+ * Identifiant du site marchand tel que renseigné
148
+ * dans l'interface marchande de la plateforme
149
+ *
150
+ * @var int
151
+ */
152
+ protected $merchantSiteId;
153
+
154
+
155
+ /**
156
+ * Identifiant du groupe statistique auquel appartient ce paiement
157
+ *
158
+ * @var int
159
+ */
160
+ protected $statsGroupId;
161
+
162
+
163
+ /**
164
+ * Données propres au marchand
165
+ *
166
+ * @var string
167
+ */
168
+ protected $merchantDatas;
169
+
170
+ /**
171
+ * Url sur laquelle est redirigée le client si le paiement est ok
172
+ *
173
+ * @var string
174
+ */
175
+ protected $url_ok;
176
+
177
+ /**
178
+ * Url sur laquelle est redirigée le client si le paiement n'est pas ok
179
+ *
180
+ * @var string
181
+ */
182
+ protected $url_nok;
183
+
184
+ /**
185
+ * Url sur laquelle est redirigée le client si le paiement est annulé
186
+ *
187
+ * @var string
188
+ */
189
+ protected $url_cancel;
190
+
191
+ /**
192
+ * Url du script qui sera appellé pour signifier le résultat du paiement
193
+ *
194
+ * @var string
195
+ */
196
+ protected $url_ack;
197
+
198
+ /**
199
+ * Chaine de caractère devant etre retournée par le script $url_ack
200
+ * pour informer de la bonne réception des informations
201
+ *
202
+ * @var string
203
+ */
204
+ protected $ack_wd;
205
+
206
+ /**
207
+ * Adresse email vers laquelle la plateforme enverra un email
208
+ * pour informer d'un nouveau paiement
209
+ *
210
+ * @var string
211
+ */
212
+ protected $email_ack;
213
+
214
+ /**
215
+ * code hexa de la couleur de fond de l'interface
216
+ *
217
+ * @var string
218
+ */
219
+ protected $bg_color;
220
+
221
+ /**
222
+ * Url du logo du marchand
223
+ *
224
+ * @var string
225
+ */
226
+ protected $logo_url;
227
+
228
+ /**
229
+ * Code langue et pays au format
230
+ * fr_FR, en_GB ect...
231
+ *
232
+ * @var string
233
+ */
234
+ protected $locale;
235
+
236
+ /**
237
+ * Login par défaut de l'acheteur potentiel
238
+ * permet une présélection du login dans les pages de paiement
239
+ *
240
+ * @var string
241
+ */
242
+ protected $issuerAccountLogin;
243
+
244
+ /**
245
+ * Id de la boutique
246
+ *
247
+ * @var integer
248
+ */
249
+ protected $shopId;
250
+
251
+ /**
252
+ * Description du marchand effectif
253
+ *
254
+ * @var string
255
+ */
256
+ protected $merchantDescription;
257
+
258
+ /**
259
+ * Informations about the order
260
+ *
261
+ * @var <type>
262
+ */
263
+ protected $informations;
264
+
265
+ /**
266
+ * Décrit si la case cgu est cochée par défaut ou non
267
+ *
268
+ * @var int
269
+ */
270
+ protected $cguChecked;
271
+
272
+ /**
273
+ * Assigne le login et le mot de passe
274
+ *
275
+ * @param string $login
276
+ * @param string $password
277
+ * @return boolean
278
+ */
279
+ public function setLogin($login,$password) {
280
+ if ($this->_locked)
281
+ return false;
282
+ $login = HIPAY_MAPI_UTF8::forceUTF8($login);
283
+ if (empty($login))
284
+ return false;
285
+ $password = HIPAY_MAPI_UTF8::forceUTF8($password);
286
+ if (empty($password))
287
+ return false;
288
+ $this->login=$login;
289
+ $this->password=$password;
290
+ return true;
291
+ }
292
+
293
+ /**
294
+ * Retourne le login
295
+ *
296
+ * @return string
297
+ */
298
+ public function getLogin() {
299
+ return $this->login;
300
+ }
301
+
302
+ /**
303
+ * Retourne le mot de passe
304
+ *
305
+ * @return string
306
+ */
307
+ public function getPassword() {
308
+ return $this->password;
309
+ }
310
+
311
+ /**
312
+ * Assigne les comptes sur lesquels seront versés les différents montants
313
+ *
314
+ * @param int $itemAccount
315
+ * @param int $taxAccount
316
+ * @param int $insuranceAccount
317
+ * @param int $fixedCostAccount
318
+ * @param int $shippingCostAccount
319
+ * @return boolean
320
+ */
321
+ public function setAccounts($itemAccount,$taxAccount=0,$insuranceAccount=0,$fixedCostAccount=0,$shippingCostAccount=0) {
322
+ if ($this->_locked)
323
+ return false;
324
+
325
+ $itemAccount=(int)$itemAccount;
326
+ $taxAccount=(int)$taxAccount;
327
+ $insuranceAccount=(int)$insuranceAccount;
328
+ $fixedCostAccount=(int)$fixedCostAccount;
329
+ $shippingCostAccount=(int)$shippingCostAccount;
330
+
331
+ if ($itemAccount<=0)
332
+ return false;
333
+ if ($taxAccount<=0)
334
+ $taxAccount=$itemAccount;
335
+ if ($insuranceAccount<=0)
336
+ $insuranceAccount=$itemAccount;
337
+ if ($fixedCostAccount<=0)
338
+ $fixedCostAccount=$itemAccount;
339
+ if ($shippingCostAccount<=0)
340
+ $shippingCostAccount=$itemAccount;
341
+ $this->itemAccount = $itemAccount;
342
+ $this->taxAccount = $taxAccount;
343
+ $this->insuranceAccount = $insuranceAccount;
344
+ $this->fixedCostAccount = $fixedCostAccount;
345
+ $this->shippingCostAccount = $shippingCostAccount;
346
+ return true;
347
+ }
348
+
349
+ /**
350
+ * Retourne le numéro de compte sur lequel sera versé
351
+ * le montant de produits
352
+ *
353
+ * @return int
354
+ */
355
+ public function getItemAccount() {
356
+ return $this->itemAccount;
357
+ }
358
+
359
+ /**
360
+ * Retourne le numéro de compte sur lequel sera versé
361
+ * le montant des taxes
362
+ *
363
+ * @return int
364
+ */
365
+ public function getTaxAccount() {
366
+ return $this->taxAccount;
367
+ }
368
+
369
+ /**
370
+ * Retourne le numéro de compte sur lequel sera versé
371
+ * le montant des assurances
372
+ *
373
+ * @return int
374
+ */
375
+ public function getInsuranceAccount() {
376
+ return $this->insuranceAccount;
377
+ }
378
+
379
+ /**
380
+ * Retourne le numéro de compte sur lequel sera versé
381
+ * le montant des coûts fixes
382
+ *
383
+ * @return int
384
+ */
385
+ public function getFixedCostAccount() {
386
+ return $this->fixedCostAccount;
387
+ }
388
+
389
+ /**
390
+ * Retourne le numéro de compte sur lequel sera versé
391
+ * le montant des frais d'envoi
392
+ *
393
+ * @return int
394
+ */
395
+ public function getShippingCostAccount() {
396
+ return $this->shippingCostAccount;
397
+ }
398
+
399
+ /**
400
+ * Assigne la lange par défaut (AZ_az = pays_langue)
401
+ *
402
+ * @param string $defaultLang
403
+ * @return boolean
404
+ */
405
+ public function setDefaultLang($defaultLang) {
406
+ if ($this->_locked)
407
+ return false;
408
+
409
+ if (!preg_match('#^[A-Z]{2}_[a-z]{2}$#',$defaultLang))
410
+ return false;
411
+ $this->defaultLang=$defaultLang;
412
+ return true;
413
+ }
414
+
415
+ /**
416
+ * Retourne la langue par défaut
417
+ *
418
+ * @return string
419
+ */
420
+ public function getDefaultLang() {
421
+ return $this->defaultLang;
422
+ }
423
+
424
+ /**
425
+ * Défini le type d'interface de paiement
426
+ *
427
+ * @param string $media
428
+ * @return boolean
429
+ */
430
+ public function setMedia($media) {
431
+ if ($this->_locked)
432
+ return false;
433
+
434
+ if (!preg_match('#^[A-Z]+$#',$media))
435
+ return false;
436
+ $this->media=$media;
437
+ return true;
438
+ }
439
+
440
+ /**
441
+ * Retourne le type d'interface de paiement
442
+ *
443
+ * @return string
444
+ */
445
+ public function getMedia() {
446
+ return $this->media;
447
+ }
448
+
449
+ /**
450
+ * Défini le public visé
451
+ *
452
+ * @param string $rating
453
+ * @return boolean
454
+ */
455
+ public function setRating($rating) {
456
+ if ($this->_locked)
457
+ return false;
458
+
459
+ $rating = trim(substr($rating,0,HIPAY_MAPI_MAX_RATING_LENGTH));
460
+ if ($rating=='')
461
+ return false;
462
+ $this->rating=$rating;
463
+ return true;
464
+ }
465
+
466
+ /**
467
+ * Retourne le type de public visé
468
+ *
469
+ * @return string
470
+ */
471
+ public function getRating() {
472
+ return $this->rating;
473
+ }
474
+
475
+ /**
476
+ * Défini si le paiement est simple ou récurrent
477
+ *
478
+ * @param int $paymentMethod
479
+ * @return boolean
480
+ */
481
+ public function setPaymentMethod($paymentMethod) {
482
+ if ($this->_locked)
483
+ {
484
+ return false;
485
+ }
486
+
487
+ $paymentMethod = (int)$paymentMethod;
488
+ if ($paymentMethod!=HIPAY_MAPI_METHOD_SIMPLE && $paymentMethod!=HIPAY_MAPI_METHOD_MULTI)
489
+ return false;
490
+ $this->paymentMethod=$paymentMethod;
491
+ return true;
492
+ }
493
+
494
+ /**
495
+ * Retourne le type de paiement (simple ou récurrent)
496
+ *
497
+ * @return int
498
+ */
499
+ public function getPaymentMethod() {
500
+ return $this->paymentMethod;
501
+ }
502
+
503
+ /**
504
+ * détermine si la valeur du champ cgu est checkée par défaut
505
+ *
506
+ * @return int
507
+ */
508
+ public function getCguChecked() {
509
+ return $this->cguChecked;
510
+ }
511
+
512
+ /**
513
+ * Défini si la case cgu est cochée ou non par défaut
514
+ *
515
+ * @param boolean $value
516
+ * @return int
517
+ */
518
+ public function setCguChecked($value) {
519
+ if($value === true || $value === '1') $value=1;
520
+ if($value === false || $value === '0') $value=0;
521
+ if ($value !== 0 && $value !== 1) return false;
522
+ $this->cguChecked = $value;
523
+ return true;
524
+ }
525
+
526
+ /**
527
+ * Défini le délai de capture
528
+ *
529
+ * @param int $captureDay
530
+ * @return boolean
531
+ */
532
+ public function setCaptureDay($captureDay) {
533
+ if ($this->_locked)
534
+ return false;
535
+
536
+ $captureDay = (int)$captureDay;
537
+ if (($captureDay!=HIPAY_MAPI_CAPTURE_MANUAL && $captureDay!=HIPAY_MAPI_CAPTURE_IMMEDIATE && $captureDay<=0) || $captureDay>HIPAY_MAPI_CAPTURE_MAX_DAYS)
538
+ return false;
539
+ $this->captureDay=$captureDay;
540
+ return true;
541
+
542
+ }
543
+
544
+ /**
545
+ * Retourne le délai de capture
546
+ *
547
+ * @return int
548
+ */
549
+ public function getCaptureDay() {
550
+ return $this->captureDay;
551
+ }
552
+
553
+ /**
554
+ * Défini la devise
555
+ *
556
+ * @param string $currency
557
+ * @return boolean
558
+ */
559
+ public function setCurrency($currency) {
560
+ if ($this->_locked)
561
+ return false;
562
+
563
+ if (!preg_match('#^[A-Z]{3}$#',$currency))
564
+ return false;
565
+ $this->currency = $currency;
566
+ return true;
567
+ }
568
+
569
+ /**
570
+ * Retourne la devise
571
+ *
572
+ * @return string
573
+ */
574
+ public function getCurrency() {
575
+ return $this->currency;
576
+ }
577
+
578
+
579
+
580
+ /**
581
+ * Défini l'identifiant du groupe statistique auquel appartient ce paiement
582
+ *
583
+ * @param int $statsGroupId
584
+ * @return boolean
585
+ */
586
+ public function setStatsGroupId($statsGroupId) {
587
+ if ($this->_locked)
588
+ return false;
589
+
590
+ $statsGroupId=(int)$statsGroupId;
591
+ if ($statsGroupId<0)
592
+ return false;
593
+ $this->statsGroupId=$statsGroupId;
594
+ return true;
595
+ }
596
+
597
+
598
+ /**
599
+ * Retourne l'identifiant du groupe statistique auquel appartient ce paiement
600
+ *
601
+ * @return int
602
+ */
603
+ public function getStatsGroupId() {
604
+ return $this->statsGroupId;
605
+ }
606
+
607
+
608
+ /**
609
+ * Défini l'identifiant de cette vente chez le marchand
610
+ *
611
+ * @param string $idForMerchant
612
+ * @return boolean
613
+ */
614
+ public function setIdForMerchant($idForMerchant) {
615
+ if ($this->_locked)
616
+ return false;
617
+
618
+ $this->idForMerchant=$idForMerchant;
619
+ return true;
620
+ }
621
+
622
+ /**
623
+ * Retourne l'identifiant de la vente pour le marchand
624
+ *
625
+ * @return string
626
+ */
627
+ public function getIdForMerchant() {
628
+ return $this->idForMerchant;
629
+ }
630
+
631
+ /**
632
+ * Défini l'identifiant du site marchand
633
+ *
634
+ * @param int $merchantSiteId
635
+ * @return boolean
636
+ */
637
+ public function setMerchantSiteId($merchantSiteId) {
638
+ if ($this->_locked)
639
+ return false;
640
+
641
+ $merchantSiteId=(int)$merchantSiteId;
642
+ if ($merchantSiteId<0)
643
+ return false;
644
+ $this->merchantSiteId=$merchantSiteId;
645
+ return true;
646
+ }
647
+
648
+ /**
649
+ * Retourne l'identifiant du site marchand
650
+ *
651
+ * @return int
652
+ */
653
+ public function getMerchantSiteId() {
654
+ return $this->merchantSiteId;
655
+ }
656
+
657
+ /**
658
+ * Assigne des données marchandes
659
+ *
660
+ * @param string $merchantDatas
661
+ * @return boolean
662
+ */
663
+ public function setMerchantDatas($key,$merchantDatas) {
664
+ if ($this->_locked)
665
+ return false;
666
+ if ($key=='')
667
+ return false;
668
+ $merchantDatas=substr($merchantDatas,0,HIPAY_MAPI_MAX_MDATAS_LENGTH);
669
+ $this->merchantDatas[$key]=$merchantDatas;
670
+ return true;
671
+ }
672
+
673
+ /**
674
+ * Retourne les données marchandes
675
+ *
676
+ * @return array
677
+ */
678
+ public function getMerchantDatas() {
679
+ return $this->merchantDatas;
680
+
681
+ }
682
+
683
+ /**
684
+ * Assigne l'url à appeller si le paiement est ok
685
+ *
686
+ * @param string $url_ok
687
+ * @return unknown
688
+ */
689
+ public function setUrlOk($url_ok) {
690
+ if ($this->_locked)
691
+ return false;
692
+ $url_ok = trim($url_ok);
693
+ if (!HIPAY_MAPI_UTILS::checkURL($url_ok) && $url_ok!='')
694
+ return false;
695
+ $this->url_ok=$url_ok;
696
+ return true;
697
+ }
698
+
699
+ /**
700
+ * Retourne l'url_ok
701
+ *
702
+ * @return string
703
+ */
704
+ public function getUrlOk() {
705
+ return $this->url_ok;
706
+
707
+ }
708
+
709
+ /**
710
+ * Assigne l'url à appeller si le paiement n'est pas ok
711
+ *
712
+ * @param string $url_nok
713
+ * @return unknown
714
+ */
715
+ public function setUrlNok($url_nok) {
716
+ if ($this->_locked)
717
+ return false;
718
+ $url_nok = trim($url_nok);
719
+ if (!HIPAY_MAPI_UTILS::checkURL($url_nok) && $url_nok!='')
720
+ return false;
721
+ $this->url_nok=$url_nok;
722
+ return true;
723
+ }
724
+
725
+ /**
726
+ * Retourne l'url_nok
727
+ *
728
+ * @return string
729
+ */
730
+ public function getUrlNok() {
731
+ return $this->url_nok;
732
+
733
+ }
734
+
735
+ /**
736
+ * Assigne l'url à appeller si le paiement est annulé
737
+ *
738
+ * @param string $url_cancel
739
+ * @return boolean
740
+ */
741
+ public function setUrlCancel($url_cancel) {
742
+ if ($this->_locked)
743
+ return false;
744
+ $url_cancel = trim($url_cancel);
745
+ if (!HIPAY_MAPI_UTILS::checkURL($url_cancel) && $url_cancel!='')
746
+ return false;
747
+ $this->url_cancel=$url_cancel;
748
+ return true;
749
+ }
750
+
751
+ /**
752
+ * Retourne l'url_cancel
753
+ *
754
+ * @return string
755
+ */
756
+ public function getUrlCancel() {
757
+ return $this->url_cancel;
758
+ }
759
+
760
+
761
+ /**
762
+ * Assigne l'url à appeller pour notifier le paiement
763
+ *
764
+ * @param string $url_cancel
765
+ * @return boolean
766
+ */
767
+ public function setUrlAck($url_ack) {
768
+ if ($this->_locked)
769
+ return false;
770
+ $url_ack = trim($url_ack);
771
+ if (!HIPAY_MAPI_UTILS::checkURL($url_ack) && $url_ack!='')
772
+ return false;
773
+ $this->url_ack=$url_ack;
774
+ return true;
775
+ }
776
+
777
+ /**
778
+ * Retourne l'url_ack
779
+ *
780
+ * @return string
781
+ */
782
+ public function getUrlAck() {
783
+ return $this->url_ack;
784
+ }
785
+
786
+
787
+
788
+
789
+ /**
790
+ * Assigne le mot clé d'acquittement
791
+ *
792
+ * @param string $ack_wd
793
+ * @return boolean
794
+ */
795
+ public function setAckWd($ack_wd) {
796
+ if ($this->_locked)
797
+ return false;
798
+ $ack_wd=trim($ack_wd);
799
+ if (strlen($ack_wd)>HIPAY_MAPI_MAX_ACKWD_LENGTH)
800
+ return false;
801
+ $this->ack_wd=$ack_wd;
802
+ return true;
803
+ }
804
+
805
+ /**
806
+ * Retourne le mot clé d'acquittement
807
+ *
808
+ * @return string
809
+ */
810
+ public function getAckWd() {
811
+ return $this->ack_wd;
812
+ }
813
+
814
+ /**
815
+ * Assigne l'adresse email de notification de paiement
816
+ *
817
+ * @param string $email_ack
818
+ * @return boolean
819
+ */
820
+ public function setEmailAck($email_ack) {
821
+ if ($this->_locked)
822
+ return false;
823
+ $email_ack=trim($email_ack);
824
+ if (strlen($email_ack)>HIPAY_MAPI_MAX_ACKMAIL_LENGTH || (!HIPAY_MAPI_UTILS::checkemail($email_ack) && $email_ack!=''))
825
+ return false;
826
+ $this->email_ack=$email_ack;
827
+ return true;
828
+ }
829
+
830
+ /**
831
+ * Retourne l'email de notification
832
+ *
833
+ * @return string
834
+ */
835
+ public function getEmailAck() {
836
+ return $this->email_ack;
837
+ }
838
+
839
+ /**
840
+ * Assigne la couleur de fond de l'interface (#XXXXXX)
841
+ *
842
+ * @param string $bg_color
843
+ * @return boolean
844
+ */
845
+ public function setBackgroundColor($bg_color) {
846
+ if ($this->_locked)
847
+ return false;
848
+ $bg_color = trim($bg_color);
849
+ if (!preg_match('#^\#([0-9a-f]){6}$#i', $bg_color) && $bg_color != '')
850
+ return false;
851
+ $this->bg_color = $bg_color;
852
+ return true;
853
+ }
854
+
855
+ /**
856
+ * Retourne la couleur de fond de l'interface
857
+ *
858
+ * @return string
859
+ */
860
+ public function getBackgroundColor() {
861
+ return $this->bg_color;
862
+ }
863
+
864
+
865
+ /**
866
+ * Assigne l'url du logo du marchand
867
+ *
868
+ * @param string $logo_url
869
+ * @return boolean
870
+ */
871
+ public function setLogoUrl($logo_url) {
872
+ if ($this->_locked)
873
+ return false;
874
+ $logo_url = trim($logo_url);
875
+ if (!HIPAY_MAPI_UTILS::checkURL($logo_url) && $logo_url!='')
876
+ return false;
877
+ $this->logo_url=$logo_url;
878
+ return true;
879
+ }
880
+
881
+ /**
882
+ * Retourne l'url du logo du marchand
883
+ *
884
+ * @return string
885
+ */
886
+ public function getLogoUrl() {
887
+ return $this->logo_url;
888
+ }
889
+
890
+ /**
891
+ * Assigne le login par défaut à utiliser pour le paiement
892
+ *
893
+ * @param string $login
894
+ * @return boolean
895
+ */
896
+ public function setIssuerAccountLogin($login) {
897
+ if ($this->_locked)
898
+ return false;
899
+ $login = trim(strtolower($login));
900
+
901
+ $this->issuerAccountLogin=$login;
902
+ return true;
903
+ }
904
+
905
+ /**
906
+ * Retourne le login du payeur par défaut
907
+ *
908
+ * @return string
909
+ */
910
+ public function getIssuerAccountLogin()
911
+ {
912
+ return $this->issuerAccountLogin;
913
+ }
914
+
915
+
916
+
917
+
918
+ /**
919
+ * Assigne une description alternative du marchand
920
+ *
921
+ * @param string $desc
922
+ * @return boolean
923
+ */
924
+ public function setMerchantDescription($desc) {
925
+ if ($this->_locked)
926
+ return false;
927
+ $desc = trim($desc);
928
+
929
+ $this->merchantDescription=$desc;
930
+ return true;
931
+ }
932
+
933
+ /**
934
+ * Retourne le login du payeur par défaut
935
+ *
936
+ * @return string
937
+ */
938
+ public function getMerchantDescription()
939
+ {
940
+ return $this->merchantDescription;
941
+ }
942
+
943
+
944
+
945
+ /**
946
+ * Assigne l'identifiant de boutique
947
+ *
948
+ * @param integer $name
949
+ * @return boolean
950
+ */
951
+ public function setShopId($id) {
952
+ if ($this->_locked)
953
+ return false;
954
+
955
+ $this->shopId=$id;
956
+ return true;
957
+ }
958
+
959
+ /**
960
+ * Retourne l'id de boutique
961
+ *
962
+ * @return integer
963
+ */
964
+ public function getShopId() {
965
+ return $this->shopId;
966
+ }
967
+
968
+ /**
969
+ * set informations about the order
970
+ *
971
+ * @param $informations
972
+ */
973
+ public function setInformations($informations) {
974
+ $this->informations = $informations;
975
+ }
976
+
977
+ /**
978
+ * return informations about the order
979
+ *
980
+ * @return String
981
+ */
982
+ public function getInformations() {
983
+ return $this->informations;
984
+ }
985
+
986
+ /**
987
+ * Assigne la locale à utiliser sur les pages de paiement
988
+ *
989
+ * @param string $locale
990
+ * @return boolean
991
+ */
992
+ public function setLocale($locale) {
993
+ if ($this->_locked)
994
+ return false;
995
+
996
+ $locale = trim($locale);
997
+
998
+ if (strlen($locale) != 5)
999
+ return false;
1000
+
1001
+ if (! preg_match("/^[a-z]{2}_[A-Z]{2}$/", $locale))
1002
+ return false;
1003
+
1004
+ $this->locale=$locale;
1005
+ return true;
1006
+ }
1007
+
1008
+ /**
1009
+ * Retourne la locale
1010
+ *
1011
+ * @return string
1012
+ */
1013
+ public function getLocale()
1014
+ {
1015
+ return $this->locale;
1016
+ }
1017
+
1018
+
1019
+ /**
1020
+ * Vérifie que l'objet est correctement initialisé
1021
+ *
1022
+ * @return boolean
1023
+ */
1024
+ public function check() {
1025
+ if ($this->login=='')
1026
+ throw new Exception('Nom d\'utilisateur manquant');
1027
+ if ($this->itemAccount<=0 || $this->taxAccount<=0 || $this->insuranceAccount <=0 ||
1028
+ $this->fixedCostAccount<=0 || $this->shippingCostAccount<=0)
1029
+ throw new Exception('Numéros de compte invalides');
1030
+ if ($this->rating=='')
1031
+ throw new Exception('Type de public visé invalide');
1032
+ if ($this->paymentMethod<0)
1033
+ throw new Exception('Type de paiement invalide');
1034
+ if ($this->captureDay==-100)
1035
+ throw new Exception('Délai de capture invalide ');
1036
+ if ($this->currency=='')
1037
+ throw new Exception('Devise non-définie');
1038
+ if ($this->idForMerchant<0)
1039
+ throw new Exception('ID chez le marchand manquant');
1040
+ if ($this->idForMerchant>0)
1041
+ if ($this->password=='')
1042
+ throw new Exception('Mot de passe manquant');
1043
+ if ($this->statsGroupId<0)
1044
+ throw new Exception('ID groupe est négatif');
1045
+ if ($this->merchantSiteId<0)
1046
+ throw new Exception('ID du site marchand manquant');
1047
+ return true;
1048
+ }
1049
+
1050
+ protected function init() {
1051
+ $this->login='';
1052
+ $this->password='';
1053
+ $this->itemAccount=0;
1054
+ $this->taxAccount=0;
1055
+ $this->insuranceAccount=0;
1056
+ $this->fixedCostAccount=0;
1057
+ $this->shippingCostAccount=0;
1058
+ $this->defaultLang=HIPAY_MAPI_DEFLANG;
1059
+ $this->media=HIPAY_MAPI_DEFMEDIA;
1060
+ $this->rating='';
1061
+ $this->paymentMethod=-1;
1062
+ $this->captureDay=-100;
1063
+ $this->currency='';
1064
+ $this->idForMerchant=-1;
1065
+ $this->statsGroupId=0;
1066
+ $this->merchantSiteId=-1;
1067
+ $this->merchantDatas=array();
1068
+ $this->url_ok='';
1069
+ $this->url_nok='';
1070
+ $this->url_cancel='';
1071
+ $this->url_ack='';
1072
+ $this->ack_wd='';
1073
+ $this->email_ack='';
1074
+ $this->bg_color='';
1075
+ $this->logo_url='';
1076
+ $this->issuerAccountLogin='';
1077
+ $this->locale='';
1078
+ $this->cguChecked=0;
1079
+ }
1080
+
1081
+ function __construct() {
1082
+ $this->init();
1083
+ parent::__construct();
1084
+ }
1085
+ }
1086
+
1087
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_product.php ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente une ligne de la commande pour un paiement simple
44
+ *
45
+ */
46
+ class HIPAY_MAPI_Product extends HIPAY_MAPI_Item {
47
+ /**
48
+ * Nom du produit
49
+ *
50
+ * @var string
51
+ */
52
+ protected $name;
53
+
54
+ /**
55
+ * Informations sur le produit
56
+ *
57
+ * @var string
58
+ */
59
+ protected $info;
60
+
61
+ /**
62
+ * quantité
63
+ *
64
+ * @var int
65
+ */
66
+ protected $quantity;
67
+
68
+ /**
69
+ * Réference produit
70
+ *
71
+ * @var string
72
+ */
73
+ protected $ref;
74
+
75
+ /**
76
+ * Catégorie du produit
77
+ *
78
+ * @var int
79
+ */
80
+ protected $category;
81
+
82
+ /**
83
+ * Montant unitaire HT du produit
84
+ *
85
+ * @var float
86
+ */
87
+ protected $price;
88
+
89
+ /**
90
+ * Taxes s'appliquant à ce produit
91
+ *
92
+ * @var array
93
+ */
94
+ protected $tax;
95
+
96
+
97
+ /**
98
+ * Assigne le nom du produit
99
+ *
100
+ * @param string $name
101
+ * @return boolean
102
+ */
103
+ public function setName($name) {
104
+ if ($this->_locked)
105
+ return false;
106
+
107
+ $name = HIPAY_MAPI_UTF8::forceUTF8($name);
108
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($name);
109
+ if ($len<1 || $len>HIPAY_MAPI_MAX_PRODUCT_NAME_LENGTH)
110
+ return false;
111
+ $this->name=$name;
112
+ return true;
113
+ }
114
+
115
+ /**
116
+ * Retourne le nom du produit
117
+ *
118
+ * @return string
119
+ */
120
+ public function getName() {
121
+ return $this->name;
122
+ }
123
+
124
+ /**
125
+ * Assigne les informations sur le produit
126
+ *
127
+ * @param string $info
128
+ * @return boolean
129
+ */
130
+ public function setInfo($info) {
131
+ if ($this->_locked)
132
+ return false;
133
+
134
+ $info = HIPAY_MAPI_UTF8::forceUTF8($info);
135
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($info);
136
+ if ($len>HIPAY_MAPI_MAX_PRODUCT_INFO_LENGTH)
137
+ return false;
138
+ $this->info=$info;
139
+ return true;
140
+ }
141
+
142
+ /**
143
+ * Retourne les informations sur le produit
144
+ *
145
+ * @return string
146
+ */
147
+ public function getInfo() {
148
+ return $this->info;
149
+ }
150
+
151
+ /**
152
+ * Assigne la quantité de produit
153
+ *
154
+ * @param int $quantity
155
+ * @return boolean
156
+ */
157
+ public function setQuantity($quantity) {
158
+ if ($this->_locked)
159
+ return false;
160
+
161
+ $quantity=(int)$quantity;
162
+ if ($quantity<1)
163
+ return false;
164
+ $this->quantity=$quantity;
165
+ return true;
166
+ }
167
+
168
+ /**
169
+ * Retourne la quantité de produit
170
+ *
171
+ * @return int
172
+ */
173
+ public function getQuantity() {
174
+ return $this->quantity;
175
+ }
176
+
177
+ /**
178
+ * Assigne la réference du produit
179
+ *
180
+ * @param string $ref
181
+ * @return boolean
182
+ */
183
+ public function setRef($ref) {
184
+ if ($this->_locked)
185
+ return false;
186
+
187
+ $ref = HIPAY_MAPI_UTF8::forceUTF8($ref);
188
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($ref);
189
+ if ($len>HIPAY_MAPI_MAX_PRODUCT_REF_LENGTH)
190
+ return false;
191
+ $this->ref=$ref;
192
+ return true;
193
+ }
194
+
195
+ /**
196
+ * Retourne la réference du produit
197
+ *
198
+ * @return string
199
+ */
200
+ public function getRef() {
201
+ return $this->ref;
202
+ }
203
+
204
+
205
+ /**
206
+ * Assigne la catégorie du produit
207
+ *
208
+ * @param int $category
209
+ * @return boolean
210
+ */
211
+ public function setCategory($category) {
212
+ if ($this->_locked)
213
+ return false;
214
+
215
+ $category = (int)$category;
216
+ if ($category<1)
217
+ return false;
218
+ $this->category=$category;
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * Retourne la catégorie du produit
224
+ *
225
+ * @return int
226
+ */
227
+ public function getCategory() {
228
+ return $this->category;
229
+ }
230
+
231
+ /**
232
+ * Assigne le montant unitaire HT du produit
233
+ *
234
+ * @param float $price
235
+ * @return boolean
236
+ */
237
+ public function setPrice($price) {
238
+ if ($this->_locked)
239
+ return false;
240
+
241
+ $price = sprintf('%.02f',(float)$price);
242
+ if ($price<0)
243
+ return false;
244
+ $this->price=$price;
245
+ return true;
246
+ }
247
+
248
+ /**
249
+ * Retourne montant unitaire HT du produit
250
+ *
251
+ * @return float
252
+ */
253
+ public function getPrice() {
254
+ return $this->price;
255
+ }
256
+
257
+ /**
258
+ * Assigne les taxes s'appliquant à ce produit
259
+ *
260
+ * @param array $tax
261
+ * @return boolean
262
+ */
263
+ public function setTax($tax) {
264
+ if ($this->_locked)
265
+ return false;
266
+
267
+ if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax'))
268
+ return false;
269
+ foreach ($tax as $obj)
270
+ $this->tax[]= clone $obj;
271
+ return true;
272
+ }
273
+
274
+ /**
275
+ * Retourne les taxes s'appliquant à ce produit
276
+ *
277
+ * @return array
278
+ */
279
+ public function getTax() {
280
+ return $this->tax;
281
+ }
282
+
283
+ /**
284
+ * Vérifie que l'objet est correctement initialisé
285
+ *
286
+ * @return boolean
287
+ */
288
+ public function check() {
289
+ if ($this->name=='' || $this->quantity<0 || $this->category<0 || $this->price<0 || !HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax'))
290
+ throw new Exception('L\'objet n\'à pas été initilisé. Vous devez préciser un nom de produit, une quantité, un prix, une catégorie et des taxes');
291
+ foreach($this->tax as $obj) {
292
+ if (!$obj->check())
293
+ return false;
294
+ }
295
+ return true;
296
+ }
297
+
298
+ protected function init() {
299
+ $this->name='';
300
+ $this->info='';
301
+ $this->quantity=-1;
302
+ $this->ref='';
303
+ $this->category=-1;
304
+ $this->price=-1;
305
+ $this->tax=array();
306
+ }
307
+
308
+ function __construct() {
309
+ $this->init();
310
+ parent::__construct();
311
+ }
312
+
313
+ }
314
+
315
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_send_xml.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_SEND_XML {
43
+
44
+ /**
45
+ * Envoi le flux XML et retourne la réponse du serveur
46
+ *
47
+ * un timeout trop bas
48
+ * Une mauvaise url
49
+ * un proxy mal configuré s'il existe
50
+ *
51
+ * peuvent engendrer une erreur de connexion
52
+ *
53
+ * @param string $xml
54
+ * @return string
55
+ */
56
+ public static function sendXML($xml, $url="") {
57
+ $xml=self::prepare($xml);
58
+
59
+ if ($url=="")
60
+ $turl=parse_url(HIPAY_GATEWAY_URL);
61
+ else $turl=parse_url($url);
62
+ if (!isset($turl['path']))
63
+ $turl['path']='/';
64
+
65
+ $curl = curl_init();
66
+ curl_setopt($curl,CURLOPT_TIMEOUT, HIPAY_MAPI_CURL_TIMEOUT);
67
+ curl_setopt($curl,CURLOPT_POST,1);
68
+ curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
69
+ curl_setopt($curl,CURLOPT_USERAGENT,"HIPAY");
70
+ curl_setopt($curl,CURLOPT_URL, $turl['scheme'].'://'.$turl['host'].$turl['path']);
71
+ curl_setopt($curl,CURLOPT_POSTFIELDS,'xml='.urlencode($xml));
72
+
73
+ if(HIPAY_MAPI_CURL_PROXY_ON === true)
74
+ {
75
+ curl_setopt($curl, CURLOPT_PROXY, HIPAY_MAPI_CURL_PROXY);
76
+ curl_setopt($curl, CURLOPT_PROXYPORT, HIPAY_MAPI_CURL_PROXYPORT);
77
+ }
78
+
79
+ if(HIPAY_MAPI_CURL_LOG_ON === true)
80
+ {
81
+ $errorFileLog = fopen(HIPAY_MAPI_CURL_LOGFILE, "a+");
82
+ curl_setopt($curl, CURLOPT_VERBOSE, true);
83
+ curl_setopt($curl, CURLOPT_STDERR, $errorFileLog);
84
+ }
85
+
86
+ curl_setopt($curl, CURLOPT_HEADER, 0);
87
+
88
+ ob_start();
89
+ if (curl_exec($curl) !== true)
90
+ {
91
+ $output = $turl['scheme'].'://'.$turl['host'].$turl['path'].' is not reachable';
92
+ $output .= '<br />Network problem ? Verify your proxy configuration in mapi_defs.php';
93
+ }
94
+ else $output = ob_get_contents();
95
+ ob_end_clean();
96
+ curl_close($curl);
97
+ if(HIPAY_MAPI_CURL_LOG_ON === true)
98
+ {
99
+ fclose($errorFileLog);
100
+ }
101
+ return $output;
102
+ }
103
+
104
+ /**
105
+ * Prépare le flux XML
106
+ *
107
+ * @param string $xml
108
+ * @return string
109
+ */
110
+ public static function prepare($xml) {
111
+ $cleanXML='';
112
+ $xml = trim($xml);
113
+ $md5 = hash('md5',$xml);
114
+ $cleanXML="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
115
+ $cleanXML.="<mapi>\n";
116
+ $cleanXML.="<mapiversion>".MAPI_VERSION."</mapiversion>\n";
117
+ $cleanXML.='<md5content>'.$md5."</md5content>\n";
118
+ $cleanXML.=$xml;
119
+ $cleanXML.="\n</mapi>\n";
120
+ return trim($cleanXML);
121
+ }
122
+ }
123
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_simplepayment.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Représente un paiement simple
44
+ * Un paiement simple contient :
45
+ * - 1 objet paramètres HIPAY_MAPI_PaymentParams
46
+ * - 1 objet order HIPAY_MAPI_Order
47
+ * - n objet produits représentant les lignes de la commande HIPAY_MAPI_Product
48
+ *
49
+ */
50
+ class HIPAY_MAPI_SimplePayment extends HIPAY_MAPI_Payment {
51
+
52
+ function __construct(HIPAY_MAPI_PaymentParams $paymentParams,HIPAY_MAPI_Order $order,$items) {
53
+ try {
54
+ parent::__construct($paymentParams,array($order),$items);
55
+ } catch(Exception $e) {
56
+ throw new Exception($e->getMessage());
57
+ }
58
+ }
59
+
60
+ }
61
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_tax.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Gestion des taxes
44
+ *
45
+ */
46
+ class HIPAY_MAPI_Tax extends HIPAY_MAPI_lockable
47
+ {
48
+ /**
49
+ * nom de la taxe
50
+ *
51
+ * @var string
52
+ */
53
+ protected $taxName;
54
+
55
+ /**
56
+ * valeur de la taxe
57
+ *
58
+ * @var float
59
+ */
60
+ protected $taxVal;
61
+
62
+ /**
63
+ * true si la valeur de la taxe est un pourcentage
64
+ *
65
+ * @var boolean
66
+ */
67
+ protected $percentage;
68
+
69
+ /**
70
+ * Montant calculé de la taxe
71
+ *
72
+ * @var float
73
+ */
74
+ protected $_amount;
75
+
76
+
77
+ /**
78
+ * assigne le nom de la taxe
79
+ *
80
+ * @param string $taxName nom de la taxe
81
+ * @return boolean true si l'assignation s'est bien déroulée
82
+ */
83
+ public function setTaxName($taxName) {
84
+ if ($this->_locked)
85
+ return false;
86
+ $taxName = HIPAY_MAPI_UTF8::forceUTF8($taxName);
87
+ $len=HIPAY_MAPI_UTF8::strlen_utf8($taxName);
88
+ if ($len<1 || $len>HIPAY_MAPI_MAX_TAX_NAME_LENGTH)
89
+ return false;
90
+ $this->taxName=$taxName;
91
+ return true;
92
+ }
93
+
94
+
95
+ /**
96
+ * retourne le nom de la taxe
97
+ *
98
+ * @return string nom de la taxe
99
+ */
100
+ public function getTaxName() {
101
+ return $this->taxName;
102
+ }
103
+
104
+
105
+ /**
106
+ * assigne la valeur de la taxe
107
+ *
108
+ * @param float $taxVal valeur de la taxe
109
+ * @param boolean $percentage true si la valeur de la taxe est un pourcentage
110
+ * @return boolean true si l'assignation s'est bien déroulée
111
+ */
112
+ public function setTaxVal($taxVal,$percentage=true) {
113
+ if ($this->_locked)
114
+ return false;
115
+ if (!is_bool($percentage))
116
+ return false;
117
+ $taxVal = sprintf('%.02f',(float)$taxVal);
118
+ if ($percentage && ($taxVal<=0 || $taxVal>100))
119
+ return false;
120
+ $this->taxVal=$taxVal;
121
+ $this->percentage=$percentage;
122
+ return true;
123
+ }
124
+
125
+
126
+ /**
127
+ * retourne la valeur de la taxe
128
+ *
129
+ * @return float valeur de la taxe
130
+ */
131
+ public function getTaxVal() {
132
+ return $this->taxVal;
133
+ }
134
+
135
+
136
+ /**
137
+ * détermine si la valeur de la taxe est un pourcentage
138
+ *
139
+ * @return boolean true si la valeur de la taxe est un pourcentage
140
+ */
141
+ public function isPercentage() {
142
+ return $this->percentage;
143
+ }
144
+
145
+
146
+ /**
147
+ * effectue une vérification des propriétés de la taxe
148
+ *
149
+ * @return boolean true si les propriétés de la taxe sont correctes
150
+ */
151
+ public function check() {
152
+ if ($this->taxName=='' || $this->taxVal<0)
153
+ throw new Exception('Nom ou valeur de la taxe non initialisée');
154
+ return true;
155
+ }
156
+
157
+
158
+ /**
159
+ * initilise les propriétés de la taxe
160
+ *
161
+ */
162
+ protected function init() {
163
+ $this->taxVal=-1;
164
+ $this->taxName='';
165
+ $this->percentage=false;
166
+ $this->_amount=0;
167
+ $this->_locked=false;
168
+ }
169
+
170
+
171
+ /**
172
+ * assigne le montant calculé de la taxe
173
+ *
174
+ * @param float $amount montant calculé
175
+ * @return boolean true si l'assignation s'est bien déroulée
176
+ */
177
+ public function setTaxAmount($amount) {
178
+ if ($this->_locked)
179
+ return false;
180
+
181
+ $amount=(float)$amount;
182
+ if ($amount<0)
183
+ $amount=0;
184
+ $this->_amount = sprintf("%.02f",$amount);
185
+
186
+ return true;
187
+ }
188
+
189
+
190
+ /**
191
+ * retourne le montant calculé de la taxe
192
+ *
193
+ * @return float montant calculé
194
+ */
195
+ public function getTaxAmount() {
196
+ return $this->_amount;
197
+ }
198
+
199
+
200
+ /**
201
+ * constructeur
202
+ *
203
+ */
204
+ function __construct() {
205
+ $this->init();
206
+ parent::__construct();
207
+ }
208
+ }
209
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_utf8.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_UTF8 {
43
+ /**
44
+ * Test si une chaine est en UTF-8
45
+ *
46
+ * @param string $string
47
+ * @return boolean
48
+ */
49
+ public static function is_utf8($string) {
50
+ // From http://w3.org/International/questions/qa-forms-utf-8.html
51
+ return preg_match('%^(?:
52
+ [\x09\x0A\x0D\x20-\x7E] # ASCII
53
+ | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
54
+ | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
55
+ | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
56
+ | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
57
+ | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
58
+ | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
59
+ | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
60
+ )*$%xs', $string);
61
+ }
62
+
63
+
64
+ /**
65
+ * Encode une chaine en UTF-8 si elle ne l'est pas déjà
66
+ *
67
+ * @param string $string
68
+ * @return string
69
+ */
70
+ public static function forceUTF8($string) {
71
+ if (!self::is_utf8($string))
72
+ return utf8_encode($string);
73
+ else return $string;
74
+ }
75
+
76
+
77
+ /**
78
+ * Longueur d'une chaine UTF-8
79
+ *
80
+ * @param string $str
81
+ * @return int longueur de la chaine
82
+ */
83
+ public static function strlen_utf8 ($str) {
84
+ $i = 0;
85
+ $count = 0;
86
+ $len = strlen ($str);
87
+ while ($i < $len)
88
+ {
89
+ $chr = ord ($str[$i]);
90
+ $count++;
91
+ $i++;
92
+ if ($i >= $len)
93
+ break;
94
+
95
+ if ($chr & 0x80)
96
+ {
97
+ $chr <<= 1;
98
+ while ($chr & 0x80)
99
+ {
100
+ $i++;
101
+ $chr <<= 1;
102
+ }
103
+ }
104
+ }
105
+ return $count;
106
+ }
107
+ }
108
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_utils.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_UTILS
43
+ {
44
+
45
+ /**
46
+ * Vérifie si le tableau $array contient des objet $objectName
47
+ *
48
+ * @param array $array
49
+ * @param string $objectName
50
+ * @return boolean
51
+ */
52
+ public static function is_an_array_of($array, $objectName) {
53
+ if (!is_array($array))
54
+ return false;
55
+ try {
56
+ foreach($array as $obj) {
57
+ if (!($obj instanceof $objectName)) {
58
+ return false;
59
+ }
60
+ }
61
+ } catch (Exception $e) {
62
+ return false;
63
+ }
64
+ return true;
65
+ }
66
+
67
+ /**
68
+ * Retourne le montant calculé d'une taxe en fonction de la valeur $itemValue
69
+ *
70
+ * @param float $itemValue
71
+ * @param HIPAY_MAPI_Tax $tax
72
+ * @return float
73
+ */
74
+ public static function computeTax($itemValue,HIPAY_MAPI_Tax $tax) {
75
+ $itemValue = (float) $itemValue;
76
+ $taxAmount=0;
77
+ if ($tax->isPercentage()) {
78
+ $taxAmount=sprintf("%.02f",($itemValue/100)*$tax->getTaxVal());
79
+ } else {
80
+ $taxAmount+=sprintf("%.02f",$tax->getTaxVal());
81
+ }
82
+ return (float)$taxAmount;
83
+ }
84
+
85
+ /**
86
+ * Vérifie la validité d'une URL
87
+ *
88
+ * @param string $url
89
+ * @return boolean
90
+ */
91
+ public static function checkURL( $url ) {
92
+ return preg_match( '#^(((http|https):\/\/){0,1})(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(.*)#i', $url );
93
+ }
94
+
95
+ /**
96
+ * Vérifie la validité de l'email
97
+ *
98
+ * @param string $email
99
+ * @return boolean
100
+ */
101
+ public static function checkemail( $email ) {
102
+ return preg_match( '#^[_a-z0-9-]+(\.[_a-z0-9-]*)*@[a-z0-9-]+(\.[a-z0-9-]+)+$#i', $email );
103
+ }
104
+
105
+ /**
106
+ * convertit un délai mapi en tableau
107
+ *
108
+ * @param string $delay
109
+ * @return array
110
+ */
111
+ public static function parseDelay( $delay )
112
+ {
113
+ $array = array_fill_keys( array('H', 'I', 'S', 'M', 'D', 'Y'), 0 );
114
+ $n = substr( $delay, 0, -1 );
115
+ $r = substr( $delay, -1, 1 );
116
+ $array[ strtoupper($r) ] = $n;
117
+
118
+ return $array;
119
+ }
120
+
121
+ /**
122
+ * Renvoie le flux xml sous forme de tableau associatif multi dimensionnel
123
+ * php.net Julio Cesar Oliveira
124
+ *
125
+ * @param string $xml
126
+ * @param boolean $recursive
127
+ *
128
+ * @return array
129
+ */
130
+ public static function xml2Array($xml, $recursive = false)
131
+ {
132
+ if(!$recursive)
133
+ {
134
+ $array = (array) simplexml_load_string($xml);
135
+ }
136
+ else
137
+ {
138
+ $array = (array) $xml;
139
+ }
140
+
141
+ $newArray = array();
142
+
143
+ foreach ($array as $key => $value)
144
+ {
145
+ $value = (array)$value;
146
+ if (isset($value[0]))
147
+ {
148
+ $newArray[$key] = trim ($value[0]);
149
+ }
150
+ else
151
+ {
152
+ $newArray[$key] = self::xml2Array($value, true);
153
+ }
154
+ }
155
+ return $newArray ;
156
+ }
157
+ }
158
+ ?>
app/code/local/HimediaPayments/Hipay/Mapi/mapi_xml.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ class HIPAY_MAPI_XML {
43
+
44
+ /**
45
+ * Cré le flux XML de cet objet.
46
+ * Les membres commençants par "_" sont ignorées
47
+ *
48
+ * @param int $t
49
+ * @return string
50
+ */
51
+ public function getXML($t=0,$noshow=true) {
52
+ $xml='';
53
+ $xml.=str_repeat(chr(9),$t)."<".get_class($this).">\n";
54
+ foreach($this as $name=>$value) {
55
+ if ($noshow && substr($name,0,1)=='_')
56
+ continue;
57
+
58
+ if (!is_array($this->$name) && !is_object($this->$name) && !is_bool($this->$name)) {
59
+ $xml.=str_repeat(chr(9),$t+1)."<$name>$value</$name>\n";
60
+ } else if (is_bool($this->$name)) {
61
+ if ($value===true)
62
+ $xml.=str_repeat(chr(9),$t+1)."<$name>true</$name>\n";
63
+ else
64
+ $xml.=str_repeat(chr(9),$t+1)."<$name>false</$name>\n";
65
+ } else if (is_object($this->$name) && method_exists($this->$name,'getXML')) {
66
+ $xml.=$this->$name->getXml($t+1);
67
+ } else if (is_array($this->$name)) {
68
+ $xml.=str_repeat(chr(9),$t+1)."<$name>\n";
69
+ $xml.=self::getXMLArray($this->$name,$t+1,$noshow);
70
+ $xml.=str_repeat(chr(9),$t+1)."</$name>\n";
71
+ }
72
+ // else : no getXML method available
73
+
74
+ }
75
+ $xml.=str_repeat(chr(9),$t)."</".get_class($this).">\n";
76
+ return $xml;
77
+
78
+ }
79
+
80
+ /**
81
+ * Cré le flux XML d'un tableau
82
+ *
83
+ * @param array $array
84
+ * @param int $t
85
+ * @return string
86
+ */
87
+ protected function getXMLArray($array,$t=0,$noshow=true) {
88
+ $xml='';
89
+ foreach($array as $name=>$value) {
90
+ if (substr($name,0,1)=='_')
91
+ continue;
92
+
93
+ if (!is_array($array[$name]) && !is_object($array[$name]) && !is_bool($array[$name])) {
94
+ $xml.=str_repeat(chr(9),$t+1)."<_aKey_$name>$value</_aKey_$name>\n";
95
+ } else if (is_bool($array[$name])) {
96
+ if ($value===true)
97
+ $xml.=str_repeat(chr(9),$t+1)."<$name>true</$name>\n";
98
+ else
99
+ $xml.=str_repeat(chr(9),$t+1)."<$name>false</$name>\n";
100
+ } else if (is_object($array[$name]) && method_exists($array[$name],'getXML')) {
101
+ $xml.=$array[$name]->getXml($t+1);
102
+ } else if (is_array($array[$name])){
103
+ $xml.=str_repeat(chr(9),$t+1)."<$name>\n";
104
+ $xml.=self::getXMLArray($array[$name],$t+1,$noshow);
105
+ $xml.=str_repeat(chr(9),$t+1)."</$name>\n";
106
+ }
107
+ }
108
+ return $xml;
109
+ }
110
+
111
+ }
112
+ ?>
app/code/local/HimediaPayments/Hipay/Model/Accountmode.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Account mode model
44
+ *
45
+ * @author Dirk Jönsson
46
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
47
+ */
48
+ class HimediaPayments_Hipay_Model_Accountmode
49
+ {
50
+ public function toOptionArray()
51
+ {
52
+ return array(
53
+ array('value'=>'HIPAY_GATEWAY_URL', 'label'=>Mage::helper('hipaymod')->__('Live')), // HIPAY_GATEWAY_URL
54
+ array('value'=>'HIPAY_GATEWAY_TEST_URL', 'label'=>Mage::helper('hipaymod')->__('Test')), // HIPAY_GATEWAY_TEST_URL
55
+ );
56
+ }
57
+
58
+ }
app/code/local/HimediaPayments/Hipay/Model/Age.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Age classification
44
+ *
45
+ * @author Dirk Jönsson
46
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
47
+ */
48
+ class HimediaPayments_Hipay_Model_Age
49
+ {
50
+ public function toOptionArray()
51
+ {
52
+ return array(
53
+ array('value'=>'ALL', 'label'=>Mage::helper('hipaymod')->__('For all ages')),
54
+ array('value'=>'12+', 'label'=>Mage::helper('hipaymod')->__('For ages 12 and over')),
55
+ array('value'=>'16+', 'label'=>Mage::helper('hipaymod')->__('For ages 16 and over')),
56
+ array('value'=>'18+', 'label'=>Mage::helper('hipaymod')->__('For ages 18 and over')),
57
+ );
58
+ }
59
+
60
+ }
app/code/local/HimediaPayments/Hipay/Model/Category.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * List of individual order and product categories.
44
+ *
45
+ * @author Dirk Jönsson
46
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
47
+ */
48
+ class HimediaPayments_Hipay_Model_Category
49
+ {
50
+ public function toOptionArray()
51
+ {
52
+ $merchantSiteId = Mage::getStoreConfig('hipay/accountsettings/merchantsiteid');
53
+ $accountMode = Mage::getStoreConfig('hipay/extendedaccountsettings/accountmode');
54
+
55
+ if(empty($merchantSiteId) || empty($accountMode))
56
+ {
57
+ return array(
58
+ array('value'=>'', 'label'=>Mage::helper('hipaymod')->__("Please enter 'Merchant Site Id' first and save config!")),
59
+ );
60
+ }
61
+ else
62
+ {
63
+ $categoryUrl = Mage::helper('hipaymod')->getHipayCategoryUrl($accountMode) . $merchantSiteId;
64
+ $response = Mage::helper('hipaymod')->sendRestCall($categoryUrl);
65
+
66
+ $optionList = array();
67
+ if( $this->analyzeCategoryResponseXML($response, $optionList) )
68
+ {
69
+ //Mage::log($optionList);
70
+ return $optionList;
71
+ }
72
+ else
73
+ {
74
+ Mage::log("Hipay: Error while resolving category list by this URL '".$categoryUrl."': " .$response);
75
+ return array(
76
+ array('value'=>'', 'label'=>Mage::helper('hipaymod')->__('Error! Check your logs, please!'))
77
+ );
78
+ }
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Create option array by xml response data
84
+ *
85
+ * @param string $xml
86
+ * @param array $optionList
87
+ * @param string $err_msg
88
+ */
89
+ protected static function analyzeCategoryResponseXML($xml, & $optionList)
90
+ {
91
+ $err_msg='';
92
+ try {
93
+ $obj = @new SimpleXMLElement(trim($xml));
94
+ } catch (Exception $e) {
95
+ return false;
96
+ }
97
+ //Mage::log($obj);
98
+ if (isset($obj->categoriesList))
99
+ {
100
+ foreach ($obj->categoriesList as $category)
101
+ {
102
+ //Mage::log($category);
103
+ foreach ($category as $item)
104
+ {
105
+ //Mage::log($item);
106
+ $label = $item[0];
107
+ $value = $item[0]->attributes();
108
+
109
+ $optionList[] = array('value'=>$value, 'label'=>Mage::helper('hipaymod')->__(''.$label));
110
+ }
111
+ }
112
+ //Mage::log($optionList);
113
+
114
+ return true;
115
+ }
116
+
117
+ if (isset($obj->result[0]->message)) {
118
+ Mage::log("Hipay: Failed to resolve order categories: ".$obj->result[0]->message);
119
+ }
120
+ return false;
121
+
122
+ }
123
+
124
+ }
app/code/local/HimediaPayments/Hipay/Model/Currencies.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Supported currencies
4
+ *
5
+ * @author Dirk Jönsson
6
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
7
+ */
8
+ class HimediaPayments_Hipay_Model_Accountmode
9
+ {
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array('value'=>'AUD', 'label'=>Mage::helper('hipaymod')->__('Australian Dollar')),
14
+ array('value'=>'GBP', 'label'=>Mage::helper('hipaymod')->__('British Pound')),
15
+ array('value'=>'EUR', 'label'=>Mage::helper('hipaymod')->__('Euro')),
16
+ array('value'=>'CAD', 'label'=>Mage::helper('hipaymod')->__('Canadian Dollar')),
17
+ array('value'=>'SEK', 'label'=>Mage::helper('hipaymod')->__('Swedish Crone')),
18
+ array('value'=>'USD', 'label'=>Mage::helper('hipaymod')->__('US Dollar')),
19
+ );
20
+ }
21
+
22
+ }
app/code/local/HimediaPayments/Hipay/Model/Currency.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * Supported currencies
44
+ *
45
+ * @author Dirk Jönsson
46
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
47
+ */
48
+ class HimediaPayments_Hipay_Model_Currency
49
+ {
50
+ public function toOptionArray()
51
+ {
52
+ return array(
53
+ array('value'=>'AUD', 'label'=>Mage::helper('hipaymod')->__('Australian Dollar')),
54
+ array('value'=>'GBP', 'label'=>Mage::helper('hipaymod')->__('British Pound')),
55
+ array('value'=>'EUR', 'label'=>Mage::helper('hipaymod')->__('Euro')),
56
+ array('value'=>'CAD', 'label'=>Mage::helper('hipaymod')->__('Canadian Dollar')),
57
+ array('value'=>'SEK', 'label'=>Mage::helper('hipaymod')->__('Swedish Crone')),
58
+ array('value'=>'USD', 'label'=>Mage::helper('hipaymod')->__('US Dollar')),
59
+ );
60
+ }
61
+
62
+ }
app/code/local/HimediaPayments/Hipay/Model/Method/Dummy.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HimediaPayments_Hipay_Model_Method_Dummy extends Mage_Payment_Model_Method_Abstract
4
+ {
5
+ /**
6
+ * Der Zahlart-Code muss einmalig sein, und wird zum Auslesen der
7
+ * System-Konfiguration unter payment/[CODE] verwendet.
8
+ *
9
+ * @var string
10
+ */
11
+ protected $_code = 'hipay';
12
+ protected $_formBlockType = 'hipaymod/form';
13
+
14
+
15
+ /**
16
+ * Wenn die Zahlung online, also automatisch ausgeführt werden kann muss
17
+ * der _isGateway Indikator-Flag auf true gesetzt werden.
18
+ * Um Payment Module zu implementieren, bei denen kein automatisches Capture erfolgt,
19
+ * die Invoice aber trotzdem als bezahlt markiert wird, müssen _isGateway und
20
+ * _canCapture auf false gesetzt werden.
21
+ *
22
+ * @var bool
23
+ */
24
+ protected $_isGateway = false;
25
+
26
+ /**
27
+ * Flag Indikator ob das Zahlart-Model authorize() unterstützt.
28
+ *
29
+ * @var bool
30
+ */
31
+ protected $_canAuthorize = false;
32
+
33
+ /**
34
+ * Flag Indikator ob das Zahlart-Model capture() unterstützt.
35
+ *
36
+ * @var bool
37
+ */
38
+ protected $_canCapture = false;
39
+
40
+ /**
41
+ * Flag Indikator ob das Zahlart-Model die Zahlung von Teilbeträgen unterstützt.
42
+ *
43
+ * @var bool
44
+ */
45
+ protected $_canCapturePartial = false;
46
+
47
+ /**
48
+ * Flag Indikator ob das Zahlart-Model refund() unterstützt.
49
+ *
50
+ * @var bool
51
+ */
52
+ protected $_canRefund = false;
53
+
54
+ /**
55
+ * Flag Indikator ob das Zahlart-Model die Rückzahlung von Teilbeträgen unterstützt.
56
+ *
57
+ * @var bool
58
+ */
59
+ protected $_canRefundInvoicePartial = false;
60
+
61
+ /**
62
+ * Flag Indikator ob das Zahlart-Model void() unterstützt.
63
+ *
64
+ * @var bool
65
+ */
66
+ protected $_canVoid = false;
67
+
68
+ /**
69
+ * Flag Indikator ob das Zahlart-Model bei Bestellungen im Admin-Interface, also
70
+ * ohne das der Kunde selber anwesend ist, verwendet werden kann (zum Beispiel für
71
+ * Kreditkarten-Zahlungen bei Bestellungen über das Telefon).
72
+ *
73
+ * @var bool
74
+ */
75
+ protected $_canUseInternal = true;
76
+
77
+ /**
78
+ * Flag Indikator ob die Zahlart im Onepage Checkout dem Kunden angeboten werden soll.
79
+ *
80
+ * @var bool
81
+ */
82
+ protected $_canUseCheckout = true;
83
+
84
+ /**
85
+ * Flag Indikator ob das Zahlart-Model im Multishipping Checkout verwendet werden kann.
86
+ * Es können nur Payment Module im Multishipping Checkout verwendet werden bei denen
87
+ * der Kunde nicht auf die Seite des Zahlungsanbieters weitergeleitet werden muss.
88
+ *
89
+ * @var bool
90
+ */
91
+ protected $_canUseForMultishipping = true;
92
+
93
+ /**
94
+ * Flag Indikator ob initialize() auf der Zahlart beim Erstellen der Order
95
+ * aufgerufen werden soll.
96
+ *
97
+ * @var bool
98
+ */
99
+ protected $_isInitializeNeeded = false ;
100
+
101
+ /**
102
+ * Rückgabe der URL, auf die nach dem Klick auf den 'place order' Button weitergeleitet
103
+ * werden soll.
104
+ *
105
+ * @return string
106
+ */
107
+ public function getOrderPlaceRedirectUrl()
108
+ {
109
+ $params = array(
110
+ );
111
+
112
+ return Mage::getUrl('hipay/mapi/payment', $params);
113
+ }
114
+
115
+ }
app/code/local/HimediaPayments/Hipay/Model/Method/Hipay.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Hipay
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
9
+ * All rights reserved.
10
+ *
11
+ * Redistribution and use in source and binary forms, with or without
12
+ * modification, are permitted provided that the following conditions are met:
13
+ *
14
+ * - Redistributions of source code must retain the above copyright notice,
15
+ * this list of conditions and the following disclaimer.
16
+ * - Redistributions in binary form must reproduce the above copyright notice,
17
+ * this list of conditions and the following disclaimer in the documentation
18
+ * and/or other materials provided with the distribution.
19
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
20
+ * nor the names of its contributors may be used to endorse or promote products
21
+ * derived from this software without specific prior written permission.
22
+ *
23
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
+ * POSSIBILITY OF SUCH DAMAGE.
34
+ *
35
+ * @category Paymentnetwork
36
+ * @package Paymentnetwork_Hipay
37
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
38
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
39
+ */
40
+ class HimediaPayments_Hipay_Model_Method_Hipay extends Mage_Payment_Model_Method_Abstract
41
+ {
42
+ /**
43
+ * Der Zahlart-Code muss einmalig sein, und wird zum Auslesen der
44
+ * System-Konfiguration unter payment/[CODE] verwendet.
45
+ *
46
+ * @var string
47
+ */
48
+ protected $_code = 'hipay';
49
+ protected $_formBlockType = 'hipaymod/form';
50
+
51
+
52
+ /**
53
+ * Wenn die Zahlung online, also automatisch ausgeführt werden kann muss
54
+ * der _isGateway Indikator-Flag auf true gesetzt werden.
55
+ * Um Payment Module zu implementieren, bei denen kein automatisches Capture erfolgt,
56
+ * die Invoice aber trotzdem als bezahlt markiert wird, müssen _isGateway und
57
+ * _canCapture auf false gesetzt werden.
58
+ *
59
+ * @var bool
60
+ */
61
+ protected $_isGateway = false;
62
+
63
+ /**
64
+ * Flag Indikator ob das Zahlart-Model authorize() unterstützt.
65
+ *
66
+ * @var bool
67
+ */
68
+ protected $_canAuthorize = false;
69
+
70
+ /**
71
+ * Flag Indikator ob das Zahlart-Model capture() unterstützt.
72
+ *
73
+ * @var bool
74
+ */
75
+ protected $_canCapture = false;
76
+
77
+ /**
78
+ * Flag Indikator ob das Zahlart-Model die Zahlung von Teilbeträgen unterstützt.
79
+ *
80
+ * @var bool
81
+ */
82
+ protected $_canCapturePartial = false;
83
+
84
+ /**
85
+ * Flag Indikator ob das Zahlart-Model refund() unterstützt.
86
+ *
87
+ * @var bool
88
+ */
89
+ protected $_canRefund = false;
90
+
91
+ /**
92
+ * Flag Indikator ob das Zahlart-Model die Rückzahlung von Teilbeträgen unterstützt.
93
+ *
94
+ * @var bool
95
+ */
96
+ protected $_canRefundInvoicePartial = false;
97
+
98
+ /**
99
+ * Flag Indikator ob das Zahlart-Model void() unterstützt.
100
+ *
101
+ * @var bool
102
+ */
103
+ protected $_canVoid = false;
104
+
105
+ /**
106
+ * Flag Indikator ob das Zahlart-Model bei Bestellungen im Admin-Interface, also
107
+ * ohne das der Kunde selber anwesend ist, verwendet werden kann (zum Beispiel für
108
+ * Kreditkarten-Zahlungen bei Bestellungen über das Telefon).
109
+ *
110
+ * @var bool
111
+ */
112
+ protected $_canUseInternal = true;
113
+
114
+ /**
115
+ * Flag Indikator ob die Zahlart im Onepage Checkout dem Kunden angeboten werden soll.
116
+ *
117
+ * @var bool
118
+ */
119
+ protected $_canUseCheckout = true;
120
+
121
+ /**
122
+ * Flag Indikator ob das Zahlart-Model im Multishipping Checkout verwendet werden kann.
123
+ * Es können nur Payment Module im Multishipping Checkout verwendet werden bei denen
124
+ * der Kunde nicht auf die Seite des Zahlungsanbieters weitergeleitet werden muss.
125
+ *
126
+ * @var bool
127
+ */
128
+ protected $_canUseForMultishipping = false;
129
+
130
+ /**
131
+ * Flag Indikator ob initialize() auf der Zahlart beim Erstellen der Order
132
+ * aufgerufen werden soll.
133
+ *
134
+ * @var bool
135
+ */
136
+ protected $_isInitializeNeeded = false ;
137
+
138
+ /**
139
+ * Rückgabe der URL, auf die nach dem Klick auf den 'place order' Button weitergeleitet
140
+ * werden soll.
141
+ *
142
+ * @return string
143
+ */
144
+ public function getOrderPlaceRedirectUrl()
145
+ {
146
+ $params = array(
147
+ );
148
+
149
+ return Mage::getUrl('hipay/mapi/payment', $params);
150
+ }
151
+
152
+ /**
153
+ * Check whether payment method can be used
154
+ * TODO: payment method instance is not supposed to know about quote
155
+ * @param Mage_Sales_Model_Quote
156
+ * @return bool
157
+ */
158
+ public function isAvailable($quote = null)
159
+ {
160
+ $checkResult = new StdClass;
161
+ //$checkResult->isAvailable = (bool)(int)$this->getConfigData('active', ($quote ? $quote->getStoreId() : null));
162
+ $checkResult->isAvailable = (bool)(int)Mage::getStoreConfig('hipay/general/active', ($quote ? $quote->getStoreId() : null));
163
+ Mage::dispatchEvent('payment_method_is_active', array(
164
+ 'result' => $checkResult,
165
+ 'method_instance' => $this,
166
+ 'quote' => $quote,
167
+ ));
168
+
169
+ // disable method if it cannot implement recurring profiles management and there are recurring items in quote
170
+ if ($checkResult->isAvailable) {
171
+ $implementsRecurring = $this->canManageRecurringProfiles();
172
+ // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last
173
+ if ($quote && (!$implementsRecurring) && $quote->hasRecurringItems()) {
174
+ $checkResult->isAvailable = false;
175
+ }
176
+ }
177
+ $available = $checkResult->isAvailable;
178
+
179
+ Mage::log("isAvailable: " . (int)$available);
180
+
181
+ return $available;
182
+ }
183
+
184
+ /**
185
+ * To check billing country is allowed for the payment method
186
+ *
187
+ * @return bool
188
+ */
189
+ public function canUseForCountry($country)
190
+ {
191
+ /*
192
+ for specific country, the flag will set up as 1
193
+ */
194
+ //if($this->getConfigData('allowspecific')==1){
195
+ if(Mage::getStoreConfig('hipay/general/allowspecific')==1){
196
+ //$availableCountries = explode(',', $this->getConfigData('specificcountry'));
197
+ $availableCountries = explode(',', Mage::getStoreConfig('hipay/general/specificcountry'));
198
+ if(!in_array($country, $availableCountries)){
199
+ return false;
200
+ }
201
+
202
+ }
203
+ return true;
204
+ }
205
+ }
app/code/local/HimediaPayments/Hipay/Model/Rating.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The audience rating for the product
4
+ *
5
+ * @author Dirk Jönsson
6
+ * @copyright 2010 Hi-media Payments (Hi-media Deutschland AG)
7
+ */
8
+ class HimediaPayments_Hipay_Model_Rating
9
+ {
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array('value'=>'ALL', 'label'=>Mage::helper('hipaymod')->__('For all ages')),
14
+ array('value'=>'12+', 'label'=>Mage::helper('hipaymod')->__('For ages 12 and over')),
15
+ array('value'=>'16+', 'label'=>Mage::helper('hipaymod')->__('For ages 16 and over')),
16
+ array('value'=>'18+', 'label'=>Mage::helper('hipaymod')->__('For ages 18 and over')),
17
+ );
18
+ }
19
+
20
+ }
app/code/local/HimediaPayments/Hipay/controllers/MapiController.php ADDED
@@ -0,0 +1,584 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+
43
+ require_once 'HimediaPayments/Hipay/Mapi/mapi_package.php';
44
+
45
+ define ('HIPAY_RESULT_PARAM_STATUS', 'status');
46
+ define ('HIPAY_RESULT_PARAM_MESSAGE', 'message');
47
+ define ('HIPAY_RESULT_PARAM_OPERATION', 'operation');
48
+ define ('HIPAY_RESULT_PARAM_DATE', 'date');
49
+ define ('HIPAY_RESULT_PARAM_TIME', 'time');
50
+ define ('HIPAY_RESULT_PARAM_TRANSID', 'transid');
51
+ define ('HIPAY_RESULT_PARAM_AMOUNT', 'origAmount');
52
+ define ('HIPAY_RESULT_PARAM_CURRENCY', 'origCurrency');
53
+ define ('HIPAY_RESULT_PARAM_MERCHANTID', 'idForMerchant');
54
+ define ('HIPAY_RESULT_PARAM_CLIENTEMAIL', 'emailClient');
55
+
56
+ define ('HIPAY_TOKEN', 'hipay_token_');
57
+
58
+ class HimediaPayments_Hipay_MapiController extends Mage_Core_Controller_Front_Action
59
+ {
60
+ /**
61
+ * Singleton des Checkout Session Models zurückliefern
62
+ *
63
+ * @return Mage_Checkout_Model_Session
64
+ */
65
+ protected function _getCheckout()
66
+ {
67
+ return Mage::getSingleton('checkout/session');
68
+ }
69
+
70
+ /**
71
+ * Aufruf durch 'orderPlaceRedirect' zum Anzeigen der Weiterleitungsseite
72
+ */
73
+ public function paymentAction()
74
+ {
75
+ Mage::log('MapiController > paymentAction');
76
+
77
+ try
78
+ {
79
+ Mage::log("Modul aktiviert? '" . Mage::getStoreConfig('hipay/general/active') /*((int) $this->getConfigData('active'))*/ . "'");
80
+
81
+ $session = $this->_getCheckout();
82
+ $order = Mage::getModel('sales/order');
83
+ $orderId = $session->getLastRealOrderId();
84
+ $order->loadByIncrementId($orderId);
85
+
86
+ if (!$order->getId())
87
+ {
88
+ $paymentUrl = "";
89
+ $message = Mage::helper('hipaymod')->__('No order for processing found!');
90
+ }
91
+ else
92
+ {
93
+ $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('Hipay payment loaded'),
94
+ Mage_Sales_Model_Order::STATE_PENDING_PAYMENT );
95
+ $order->save();
96
+
97
+ $paymentUrl = Mage::getUrl("hipay/mapi/redirect/");
98
+ $message = Mage::helper('hipaymod')->__('You will be redirected to Hipay ...');
99
+
100
+ Mage::log("order ID: " . $orderId);
101
+ Mage::log("payment Url: " . $paymentUrl . $orderId);
102
+ }
103
+
104
+ // Laden der Layout XML
105
+ $this->loadLayout();
106
+ $this->getLayout()->getBlock("hipaypayment.redirect")->assign("paymentUrl", $paymentUrl . $orderId)
107
+ ->assign("message", $message);
108
+ $this->renderLayout();
109
+ }
110
+ catch (Exception $e)
111
+ {
112
+ Mage::logException($e);
113
+ parent::_redirect('checkout/cart');
114
+ }
115
+ }
116
+
117
+
118
+ /**
119
+ * Weiterleiten auf hipay
120
+ */
121
+ public function redirectAction()
122
+ {
123
+ Mage::log('MapiController > redirectAction');
124
+
125
+ try
126
+ {
127
+ Mage::log($_SERVER['REQUEST_URI']);
128
+
129
+ $uri = $_SERVER['REQUEST_URI'];
130
+ $uriArray = explode("/", $uri);
131
+ $redirectOrder = trim(end($uriArray));
132
+
133
+ $session = $this->_getCheckout();
134
+ $orderId = $session->getLastRealOrderId();
135
+
136
+ if($orderId == $redirectOrder)
137
+ {
138
+ $order = Mage::getModel('sales/order');
139
+ $order->loadByIncrementId($orderId);
140
+
141
+ $token = Mage::helper('hipaymod')->generateToken();
142
+ Mage::log("Token: [".$token."]");
143
+ $_SESSION['hipay_token_'.$token] = $orderId;
144
+
145
+ $resultArray = Mage::helper('hipaymod')->getSinglePaymentUrl($order, $token);
146
+
147
+ $paymentUrl = $resultArray["paymentUrl"];
148
+ $errorMsg = $resultArray["errorMsg"];
149
+
150
+ if(!empty($paymentUrl))
151
+ {
152
+ $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('The customer was redirected to Hipay'),
153
+ Mage_Sales_Model_Order::STATE_PENDING_PAYMENT );
154
+ $order->save();
155
+
156
+ Mage::log("redirect to '".$paymentUrl."'");
157
+ parent::_redirectUrl($paymentUrl);
158
+ }
159
+ else
160
+ {
161
+ Mage::log("redirect error: '".$errorMsg."'");
162
+ $this->_redirect('checkout/cart');
163
+ }
164
+ }
165
+ else
166
+ {
167
+ Mage::log("Illegal redirect attempt");
168
+ $this->_redirect('checkout/cart');
169
+ }
170
+ }
171
+ catch (Exception $e)
172
+ {
173
+ Mage::logException($e);
174
+ parent::_redirect('checkout/cart');
175
+ }
176
+ }
177
+
178
+
179
+ /**
180
+ * Erfolgreiche Zahlung (URL_OK) verarbeiten.
181
+ */
182
+ public function successAction()
183
+ {
184
+ Mage::log('MapiController > successAction');
185
+
186
+ try
187
+ {
188
+ if($this->checkToken())
189
+ {
190
+ // $session = $this->_getCheckout();
191
+ //
192
+ // $order = Mage::getModel('sales/order');
193
+ // $order->loadByIncrementId($session->getLastRealOrderId());
194
+ //
195
+ // $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('The customer has successfully paid via Hipay'),
196
+ // Mage_Sales_Model_Order::STATE_PROCESSING )
197
+ // ->setIsCustomerNotified(true);
198
+ // $order->save();
199
+ //
200
+ // $order->sendNewOrderEmail();
201
+ // $order->save();
202
+
203
+ $this->_redirect('checkout/onepage/success');
204
+ }
205
+ else
206
+ {
207
+ Mage::log('Invalid security token');
208
+ parent::_redirect('checkout/cart');
209
+ }
210
+ }
211
+ catch (Exception $e)
212
+ {
213
+ Mage::logException($e);
214
+ parent::_redirect('checkout/cart');
215
+ }
216
+ }
217
+
218
+
219
+ /**
220
+ * Benutzerbedigten Abbruch (URL_CANCEL) verarbeiten.
221
+ */
222
+ public function cancelAction()
223
+ {
224
+ Mage::log('MapiController > cancelAction');
225
+
226
+ try
227
+ {
228
+ Mage::log("Hipay POST data: [");
229
+ Mage::log($_POST);
230
+ Mage::log("]");
231
+
232
+ if($this->checkToken())
233
+ {
234
+ if($this->requestHasValidPostData())
235
+ {
236
+ $session = $this->_getCheckout();
237
+
238
+ $order = Mage::getModel('sales/order');
239
+ $order->loadByIncrementId($session->getLastRealOrderId());
240
+ $order->cancel();
241
+ $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('Payment has been canceled by customer'),
242
+ Mage_Sales_Model_Order::STATE_CANCELED);
243
+ $order->save();
244
+
245
+ $order->sendOrderUpdateEmail(Mage::helper('hipaymod')->__('Your order has been canceled because you have canceled the payment process.'));
246
+
247
+ $this->_redirect('checkout/onepage/failure');
248
+ }
249
+ else
250
+ {
251
+ Mage::log('Received data could not be validated (invalid hash key!): ' . $xml);
252
+ parent::_redirect('checkout/cart');
253
+ }
254
+ }
255
+ else
256
+ {
257
+ Mage::log('Invalid security token');
258
+ parent::_redirect('checkout/cart');
259
+ }
260
+ }
261
+ catch (Exception $e)
262
+ {
263
+ Mage::logException($e);
264
+ parent::_redirect('checkout/cart');
265
+ }
266
+ }
267
+
268
+
269
+ /**
270
+ * Fehlerbedigten Abbruch (URL_NOK) verarbeiten.
271
+ *
272
+ * @todo Fehlermeldung extrahieren und zum Verlauf hinzufügen
273
+ */
274
+ public function failedAction()
275
+ {
276
+ Mage::log('MapiController > failedAction');
277
+
278
+ try
279
+ {
280
+ Mage::log("Hipay POST data: [");
281
+ Mage::log($_POST);
282
+ Mage::log("]");
283
+
284
+ if($this->checkToken())
285
+ {
286
+ if($this->requestHasValidPostData())
287
+ {
288
+ $session = $this->_getCheckout();
289
+
290
+ $order = Mage::getModel('sales/order');
291
+ $order->loadByIncrementId($session->getLastRealOrderId());
292
+ $order->cancel();
293
+ $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('Hipay payment failed'),
294
+ Mage_Sales_Model_Order::STATE_CANCELED);
295
+ $order->save();
296
+
297
+ $order->sendOrderUpdateEmail(Mage::helper('hipaymod')->__('Your order has been canceled because the payment process failed.'));
298
+
299
+ $this->_redirect('checkout/onepage/failure');
300
+ }
301
+ else
302
+ {
303
+ Mage::log('Received data could not be validated (invalid hash key!): ' . $xml);
304
+ parent::_redirect('checkout/cart');
305
+ }
306
+ }
307
+ else
308
+ {
309
+ Mage::log('Invalid security token');
310
+ parent::_redirect('checkout/cart');
311
+ }
312
+ }
313
+ catch (Exception $e)
314
+ {
315
+ Mage::logException($e);
316
+ parent::_redirect('checkout/cart');
317
+ }
318
+ }
319
+
320
+
321
+ /**
322
+ * Payment Notification verarbeiten
323
+ */
324
+ public function notificationAction()
325
+ {
326
+
327
+ Mage::log('MapiController > notificationAction');
328
+
329
+ try
330
+ {
331
+ if($this->requestHasValidPostData())
332
+ {
333
+ $xml = $_POST['xml'];
334
+
335
+ $obj = @new SimpleXMLElement(trim($xml));
336
+
337
+ Mage::log($xml);
338
+
339
+ if (isset($obj->result[0]))
340
+ {
341
+ Mage::log("Processing result...");
342
+
343
+ $result = $obj->result[0];
344
+
345
+ $operation = $this->getResultValue(HIPAY_RESULT_PARAM_OPERATION);
346
+ if(isset($operation)) {$error = true;}
347
+
348
+ $status = $this->getResultValue(HIPAY_RESULT_PARAM_STATUS);
349
+ if(isset($status)) {$error = true;}
350
+
351
+ $date = $this->getResultValue(HIPAY_RESULT_PARAM_DATE);
352
+ if(isset($date)) {$error = true;}
353
+
354
+ $time = $this->getResultValue(HIPAY_RESULT_PARAM_TIME);
355
+ if(isset($time)) {$error = true;}
356
+
357
+ $transid = $this->getResultValue(HIPAY_RESULT_PARAM_TRANSID);
358
+ if(isset($transid)) {$error = true;}
359
+
360
+ $origAmount = $this->getResultValue(HIPAY_RESULT_PARAM_AMOUNT);
361
+ if(isset($origAmount)) {$error = true;}
362
+
363
+ $origCurrency = $this->getResultValue(HIPAY_RESULT_PARAM_CURRENCY);
364
+ if(isset($origCurrency)) {$error = true;}
365
+
366
+ $idForMerchant = $this->getResultValue(HIPAY_RESULT_PARAM_MERCHANTID);
367
+ if(isset($idForMerchant)) {$error = true;}
368
+
369
+ $emailClient = $this->getResultValue(HIPAY_RESULT_PARAM_CLIENTEMAIL);
370
+ if(isset($emailClient)) {$error = true;}
371
+
372
+ if(isset($idForMerchant))
373
+ {
374
+ Mage::log("has idForMerchant");
375
+
376
+ $order = Mage::getModel('sales/order');
377
+ $order->loadByIncrementId(trim($idForMerchant));
378
+
379
+ if(isset($order))
380
+ {
381
+ Mage::log("found Order");
382
+ $historyComment = Mage::helper('hipaymod')->__('Hipay payment notification') ." - "
383
+ . Mage::helper('hipaymod')->__('OPERATION') . ": '".$operation."', "
384
+ . Mage::helper('hipaymod')->__('STATUS') . ": '".$status."', "
385
+ . Mage::helper('hipaymod')->__('DATE') . ": '".$date." ".$time."', "
386
+ . Mage::helper('hipaymod')->__('TRANSACTION ID') . ": '".$transid."', "
387
+ . Mage::helper('hipaymod')->__('PAID AMOUNT') . ": '".$origAmount." ".$origCurrency."', "
388
+ . Mage::helper('hipaymod')->__('CUSTOMER EMAIL') . ": '".$emailClient."'";
389
+ Mage::log("History Comment: " . $historyComment);
390
+
391
+ $order->addStatusHistoryComment($historyComment);
392
+ Mage::log("add StatusHistoryComment (notification of ".$operation.")");
393
+
394
+ if($operation == "capture")
395
+ {
396
+ Mage::log("add StatusHistoryComment (capture)");
397
+ $order->addStatusHistoryComment(Mage::helper('hipaymod')->__('The customer has successfully paid via Hipay'),
398
+ Mage_Sales_Model_Order::STATE_PROCESSING
399
+ )->setIsCustomerNotified(true);
400
+ $order->save();
401
+ Mage::log("saved Order");
402
+ $order->sendNewOrderEmail();
403
+ Mage::log("send new Order Mail");
404
+ }
405
+ else
406
+ {
407
+ $order->save();
408
+ Mage::log("saved Order");
409
+ }
410
+
411
+ }
412
+ else {$error = true;}
413
+ }
414
+ Mage::log("Done.");
415
+
416
+ Mage::log("Error: " . ((int) $error));
417
+ if(isset($error) && $error)
418
+ {
419
+ Mage::log("The received payment notification data is incomplete or incorrect: [" . $xml . "]");
420
+ return false;
421
+ }
422
+ }
423
+ }
424
+ else
425
+ {
426
+ Mage::log('Received data could not be validated (invalid hash key!): ' . $xml);
427
+ return false;
428
+ }
429
+ } catch (Exception $e) {
430
+ Mage::log("Exception occured");
431
+ Mage::logException($e);
432
+ return false;
433
+ }
434
+ }
435
+
436
+
437
+ /**
438
+ * Liefert Werte der übermittelten Daten
439
+ *
440
+ * @param string $name
441
+ */
442
+ private function getResultValue($name)
443
+ {
444
+ Mage::log("Hipay > getResultValue (".$name.")");
445
+
446
+ if($this->requestHasValidPostData())
447
+ {
448
+ $xml = $_POST['xml'];
449
+
450
+ $obj = @new SimpleXMLElement(trim($xml));
451
+
452
+ if (isset($obj->result[0]))
453
+ {
454
+ $result = $obj->result[0];
455
+
456
+ if($name == HIPAY_RESULT_PARAM_STATUS && isset($result->status)) {
457
+ $value = $result->status;
458
+ }
459
+
460
+ if($name == HIPAY_RESULT_PARAM_MESSAGE && isset($result->message)) {
461
+ $value = $result->message;
462
+ }
463
+
464
+ if($name == HIPAY_RESULT_PARAM_OPERATION && isset($result->operation)) {
465
+ $value = $result->operation;
466
+ }
467
+
468
+ if($name == HIPAY_RESULT_PARAM_DATE && isset($result->date)) {
469
+ $value = $result->date;
470
+ }
471
+
472
+ if($name == HIPAY_RESULT_PARAM_TIME && isset($result->time)) {
473
+ $value = $result->time;
474
+ }
475
+
476
+ if($name == HIPAY_RESULT_PARAM_TRANSID && isset($result->transid)) {
477
+ $value = $result->transid;
478
+ }
479
+
480
+ if($name == HIPAY_RESULT_PARAM_AMOUNT && isset($result->origAmount)) {
481
+ $value = $result->origAmount;
482
+ }
483
+
484
+ if($name == HIPAY_RESULT_PARAM_CURRENCY && isset($result->origCurrency)) {
485
+ $value = $result->origCurrency;
486
+ }
487
+
488
+ if($name == HIPAY_RESULT_PARAM_MERCHANTID && isset($result->idForMerchant)) {
489
+ $value = $result->idForMerchant;
490
+ }
491
+
492
+ if($name == HIPAY_RESULT_PARAM_CLIENTEMAIL && isset($result->emailClient)) {
493
+ $value = $result->emailClient;
494
+ }
495
+
496
+ if(isset($value)) {
497
+ return $value;
498
+ }
499
+ }
500
+ }
501
+
502
+ return "?".$name."?";
503
+ }
504
+
505
+
506
+ /**
507
+ * Validiert die übermittelten Daten
508
+ *
509
+ * @param Mage_Core_Controller_Request_Http $request
510
+ */
511
+ private function requestHasValidPostData()
512
+ {
513
+ // Mage::log('MapiController > validateResponse');
514
+
515
+ try
516
+ {
517
+ if(isset($_POST) && isset($_POST['xml']))
518
+ {
519
+ $xml = $_POST['xml'];
520
+
521
+ $obj = @new SimpleXMLElement(trim($xml));
522
+
523
+ if (isset($obj->result[0]))
524
+ {
525
+ if(isset($obj->md5content))
526
+ {
527
+ $md5content = $obj->md5content;
528
+
529
+ $startPos = strrpos($xml, "<result>");
530
+ $endPos = strrpos($xml, "</result>")+9;
531
+ $data = substr($xml, $startPos, ($endPos-$startPos));
532
+ $md5 = hash('md5', trim($data));
533
+ }
534
+ }
535
+
536
+ if(isset($md5) || isset($md5content) || ($md5 == $md5content))
537
+ {
538
+ // Mage::log("Received data is valid.");
539
+ return true;
540
+ }
541
+
542
+ Mage::log('Received data could not be validated (invalid hash key!): ' . $xml);
543
+ return false;
544
+ }
545
+ Mage::log('Received data could not be validated (no xml data found).');
546
+
547
+ } catch (Exception $e) {
548
+ Mage::logException($e);
549
+ }
550
+ return false;
551
+ }
552
+
553
+ /**
554
+ * Prüft ob der Token vorhanden und valide ist.
555
+ * @param boolean $removeToken Löschen den Token wenn true (default)
556
+ */
557
+ private function checkToken($removeToken = true)
558
+ {
559
+ $session = $this->_getCheckout();
560
+ $orderId = $session->getLastRealOrderId();
561
+ $uri = $_SERVER['REQUEST_URI'];
562
+
563
+ Mage::log($uri);
564
+ Mage::log("OrderId: " . $orderId);
565
+
566
+ $uriArray = explode("/", $uri);
567
+ $token = trim(end($uriArray));
568
+
569
+ if(isset($_SESSION[HIPAY_TOKEN.$token]))
570
+ {
571
+ $tokenOrder = $_SESSION[HIPAY_TOKEN.$token];
572
+ Mage::log("TokenOrderId: " . $tokenOrder);
573
+
574
+ if($removeToken) {
575
+ unset($_SESSION[HIPAY_TOKEN.$token]);
576
+ }
577
+
578
+ return ($orderId == $tokenOrder);
579
+ }
580
+ return false;
581
+ }
582
+ }
583
+
584
+
app/code/local/HimediaPayments/Hipay/controllers/MapiHelper.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'HimediaPayments/Hipay/Mapi/mapi_package.php';
4
+
5
+ class HimediaPayments_Hipay_Helper_Mapi
6
+ {
7
+ function createSinglePaymentDlg()
8
+ {
9
+ $params = new HIPAY_MAPI_PaymentParams();
10
+ //The Hipay platform connection parameters. This is not the information used to connect to your Hipay
11
+ //account, but the specific login and password used to connect to the payment platform.
12
+ //The login is the ID of the hipay merchant account receiving the payment, and the password is
13
+ //the « merchant password » set within your Hipay account (site info).
14
+ $params->setLogin('22955','mypassword');
15
+ // The amounts will be credited to account 22955, except the taxes which will be credited to account 23192
16
+ $params->setAccounts(22955,23192);
17
+ // The payment interface will be in International French by default
18
+ $params->setDefaultLang('de_DE');
19
+ // The interface will be the Web interface
20
+ $params->setMedia('WEB');
21
+ //The order content is intended for people at least 16 years old.
22
+ $params->setRating('16+');
23
+ // This is a single payment
24
+ $params->setPaymentMethod(HIPAY_MAPI_METHOD_SIMPLE);
25
+ // The capture take place immediately
26
+ $params->setCaptureDay(HIPAY_MAPI_CAPTURE_IMMEDIATE);
27
+ // The amounts are expressed in Euros, this has to be the same currency as the merchant's account.
28
+ $params->setCurrency('EUR');
29
+ // The merchant-selected identifier for this order is REF6522
30
+ $params->setIdForMerchant('REF6522');
31
+ // Two data elements of type key=value are declared and will be returned to the merchant after the payment in the
32
+ // notification data feed [C].
33
+ $params->setMerchantDatas('id_client','2000');
34
+ $params->setMerchantDatas('credit','10');
35
+ // This order relates to the web site which the merchant declared in the Hipay platform.
36
+ // The I.D. assigned to this website is '9'
37
+ $params->setMerchantSiteId(9);
38
+ // If the payment is accepted, the user will be redirected to this page
39
+ $params->setURLOk('http://www.mywebsite.com/success.html ');
40
+ // If the payment is refused, the user will be redirected to this page
41
+ $params->setUrlNok('http://www.mywebsite.com/refused.html ');
42
+ // If the user cancels the payment, he will be redirected to this page
43
+ $params->setUrlCancel('http://www.mywebsite.com/cancel.html ');
44
+ // The email address used to send the notifications, on top of the http notifications.
45
+ // cf chap 19 : RECEIVING A RESULTS NOTIFICATION ABOUT A PAYMENT ACTION
46
+ $params->setEmailAck('djoensson@hi-media.com');
47
+ // The merchant's site will be notified of the result of the payment by a call to the script
48
+ // "listen_hipay_notification.php"
49
+ // cf chap 19 : RECEIVING A RESULTS NOTIFICATION ABOUT A PAYMENT ACTION
50
+ $params->setUrlAck('http://www.mywebsite.com/listen_hipay_notification.php');
51
+ // The background color of the interface will be #FFFFFF (default color recommended)
52
+ $t=$params->setBackgroundColor('#FFFFFF');
53
+ $t=$params->check();
54
+
55
+ if (!$t)
56
+ {
57
+ echo "An error occurred while creating the paymentParams object";
58
+ exit;
59
+ }
60
+
61
+ // ## Taxes ##
62
+ // Tax at 19.6%
63
+ $tax1 = new HIPAY_MAPI_Tax();
64
+ $tax1->setTaxName('TVA (19.6)');
65
+ $tax1->setTaxVal(19.6,true);
66
+ $t=$tax1->check();
67
+ if (!$t)
68
+ {
69
+ echo "An error occurred while creating a tax object";
70
+ exit;
71
+ }
72
+ // Fixed tax of 3.50 euros
73
+ $tax2 = new HIPAY_MAPI_Tax();
74
+ $tax2->setTaxName('Taxe fixe');
75
+ $tax2->setTaxVal(3.5,false);
76
+ $t=$tax2->check();
77
+ if (!$t)
78
+ {
79
+ echo "An error occurred while creating a tax object";
80
+ exit;
81
+ }
82
+ // Tax at 5.5%
83
+ $tax3 = new HIPAY_MAPI_Tax();
84
+ $tax3->setTaxName('TVA (5.5)');
85
+ $tax3->setTaxVal(5.5,true);
86
+ $t=$tax3->check();
87
+ if (!$t)
88
+ {
89
+ echo "An error occurred while creating a tax object";
90
+ exit;
91
+ }
92
+
93
+ // //## Affiliates ##
94
+ // // Affiliate who will receive 10% of all the items in the order
95
+ // $aff1 = new HIPAY_MAPI_Affiliate();
96
+ // $aff1->setCustomerId(331);
97
+ // $aff1->setAccountId(59074);
98
+ // $aff1->setValue(10.0,HIPAY_MAPI_TTARGET_ALL);
99
+ // $t=$aff1->check();
100
+ // if (!$t)
101
+ // {
102
+ // echo "An error occurred while creating an affiliate object";
103
+ // exit;
104
+ // }
105
+ // // Affiliate who will receive 15% of the amount of the products, insurance and delivery amounts
106
+ // $aff2 = new HIPAY_MAPI_Affiliate();
107
+ // $aff2->setCustomerId(332);
108
+ // $aff2->setAccountId(59075);
109
+ // $aff2->setValue(15.0,HIPAY_MAPI_TTARGET_ITEM | HIPAY_MAPI_TTARGET_INSURANCE | HIPAY_MAPI_TTARGET_SHIPPING);
110
+ // $t=$aff2->check();
111
+ // if (!$t)
112
+ // {
113
+ // echo "An error occurred while creating an affiliate object";
114
+ // exit;
115
+ // }
116
+
117
+ // ##Products (order lines) ##
118
+ // First product: 2 copies of a book at 12.5 Euros per unit on which two taxes are applied
119
+ //(taxes $tax3 and $tax2)
120
+ $item1 = new HIPAY_MAPI_Product();
121
+ $item1->setName('The Fall of Hyperion');
122
+ $item1->setInfo('Simmons, Dan – ISBN 0575076380');
123
+ $item1->setquantity(2);
124
+ $item1->setRef('JV005');
125
+ $item1->setCategory(5);
126
+ $item1->setPrice(12.50);
127
+ $item1->setTax(array($tax3,$tax2));
128
+ $t=$item1->check();
129
+ if (!$t)
130
+ {
131
+ echo "An error occurred while creating a product object";
132
+ exit;
133
+ }
134
+ // Second product: An example of a product at 2360 Euros, on which 3 taxes are applied
135
+ //($tax1, $tax2 and $tax3)
136
+ $item2 = new HIPAY_MAPI_Product();
137
+ $item2->setName('PC Linux');
138
+ $item2->setInfo('Computer 445');
139
+ $item2->setquantity(1);
140
+ $item2->setRef('PC445');
141
+ $item2->setCategory(2);
142
+ $item2->setPrice(2360);
143
+ $item2->setTax(array($tax1,$tax2,$tax3));
144
+ $t=$item2->check();
145
+ if (!$t)
146
+ {
147
+ echo "An error occurred while creating a product object";
148
+ exit;
149
+ }
150
+
151
+ // ## Order object ##
152
+ $order = new HIPAY_MAPI_Order();
153
+ // Order title and information
154
+ $order->setOrderTitle('order on mywebsite.com');
155
+ $order->setOrderInfo('best products');
156
+ // The order category is 3 (Books)
157
+ // Refer to annex 7 to see how to find out what category your site belongs to.
158
+ $order->setOrderCategory(3);
159
+ // The shipping costs are 1.50 Euros excluding taxes, and $tax1 is applied
160
+ $order->setShipping(1.50,array($tax1));
161
+ // The insurance costs are 2 Euros excluding taxes, and $tax1 and $tax3 are applied
162
+ $order->setInsurance(2,array($tax3,$tax1));
163
+ // The fixed costs are 2.25 Euros excluding taxes, and $tax3 is applied to this amount
164
+ $order->setFixedCost(2.25,array($tax3));
165
+ // This order has two affiliates, $aff1 and $aff2
166
+ $order->setAffiliate(array($aff1,$aff2));
167
+ $t=$order->check();
168
+ if (!$t)
169
+ {
170
+ echo "An error occurred while creating a product object";
171
+ exit;
172
+ }
173
+
174
+ // ## Payment object ##
175
+ try {
176
+ $payment = new HIPAY_MAPI_SimplePayment($params,$order,array($item1,$item2));
177
+ }
178
+ catch (Exception $e) {
179
+ echo "Error" .$e->getMessage();
180
+ }
181
+
182
+ // ## XML representation of this order and sending the feed to the Hipay platform ##
183
+ $xmlTx=$payment->getXML();
184
+ $output=HIPAY_MAPI_SEND_XML::sendXML($xmlTx);
185
+
186
+ // ## Processing the platform's response ##
187
+ $r=HIPAY_MAPI_COMM_XML::analyzeResponseXML($output, &$url, &$err_msg);
188
+ if ($r===true) {
189
+ // The internet user is sent to the URL indicated by the Hipay platform
190
+ //header('Location: '.$url) ;
191
+ // echo $url;
192
+ return $url;
193
+ } else {
194
+ // Une erreur est intervenue
195
+ echo $err_msg;
196
+ // $url_error = "/error.html";
197
+ //header('Location: '.$url_error) ;
198
+ }
199
+ }
200
+ }
app/code/local/HimediaPayments/Hipay/etc/adminhtml.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <hipay translate="title">
15
+ <title>Hipay</title>
16
+ </hipay>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/local/HimediaPayments/Hipay/etc/config.xml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <modules>
5
+ <HimediaPayments_Hipay>
6
+ <version>1.0.0</version>
7
+ </HimediaPayments_Hipay>
8
+ </modules>
9
+
10
+ <global>
11
+ <models>
12
+ <hipaymod>
13
+ <class>HimediaPayments_Hipay_Model</class>
14
+ </hipaymod>
15
+ </models>
16
+ <blocks>
17
+ <hipaymod>
18
+ <class>HimediaPayments_Hipay_Block</class>
19
+ </hipaymod>
20
+ </blocks>
21
+ <helpers>
22
+ <hipaymod>
23
+ <class>HimediaPayments_Hipay_Helper</class>
24
+ </hipaymod>
25
+ </helpers>
26
+ </global>
27
+
28
+ <adminhtml>
29
+ <layout>
30
+ <updates>
31
+ <hipaymod>
32
+ <file>hipaybase.xml</file>
33
+ </hipaymod>
34
+ </updates>
35
+ </layout>
36
+ <translate>
37
+ <modules>
38
+ <HimediaPayments_Hipay>
39
+ <files>
40
+ <default>HimediaPayments_Hipay.csv</default>
41
+ </files>
42
+ </HimediaPayments_Hipay>
43
+ </modules>
44
+ </translate>
45
+ </adminhtml>
46
+
47
+ <frontend>
48
+ <routers>
49
+ <hipay>
50
+ <use>standard</use>
51
+ <args>
52
+ <module>HimediaPayments_Hipay</module>
53
+ <frontName>hipay</frontName>
54
+ </args>
55
+ </hipay>
56
+ </routers>
57
+ <layout>
58
+ <updates>
59
+ <hipay>
60
+ <file>hipay.xml</file>
61
+ </hipay>
62
+ </updates>
63
+ </layout>
64
+ <translate>
65
+ <modules>
66
+ <HimediaPayments_Hipay>
67
+ <files>
68
+ <default>HimediaPayments_Hipay.csv</default>
69
+ </files>
70
+ </HimediaPayments_Hipay>
71
+ </modules>
72
+ </translate>
73
+ </frontend>
74
+
75
+ <default>
76
+ <payment>
77
+ <hipay>
78
+ <active>1</active>
79
+ <title>Hipay</title>
80
+ <order_status>processing</order_status>
81
+ <allowspecific>0</allowspecific>
82
+ <specificcountry></specificcountry>
83
+ <sort_order></sort_order>
84
+ <model>hipaymod/method_hipay</model>
85
+ </hipay>
86
+ </payment>
87
+ </default>
88
+
89
+ </config>
app/code/local/HimediaPayments/Hipay/etc/system.xml ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <sections>
5
+ <hipay translate="label" module="hipaymod">
6
+ <label>Hipay</label>
7
+ <tab>sales</tab>
8
+ <class>hipay-section</class>
9
+ <header_css>hipay-header</header_css>
10
+ <frontend_type>text</frontend_type>
11
+ <sort_order>345</sort_order>
12
+ <show_in_default>1</show_in_default>
13
+ <show_in_website>1</show_in_website>
14
+ <show_in_store>1</show_in_store>
15
+ <groups>
16
+ <howto translate="label" module="hipaymod">
17
+ <label>How to setup Hipay</label>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ <fields>
23
+ <groupcomment translate="label">
24
+ <frontend_type>note</frontend_type>
25
+ <frontend_model>hipaymod/commentbox</frontend_model>
26
+ <sort_order>10</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </groupcomment>
31
+ </fields>
32
+ </howto>
33
+ <general translate="label" module="hipaymod">
34
+ <label>General Extension Settings</label>
35
+ <sort_order>20</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <fields>
40
+ <groupcomment translate="label">
41
+ <frontend_type>note</frontend_type>
42
+ <frontend_model>hipaymod/commentbox</frontend_model>
43
+ <sort_order>5</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </groupcomment>
48
+ <active translate="label">
49
+ <label>Enabled</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ <sort_order>10</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </active>
57
+ <allowspecific translate="label">
58
+ <label>Payment from applicable countries</label>
59
+ <frontend_type>allowspecific</frontend_type>
60
+ <sort_order>40</sort_order>
61
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ </allowspecific>
66
+ <specificcountry translate="label">
67
+ <label>Payment from specific countries</label>
68
+ <frontend_type>multiselect</frontend_type>
69
+ <sort_order>50</sort_order>
70
+ <source_model>adminhtml/system_config_source_country</source_model>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>1</show_in_website>
73
+ <show_in_store>1</show_in_store>
74
+ <can_be_empty>1</can_be_empty>
75
+ </specificcountry>
76
+ <sort_order translate="label">
77
+ <label>Sort order</label>
78
+ <frontend_type>text</frontend_type>
79
+ <sort_order>60</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </sort_order>
84
+ </fields>
85
+ </general>
86
+ <accountsettings translate="label" module="hipaymod">
87
+ <label>Hipay Account</label>
88
+ <sort_order>30</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ <fields>
93
+ <groupcomment translate="label">
94
+ <frontend_type>note</frontend_type>
95
+ <frontend_model>hipaymod/commentbox</frontend_model>
96
+ <sort_order>5</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>1</show_in_website>
99
+ <show_in_store>1</show_in_store>
100
+ </groupcomment>
101
+ <accountid translate="label comment">
102
+ <label>Hipay Account</label>
103
+ <frontend_type>text</frontend_type>
104
+ <comment><![CDATA[hipay-account-field-comment]]></comment>
105
+ <sort_order>20</sort_order>
106
+ <show_in_default>1</show_in_default>
107
+ <show_in_website>1</show_in_website>
108
+ <show_in_store>1</show_in_store>
109
+ </accountid>
110
+ <merchantpassword translate="label comment">
111
+ <label>Hipay Merchant Password</label>
112
+ <frontend_type>password</frontend_type>
113
+ <comment><![CDATA[hipay-merchant-password-comment]]></comment>
114
+ <sort_order>30</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ </merchantpassword>
119
+ <merchantsiteid translate="label comment">
120
+ <label>Merchant Site Id</label>
121
+ <frontend_type>text</frontend_type>
122
+ <comment><![CDATA[merchant-site-id-comment]]></comment>
123
+ <sort_order>40</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>1</show_in_store>
127
+ </merchantsiteid>
128
+ <ordercategory translate="label comment">
129
+ <label>Order Category</label>
130
+ <frontend_type>select</frontend_type>
131
+ <source_model>hipaymod/category</source_model>
132
+ <comment><![CDATA[ordercategory-comment]]></comment>
133
+ <sort_order>50</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ </ordercategory>
138
+ <!--
139
+ <accountcurrency translate="label comment">
140
+ <label>Account Currency</label>
141
+ <frontend_type>select</frontend_type>
142
+ <source_model>hipaymod/currency</source_model>
143
+ <comment>
144
+ <![CDATA[Select the same currency as in the Hipay account.]]>
145
+ </comment>
146
+ <sort_order>60</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ </accountcurrency>
151
+ -->
152
+ <ageclassification translate="label comment">
153
+ <label>Age Classification</label>
154
+ <frontend_type>select</frontend_type>
155
+ <source_model>hipaymod/age</source_model>
156
+ <comment><![CDATA[ageclassification-comment]]></comment>
157
+ <sort_order>70</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </ageclassification>
162
+ <notificationemail translate="label comment">
163
+ <label>Notification E-Mail Address</label>
164
+ <frontend_type>text</frontend_type>
165
+ <comment><![CDATA[notificationemail-comment]]></comment>
166
+ <sort_order>80</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </notificationemail>
171
+ </fields>
172
+ </accountsettings>
173
+ <extendedaccountsettings translate="label" module="hipaymod">
174
+ <label>Optional Settings</label>
175
+ <sort_order>50</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ <fields>
180
+ <groupcomment translate="label">
181
+ <frontend_type>note</frontend_type>
182
+ <frontend_model>hipaymod/commentbox</frontend_model>
183
+ <sort_order>5</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>1</show_in_store>
187
+ </groupcomment>
188
+ <accountmode translate="label comment">
189
+ <label>Account Mode</label>
190
+ <frontend_type>select</frontend_type>
191
+ <source_model>hipaymod/accountmode</source_model>
192
+ <comment><![CDATA[accountmode-comment]]></comment>
193
+ <sort_order>10</sort_order>
194
+ <show_in_default>1</show_in_default>
195
+ <show_in_website>1</show_in_website>
196
+ <show_in_store>1</show_in_store>
197
+ </accountmode>
198
+ <logourl translate="label comment">
199
+ <label>Merchant Logo URL</label>
200
+ <frontend_type>text</frontend_type>
201
+ <comment><![CDATA[logourl-comment]]></comment>
202
+ <sort_order>20</sort_order>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>1</show_in_store>
206
+ </logourl>
207
+ <itemaccountid translate="label comment">
208
+ <label>Item Account</label>
209
+ <frontend_type>text</frontend_type>
210
+ <comment><![CDATA[itemaccountid-comment]]></comment>
211
+ <sort_order>30</sort_order>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>1</show_in_website>
214
+ <show_in_store>1</show_in_store>
215
+ </itemaccountid>
216
+ <!-- Not yet supported
217
+ <taxaccountid translate="label comment">
218
+ <label>Tax Account</label>
219
+ <frontend_type>text</frontend_type>
220
+ <comment>
221
+ <![CDATA[Account ID of the account into which the tax amount will be deposited.<br />
222
+ <span class="notice">If this field is left empty, the <span
223
+ style="font-style: italic;">Hipay Account</span> is used.</span>]]>
224
+ </comment>
225
+ <sort_order>40</sort_order>
226
+ <show_in_default>1</show_in_default>
227
+ <show_in_website>1</show_in_website>
228
+ <show_in_store>1</show_in_store>
229
+ </taxaccountid>
230
+ <insuranceaccountid translate="label comment">
231
+ <label>Insurance Account</label>
232
+ <frontend_type>text</frontend_type>
233
+ <comment>
234
+ <![CDATA[Account ID of the account into which the insurance amount will be deposited.<br />
235
+ <span class="notice">If this field is left empty, the <span
236
+ style="font-style: italic;">Hipay Account</span> is used.</span>]]>
237
+ </comment>
238
+ <sort_order>50</sort_order>
239
+ <show_in_default>1</show_in_default>
240
+ <show_in_website>1</show_in_website>
241
+ <show_in_store>1</show_in_store>
242
+ </insuranceaccountid>
243
+ <fixcostaccountid translate="label comment">
244
+ <label>Fix Cost Account</label>
245
+ <frontend_type>text</frontend_type>
246
+ <comment>
247
+ <![CDATA[Account ID of the account into which the fix cost amount will be deposited.<br />
248
+ <span class="notice">If this field is left empty, the <span
249
+ style="font-style: italic;">Hipay Account</span> is used.</span>]]>
250
+ </comment>
251
+ <sort_order>60</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ </fixcostaccountid>
256
+ -->
257
+ <shippingaccountid translate="label comment">
258
+ <label>Shipping Account</label>
259
+ <frontend_type>text</frontend_type>
260
+ <comment><![CDATA[shippingaccountid-comment]]></comment>
261
+ <sort_order>70</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>1</show_in_website>
264
+ <show_in_store>1</show_in_store>
265
+ </shippingaccountid>
266
+ </fields>
267
+ </extendedaccountsettings>
268
+ <support translate="label comment">
269
+ <label>Help and Support</label>
270
+ <sort_order>60</sort_order>
271
+ <show_in_default>1</show_in_default>
272
+ <show_in_website>1</show_in_website>
273
+ <show_in_store>1</show_in_store>
274
+ <fields>
275
+ <groupcomment translate="label">
276
+ <frontend_type>note</frontend_type>
277
+ <frontend_model>hipaymod/commentbox</frontend_model>
278
+ <sort_order>10</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>1</show_in_website>
281
+ <show_in_store>1</show_in_store>
282
+ </groupcomment>
283
+ </fields>
284
+ </support>
285
+ </groups>
286
+ </hipay>
287
+ </sections>
288
+ </config>
app/design/adminhtml/default/default/layout/hipaybase.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="head">
6
+ <action method="addItem">
7
+ <type>skin_css</type>
8
+ <name>css/himediapayments/hipay.css</name>
9
+ </action>
10
+ </reference>
11
+ </default>
12
+ </layout>
app/design/adminhtml/default/default/template/himediapayments/array.phtml ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php
29
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
30
+
31
+ $_colspan = 2;
32
+ if (!$this->_addAfter) {
33
+ $_colspan -= 1;
34
+ }
35
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
36
+ ?>
37
+
38
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
39
+ <table cellpadding="0" cellspacing="0" class="border">
40
+ <tbody>
41
+
42
+ <tr class="headings" id="headings<?php echo $_htmlId ?>">
43
+ <?php foreach ($this->_columns as $columnName => $column):?>
44
+ <th><?php echo $column['label'] ?></th>
45
+ <?php endforeach;?>
46
+ <th <?php echo $_colspan?>></th>
47
+ </tr>
48
+
49
+ <tr id="addRow<?php echo $_htmlId ?>">
50
+ <td colspan="<?php echo count($this->_columns) ?>"></td>
51
+ <td <?php echo $_colspan?>>
52
+ <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
53
+ <span><?php echo $this->_addButtonLabel ?></span>
54
+ </button>
55
+ </td>
56
+ </tr>
57
+
58
+ </tbody>
59
+ </table>
60
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
61
+ </div>
62
+ <div id="empty<?php echo $_htmlId ?>">
63
+ <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
64
+ <span><?php echo $this->_addButtonLabel ?></span>
65
+ </button>
66
+ </div>
67
+
68
+ <script type="text/javascript">
69
+ //<![CDATA[
70
+ // create row creator
71
+ var arrayRow<?php echo $_htmlId ?> = {
72
+ // define row prototypeJS template
73
+ template : new Template(
74
+ '<tr id="#{_id}">'
75
+ <?php foreach ($this->_columns as $columnName => $column):?>
76
+ +'<td>'
77
+ +'<?php echo $this->_renderCellTemplate($columnName)?>'
78
+ +'<\/td>'
79
+ <?php endforeach;?>
80
+ <?php if ($this->_addAfter):?>
81
+ +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo Mage::helper('adminhtml')->__('Add after') ?><\/span><\/button><\/td>'
82
+ <?php endif;?>
83
+ +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo Mage::helper('adminhtml')->__('Delete') ?><\/span><\/button><\/td>'
84
+ +'<\/tr>'
85
+ ),
86
+
87
+ rowsCount : 0,
88
+
89
+ add : function(templateData, insertAfterId)
90
+ {
91
+ // generate default template data
92
+ if ('' == templateData) {
93
+ var d = new Date();
94
+ var templateData = {
95
+ <?php foreach ($this->_columns as $columnName => $column):?>
96
+ <?php echo $columnName ?> : '',
97
+ <?php endforeach;?>
98
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
99
+ };
100
+ }
101
+
102
+ // insert before last row
103
+ if ('' == insertAfterId) {
104
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
105
+ }
106
+ // insert after specified row
107
+ else {
108
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
109
+ }
110
+
111
+ <?php if ($this->_addAfter):?>
112
+ Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
113
+ <?php endif;?>
114
+
115
+ this.rowsCount += 1;
116
+ },
117
+
118
+ del : function(rowId)
119
+ {
120
+ $(rowId).remove();
121
+ this.rowsCount -= 1;
122
+ if (0 == this.rowsCount) {
123
+ this.showButtonOnly();
124
+ }
125
+ },
126
+
127
+ showButtonOnly : function()
128
+ {
129
+ $('grid<?php echo $_htmlId ?>').hide();
130
+ $('empty<?php echo $_htmlId ?>').show();
131
+ }
132
+ }
133
+
134
+ // bind add action to "Add" button in last row
135
+ Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
136
+
137
+ // add existing rows
138
+ <?php
139
+ $_addAfterId = "headings{$_htmlId}";
140
+ foreach ($this->getArrayRows() as $_rowId => $_row) {
141
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
142
+ $_addAfterId = $_rowId;
143
+ }
144
+ ?>
145
+
146
+ // initialize standalone button
147
+ $('empty<?php echo $_htmlId ?>').hide();
148
+ Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
149
+ $('grid<?php echo $_htmlId ?>').show();
150
+ $('empty<?php echo $_htmlId ?>').hide();
151
+ arrayRow<?php echo $_htmlId ?>.add('', '');
152
+ });
153
+
154
+ // if no rows, hide grid and show button only
155
+ <?php if (!$this->getArrayRows()):?>
156
+ arrayRow<?php echo $_htmlId ?>.showButtonOnly();
157
+ <?php endif;?>
158
+
159
+ // toggle the grid, if element is disabled (depending on scope)
160
+ <?php if ($this->getElement()->getDisabled()):?>
161
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
162
+ <?php endif;?>
163
+ //]]>
164
+ </script>
app/design/adminhtml/default/default/template/himediapayments/commentbox.phtml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * @see HimediaPayments_Hipay_Block_Commentbox
44
+ */
45
+ ?>
46
+
47
+ <div class="hipay-commentbox">
48
+ <?php
49
+ if(isset($element))
50
+ {
51
+ $html = Mage::helper('hipaymod')->__($element->getId());
52
+ $replace = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . "adminhtml/base/default/css/himediapayments/files";
53
+ $html = str_replace("%HIPAYFILES%", $replace, $html);
54
+
55
+ if($html == $element->getId()) {
56
+ echo "Sorry, your language is in no translation available, please use the default language: English (United States).";
57
+ } else {
58
+ echo $html;
59
+ }
60
+ }
61
+ else
62
+ {
63
+ echo Mage::helper('hipaymod')->__("Error: Can't find element to render!'");
64
+ }
65
+ ?>
66
+ </div>
app/design/adminhtml/default/default/template/himediapayments/system/config/fieldset/commentbox.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see HimediaPayments_Block_System_Config_Fieldset_Commentbox
4
+ */
5
+ ?>
6
+
7
+ <div style="background-color:#D1DEDF; border:2px solid #6F8992; padding:10px; margin-bottom:10px;">
8
+ <?php echo Mage::helper('hipaymod')->__('how-to-setup-hipay-comment')?>
9
+ </div>
app/design/adminhtml/default/default/template/himediapayments/system/config/fieldset/hint.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ /**
43
+ * @see HimediaPayments_Block_System_Config_Fieldset_Hint
44
+ */
45
+ ?>
46
+ <div class="hipay-notice">
47
+ <h4><?php echo Mage::helper('hipaymod')->__('Welcome to Hipay!.')?></h4>
48
+ <p><a href="<?php echo $this->escapeHtml($this->getUrl('adminhtml/system_config/edit', array('section' => 'hipay'))) ?>"><?php echo Mage::helper('hipaymod')->__('View Hipay solutions.')?></a></p>
49
+ </div>
app/design/frontend/base/default/layout/hipay.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+
4
+ <hipay_mapi_payment>
5
+ <reference name="root">
6
+ <action method="setTemplate">
7
+ <template>page/empty.phtml</template>
8
+ </action>
9
+ </reference>
10
+ <reference name="content">
11
+ <block type="core/template" name="hipaypayment.redirect" template="himediapayments/hipay/payment.phtml" />
12
+ </reference>
13
+ </hipay_mapi_payment>
14
+
15
+ </layout>
16
+
app/design/frontend/base/default/template/himediapayments/hipay/form.phtml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <?php
42
+ $_code = $this->getMethodCode();
43
+ ?>
44
+
45
+ <style type="text/css">
46
+
47
+ .hipay_infobox_head {
48
+ background-image: url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/hipay-frame-top.png");
49
+ background-attachment: scroll;
50
+ background-position: top;
51
+ background-repeat: no-repeat;
52
+ background-color: transparent;
53
+ overflow:hidden;
54
+ width:555px;
55
+ padding:0;
56
+ margin:0;
57
+ min-height:255px;
58
+ }
59
+
60
+ .hipay_infobox_bottom {
61
+ background:url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/hipay-frame-bottom.png") bottom no-repeat scroll transparent;
62
+ overflow:hidden;
63
+ width:555px;
64
+ padding:0;
65
+ margin:0;
66
+ }
67
+
68
+ .hipay_infobox_headline {
69
+ color:#D9263E;
70
+ font-family:Helvetica;
71
+ font-size:16px;
72
+ padding-left:102px;
73
+ padding-top:14px;
74
+ }
75
+
76
+ .hipay_process_note {
77
+ margin-bottom:15px;
78
+ }
79
+
80
+ .hipay_infobox_content {
81
+ margin-top:25px;
82
+ padding: 5px 13px;
83
+ }
84
+
85
+ .hipay_infobox_content .homeRed {
86
+ color:#D9263E;
87
+ }
88
+ .hipay_infobox_content .homeRed li {
89
+ list-style:disc inside none;
90
+ display:list-item;
91
+ margin-left:10px;
92
+ margin-top:1px;
93
+ margin-bottom:1px;
94
+ }
95
+ .hipay_infobox_content .li-home-text {
96
+ color:#000000;
97
+ vertical-align:middle;
98
+ }
99
+ .hipay_infobox_content .payment_methods {
100
+ padding-bottom:5px;
101
+ padding-left:5px;
102
+ padding-right:5px;
103
+ padding-top:15px;
104
+ }
105
+ .hipay_infobox_content .payment_methods>img {
106
+ margin-bottom:5px;
107
+ margin-right:20px;
108
+ }
109
+
110
+ .hipay_infobox_content .red_line {
111
+ background:url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/hr_1x1.png") repeat-x scroll transparent;
112
+ width:100%;
113
+ height:2px;
114
+ padding:0;
115
+ margin:0;
116
+ }
117
+ .hipay_infobox_content .provider_infos {
118
+ text-align:center;
119
+ color:#666666;
120
+ font-size:9px;
121
+ padding:0 5px;
122
+ }
123
+ .hipay_infobox_content .provider_infos a {
124
+ color:#666666;
125
+ text-decoration:none;
126
+ }
127
+ .hipay_infobox_content .provider_infos a:hover {
128
+ color:#666666;
129
+ text-decoration:underline;
130
+ }
131
+ .hipay_infobox_content .provider_infos span {
132
+ margin-left:8px;
133
+ }
134
+ </style>
135
+
136
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
137
+ <li>
138
+ <div class="hipay_process_note">
139
+ <?php echo Mage::helper('hipaymod')->__('You will be redirected to our secure payment page when you complete your order.') ?>
140
+ </div>
141
+
142
+ <div class="hipay_infobox_bottom">
143
+ <div class="hipay_infobox_head">
144
+ <div class="hipay_infobox_headline">
145
+ <?php echo Mage::helper('hipaymod')->__('Secure online payment solution') ?>
146
+ </div>
147
+ <div class="hipay_infobox_content">
148
+ <?php echo Mage::helper('hipaymod')->__('This is what you can expect when you pay with hipay:') ?>
149
+
150
+ <ul class="homeRed">
151
+ <li><span class="li-home-text"><?php echo Mage::helper('hipaymod')->__('Secure') ?></span></li>
152
+ <li><span class="li-home-text"><?php echo Mage::helper('hipaymod')->__('Easy to use') ?></span></li>
153
+ <li><span class="li-home-text"><?php echo Mage::helper('hipaymod')->__('No registration required') ?></span></li>
154
+ <li><span class="li-home-text"><?php echo Mage::helper('hipaymod')->__('Local means of payment') ?></span></li>
155
+ <li><span class="li-home-text"><?php echo Mage::helper('hipaymod')->__('Over 15 payment types accepted, including local ones') ?>:</span>
156
+ <div class="payment_methods">
157
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_visa.png">
158
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_mastercard.png">
159
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_sofort-ueberweisung.png">
160
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_sofort-lastschrift.png">
161
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_giropay.png">
162
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_cb.png">
163
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_amex.png">
164
+
165
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_cbc.png">
166
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_cofidis.png">
167
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_aurora.png">
168
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_bcmc.png">
169
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_dexia.png">
170
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_ing.png">
171
+ <img src="<?= $this->getSkinUrl() ?>images/himediapayments/hipay/payment_methods/pm_maestro.png">
172
+ </div>
173
+ </li>
174
+ </ul>
175
+ <div class="red_line"></div>
176
+ <div class="provider_infos">
177
+ <a href="https://www.hipay.com/info/about-us" target="_blank"><?php echo Mage::helper('hipaymod')->__('About us') ?></a> -
178
+ <a href="https://www.hipay.com/info/services-buyer" target="_blank"><?php echo Mage::helper('hipaymod')->__('Buyer Information') ?></a> -
179
+ <a href="https://www.hipay.com/info/contact" target="_blank"><?php echo Mage::helper('hipaymod')->__('Contact') ?></a>
180
+ <span>
181
+ <?php echo Mage::helper('hipaymod')->__('hipay&trade; is a product of HPME a subsidiary of the') ?> <a href="http://www.hi-media.com" target="_blank">Hi-Media Group</a>
182
+ </span>
183
+ </div>
184
+ </div>
185
+
186
+ </div>
187
+ </div>
188
+ </li>
189
+ </ul>
190
+
app/design/frontend/base/default/template/himediapayments/hipay/payment.phtml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hipay
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Copyright (c) 2010, HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE (Groupe Hi-Media, Seed Factory, 19 Avenue des Volontaires, 1160 Bruxelles - Belgium)
8
+ * All rights reserved.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions are met:
12
+ *
13
+ * - Redistributions of source code must retain the above copyright notice,
14
+ * this list of conditions and the following disclaimer.
15
+ * - Redistributions in binary form must reproduce the above copyright notice,
16
+ * this list of conditions and the following disclaimer in the documentation
17
+ * and/or other materials provided with the distribution.
18
+ * - Neither the name of the Hipay and HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
19
+ * nor the names of its contributors may be used to endorse or promote products
20
+ * derived from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ * POSSIBILITY OF SUCH DAMAGE.
33
+ *
34
+ * @category Paymentnetwork
35
+ * @package Paymentnetwork_Hipay
36
+ * @copyright Copyright (c) 2010 HPME - HI-MEDIA PORTE MONNAIE ELECTRONIQUE
37
+ * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
38
+ */
39
+ ?>
40
+
41
+ <style type="text/css">
42
+
43
+ body {
44
+ text-align:center !important;
45
+ }
46
+
47
+ .hipay_centered_content {
48
+ width:620px;
49
+ margin:0px auto;
50
+ text-align:left;
51
+ }
52
+
53
+ .hipay_redirect_infobox_head {
54
+ background-image: url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/hipay_redirect_frame_top.png");
55
+ background-attachment: scroll;
56
+ background-position: top;
57
+ background-repeat: no-repeat;
58
+ background-color: transparent;
59
+ overflow:hidden;
60
+ width:620px;
61
+ padding:0;
62
+ margin-top:150px;
63
+ min-height:150px;
64
+ }
65
+
66
+ .hipay_redirect_infobox_bottom {
67
+ background:url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/hipay_redirect_frame_bottom.png") bottom no-repeat scroll transparent;
68
+ overflow:hidden;
69
+ width:620px;
70
+ padding:0;
71
+ margin:0;
72
+ }
73
+
74
+ .hipay_redirect_infobox_content {
75
+ margin-top:75px;
76
+ text-align: center;
77
+ }
78
+
79
+ .hipay_redirect_infobox_content span {
80
+ color: #666666;
81
+ font-size: 16px;
82
+ font-weight: bold;
83
+ }
84
+
85
+ .show_loader_image {
86
+ background:url("<?= $this->getSkinUrl() ?>images/himediapayments/hipay/loader.gif") no-repeat scroll transparent;
87
+ padding-left: 25px;
88
+ }
89
+
90
+ </style>
91
+
92
+
93
+ <div class="hipay_centered_content">
94
+ <div class="hipay_redirect_infobox_bottom">
95
+ <div class="hipay_redirect_infobox_head">
96
+ <div class="hipay_redirect_infobox_content">
97
+ <span <?php if(!empty($paymentUrl)) { ?>class="show_loader_image"<?php }; ?>>
98
+ <?php echo $message ?>
99
+ </span>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+
105
+ <?php if(!empty($paymentUrl)) { ?>
106
+ <script type="text/javascript">parent.location.href="<?php echo $paymentUrl ?>";</script>
107
+ <?php }; ?>
108
+
109
+
110
+
app/etc/modules/HimediaPayments_Hipay.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HimediaPayments_Hipay>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </HimediaPayments_Hipay>
8
+ </modules>
9
+ </config>
app/locale/de_AT/HimediaPayments_Hipay.csv ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "No order for processing found!","Es wurde keine Bestellung gefunden!"
2
+ "Hipay payment loaded","Hipay-Bezahlvorgang geladen"
3
+ "You will be redirected to Hipay ...","Sie werden zu Hipay weitergeleitet..."
4
+ "The customer was redirected to Hipay","Der Kunde wurde zu Hipay weitergeleitet"
5
+ "Payment has been canceled by customer","Der Kunde hat den Zahlvorgang abgebrochen"
6
+ "Your order has been canceled because you have canceled the payment process.","Ihr Bestellvorgang wurde abgebrochen, da Sie den Bezahlvorgang abgebrochen haben."
7
+ "Hipay payment failed","Hipay-Bezahlvorgang ist fehlgeschlagen"
8
+ "Your order has been canceled because the payment process failed.","Ihr Bestellvorgang wurde abgebrochen, da während des Bezahlvorgangs ein Fehler augetreten ist."
9
+ "Hipay payment notification","Benachrichtigung zum Hipay-Bezahlvorgang"
10
+ "OPERATION","VORGANGSART"
11
+ "STATUS","STATUS"
12
+ "DATE","ZEITPUNKT"
13
+ "TRANSACTION ID","TRANSAKTIONS-ID"
14
+ "PAID AMOUNT","BETRAG"
15
+ "CUSTOMER EMAIL","KUNDEN E-MAIL-ADRESSE"
16
+ "The customer has successfully paid via Hipay","Der Kunde hat erfolgreich mit Hipay bezahlt."
17
+ "Order","Bestellung"
18
+ "at","bei"
19
+ "Shopping cart","Warenkorb"
20
+ "Live","Live"
21
+ "Test","Test"
22
+ "For all ages","Für alle Altersgruppen"
23
+ "For ages 12 and over","12 Jahre und älter"
24
+ "For ages 16 and over","16 Jahre und älter"
25
+ "For ages 18 and over","18 Jahre und älter"
26
+ "Please enter 'Merchant Site Id' first and save config!","Bitte zuvor 'Händler Site Id' eintragen und Konfiguration speichern!"
27
+ "Error! Check your logs, please!","Fehler! Bitte prüfen Sie Ihre Logs!"
28
+ "Australian Dollar","Australischer Dollar"
29
+ "British Pound","Britisches Pfund"
30
+ "Euro","Euro"
31
+ "Canadian Dollar","Kanadischer Dollar"
32
+ "Swedish Crone","Schwedische Krone"
33
+ "US Dollar","US Dollar"
34
+ "How to setup Hipay","Wie man Hipay konfiguriert"
35
+ "hipay_howto_groupcomment","Um diese Erweiterung nutzen zu können, müssen Sie sich ein Händlerkonto auf hipay.com anlegen.<br />Öffnen Sie anschließend den Reiter <span style=""font-style: italic;"">Hipay Händlerkonto</span> und hinterlegen Sie dort die Hipay-Kontodaten. Die Erweiterung ist damit vollständig konfiguriert.<br />Aktivieren Sie nun die Erweiterung auf dem Reiter <span style=""font-style: italic;"">Allgemeine Einstellungen</span>.<br />Fertig!<div style=""margin-top:10px;""><a href=""https://www.hipay.com/registration/register/type/merchant"" target=""_blank"">Händlerkonto anlegen auf hipay.com</a><br /><br /><a href=""%HIPAYFILES%/Hipay-Payment-Extension_german.pdf"" target=""_blank"" class=""hipay-pdf-link"">Anleitung</a> zum Einrichten des Hipay-Kontos und des Zahlungsmoduls</div>"
36
+ "General Extension Settings","Allgemeine Einstellungen"
37
+ "hipay_general_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Diese Zahlungsmethode aktivieren</li><li>Die Länder auswählen, in denen diese Zahlungsmethode verfügbar sein soll.</li>"
38
+ "Enabled","Aktiviert"
39
+ "Payment from applicable countries","Zahlung aus zugelassenen Ländern"
40
+ "Payment from specific countries","Zahlung von bestimmten Ländern"
41
+ "Sort order","Reihenfolge"
42
+ "Hipay Account","Hipay Händlerkonto"
43
+ "hipay_accountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen müssen:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Hinterlegen Sie Ihre Hipay-Kontodaten (Konto-ID, Site-Passwort und Site-ID).</li><li>Festlegen der Bestellkategorie und der Alterseinstufung.</li><li>Festlegen der E-Mail-Adresse für Zahlungsbenachrichtigungen.</li></ul>Weitere Informationen finden Sie auf dem Reiter <span style=""font-style: italic;"">Wie man Hipay konfiguriert</span>."
44
+ "hipay-account-field-comment","ID des Hipay Händlerkontos unter welchem die Site angelegt wurde.<br/><span class=""notice"">Üblicherweise handelt es sich dabei um Ihr Hauptkonto. Tragen Sie hier <span style=""font-weight: bold;"">nicht</span> die ID Ihres <span style=""font-style: italic;"">Benutzerbereichs</span> ein!</span>."
45
+ "Hipay Merchant Password","Hipay Verkäufer-Passwort"
46
+ "hipay-merchant-password-comment","Verkäufer-Passwort der Site (es handelt sich nicht um das Kennwort zur Anmeldung!).<br /><span class=""notice"">Setzen eines neuen Verkäufer-Passworts: Melden Sie sich mit Ihrem Händlerkonto bei Hipay an, klicken Sie auf den Menüpunkt <span style=""font-style: italic;"">Zahlungsbuttons</span>, unter dem Sie eine Liste der von Ihnen definierten Sites finden. Klicken Sie auf das Symbol <span style=""font-style: italic;"">Site-Informationen</span> der entsprechenden Site. Tragen Sie Ihr <span style=""font-style: italic;"">Verkäufer-Passwort</span> ein und klicken Sie auf <span style=""font-style: italic;"">Bestätigung</span>. Vergessen Sie nicht, das neue Passwort auch hier einzutagen.</span>"
47
+ "Merchant Site Id","Site ID"
48
+ "merchant-site-id-comment","ID der Site die unter obigem Händlerkonto angelegt wurde.<br/><span class=""notice"">Um eine Site ID zu erhalten tragen Sie Ihre Onlineshop URL unter Ihrem Hipay Händlerkonto ein. Sie finden die Option dazu unter dem Menüeintrag <span style=""font-style: italic;"">Zahlungsbuttons</span></span>."
49
+ "Order Category","Bestellkategorie"
50
+ "ordercategory-comment","Wählen Sie die Bestellkategorie<br /><span class=""notice"">Eine Liste der verfügbaren Kategorien für Ihre Seite (basierend auf der Auswahl von <span style=""font-style: italic;"">Haupthema</span> und <span style=""font-style: italic;"">Nebenthema</span> die Sie für Ihre Seite festgelegt haben).<br />1. Tragen Sie zunächst die <span style=""font-style: italic;"">Site-ID</span> ein<br /> 2. Klicken Sie auf <span style=""font-style: italic;"">Konfiguration speichern</span><br />3. Die Liste der <span style=""font-style: italic;"">Bestellkategorien</span> wird aktualisiert.<br />4. Wählen Sie eine passende Kategorie aus und klicken Sie erneut auf <span style=""font-style: italic;"">Konfiguration speichern</span>.</span>"
51
+ "Age Classification","Alterseinstufung"
52
+ "ageclassification-comment","Legen Sie das Mindestalter für Käufer fest."
53
+ "Notification E-Mail Address","E-Mail-Adresse für Benachrichtigungen"
54
+ "notificationemail-comment","An diese E-Mail-Adresse sendet Ihnen Hipay Benachrichtungen über alle Zahlungsvorgänge."
55
+ "Optional Settings","Optionale Einstellungen"
56
+ "hipay_extendedaccountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Ändern des Betriebsmodus auf 'Test' um diese Erweiterung im Testmodus zu betreiben.</li><li>Festlegen eines eigenen Logos für den Zahlungsdialog.</li> <li>Festlegen abweichender Hipaykonten um den Gesamtbetrag in Teilbeträge aufzuspalten.<p>Sie können den Gesamtbetrag dabei in die folgenden Teilbeträge aufspalten lassen: Produkte und Versand.<br />Als folge daraus, müssen Sie für jeden Teilbetrag mit wenigen Klicks ein eigenes Unterkonto in Ihrem Hipaykonto erstellen.</p></li>"
57
+ "Account Mode","Betriebsmodus"
58
+ "accountmode-comment","Wenn der Betriebsmodus auf 'Test' gestellt wird verbindet sich das Modul mit dem Hipay-Testsystem, andernfalls wird das produktive System ('Live') verwendet.<br/><span class=""notice"">Beachten Sie bitte, dass für den Betrieb im Testmodus ein gesondertes Hipaykonto auf dem Testsystem eingerichtet werden muss. Auf dem Reiter 'Wie man Hipay konfiguriert' finden Sie weitere Informationen.</span>"
59
+ "Merchant Logo URL","URL des Shop-Logos"
60
+ "logourl-comment","Wenn eine Logo-URL eingetragen wurde, wird das Logo im Bezahldialog angezeigt.<br/><span class=""notice"">Das Logo, im GIF, PNG oder JPG (JPEG) Format muss im Internet über das HTTPS Protokoll erreichbar sein. Das Logo darf die Größe von 100x100 Pixeln nicht überschreiten.</span>"
61
+ "Item Account","Produkt-Konto"
62
+ "itemaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Produkte gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
63
+ "",""
64
+ "",""
65
+ "",""
66
+ "",""
67
+ "",""
68
+ "",""
69
+ "Shipping Account","Versankosten-Konto"
70
+ "shippingaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Versandkosten gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
71
+ "Help and Support","Hilfe und Unterstützung"
72
+ "hipay_support_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Wo Sie Hilfe finden:</span><p>Bei Fragen zu dieser Erweiterung, Verbesserungsvorschlägen oder wenn Sie glauben, dass Sie einen Fehler gefunden haben senden Sie bitte eine E-Mail an <a href=""mailto:shop-extensions@hi-media.com"">shop-extensions@hi-media.com</a>.</p><p>Für alle anderen Fragen, z.B. wenn Sie ein Problem mit einer Zahlungstransaktion haben, benutzen Sie bitte unser <a href=""https://www.hipay.com/info/contact"" target=""_blank"">Kontaktformular</a> auf hipay.com</p>"
73
+ "",""
74
+ "",""
75
+ "",""
76
+ "You will be redirected to our secure payment page when you complete your order.","Sie werden auf unsere sichere Bezahlseite weitergeleitet, wenn Sie Ihre Bestellung abschließen."
77
+ "Secure online payment solution","Sicher Online Bezahlen"
78
+ "This is what you can expect when you pay with hipay:","Dies können Sie erwarten, wenn Sie mit hipay bezahlen:"
79
+ "Easy to use","Einfach zu benutzen"
80
+ "Secure","Sicher"
81
+ "No registration required","Keine Registrierung notwendig"
82
+ "Local means of payment","Lokale Zahlungsmethoden"
83
+ "Over 15 payment types accepted, including local ones","Über 15 akzeptierte Zahlungsmethoden, einschließlich lokaler Zahlungsmethoden"
84
+ "About us","Ãœber uns"
85
+ "Buyer Information","Käuferinformationen"
86
+ "Contact","Kontakt"
87
+ "hipay&trade; is a product of HPME a subsidiary of the","hipay&trade; ist ein Produkt von HPME einer Tochtergesellschaft der"
app/locale/de_CH/HimediaPayments_Hipay.csv ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "No order for processing found!","Es wurde keine Bestellung gefunden!"
2
+ "Hipay payment loaded","Hipay-Bezahlvorgang geladen"
3
+ "You will be redirected to Hipay ...","Sie werden zu Hipay weitergeleitet..."
4
+ "The customer was redirected to Hipay","Der Kunde wurde zu Hipay weitergeleitet"
5
+ "Payment has been canceled by customer","Der Kunde hat den Zahlvorgang abgebrochen"
6
+ "Your order has been canceled because you have canceled the payment process.","Ihr Bestellvorgang wurde abgebrochen, da Sie den Bezahlvorgang abgebrochen haben."
7
+ "Hipay payment failed","Hipay-Bezahlvorgang ist fehlgeschlagen"
8
+ "Your order has been canceled because the payment process failed.","Ihr Bestellvorgang wurde abgebrochen, da während des Bezahlvorgangs ein Fehler augetreten ist."
9
+ "Hipay payment notification","Benachrichtigung zum Hipay-Bezahlvorgang"
10
+ "OPERATION","VORGANGSART"
11
+ "STATUS","STATUS"
12
+ "DATE","ZEITPUNKT"
13
+ "TRANSACTION ID","TRANSAKTIONS-ID"
14
+ "PAID AMOUNT","BETRAG"
15
+ "CUSTOMER EMAIL","KUNDEN E-MAIL-ADRESSE"
16
+ "The customer has successfully paid via Hipay","Der Kunde hat erfolgreich mit Hipay bezahlt."
17
+ "Order","Bestellung"
18
+ "at","bei"
19
+ "Shopping cart","Warenkorb"
20
+ "Live","Live"
21
+ "Test","Test"
22
+ "For all ages","Für alle Altersgruppen"
23
+ "For ages 12 and over","12 Jahre und älter"
24
+ "For ages 16 and over","16 Jahre und älter"
25
+ "For ages 18 and over","18 Jahre und älter"
26
+ "Please enter 'Merchant Site Id' first and save config!","Bitte zuvor 'Händler Site Id' eintragen und Konfiguration speichern!"
27
+ "Error! Check your logs, please!","Fehler! Bitte prüfen Sie Ihre Logs!"
28
+ "Australian Dollar","Australischer Dollar"
29
+ "British Pound","Britisches Pfund"
30
+ "Euro","Euro"
31
+ "Canadian Dollar","Kanadischer Dollar"
32
+ "Swedish Crone","Schwedische Krone"
33
+ "US Dollar","US Dollar"
34
+ "How to setup Hipay","Wie man Hipay konfiguriert"
35
+ "hipay_howto_groupcomment","Um diese Erweiterung nutzen zu können, müssen Sie sich ein Händlerkonto auf hipay.com anlegen.<br />Öffnen Sie anschließend den Reiter <span style=""font-style: italic;"">Hipay Händlerkonto</span> und hinterlegen Sie dort die Hipay-Kontodaten. Die Erweiterung ist damit vollständig konfiguriert.<br />Aktivieren Sie nun die Erweiterung auf dem Reiter <span style=""font-style: italic;"">Allgemeine Einstellungen</span>.<br />Fertig!<div style=""margin-top:10px;""><a href=""https://www.hipay.com/registration/register/type/merchant"" target=""_blank"">Händlerkonto anlegen auf hipay.com</a><br /><br /><a href=""%HIPAYFILES%/Hipay-Payment-Extension_german.pdf"" target=""_blank"" class=""hipay-pdf-link"">Anleitung</a> zum Einrichten des Hipay-Kontos und des Zahlungsmoduls</div>"
36
+ "General Extension Settings","Allgemeine Einstellungen"
37
+ "hipay_general_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Diese Zahlungsmethode aktivieren</li><li>Die Länder auswählen, in denen diese Zahlungsmethode verfügbar sein soll.</li>"
38
+ "Enabled","Aktiviert"
39
+ "Payment from applicable countries","Zahlung aus zugelassenen Ländern"
40
+ "Payment from specific countries","Zahlung von bestimmten Ländern"
41
+ "Sort order","Reihenfolge"
42
+ "Hipay Account","Hipay Händlerkonto"
43
+ "hipay_accountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen müssen:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Hinterlegen Sie Ihre Hipay-Kontodaten (Konto-ID, Site-Passwort und Site-ID).</li><li>Festlegen der Bestellkategorie und der Alterseinstufung.</li><li>Festlegen der E-Mail-Adresse für Zahlungsbenachrichtigungen.</li></ul>Weitere Informationen finden Sie auf dem Reiter <span style=""font-style: italic;"">Wie man Hipay konfiguriert</span>."
44
+ "hipay-account-field-comment","ID des Hipay Händlerkontos unter welchem die Site angelegt wurde.<br/><span class=""notice"">Üblicherweise handelt es sich dabei um Ihr Hauptkonto. Tragen Sie hier <span style=""font-weight: bold;"">nicht</span> die ID Ihres <span style=""font-style: italic;"">Benutzerbereichs</span> ein!</span>."
45
+ "Hipay Merchant Password","Hipay Verkäufer-Passwort"
46
+ "hipay-merchant-password-comment","Verkäufer-Passwort der Site (es handelt sich nicht um das Kennwort zur Anmeldung!).<br /><span class=""notice"">Setzen eines neuen Verkäufer-Passworts: Melden Sie sich mit Ihrem Händlerkonto bei Hipay an, klicken Sie auf den Menüpunkt <span style=""font-style: italic;"">Zahlungsbuttons</span>, unter dem Sie eine Liste der von Ihnen definierten Sites finden. Klicken Sie auf das Symbol <span style=""font-style: italic;"">Site-Informationen</span> der entsprechenden Site. Tragen Sie Ihr <span style=""font-style: italic;"">Verkäufer-Passwort</span> ein und klicken Sie auf <span style=""font-style: italic;"">Bestätigung</span>. Vergessen Sie nicht, das neue Passwort auch hier einzutagen.</span>"
47
+ "Merchant Site Id","Site ID"
48
+ "merchant-site-id-comment","ID der Site die unter obigem Händlerkonto angelegt wurde.<br/><span class=""notice"">Um eine Site ID zu erhalten tragen Sie Ihre Onlineshop URL unter Ihrem Hipay Händlerkonto ein. Sie finden die Option dazu unter dem Menüeintrag <span style=""font-style: italic;"">Zahlungsbuttons</span></span>."
49
+ "Order Category","Bestellkategorie"
50
+ "ordercategory-comment","Wählen Sie die Bestellkategorie<br /><span class=""notice"">Eine Liste der verfügbaren Kategorien für Ihre Seite (basierend auf der Auswahl von <span style=""font-style: italic;"">Haupthema</span> und <span style=""font-style: italic;"">Nebenthema</span> die Sie für Ihre Seite festgelegt haben).<br />1. Tragen Sie zunächst die <span style=""font-style: italic;"">Site-ID</span> ein<br /> 2. Klicken Sie auf <span style=""font-style: italic;"">Konfiguration speichern</span><br />3. Die Liste der <span style=""font-style: italic;"">Bestellkategorien</span> wird aktualisiert.<br />4. Wählen Sie eine passende Kategorie aus und klicken Sie erneut auf <span style=""font-style: italic;"">Konfiguration speichern</span>.</span>"
51
+ "Age Classification","Alterseinstufung"
52
+ "ageclassification-comment","Legen Sie das Mindestalter für Käufer fest."
53
+ "Notification E-Mail Address","E-Mail-Adresse für Benachrichtigungen"
54
+ "notificationemail-comment","An diese E-Mail-Adresse sendet Ihnen Hipay Benachrichtungen über alle Zahlungsvorgänge."
55
+ "Optional Settings","Optionale Einstellungen"
56
+ "hipay_extendedaccountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Ändern des Betriebsmodus auf 'Test' um diese Erweiterung im Testmodus zu betreiben.</li><li>Festlegen eines eigenen Logos für den Zahlungsdialog.</li> <li>Festlegen abweichender Hipaykonten um den Gesamtbetrag in Teilbeträge aufzuspalten.<p>Sie können den Gesamtbetrag dabei in die folgenden Teilbeträge aufspalten lassen: Produkte und Versand.<br />Als folge daraus, müssen Sie für jeden Teilbetrag mit wenigen Klicks ein eigenes Unterkonto in Ihrem Hipaykonto erstellen.</p></li>"
57
+ "Account Mode","Betriebsmodus"
58
+ "accountmode-comment","Wenn der Betriebsmodus auf 'Test' gestellt wird verbindet sich das Modul mit dem Hipay-Testsystem, andernfalls wird das produktive System ('Live') verwendet.<br/><span class=""notice"">Beachten Sie bitte, dass für den Betrieb im Testmodus ein gesondertes Hipaykonto auf dem Testsystem eingerichtet werden muss. Auf dem Reiter 'Wie man Hipay konfiguriert' finden Sie weitere Informationen.</span>"
59
+ "Merchant Logo URL","URL des Shop-Logos"
60
+ "logourl-comment","Wenn eine Logo-URL eingetragen wurde, wird das Logo im Bezahldialog angezeigt.<br/><span class=""notice"">Das Logo, im GIF, PNG oder JPG (JPEG) Format muss im Internet über das HTTPS Protokoll erreichbar sein. Das Logo darf die Größe von 100x100 Pixeln nicht überschreiten.</span>"
61
+ "Item Account","Produkt-Konto"
62
+ "itemaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Produkte gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
63
+ "",""
64
+ "",""
65
+ "",""
66
+ "",""
67
+ "",""
68
+ "",""
69
+ "Shipping Account","Versankosten-Konto"
70
+ "shippingaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Versandkosten gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
71
+ "Help and Support","Hilfe und Unterstützung"
72
+ "hipay_support_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Wo Sie Hilfe finden:</span><p>Bei Fragen zu dieser Erweiterung, Verbesserungsvorschlägen oder wenn Sie glauben, dass Sie einen Fehler gefunden haben senden Sie bitte eine E-Mail an <a href=""mailto:shop-extensions@hi-media.com"">shop-extensions@hi-media.com</a>.</p><p>Für alle anderen Fragen, z.B. wenn Sie ein Problem mit einer Zahlungstransaktion haben, benutzen Sie bitte unser <a href=""https://www.hipay.com/info/contact"" target=""_blank"">Kontaktformular</a> auf hipay.com</p>"
73
+ "",""
74
+ "",""
75
+ "",""
76
+ "You will be redirected to our secure payment page when you complete your order.","Sie werden auf unsere sichere Bezahlseite weitergeleitet, wenn Sie Ihre Bestellung abschließen."
77
+ "Secure online payment solution","Sicher Online Bezahlen"
78
+ "This is what you can expect when you pay with hipay:","Dies können Sie erwarten, wenn Sie mit hipay bezahlen:"
79
+ "Easy to use","Einfach zu benutzen"
80
+ "Secure","Sicher"
81
+ "No registration required","Keine Registrierung notwendig"
82
+ "Local means of payment","Lokale Zahlungsmethoden"
83
+ "Over 15 payment types accepted, including local ones","Über 15 akzeptierte Zahlungsmethoden, einschließlich lokaler Zahlungsmethoden"
84
+ "About us","Ãœber uns"
85
+ "Buyer Information","Käuferinformationen"
86
+ "Contact","Kontakt"
87
+ "hipay&trade; is a product of HPME a subsidiary of the","hipay&trade; ist ein Produkt von HPME einer Tochtergesellschaft der"
app/locale/de_DE/HimediaPayments_Hipay.csv ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "No order for processing found!","Es wurde keine Bestellung gefunden!"
2
+ "Hipay payment loaded","Hipay-Bezahlvorgang geladen"
3
+ "You will be redirected to Hipay ...","Sie werden zu Hipay weitergeleitet..."
4
+ "The customer was redirected to Hipay","Der Kunde wurde zu Hipay weitergeleitet"
5
+ "Payment has been canceled by customer","Der Kunde hat den Zahlvorgang abgebrochen"
6
+ "Your order has been canceled because you have canceled the payment process.","Ihr Bestellvorgang wurde abgebrochen, da Sie den Bezahlvorgang abgebrochen haben."
7
+ "Hipay payment failed","Hipay-Bezahlvorgang ist fehlgeschlagen"
8
+ "Your order has been canceled because the payment process failed.","Ihr Bestellvorgang wurde abgebrochen, da während des Bezahlvorgangs ein Fehler augetreten ist."
9
+ "Hipay payment notification","Benachrichtigung zum Hipay-Bezahlvorgang"
10
+ "OPERATION","VORGANGSART"
11
+ "STATUS","STATUS"
12
+ "DATE","ZEITPUNKT"
13
+ "TRANSACTION ID","TRANSAKTIONS-ID"
14
+ "PAID AMOUNT","BETRAG"
15
+ "CUSTOMER EMAIL","KUNDEN E-MAIL-ADRESSE"
16
+ "The customer has successfully paid via Hipay","Der Kunde hat erfolgreich mit Hipay bezahlt."
17
+ "Order","Bestellung"
18
+ "at","bei"
19
+ "Shopping cart","Warenkorb"
20
+ "Live","Live"
21
+ "Test","Test"
22
+ "For all ages","Für alle Altersgruppen"
23
+ "For ages 12 and over","12 Jahre und älter"
24
+ "For ages 16 and over","16 Jahre und älter"
25
+ "For ages 18 and over","18 Jahre und älter"
26
+ "Please enter 'Merchant Site Id' first and save config!","Bitte zuvor 'Händler Site Id' eintragen und Konfiguration speichern!"
27
+ "Error! Check your logs, please!","Fehler! Bitte prüfen Sie Ihre Logs!"
28
+ "Australian Dollar","Australischer Dollar"
29
+ "British Pound","Britisches Pfund"
30
+ "Euro","Euro"
31
+ "Canadian Dollar","Kanadischer Dollar"
32
+ "Swedish Crone","Schwedische Krone"
33
+ "US Dollar","US Dollar"
34
+ "How to setup Hipay","Wie man Hipay konfiguriert"
35
+ "hipay_howto_groupcomment","Um diese Erweiterung nutzen zu können, müssen Sie sich ein Händlerkonto auf hipay.com anlegen.<br />Öffnen Sie anschließend den Reiter <span style=""font-style: italic;"">Hipay Händlerkonto</span> und hinterlegen Sie dort die Hipay-Kontodaten. Die Erweiterung ist damit vollständig konfiguriert.<br />Aktivieren Sie nun die Erweiterung auf dem Reiter <span style=""font-style: italic;"">Allgemeine Einstellungen</span>.<br />Fertig!<div style=""margin-top:10px;""><a href=""https://www.hipay.com/registration/register/type/merchant"" target=""_blank"">Händlerkonto anlegen auf hipay.com</a><br /><br /><a href=""%HIPAYFILES%/Hipay-Payment-Extension_german.pdf"" target=""_blank"" class=""hipay-pdf-link"">Anleitung</a> zum Einrichten des Hipay-Kontos und des Zahlungsmoduls</div>"
36
+ "General Extension Settings","Allgemeine Einstellungen"
37
+ "hipay_general_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Diese Zahlungsmethode aktivieren</li><li>Die Länder auswählen, in denen diese Zahlungsmethode verfügbar sein soll.</li>"
38
+ "Enabled","Aktiviert"
39
+ "Payment from applicable countries","Zahlung aus zugelassenen Ländern"
40
+ "Payment from specific countries","Zahlung von bestimmten Ländern"
41
+ "Sort order","Reihenfolge"
42
+ "Hipay Account","Hipay Händlerkonto"
43
+ "hipay_accountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen müssen:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Hinterlegen Sie Ihre Hipay-Kontodaten (Konto-ID, Site-Passwort und Site-ID).</li><li>Festlegen der Bestellkategorie und der Alterseinstufung.</li><li>Festlegen der E-Mail-Adresse für Zahlungsbenachrichtigungen.</li></ul>Weitere Informationen finden Sie auf dem Reiter <span style=""font-style: italic;"">Wie man Hipay konfiguriert</span>."
44
+ "hipay-account-field-comment","ID des Hipay Händlerkontos unter welchem die Site angelegt wurde.<br/><span class=""notice"">Üblicherweise handelt es sich dabei um Ihr Hauptkonto. Tragen Sie hier <span style=""font-weight: bold;"">nicht</span> die ID Ihres <span style=""font-style: italic;"">Benutzerbereichs</span> ein!</span>."
45
+ "Hipay Merchant Password","Hipay Verkäufer-Passwort"
46
+ "hipay-merchant-password-comment","Verkäufer-Passwort der Site (es handelt sich nicht um das Kennwort zur Anmeldung!).<br /><span class=""notice"">Setzen eines neuen Verkäufer-Passworts: Melden Sie sich mit Ihrem Händlerkonto bei Hipay an, klicken Sie auf den Menüpunkt <span style=""font-style: italic;"">Zahlungsbuttons</span>, unter dem Sie eine Liste der von Ihnen definierten Sites finden. Klicken Sie auf das Symbol <span style=""font-style: italic;"">Site-Informationen</span> der entsprechenden Site. Tragen Sie Ihr <span style=""font-style: italic;"">Verkäufer-Passwort</span> ein und klicken Sie auf <span style=""font-style: italic;"">Bestätigung</span>. Vergessen Sie nicht, das neue Passwort auch hier einzutagen.</span>"
47
+ "Merchant Site Id","Site ID"
48
+ "merchant-site-id-comment","ID der Site die unter obigem Händlerkonto angelegt wurde.<br/><span class=""notice"">Um eine Site ID zu erhalten tragen Sie Ihre Onlineshop URL unter Ihrem Hipay Händlerkonto ein. Sie finden die Option dazu unter dem Menüeintrag <span style=""font-style: italic;"">Zahlungsbuttons</span></span>."
49
+ "Order Category","Bestellkategorie"
50
+ "ordercategory-comment","Wählen Sie die Bestellkategorie<br /><span class=""notice"">Eine Liste der verfügbaren Kategorien für Ihre Seite (basierend auf der Auswahl von <span style=""font-style: italic;"">Haupthema</span> und <span style=""font-style: italic;"">Nebenthema</span> die Sie für Ihre Seite festgelegt haben).<br />1. Tragen Sie zunächst die <span style=""font-style: italic;"">Site-ID</span> ein<br /> 2. Klicken Sie auf <span style=""font-style: italic;"">Konfiguration speichern</span><br />3. Die Liste der <span style=""font-style: italic;"">Bestellkategorien</span> wird aktualisiert.<br />4. Wählen Sie eine passende Kategorie aus und klicken Sie erneut auf <span style=""font-style: italic;"">Konfiguration speichern</span>.</span>"
51
+ "Age Classification","Alterseinstufung"
52
+ "ageclassification-comment","Legen Sie das Mindestalter für Käufer fest."
53
+ "Notification E-Mail Address","E-Mail-Adresse für Benachrichtigungen"
54
+ "notificationemail-comment","An diese E-Mail-Adresse sendet Ihnen Hipay Benachrichtungen über alle Zahlungsvorgänge."
55
+ "Optional Settings","Optionale Einstellungen"
56
+ "hipay_extendedaccountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Was Sie hier einstellen können:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Ändern des Betriebsmodus auf 'Test' um diese Erweiterung im Testmodus zu betreiben.</li><li>Festlegen eines eigenen Logos für den Zahlungsdialog.</li> <li>Festlegen abweichender Hipaykonten um den Gesamtbetrag in Teilbeträge aufzuspalten.<p>Sie können den Gesamtbetrag dabei in die folgenden Teilbeträge aufspalten lassen: Produkte und Versand.<br />Als folge daraus, müssen Sie für jeden Teilbetrag mit wenigen Klicks ein eigenes Unterkonto in Ihrem Hipaykonto erstellen.</p></li>"
57
+ "Account Mode","Betriebsmodus"
58
+ "accountmode-comment","Wenn der Betriebsmodus auf 'Test' gestellt wird verbindet sich das Modul mit dem Hipay-Testsystem, andernfalls wird das produktive System ('Live') verwendet.<br/><span class=""notice"">Beachten Sie bitte, dass für den Betrieb im Testmodus ein gesondertes Hipaykonto auf dem Testsystem eingerichtet werden muss. Auf dem Reiter 'Wie man Hipay konfiguriert' finden Sie weitere Informationen.</span>"
59
+ "Merchant Logo URL","URL des Shop-Logos"
60
+ "logourl-comment","Wenn eine Logo-URL eingetragen wurde, wird das Logo im Bezahldialog angezeigt.<br/><span class=""notice"">Das Logo, im GIF, PNG oder JPG (JPEG) Format muss im Internet über das HTTPS Protokoll erreichbar sein. Das Logo darf die Größe von 100x100 Pixeln nicht überschreiten.</span>"
61
+ "Item Account","Produkt-Konto"
62
+ "itemaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Produkte gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
63
+ "",""
64
+ "",""
65
+ "",""
66
+ "",""
67
+ "",""
68
+ "",""
69
+ "Shipping Account","Versankosten-Konto"
70
+ "shippingaccountid-comment","Konto-ID des (Unter-)Kontos dem die gezahlten Beträge für die Versandkosten gutgeschrieben werden.<br /><span class=""notice"">Ist dieses Feld leer, wird das <span style=""font-style: italic;"">Hipay Händlerkonto</span> verwendet.</span>"
71
+ "Help and Support","Hilfe und Unterstützung"
72
+ "hipay_support_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Wo Sie Hilfe finden:</span><p>Bei Fragen zu dieser Erweiterung, Verbesserungsvorschlägen oder wenn Sie glauben, dass Sie einen Fehler gefunden haben senden Sie bitte eine E-Mail an <a href=""mailto:shop-extensions@hi-media.com"">shop-extensions@hi-media.com</a>.</p><p>Für alle anderen Fragen, z.B. wenn Sie ein Problem mit einer Zahlungstransaktion haben, benutzen Sie bitte unser <a href=""https://www.hipay.com/info/contact"" target=""_blank"">Kontaktformular</a> auf hipay.com</p>"
73
+ "",""
74
+ "",""
75
+ "",""
76
+ "You will be redirected to our secure payment page when you complete your order.","Sie werden auf unsere sichere Bezahlseite weitergeleitet, wenn Sie Ihre Bestellung abschließen."
77
+ "Secure online payment solution","Sicher Online Bezahlen"
78
+ "This is what you can expect when you pay with hipay:","Dies können Sie erwarten, wenn Sie mit hipay bezahlen:"
79
+ "Easy to use","Einfach zu benutzen"
80
+ "Secure","Sicher"
81
+ "No registration required","Keine Registrierung notwendig"
82
+ "Local means of payment","Lokale Zahlungsmethoden"
83
+ "Over 15 payment types accepted, including local ones","Über 15 akzeptierte Zahlungsmethoden, einschließlich lokaler Zahlungsmethoden"
84
+ "About us","Ãœber uns"
85
+ "Buyer Information","Käuferinformationen"
86
+ "Contact","Kontakt"
87
+ "hipay&trade; is a product of HPME a subsidiary of the","hipay&trade; ist ein Produkt von HPME einer Tochtergesellschaft der"
app/locale/en_US/HimediaPayments_Hipay.csv ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "No order for processing found!","No order for processing found!"
2
+ "Hipay payment loaded","Hipay payment loaded"
3
+ "You will be redirected to Hipay ...","You will be redirected to Hipay ..."
4
+ "The customer was redirected to Hipay","The customer was redirected to Hipay"
5
+ "Payment has been canceled by customer","Payment has been canceled by customer"
6
+ "Your order has been canceled because you have canceled the payment process.","Your order has been canceled because you have canceled the payment process."
7
+ "Hipay payment failed","Hipay payment failed"
8
+ "Your order has been canceled because the payment process failed.","Your order has been canceled because the payment process failed."
9
+ "Hipay payment notification","Hipay payment notification"
10
+ "OPERATION","OPERATION
11
+ "STATUS","STATUS"
12
+ "DATE","DATE"
13
+ "TRANSACTION ID","TRANSACTION ID"
14
+ "PAID AMOUNT","PAID AMOUNT"
15
+ "CUSTOMER EMAIL","CUSTOMER EMAIL"
16
+ "The customer has successfully paid via Hipay","The customer has successfully paid via Hipay"
17
+ "Order","Order"
18
+ "at","at"
19
+ "Shopping cart","Shopping cart"
20
+ "Live","Live"
21
+ "Test","Test"
22
+ "For all ages","For all ages"
23
+ "For ages 12 and over","For ages 12 and over"
24
+ "For ages 16 and over","For ages 16 and over"
25
+ "For ages 18 and over","For ages 18 and over"
26
+ "Please enter 'Merchant Site Id' first and save config!","Please enter 'Merchant Site Id' first and save config!"
27
+ "Error! Check your logs, please!","Error! Check your logs, please!"
28
+ "Australian Dollar","Australian Dollar"
29
+ "British Pound","British Pound"
30
+ "Euro","Euro"
31
+ "Canadian Dollar","Canadian Dollar"
32
+ "Swedish Crone","Swedish Crone"
33
+ "US Dollar","US Dollar"
34
+ "How to setup Hipay","How to setup Hipay"
35
+ "hipay_howto_groupcomment","To use this extension you must create a user area on hipay.com and store certain information about your shop.<br />Afterwards open the tab <span style=""font-style: italic;"">Hipay Account</span> and enter the necessary account data. The extension is now fully configured.<br />Enable the extension and Hipay as a new payment method on the tab <span style=""font-style: italic;"">General Extension Settings</span>.<br />Well done.<div style=""margin-top:10px;""><a href=""https://www.hipay.com/registration/register/type/merchant"" target=""_blank"">Create your user account on hipay.com</a>.</div>"
36
+ "General Extension Settings","General Extension Settings"
37
+ "hipay_general_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">What you can do here:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Enable this payment method</li><li>Select the counties where this payment method should be available</li>"
38
+ "Enabled","Enabled"
39
+ "Payment from applicable countries","Payment from applicable countries"
40
+ "Payment from specific countries","Payment from specific countries"
41
+ "Sort order","Sort order"
42
+ "Hipay Account","Hipay Account"
43
+ "hipay_accountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">What you have to do here:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Set your account data (account id, password and site id).</li><li>Select order category and age classification.</li><li>Set an e-mail address for payment notifications.</li></ul>For more informations please go to the <span style=""font-style: italic;"">How to setup Hipay</span> tab above."
44
+ "hipay-account-field-comment","ID number of the Hipay account on which this store website is declared.<br/><span class=""notice"">Normally this is your main account. Do <span style=""font-weight: bold;"">not</span> use your <span style=""font-style: italic;"">member area id</span> here!</span>."
45
+ "Hipay Merchant Password","Hipay Merchant Password"
46
+ "hipay-merchant-password-comment","Merchant password of the Hipay account on which this store website is declared (it's not the login password!).<br /><span class=""notice"">To set a new merchant password: Log in to your Hipay account, navigate to <span style=""font-style: italic;"">Payment buttons</span> where you can find a list of your registered sites. Click on the <span style=""font-style: italic;"">site informations</span> button of the related site. Enter your <span style=""font-style: italic;""> merchant password</span> and click on confirm. Do not forget to enter your new password here too.</span>"
47
+ "Merchant Site Id","Merchant Site Id"
48
+ "merchant-site-id-comment","Id of the selected site.<br/><span class=""notice"">To get a site id register your store website on the selected Hipay account. You can find this option in your Hipay account under the menu item <span style=""font-style: italic;"">Payment buttons</span></span>."
49
+ "Order Category","Order Category"
50
+ "ordercategory-comment","Select the order category.<br /><span class=""notice"">A list of your categories (based on the selected <span style=""font-style: italic;"">business line</span>and <span style=""font-style: italic;"">category</span> for your site on Hipay).<br />1. Enter your <span style=""font-style: italic;"">Site Id</span><br />2. Click on <span style=""font-style: italic;"">Save Config</span><br />3. The <span style=""font-style: italic;"">Order Category</span> list will be updated.<br />4. Choose a pleasant category and click on <span style=""font-style: italic;"">Save Config</span> again.</span>"
51
+ "Age Classification","Age Classification"
52
+ "ageclassification-comment","Select the minimum age of the buyers."
53
+ "Notification E-Mail Address","Notification E-Mail Address"
54
+ "notificationemail-comment","E-Mail used by Hipay to post operation notification."
55
+ "Optional Settings","Optional Settings"
56
+ "hipay_extendedaccountsettings_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">What you can do here:</span><br /><ul style=""list-style:square outside none; padding-left:15px;""><li>Change the account mode to 'test' and run this extension in test mode.</li><li>Set your own logo for the payment dialog.</li> <li>Set different accounts to split the amounts of your payments. <p>You can automatically split the payment amount into one ore more of the following partial amounts: product and shipping.<br />As a result of this, you have do create different sub accounts for each of the partial amounts under your Hipay account.</p></li>"
57
+ "Account Mode","Account Mode"
58
+ "accountmode-comment","If set to 'Test' the module will use the Hipay test system otherwise it's using the live system.<br/><span class=""notice"">Note, you need separate accounts for each system. See 'How to setup Hipay' for more information.</span>"
59
+ "Merchant Logo URL","Merchant Logo URL"
60
+ "logourl-comment","Sets the merchant’s logo URL, this logo will be displayed on your payment pages.<br/><span class=""notice"">This logo, in GIF, PNG or JPG (JPEG) format must be accessible from the Internet via HTTPS protocol. This logo must not exceed 100x100 pixels in size.</span>"
61
+ "Item Account","Item Account"
62
+ "itemaccountid-comment","Account ID of the account into which the product amount will be deposited.<br /><span class=""notice"">If this field is left empty, the <span style=""font-style: italic;"">Hipay Account</span> is used.</span>"
63
+ "",""
64
+ "",""
65
+ "",""
66
+ "",""
67
+ "",""
68
+ "",""
69
+ "Shipping Account","Shipping Account"
70
+ "shippingaccountid-comment","Account ID of the account into which the shipping amount will be deposited.<br /><span class=""notice"">If this field is left empty, the <span style=""font-style: italic;"">Hipay Account</span> is used.</span>"
71
+ "Help and Support","Help and Support"
72
+ "hipay_support_groupcomment","<span style=""font-weight:bold; padding-bottom:3px; background-color:#D1DEDF;"">Where you can find help:</span><p>If you have questions about our extension, suggestions for improvement or you think you have found a bug, please write an email to <a href=""mailto:shop-extensions@hi-media.com"">shop-extensions@hi-media.com</a>.</p><p>For any other question, e.g. if you have an issue with one of your payment transactions, please use our <a href=""https://www.hipay.com/info/contact"" target=""_blank"">contact form</a> on hipay.com</p>"
73
+ "",""
74
+ "",""
75
+ "",""
76
+ "You will be redirected to our secure payment page when you complete your order.","You will be redirected to our secure payment page when you complete your order."
77
+ "Secure online payment solution","Secure online payment solution"
78
+ "This is what you can expect when you pay with hipay:","This is what you can expect when you pay with hipay:"
79
+ "Easy to use","Easy to use"
80
+ "Secure","Secure"
81
+ "No registration required","No registration required"
82
+ "Local means of payment","Local means of payment"
83
+ "Over 15 payment types accepted, including local ones","Over 15 payment types accepted, including local ones"
84
+ "About us","About us"
85
+ "Buyer Information","Buyer Information"
86
+ "Contact","Contact"
87
+ "hipay&trade; is a product of HPME a subsidiary of the","hipay&trade; is a product of HPME a subsidiary of the"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Hipay</name>
4
+ <version>1.0.0</version>
5
+ <stability>beta</stability>
6
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Payment extension to integreate Hipay as a new payment method.</summary>
10
+ <description>Hipay is a payment solution that is easy to use, fast and secure. It offers over 15 payment methods, including local ones.</description>
11
+ <notes>Release Candidate 1 (testing only, not for productive use)</notes>
12
+ <authors><author><name>Dirk J&#xF6;nsson</name><user>auto-converted</user><email>djoensson@hi-media.com</email></author></authors>
13
+ <date>2010-12-15</date>
14
+ <time>15:40:52</time>
15
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><dir name="himediapayments"><dir name="files"><file name="Hipay-Payment-Extension_german.pdf" hash="21f5eceb7f5f4b9b72d3f5c913ef5526"/></dir><dir name="images"><file name="hipay_section_logo.png" hash="569b8c260d2d8c228f93022be5473428"/><file name="hipay_section_logo_hover.png" hash="f1e67746b8536d8b7131410be96d24b9"/><file name="pdf_16x16.png" hash="3d6afa6a2ed73b461846b8a13cfc730b"/><file name="pdf_22x22.png" hash="98a01edf5744ed484a022f88bdc06e31"/><file name="pdf_32x32.png" hash="c9075f2f6d959aef5fd11df746f488eb"/><file name="tabs_link_over_bg.gif" hash="2cf3f56884096055fb0bdf9474f280c9"/><file name="tabs_span_bg.gif" hash="bcabd4fea0d67b181f21779564c2284b"/></dir><file name="hipay.css" hash="f160f95dcbe5b609acd4dc52b1842db7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><dir name="himediapayments"><dir name="hipay"><dir name="payment_methods"><file name="pm_amex.png" hash="dd93dd57f760189666243cbf355dc1f7"/><file name="pm_aurora.png" hash="ae4c0827d22cfd0ab34fe5d9e9bced9c"/><file name="pm_bcmc.png" hash="a5738fccfa594ebc7da1b3f8d08be530"/><file name="pm_cb.png" hash="5de6d1cde59a01dd6f4e80005983224a"/><file name="pm_cbc.png" hash="beb8ec556ec84f3d22b223d7a622bbb2"/><file name="pm_cofidis.png" hash="e79c4ecc66ba1231a15cd2a852871e83"/><file name="pm_dexia.png" hash="366c2cf937d0521bf04947a709964179"/><file name="pm_giropay.png" hash="4e65f6177095575526e933ae0be0ca2a"/><file name="pm_ing.png" hash="81fb2b557ac6eea34a1ce7b5bba8c3a5"/><file name="pm_maestro.png" hash="356f0137694d6815142a7c4f4a1f2b86"/><file name="pm_mastercard.png" hash="42d083e6823002ede041cdd3102dca93"/><file name="pm_sofort-lastschrift.png" hash="b501b25fc468e4056269ce6df2b46e45"/><file name="pm_sofort-ueberweisung.png" hash="fc1e1a947ac4affa08cae4762814c540"/><file name="pm_visa.png" hash="65620739d2afc84ff7ed6b22a2434c08"/></dir><file name="hipay-frame-bottom.png" hash="5fc92cf1b4304a16809e99d47bcf2c1a"/><file name="hipay-frame-top.png" hash="9d494e2c1d158f204574a0408d802c90"/><file name="hipay_logo.png" hash="569b8c260d2d8c228f93022be5473428"/><file name="hipay_redirect_frame_bottom.png" hash="e5a9019780f83e78ccbf9703d20ea7e8"/><file name="hipay_redirect_frame_top.png" hash="bee3367cafec0cc023c26dde80a0281d"/><file name="hr_1x1.png" hash="aa9c034d5dc827d9459f62efb4a65d83"/><file name="loader.gif" hash="a64410b8c2d8913fbe5c720f76b66f5b"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="hipaybase.xml" hash="53aeac84b9561dfc8551a738893dde4b"/></dir><dir name="template"><dir name="himediapayments"><dir name="system"><dir name="config"><dir name="fieldset"><file name="commentbox.phtml" hash="407635d0eab891370e7707f032157a49"/><file name="hint.phtml" hash="65a384a048513619d9c5d88ba00b00fc"/></dir></dir></dir><file name="array.phtml" hash="c339ad1179e5c6011aa3aac7bb9654bd"/><file name="commentbox.phtml" hash="c84e61c4319630a197fa44042ce5058f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hipay.xml" hash="94e76e0a0581d73cf66fc4e6130eb1dc"/></dir><dir name="template"><dir name="himediapayments"><dir name="hipay"><file name="form.phtml" hash="2f46668d77cf945ff9d25caad8a82699"/><file name="payment.phtml" hash="d7290cdb5719e6fbd2b1b2c2a51c52ad"/></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="HimediaPayments"><dir name="Hipay"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Commentbox.php" hash="0af5e6dbb3602b0a9cf9f151acc49f7e"/><file name="Hint.php" hash="786033fb0447fdee39123709d510faa1"/></dir></dir></dir></dir><file name="Adminarray.php" hash="189f6550d025fc6e044839e83f7c98c9"/><file name="Commentbox.php" hash="9452dc585c0e1e89a53699bb678242e0"/><file name="Form.php" hash="d1a733cc6bcf35ab156002c32aa7ee49"/></dir><dir name="controllers"><file name="MapiController.php" hash="4e367013f1ef504f074c89e303d8b2b0"/><file name="MapiHelper.php" hash="b66ae8d5495defc2b70a404b331b9c2c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="00df6932b58615daa65a0f2704b33246"/><file name="config.xml" hash="3420b42fcd38834c357f343c99a695ef"/><file name="system.xml" hash="84ffc4b1d023d24e3d1a4ab5296efc15"/></dir><dir name="Helper"><file name="Data.php" hash="4f8baba90a1d5cdca868b9103a8723d3"/></dir><dir name="Mapi"><file name="mapi_affiliate.php" hash="2ea2252dba9ffc014fd14595480e33ec"/><file name="mapi_comm_xml.php" hash="4110c547b5cefa2cebe4b620bc87af69"/><file name="mapi_defs.php" hash="fa76fa08b320e481e27689ccbad1d827"/><file name="mapi_defs_ext.php" hash="1694d0de9ae404cf4a2e7d51b4a84f3b"/><file name="mapi_exception.php" hash="155d58b4feeb8ceb7b602d73e5deb285"/><file name="mapi_installment.php" hash="9dbb298edcbeed7c589c731f6c58d45e"/><file name="mapi_item.php" hash="3f464cd23c6104346e08df7cceba3c2d"/><file name="mapi_lockable.php" hash="1614113ba7461861e239f30d44e2f0ff"/><file name="mapi_multiplepayment.php" hash="18341edbef63a6e2773f20c1c00dd1e1"/><file name="mapi_order.php" hash="fb4db16de952401cc212029c17cf03f6"/><file name="mapi_package.php" hash="f17dba24320d859d0914c15e6237c116"/><file name="mapi_payment.php" hash="98f15bdcde2c919df32b48d5bab7e76c"/><file name="mapi_paymentparams.php" hash="2f884b31917e81adec043b6a43bf72f1"/><file name="mapi_product.php" hash="d1f004a687a334672686491918e524d0"/><file name="mapi_send_xml.php" hash="c8ad62f7c95483e0f0faa5cc5071183c"/><file name="mapi_simplepayment.php" hash="94329f6f6d53e82a2b043927f2aee725"/><file name="mapi_tax.php" hash="a8fe907a7724d8c7117c9f91d409f884"/><file name="mapi_utf8.php" hash="2bb239d2a24f735c5183fd44e0c034c6"/><file name="mapi_utils.php" hash="61d2f5f598ed27112a6154d1c5e8a405"/><file name="mapi_xml.php" hash="46231a9588091efb9cdc8981a1927a3e"/></dir><dir name="Model"><dir name="Method"><file name="Dummy.php" hash="79475fff99859df971abc4d752ec1d9b"/><file name="Hipay.php" hash="bc61d260ae7534a4fa4d573d63280528"/></dir><file name="Accountmode.php" hash="4dea3b1b21d92106e57bdd561aa1200e"/><file name="Age.php" hash="6cb82f9096cd40049d747d8396d444e9"/><file name="Category.php" hash="32611259699f162df6b4d183f04bad66"/><file name="Currencies.php" hash="ef8f334ae60917db43b98ee3275c8c11"/><file name="Currency.php" hash="9d680d67ee4e164decd1cb12282b01f0"/><file name="Rating.php" hash="a58118d4d37b87f9f3baa0dfe7276548"/></dir></dir></dir></target><target name="magelocale"><dir name="de_AT"><file name="HimediaPayments_Hipay.csv" hash="0d901b5fca2579842054fe388ad73d71"/></dir><dir name="de_CH"><file name="HimediaPayments_Hipay.csv" hash="0d901b5fca2579842054fe388ad73d71"/></dir><dir name="de_DE"><file name="HimediaPayments_Hipay.csv" hash="0d901b5fca2579842054fe388ad73d71"/></dir><dir name="en_US"><file name="HimediaPayments_Hipay.csv" hash="5338c5dfcf789c5a7a8886173a1cea03"/></dir></target><target name="mageetc"><dir name="modules"><file name="HimediaPayments_Hipay.xml" hash="541f88b523115eb4a75fe845bb45af63"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/adminhtml/base/default/css/himediapayments/files/Hipay-Payment-Extension_german.pdf ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/hipay.css ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @CHARSET "UTF-8";
2
+
3
+ /* ## SECTION ********************************************* ## */
4
+
5
+ ul.tabs a.hipay-section {
6
+ background:url("images/tabs_span_bg.gif") repeat-x scroll 0 100% transparent;
7
+ border-bottom:medium none;
8
+ padding:0.5em 0.5em 0.28em 1.5em;
9
+ }
10
+ ul.tabs a.hipay-section:hover {
11
+ background-color:#D8E6E6 !important;
12
+ /*background-image:url("images/tabs_link_over_bg.gif") !important;*/
13
+ padding:0.5em 0.5em 0.28em 1.5em;
14
+ }
15
+ ul.tabs a.hipay-section.active {
16
+ background:none repeat scroll 0 0 #FFFFFF !important;
17
+ /*background-color:#FFFFFF;*/
18
+ border-bottom:1px solid #BEBEBE;
19
+ }
20
+
21
+ ul.tabs a.hipay-section span {
22
+ background:url("images/hipay_section_logo.png") no-repeat scroll 0 0 transparent;
23
+ height:0;
24
+ overflow:hidden;
25
+ padding:14px 0 0;
26
+ width:49px;
27
+ }
28
+ ul.tabs a.hipay-section:hover span {
29
+ background:url("images/hipay_section_logo_hover.png") no-repeat scroll 0 0 transparent;
30
+ }
31
+ ul.tabs a.hipay-section.active span,
32
+ ul.tabs a.hipay-section.active:hover span {
33
+ background:url("images/hipay_section_logo_hover.png") no-repeat scroll 0 0 transparent;
34
+ padding:0.5em 0.5em 0.28em 1.5em;
35
+ background-color:#FFFFFF;
36
+ font-weight:bold;
37
+
38
+ height:0;
39
+ overflow:hidden;
40
+ padding:14px 0 0;
41
+ width:49px;
42
+ }
43
+
44
+ /* ## SECTION NOTICE ************************************** ## */
45
+
46
+ .hipay-notice {
47
+ background:url(images/hipay_section_logo.gif) no-repeat 5px center #eaf0ee;
48
+ border:1px solid #ccc;
49
+ margin-bottom:10px;
50
+ padding:10px 5px 5px 115px;
51
+ zoom: 1; /* for IE */
52
+ }
53
+ .hipay-notice h4,
54
+ .hipay-notice p {
55
+ margin:0;
56
+ }
57
+ .hipay-notice h2 {
58
+ color:#444;
59
+ font-size:1.4em;
60
+ line-height:1em;
61
+ }
62
+ .hipay-notice a {
63
+ text-decoration:none;
64
+ }
65
+
66
+ /* ## SECTION CONTENT ************************************* ## */
67
+
68
+ h3.hipay-header {
69
+ background:url(images/hipay_section_logo.png) no-repeat 0 0;
70
+ height:0;
71
+ overflow:hidden;
72
+ padding:14px 0 0;
73
+ width:49px;
74
+ }
75
+
76
+ a.hipay-pdf-link {
77
+ background:url(images/pdf_16x16.png) no-repeat left;
78
+ padding-left: 18px;
79
+ }
80
+
81
+ div.hipay-commentbox {
82
+ background-color:#D1DEDF;
83
+ border:2px solid #6F8992;
84
+ padding:10px;
85
+ margin-bottom:10px;
86
+ }
skin/adminhtml/base/default/css/himediapayments/images/hipay_section_logo.png ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/hipay_section_logo_hover.png ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/pdf_16x16.png ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/pdf_22x22.png ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/pdf_32x32.png ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/tabs_link_over_bg.gif ADDED
Binary file
skin/adminhtml/base/default/css/himediapayments/images/tabs_span_bg.gif ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hipay-frame-bottom.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hipay-frame-top.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hipay_logo.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hipay_redirect_frame_bottom.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hipay_redirect_frame_top.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/hr_1x1.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/loader.gif ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_amex.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_aurora.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_bcmc.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cb.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cbc.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_cofidis.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_dexia.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_giropay.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_ing.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_maestro.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_mastercard.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_sofort-lastschrift.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_sofort-ueberweisung.png ADDED
Binary file
skin/frontend/default/default/images/himediapayments/hipay/payment_methods/pm_visa.png ADDED
Binary file