Allopass_Hipay - Version 1.2.2

Version Notes

Add paypal API

Download this release

Release Info

Developer Kassim_Profileo
Extension Allopass_Hipay
Version 1.2.2
Comparing to
See all releases


Code changes from version 1.0.6 to 1.2.2

Files changed (105) hide show
  1. app/code/community/Allopass/Hipay/Block/Adminhtml/Card/Edit.php +59 -0
  2. app/code/community/Allopass/Hipay/Block/Adminhtml/Card/Edit/Form.php +95 -0
  3. app/code/community/Allopass/Hipay/Block/Adminhtml/Customer/Edit/Tab/Card.php +155 -0
  4. app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile.php +14 -0
  5. app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Edit.php +35 -0
  6. app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Edit/Form.php +75 -0
  7. app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Grid.php +83 -0
  8. app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment.php +14 -0
  9. app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Edit.php +55 -0
  10. app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Edit/Form.php +96 -0
  11. app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Grid.php +103 -0
  12. app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/3dsRule.php +5 -0
  13. app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Allowsplitpayment.php +42 -0
  14. app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/MultiselectSortable.php +46 -0
  15. app/code/community/Allopass/Hipay/Block/Card.php +59 -0
  16. app/code/community/Allopass/Hipay/Block/Card/Edit.php +44 -0
  17. app/code/community/Allopass/Hipay/Block/Form/Abstract.php +94 -3
  18. app/code/community/Allopass/Hipay/Block/Form/Cc.php +14 -0
  19. app/code/community/Allopass/Hipay/Block/Info/Cc.php +14 -0
  20. app/code/community/Allopass/Hipay/Block/Info/Hosted.php +50 -1
  21. app/code/community/Allopass/Hipay/Controller/Payment.php +79 -49
  22. app/code/community/Allopass/Hipay/Helper/Data.php +368 -11
  23. app/code/community/Allopass/Hipay/Model/Api/Request.php +1 -0
  24. app/code/community/Allopass/Hipay/Model/Card.php +20 -0
  25. app/code/community/Allopass/Hipay/Model/Config.php +8 -1
  26. app/code/community/Allopass/Hipay/Model/Method/Abstract.php +409 -83
  27. app/code/community/Allopass/Hipay/Model/Method/Cc.php +22 -5
  28. app/code/community/Allopass/Hipay/Model/Method/Dexia.php +3 -0
  29. app/code/community/Allopass/Hipay/Model/Method/Giropay.php +4 -1
  30. app/code/community/Allopass/Hipay/Model/Method/Hosted.php +11 -4
  31. app/code/community/Allopass/Hipay/Model/Method/Ideal.php +2 -0
  32. app/code/community/Allopass/Hipay/Model/Method/Ing.php +4 -1
  33. app/code/community/Allopass/Hipay/Model/Method/Kbc.php +2 -0
  34. app/code/community/Allopass/Hipay/Model/Method/PaypalApi.php +87 -0
  35. app/code/community/Allopass/Hipay/Model/Method/Przelewy24Api.php +10 -5
  36. app/code/community/Allopass/Hipay/Model/Method/Qiwi.php +3 -0
  37. app/code/community/Allopass/Hipay/Model/Method/Sisal.php +3 -0
  38. app/code/community/Allopass/Hipay/Model/Method/SisalApi.php +12 -5
  39. app/code/community/Allopass/Hipay/Model/Method/SofortApi.php +9 -5
  40. app/code/community/Allopass/Hipay/Model/Method/Webmoney.php +3 -0
  41. app/code/community/Allopass/Hipay/Model/Method/WebmoneyApi.php +12 -5
  42. app/code/community/Allopass/Hipay/Model/Method/Yandex.php +3 -0
  43. app/code/community/Allopass/Hipay/Model/Method/YandexApi.php +12 -5
  44. app/code/community/Allopass/Hipay/Model/Observer.php +133 -0
  45. app/code/community/Allopass/Hipay/Model/PaymentProfile.php +155 -0
  46. app/code/community/Allopass/Hipay/Model/Resource/Card.php +12 -0
  47. app/code/community/Allopass/Hipay/Model/Resource/Card/Collection.php +19 -0
  48. app/code/community/Allopass/Hipay/Model/Resource/PaymentProfile.php +12 -0
  49. app/code/community/Allopass/Hipay/Model/Resource/PaymentProfile/Collection.php +37 -0
  50. app/code/community/Allopass/Hipay/Model/Resource/SplitPayment.php +12 -0
  51. app/code/community/Allopass/Hipay/Model/Resource/SplitPayment/Collection.php +19 -0
  52. app/code/community/Allopass/Hipay/Model/Rule.php +7 -2
  53. app/code/community/Allopass/Hipay/Model/Rule/Condition/Address.php +6 -2
  54. app/code/community/Allopass/Hipay/Model/Rule/Condition/Customer.php +25 -11
  55. app/code/community/Allopass/Hipay/Model/Rule/Config.php +22 -3
  56. app/code/community/Allopass/Hipay/Model/Source/3ds.php +6 -2
  57. app/code/community/Allopass/Hipay/Model/Source/CcType.php +23 -1
  58. app/code/community/Allopass/Hipay/Model/Source/CcTypeHosted.php +21 -1
  59. app/code/community/Allopass/Hipay/Model/Source/PaymentProfile.php +48 -0
  60. app/code/community/Allopass/Hipay/Model/Source/Template.php +1 -12
  61. app/code/community/Allopass/Hipay/Model/SplitPayment.php +91 -0
  62. app/code/community/Allopass/Hipay/Model/System/Config/Backend/CcTypes.php +12 -0
  63. app/code/community/Allopass/Hipay/controllers/Adminhtml/CardController.php +150 -0
  64. app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentController.php +297 -0
  65. app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentProfileController.php +153 -0
  66. app/code/community/Allopass/Hipay/controllers/Adminhtml/RuleController.php +1 -0
  67. app/code/community/Allopass/Hipay/controllers/Adminhtml/SplitPaymentController.php +163 -0
  68. app/code/community/Allopass/Hipay/controllers/CardController.php +175 -0
  69. app/code/community/Allopass/Hipay/controllers/NotifyController.php +15 -6
  70. app/code/community/Allopass/Hipay/controllers/PaypalapiController.php +8 -0
  71. app/code/community/Allopass/Hipay/controllers/Sales/Order/CreateController.php +79 -0
  72. app/code/community/Allopass/Hipay/etc/config.xml +222 -72
  73. app/code/community/Allopass/Hipay/etc/system.xml +778 -221
  74. app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-install-0.1.0.php +14 -14
  75. app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.6-1.0.7.php +43 -0
  76. app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.7-1.0.8.php +18 -0
  77. app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.8-1.0.9.php +32 -0
  78. app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.9-1.1.0.php +69 -0
  79. app/design/adminhtml/default/default/layout/hipay.xml +38 -1
  80. app/design/{frontend → adminhtml}/default/default/template/hipay/form/cc.phtml +43 -19
  81. app/design/adminhtml/default/default/template/hipay/form/hosted.phtml +41 -0
  82. app/design/adminhtml/default/default/template/hipay/info/cc.phtml +19 -0
  83. app/design/adminhtml/default/default/template/hipay/info/hosted.phtml +19 -0
  84. app/design/frontend/base/default/layout/hipay.xml +41 -0
  85. app/design/frontend/base/default/template/hipay/card/account.phtml +56 -0
  86. app/design/frontend/base/default/template/hipay/card/form/edit.phtml +33 -0
  87. app/design/frontend/{default → base}/default/template/hipay/checkout/pending.phtml +0 -0
  88. app/design/frontend/base/default/template/hipay/form/cc.phtml +245 -0
  89. app/design/frontend/{default → base}/default/template/hipay/form/hosted.phtml +40 -12
  90. app/design/frontend/base/default/template/hipay/info/cc.phtml +19 -0
  91. app/design/frontend/base/default/template/hipay/info/hosted.phtml +19 -0
  92. app/design/frontend/default/default/layout/hipay.xml +0 -12
  93. app/locale/en_US/Allopass_Hipay.csv +35 -3
  94. app/locale/en_US/template/email/hipay_fraud_payment.html +64 -0
  95. app/locale/en_US/template/email/hipay_fraud_payment_accept.html +64 -0
  96. app/locale/en_US/template/email/hipay_fraud_payment_deny.html +64 -0
  97. app/locale/fr_FR/Allopass_Hipay.csv +38 -2
  98. app/locale/fr_FR/template/email/hipay_fraud_payment.html +66 -0
  99. app/locale/fr_FR/template/email/hipay_fraud_payment_accept.html +64 -0
  100. app/locale/fr_FR/template/email/hipay_fraud_payment_deny.html +64 -0
  101. app/locale/it_IT/Allopass_Hipay.csv +33 -0
  102. app/locale/it_IT/template/email/hipay_fraud_payment.html +64 -0
  103. app/locale/it_IT/template/email/hipay_fraud_payment_accept.html +64 -0
  104. app/locale/it_IT/template/email/hipay_fraud_payment_deny.html +64 -0
  105. package.xml +6 -6
app/code/community/Allopass/Hipay/Block/Adminhtml/Card/Edit.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_Card_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ /**
5
+ * Initialize cms page edit block
6
+ *
7
+ * @return void
8
+ */
9
+ public function __construct()
10
+ {
11
+
12
+ $this->_objectId = 'card_id';
13
+ $this->_blockGroup = 'hipay';
14
+ $this->_controller = 'adminhtml_card';
15
+ $this->_headerText = $this->__('Card Hipay');
16
+ parent::__construct();
17
+
18
+ $this->removeButton('delete');
19
+
20
+
21
+ $this->_addButton('saveandcontinue', array(
22
+ 'label' => Mage::helper('adminhtml')->__('Save and Continue Edit'),
23
+ 'onclick' => 'saveAndContinueEdit(\''.$this->getUrl('*/*/save', array('_current'=>true,'back'=>'edit')).'\')',
24
+ 'class' => 'save',
25
+ ), -100);
26
+
27
+
28
+ $this->_formScripts[] = "
29
+ function saveAndContinueEdit(){
30
+ editForm.submit($('edit_form').action+'back/edit/');
31
+ }
32
+
33
+ function run(url){
34
+ editForm.submit(url);
35
+ }
36
+ ";
37
+ }
38
+
39
+ /**
40
+ * Get URL for back (reset) button
41
+ *
42
+ * @return string
43
+ */
44
+ public function getBackUrl()
45
+ {
46
+ return $this->getUrl('adminhtml/customer/edit',array('id'=>$this->getCard()->getCustomerId()));
47
+ }
48
+
49
+ /**
50
+ * Retrieve card model object
51
+ *
52
+ * @return Allopass_Hipay_Model_Card
53
+ */
54
+ public function getCard()
55
+ {
56
+ return Mage::registry('current_card');
57
+ }
58
+
59
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/Card/Edit/Form.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Adminhtml_Card_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareForm()
7
+ {
8
+
9
+ /* @var $card Allopass_Hipay_Model_Card */
10
+ $card = Mage::registry('current_card');
11
+
12
+
13
+ $form = new Varien_Data_Form(array('id'=>'edit_form','action' => $this->getUrl('*/card/save'), 'method' => 'post'));
14
+
15
+ $fieldset = $form->addFieldset('card_form', array('legend'=>Mage::helper('hipay')->__('Card Hipay')));
16
+
17
+ if ($card->getCardId()) {
18
+ $fieldset->addField('card_id', 'hidden', array(
19
+ 'name' => 'card_id',
20
+ ));
21
+ $fieldset->addField('customer_id', 'hidden', array(
22
+ 'name' => 'customer_id',
23
+ ));
24
+ }
25
+ $fieldset->addField('name', 'text', array(
26
+ 'label' => Mage::helper('hipay')->__('Card #'),
27
+ 'title' => Mage::helper('hipay')->__('Card #'),
28
+ 'class' => 'required-entry',
29
+ 'required' => true,
30
+ 'name' => 'name',
31
+ ));
32
+
33
+ $fieldset->addField('is_default', 'select', array(
34
+ 'label' => Mage::helper('hipay')->__('Is default'),
35
+ 'title' => Mage::helper('hipay')->__('Is default'),
36
+ 'name' => 'is_default',
37
+ 'values' => array(Mage::helper('sales')->__('No'),Mage::helper('adminhtml')->__('Yes'))
38
+ ));
39
+
40
+ $statues = array(Allopass_Hipay_Model_Card::STATUS_ENABLED =>$this->__('Enabled') ,Allopass_Hipay_Model_Card::STATUS_DISABLED=>$this->__('Disabled'));
41
+ $fieldset->addField('cc_status', 'select', array(
42
+ 'label' => Mage::helper('hipay')->__('Status'),
43
+ 'title' => Mage::helper('hipay')->__('Status'),
44
+ 'name' => 'cc_status',
45
+ 'values' => $statues
46
+ ));
47
+
48
+
49
+ $fieldset_info = $form->addFieldset('card_info', array('legend'=>Mage::helper('hipay')->__('Informations'))) ;
50
+
51
+ $fieldset_info->addField('cc_type', 'text', array(
52
+ 'label' => Mage::helper('payment')->__('Card type'),
53
+ 'title' => Mage::helper('payment')->__('Card type'),
54
+ 'name' => 'cc_type',
55
+ 'readonly' => true,
56
+ ));
57
+
58
+ $fieldset_info->addField('cc_number_enc', 'text', array(
59
+ 'label' => Mage::helper('payment')->__('Card number'),
60
+ 'title' => Mage::helper('payment')->__('Card number'),
61
+ 'name' => 'cc_number_enc',
62
+ 'readonly' => true,
63
+ ));
64
+
65
+ $fieldset_info->addField('cc_exp_month', 'text', array(
66
+ 'label' => Mage::helper('payment')->__('Card Exp. month'),
67
+ 'title' => Mage::helper('payment')->__('Card Exp. month'),
68
+ 'name' => 'cc_exp_month',
69
+ 'readonly' => true,
70
+ ));
71
+
72
+ $fieldset_info->addField('cc_exp_year', 'text', array(
73
+ 'label' => Mage::helper('payment')->__('Card Exp. year'),
74
+ 'title' => Mage::helper('payment')->__('Card Exp. year'),
75
+ 'name' => 'cc_exp_year',
76
+ 'readonly' => true,
77
+ ));
78
+
79
+
80
+ $fieldset_info->addField('cc_token', 'text', array(
81
+ 'label' => Mage::helper('hipay')->__('Card Token'),
82
+ 'title' => Mage::helper('hipay')->__('Card Token'),
83
+ 'readonly' => true,
84
+ 'name' => 'cc_token',
85
+ ));
86
+
87
+
88
+
89
+ $form->setUseContainer(true);
90
+ $form->setValues($card->getData());
91
+ $this->setForm($form);
92
+ return parent::_prepareForm();
93
+ }
94
+
95
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/Customer/Edit/Tab/Card.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Adminhtml_Customer_Edit_Tab_Card extends
4
+ Mage_Adminhtml_Block_Widget_Grid implements
5
+ Mage_Adminhtml_Block_Widget_Tab_Interface {
6
+
7
+ /**
8
+ * Initialize Grid
9
+ *
10
+ */
11
+ public function __construct() {
12
+ parent::__construct();
13
+ $this->setId('hipay_card_grid');
14
+ $this->setDefaultSort('card_id', 'desc');
15
+ $this->setUseAjax(true);
16
+ }
17
+
18
+ /**
19
+ * Retrieve current customer object
20
+ *
21
+ * @return Mage_Customer_Model_Customer
22
+ */
23
+ protected function _getCustomer() {
24
+ return Mage::registry('current_customer');
25
+ }
26
+
27
+ /**
28
+ * Create customer cards collection
29
+ *
30
+ * @return Allopass_Hipay_Model_Resource_Card_Collection
31
+ */
32
+ protected function _createCollection() {
33
+ return Mage::getModel('hipay/card')->getCollection();
34
+ }
35
+
36
+ /**
37
+ * Prepare customer card collection
38
+ *
39
+ * @return Allopass_Hipay_Block_Adminhtml_Customer_Edit_Tab_Card
40
+ */
41
+ protected function _prepareCollection() {
42
+ $collection = $this->_createCollection()
43
+ ->addFieldToFilter('customer_id',
44
+ $this->_getCustomer()->getId());
45
+ $this->setCollection($collection);
46
+
47
+ return parent::_prepareCollection();
48
+ }
49
+
50
+ /**
51
+ * Prepare Grid columns
52
+ *
53
+ * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist
54
+ */
55
+ protected function _prepareColumns() {
56
+ $this
57
+ ->addColumn('name',
58
+ array(
59
+ 'header' => Mage::helper('hipay')
60
+ ->__('Card Name'),
61
+ 'index' => 'name',));
62
+
63
+ $this
64
+ ->addColumn('cc_type',
65
+ array(
66
+ 'header' => Mage::helper('hipay')->__('Type'),
67
+ 'index' => 'cc_type',));
68
+
69
+ $this
70
+ ->addColumn('cc_exp_month',
71
+ array(
72
+ 'header' => Mage::helper('hipay')
73
+ ->__('Exp. Month'),
74
+ 'index' => 'cc_exp_month',
75
+ 'type' => 'number', 'width' => '30px'));
76
+
77
+ $this
78
+ ->addColumn('cc_exp_year',
79
+ array(
80
+ 'header' => Mage::helper('hipay')
81
+ ->__('Exp. Year'),
82
+ 'index' => 'cc_exp_year',
83
+ 'type' => 'number', 'width' => '30px'));
84
+
85
+ $this
86
+ ->addColumn('cc_token',
87
+ array(
88
+ 'header' => Mage::helper('hipay')
89
+ ->__('Alias oneclick'),
90
+ 'index' => 'cc_token',));
91
+
92
+ $this->addColumn('cc_status',
93
+ array(
94
+ 'header'=> Mage::helper('hipay')->__('Status'),
95
+ 'index' => 'cc_status',
96
+ 'type' => 'options',
97
+ 'options' => array(Allopass_Hipay_Model_Card::STATUS_ENABLED=>$this->__('Enabled'),Allopass_Hipay_Model_Card::STATUS_DISABLED=>$this->__('Disabled')),
98
+ ));
99
+
100
+ $this->addColumn('is_default',
101
+ array(
102
+ 'header'=> Mage::helper('hipay')->__('Is default'),
103
+ 'index' => 'is_default',
104
+ 'type' => 'options',
105
+ 'options' => array($this->__('No'),$this->__('Yes')),
106
+ ));
107
+
108
+
109
+
110
+ return parent::_prepareColumns();
111
+ }
112
+
113
+
114
+ public function getGridUrl() {
115
+ return $this
116
+ ->getUrl('hipay/adminhtml_card/cards',
117
+ array('_current' => true));
118
+ }
119
+
120
+ /**
121
+ * Row click url
122
+ *
123
+ * @return string
124
+ */
125
+ public function getRowUrl($row)
126
+ {
127
+ return $this->getUrl('adminhtml/card/edit', array('card_id' => $row->getId()));
128
+ }
129
+
130
+ public function getTabLabel() {
131
+ return Mage::helper('hipay')->__("Hipay's Cards");
132
+
133
+ }
134
+ public function getTabTitle() {
135
+ return Mage::helper('hipay')->__("Hipay's Cards");
136
+
137
+ }
138
+
139
+ public function canShowTab()
140
+ {
141
+ if (Mage::registry('current_customer')->getId()) {
142
+ return true;
143
+ }
144
+ return false;
145
+ }
146
+
147
+ public function isHidden()
148
+ {
149
+ if (Mage::registry('current_customer')->getId()) {
150
+ return false;
151
+ }
152
+ return true;
153
+ }
154
+
155
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_PaymentProfile extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+
7
+ $this->_controller = 'adminhtml_paymentProfile';
8
+ $this->_blockGroup = 'hipay';
9
+ $this->_headerText = $this->__('Hipay Payment Profiles');
10
+ $this->_addButtonLabel = $this->__('Add payment profile');
11
+
12
+ parent::__construct();
13
+ }
14
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Edit.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_PaymentProfile_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ /**
5
+ * Initialize cms page edit block
6
+ *
7
+ * @return void
8
+ */
9
+ public function __construct()
10
+ {
11
+
12
+ $this->_objectId = 'profile_id';
13
+ $this->_blockGroup = 'hipay';
14
+ $this->_controller = 'adminhtml_paymentProfile';
15
+ $this->_headerText = $this->__('Payment Profile');
16
+ parent::__construct();
17
+
18
+ $this->_addButton('saveandcontinue', array(
19
+ 'label' => Mage::helper('adminhtml')->__('Save and Continue Edit'),
20
+ 'onclick' => 'saveAndContinueEdit(\''.$this->getUrl('*/*/save', array('_current'=>true,'back'=>'edit')).'\')',
21
+ 'class' => 'save',
22
+ ), -100);
23
+
24
+ $this->_formScripts[] = "
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ ";
29
+
30
+ }
31
+
32
+
33
+
34
+
35
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Edit/Form.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Adminhtml_PaymentProfile_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareForm()
7
+ {
8
+ /* @var $profile Allopass_Hipay_Model_PaymentProfile */
9
+ $profile = Mage::registry('payment_profile');
10
+
11
+ $form = new Varien_Data_Form(array('id'=>'edit_form','action' => $this->getUrl('*/paymentProfile/save'), 'method' => 'post'));
12
+
13
+ $fieldset = $form->addFieldset('paymentProfile_form', array('legend'=>Mage::helper('hipay')->__('Payment Profile')));
14
+
15
+ if ($profile->getProfileId()) {
16
+ $fieldset->addField('profile_id', 'hidden', array(
17
+ 'name' => 'profile_id',
18
+ ));
19
+ }
20
+ $fieldset->addField('name', 'text', array(
21
+ 'label' => Mage::helper('hipay')->__('Name'),
22
+ 'title' => Mage::helper('hipay')->__('Name'),
23
+ 'class' => 'required-entry',
24
+ 'required' => true,
25
+ 'name' => 'name',
26
+ ));
27
+
28
+ $fieldset->addField('period_unit', 'select', array(
29
+ 'label' => $profile->getFieldLabel('period_unit'),
30
+ 'title' => $profile->getFieldLabel('period_unit'),
31
+ 'class' => 'required-entry',
32
+ 'name' => 'period_unit',
33
+ 'values' => Mage::getSingleton('hipay/paymentProfile')->getAllPeriodUnits(),
34
+ 'note'=>$this->__('Unit for billing during the subscription period.')
35
+ )
36
+ );
37
+
38
+ $fieldset->addField('period_frequency', 'text', array(
39
+ 'label' => $profile->getFieldLabel('period_frequency'),
40
+ 'title' => $profile->getFieldLabel('period_frequency'),
41
+ 'class' => 'required-entry validate-number',
42
+ 'required' => true,
43
+ 'name' => 'period_frequency',
44
+ 'note'=>$this->__('Number of billing periods that make up one billing cycle.')
45
+ ));
46
+
47
+ $fieldset->addField('period_max_cycles', 'text', array(
48
+ 'label' => $profile->getFieldLabel('period_max_cycles'),
49
+ 'title' => $profile->getFieldLabel('period_max_cycles'),
50
+ 'class' => 'required-entry validate-number',
51
+ 'required' => true,
52
+ 'name' => 'period_max_cycles',
53
+ 'note'=>$this->__('The number of billing cycles for payment period.')
54
+ ));
55
+
56
+ /*$fieldset->addField('payment_type', 'select', array(
57
+ 'label' => $profile->getPaymentTypeLabel('payment_type'),
58
+ 'title' => $profile->getPaymentTypeLabel('payment_type'),
59
+ 'name' => 'payment_type',
60
+ 'values' => $profile->getAllPaymentTypes(),
61
+ )
62
+ );*/
63
+
64
+ $fieldset->addField('payment_type', "hidden", array(
65
+ 'name' => 'payment_type'
66
+ ));
67
+ $profile->setData('payment_type',"split_payment");
68
+
69
+ $form->setUseContainer(true);
70
+ $form->setValues($profile->getData());
71
+ $this->setForm($form);
72
+ return parent::_prepareForm();
73
+ }
74
+
75
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/PaymentProfile/Grid.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_PaymentProfile_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+
5
+ protected function _prepareCollection()
6
+ {
7
+
8
+ $collection = Mage::getModel('hipay/paymentProfile')->getCollection();
9
+ $this->setCollection($collection);
10
+ parent::_prepareCollection();
11
+ return $this;
12
+ }
13
+
14
+
15
+ protected function _prepareColumns()
16
+ {
17
+ /* @var $profile Allopass_Hipay_Model_PaymentProfile */
18
+ $profile = Mage::getModel('hipay/paymentProfile');
19
+
20
+ $this->addColumn('profile_id',
21
+ array(
22
+ 'header'=> Mage::helper('hipay')->__('ID'),
23
+ 'width' => '50px',
24
+ 'type' => 'number',
25
+ 'index' => 'profile_id',
26
+ ));
27
+ $this->addColumn('name',
28
+ array(
29
+ 'header'=> Mage::helper('hipay')->__('Name'),
30
+ 'index' => 'name',
31
+ ));
32
+
33
+
34
+ $this->addColumn('period_unit',
35
+ array(
36
+ 'header'=> $profile->getFieldLabel('period_unit'),
37
+ 'width' => '60px',
38
+ 'index' => 'period_unit',
39
+ 'type' => 'options',
40
+ 'options' => Mage::getSingleton('hipay/paymentProfile')->getAllPeriodUnits(),
41
+ ));
42
+
43
+
44
+ $this->addColumn('period_frequency',
45
+ array(
46
+ 'header'=> $profile->getFieldLabel('period_frequency'),
47
+ 'width' => '10px',
48
+ 'type' => 'number',
49
+ 'index' => 'period_frequency',
50
+ ));
51
+
52
+ $this->addColumn('period_max_cycles',
53
+ array(
54
+ 'header'=> $profile->getFieldLabel('period_max_cycles'),
55
+ 'width' => '10px',
56
+ 'type' => 'number',
57
+ 'index' => 'period_max_cycles',
58
+ ));
59
+
60
+ $this->addColumn('payment_type',
61
+ array(
62
+ 'header'=> Mage::helper('hipay')->__('Payment type'),
63
+ 'width' => '60px',
64
+ 'index' => 'payment_type',
65
+ 'type' => 'options',
66
+ 'options' => Mage::getSingleton('hipay/paymentProfile')->getAllPaymentTypes(),
67
+ ));
68
+
69
+
70
+
71
+ return parent::_prepareColumns();
72
+ }
73
+
74
+ /**
75
+ * Row click url
76
+ *
77
+ * @return string
78
+ */
79
+ public function getRowUrl($row)
80
+ {
81
+ return $this->getUrl('*/*/edit', array('profile_id' => $row->getId()));
82
+ }
83
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_SplitPayment extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_splitPayment';
7
+ $this->_blockGroup = 'hipay';
8
+ $this->_headerText = $this->__('Hipay Split Payments');
9
+
10
+ parent::__construct();
11
+
12
+ $this->_removeButton('add');
13
+ }
14
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Edit.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_SplitPayment_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ /**
5
+ * Initialize cms page edit block
6
+ *
7
+ * @return void
8
+ */
9
+ public function __construct()
10
+ {
11
+
12
+ $this->_objectId = 'split_payment_id';
13
+ $this->_blockGroup = 'hipay';
14
+ $this->_controller = 'adminhtml_splitPayment';
15
+ $this->_headerText = $this->__('Split Payment');
16
+ parent::__construct();
17
+
18
+ $this->removeButton('delete');
19
+
20
+
21
+ $this->_addButton('saveandcontinue', array(
22
+ 'label' => Mage::helper('adminhtml')->__('Save and Continue Edit'),
23
+ 'onclick' => 'saveAndContinueEdit(\''.$this->getUrl('*/*/save', array('_current'=>true,'back'=>'edit')).'\')',
24
+ 'class' => 'save',
25
+ ), -100);
26
+
27
+ if($this->getSplitPayment()->canPay())
28
+ $this->_addButton('payNow', array(
29
+ 'label' => Mage::helper('adminhtml')->__('Pay now'),
30
+ 'onclick' => 'run(\''.$this->getUrl('*/*/payNow', array('_current'=>true,'back'=>'edit')).'\')',
31
+ 'class' => 'go',
32
+ ), -120);
33
+
34
+ $this->_formScripts[] = "
35
+ function saveAndContinueEdit(){
36
+ editForm.submit($('edit_form').action+'back/edit/');
37
+ }
38
+
39
+ function run(url){
40
+ editForm.submit(url);
41
+ }
42
+ ";
43
+ }
44
+
45
+ /**
46
+ * Retrieve SplitPayment model object
47
+ *
48
+ * @return Allopass_Hipay_Model_SplitPayment
49
+ */
50
+ public function getSplitPayment()
51
+ {
52
+ return Mage::registry('split_payment');
53
+ }
54
+
55
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Edit/Form.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Adminhtml_SplitPayment_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareForm()
7
+ {
8
+ /* @var $profile Allopass_Hipay_Model_SplitPayment */
9
+ $splitPayment = Mage::registry('split_payment');
10
+
11
+ $form = new Varien_Data_Form(array('id'=>'edit_form','action' =>$this->getUrl('*/splitPayment/save'), 'method' => 'post'));
12
+
13
+ $fieldset = $form->addFieldset('splitPayment_form', array('legend'=>Mage::helper('hipay')->__('Split Payment')));
14
+
15
+ if ($splitPayment->getSplitPaymentId()) {
16
+ $fieldset->addField('split_payment_id', 'hidden', array(
17
+ 'name' => 'split_payment_id',
18
+ ));
19
+ }
20
+ $fieldset->addField('real_order_id', 'text', array(
21
+ 'label' => Mage::helper('sales')->__('Order #'),
22
+ 'title' => Mage::helper('sales')->__('Order #'),
23
+ 'class' => 'required-entry',
24
+ 'required' => true,
25
+ 'name' => 'real_order_id',
26
+ 'readonly' => true,
27
+ ));
28
+
29
+ $fieldset->addField('customer_id', 'text', array(
30
+ 'label' => Mage::helper('customer')->__('Customer ID'),
31
+ 'title' => Mage::helper('customer')->__('Customer ID'),
32
+ 'class' => 'required-entry',
33
+ 'required' => true,
34
+ 'name' => 'customer_id',
35
+ 'readonly' => true,
36
+ ));
37
+
38
+ $fieldset->addField('card_token', 'text', array(
39
+ 'label' => Mage::helper('hipay')->__('Card Token'),
40
+ 'title' => Mage::helper('hipay')->__('Card Token'),
41
+ 'class' => 'required-entry',
42
+ 'required' => true,
43
+ 'name' => 'card_token',
44
+ ));
45
+
46
+ $fieldset->addField('total_amount', 'text', array(
47
+ 'label' => Mage::helper('sales')->__('G.T. (Purchased)'),
48
+ 'title' => Mage::helper('sales')->__('G.T. (Purchased)'),
49
+ 'class' => 'required-entry validate-number',
50
+ 'required' => true,
51
+ 'name' => 'total_amount',
52
+ 'readonly' => true,
53
+ ));
54
+
55
+ $fieldset->addField('amount_to_pay', 'text', array(
56
+ 'label' => Mage::helper('hipay')->__('Amount to pay'),
57
+ 'title' => Mage::helper('hipay')->__('Amount to pay'),
58
+ 'class' => 'required-entry validate-number',
59
+ 'required' => true,
60
+ 'name' => 'amount_to_pay',
61
+ ));
62
+
63
+ $fieldset->addField('date_to_pay', 'date', array(
64
+ 'label' => Mage::helper('hipay')->__('Date to pay'),
65
+ 'title' => Mage::helper('hipay')->__('Date to pay'),
66
+ 'class' => 'required-entry',
67
+ 'required' => true,
68
+ 'name' => 'date_to_pay',
69
+ 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
70
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
71
+ ));
72
+
73
+ $fieldset->addField('attempts', 'text', array(
74
+ 'label' => Mage::helper('hipay')->__('Attempts'),
75
+ 'title' => Mage::helper('hipay')->__('Attempts'),
76
+ 'class' => 'required-entry validate-number',
77
+ 'required' => true,
78
+ 'name' => 'attempts',
79
+ 'readonly' => true,
80
+ ));
81
+
82
+ $fieldset->addField('status', 'select', array(
83
+ 'label' => Mage::helper('hipay')->__('Status'),
84
+ 'title' => Mage::helper('hipay')->__('Status'),
85
+ 'name' => 'status',
86
+ 'values' => Allopass_Hipay_Model_SplitPayment::getStatues(),
87
+ )
88
+ );
89
+
90
+ $form->setUseContainer(true);
91
+ $form->setValues($splitPayment->getData());
92
+ $this->setForm($form);
93
+ return parent::_prepareForm();
94
+ }
95
+
96
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/SplitPayment/Grid.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_SplitPayment_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ protected $_defaultSort = 'split_payment_id';
5
+
6
+ protected function _prepareCollection()
7
+ {
8
+
9
+ $collection = Mage::getModel('hipay/splitPayment')->getCollection();
10
+ $this->setCollection($collection);
11
+ parent::_prepareCollection();
12
+ return $this;
13
+ }
14
+
15
+
16
+ protected function _prepareColumns()
17
+ {
18
+
19
+
20
+ $this->addColumn('split_payment_id',
21
+ array(
22
+ 'header'=> Mage::helper('hipay')->__('ID'),
23
+ 'width' => '50px',
24
+ 'type' => 'number',
25
+ 'index' => 'split_payment_id',
26
+ ));
27
+ $this->addColumn('real_order_id',
28
+ array(
29
+ 'header'=> Mage::helper('sales')->__('Order #'),
30
+ 'type' => 'text',
31
+ 'width'=>'20px',
32
+ 'index' => 'real_order_id',
33
+ ));
34
+
35
+ $this->addColumn('customer_id',
36
+ array(
37
+ 'header'=> Mage::helper('customer')->__('Customer ID'),
38
+ 'type' => 'text',
39
+ 'width'=>'20px',
40
+ 'index' => 'customer_id',
41
+ ));
42
+
43
+ $this->addColumn('card_token',
44
+ array(
45
+ 'header'=> Mage::helper('hipay')->__('Card Token'),
46
+ 'type' => 'text',
47
+ 'width'=>'60px',
48
+ 'index' => 'card_token',
49
+ ));
50
+
51
+
52
+ $this->addColumn('total_amount',
53
+ array(
54
+ 'header'=> Mage::helper('sales')->__('G.T. (Purchased)'),
55
+ 'index' => 'total_amount',
56
+ 'type' => 'currency',
57
+ ));
58
+
59
+
60
+ $this->addColumn('amount_to_pay',
61
+ array(
62
+ 'header'=> Mage::helper('hipay')->__('Amount to pay'),
63
+ 'type' => 'currency',
64
+ 'index' => 'amount_to_pay',
65
+ ));
66
+
67
+ $this->addColumn('date_to_pay',
68
+ array(
69
+ 'header'=> Mage::helper('hipay')->__('Date to pay'),
70
+ 'type' => 'date',
71
+ 'index' => 'date_to_pay',
72
+ ));
73
+
74
+ $this->addColumn('attempts',
75
+ array(
76
+ 'header'=> Mage::helper('hipay')->__('Attempts'),
77
+ 'index' => 'attempts',
78
+ 'type' => 'number',
79
+ ));
80
+
81
+ $this->addColumn('status',
82
+ array(
83
+ 'header'=> Mage::helper('hipay')->__('Status'),
84
+ 'index' => 'status',
85
+ 'type' => 'options',
86
+ 'options' => Allopass_Hipay_Model_SplitPayment::getStatues(),
87
+ ));
88
+
89
+
90
+
91
+ return parent::_prepareColumns();
92
+ }
93
+
94
+ /**
95
+ * Row click url
96
+ *
97
+ * @return string
98
+ */
99
+ public function getRowUrl($row)
100
+ {
101
+ return $this->getUrl('*/*/edit', array('split_payment_id' => $row->getId()));
102
+ }
103
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/3dsRule.php CHANGED
@@ -29,12 +29,17 @@ class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_3dsRule extends M
29
  */
30
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
31
  {
 
32
  $partsId = explode("_", $element->getId());
33
  $method_code = $partsId[1]. "_" . $partsId[2];
34
  $rule = Mage::getModel('hipay/rule');
35
  $rule->setMethodCode($method_code);
 
36
  if($element->getValue())
37
  $rule->load($element->getValue());
 
 
 
38
 
39
  $element->setRule($rule);
40
 
29
  */
30
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
31
  {
32
+
33
  $partsId = explode("_", $element->getId());
34
  $method_code = $partsId[1]. "_" . $partsId[2];
35
  $rule = Mage::getModel('hipay/rule');
36
  $rule->setMethodCode($method_code);
37
+
38
  if($element->getValue())
39
  $rule->load($element->getValue());
40
+
41
+ if($rule->getConfigPath() == "")
42
+ $rule->setConfigPath($element->getId());
43
 
44
  $element->setRule($rule);
45
 
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/Allowsplitpayment.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_Allowsplitpayment extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+
6
+ /**
7
+ *
8
+ * @param Varien_Data_Form_Element_Abstract $element
9
+ * @return string
10
+ */
11
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
+ {
13
+ $javaScript = "
14
+ <script type=\"text/javascript\">
15
+ Event.observe('{$element->getId()}', 'change', function(){
16
+ split_payment=$('{$element->getId()}').value;
17
+ $('{$this->_getSplitPaymentElementId($element)}').disabled = (!split_payment || split_payment!=1);
18
+ });
19
+ </script>";
20
+
21
+ $element->setData('after_element_html',$javaScript.$element->getAfterElementHtml());
22
+
23
+ $this->toggleDisabled($element);
24
+
25
+ return parent::_getElementHtml($element);
26
+ }
27
+
28
+ public function toggleDisabled($element)
29
+ {
30
+ if(!$element->getValue() || $element->getValue()!=1) {
31
+
32
+ $element->getForm()->getElement($this->_getSplitPaymentElementId($element))->setDisabled('disabled');
33
+ }
34
+ return parent::getHtml();
35
+ }
36
+
37
+ protected function _getSplitPaymentElementId($element)
38
+ {
39
+ return substr($element->getId(), 0, strrpos($element->getId(), 'allow_split_payment')) . 'split_payment_profile';
40
+ }
41
+
42
+ }
app/code/community/Allopass/Hipay/Block/Adminhtml/System/Config/Form/Field/MultiselectSortable.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Adminhtml_System_Config_Form_Field_MultiselectSortable extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+
5
+ /**
6
+ *
7
+ * @param Varien_Data_Form_Element_Abstract $element
8
+ * @return string
9
+ */
10
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
11
+ {
12
+ $javaScript = "
13
+ <script type=\"text/javascript\">
14
+ var options = $$(\"#row_".$element->getHtmlId()." ul.checkboxes li\");
15
+ options.each(function(e){
16
+ var input = e.select('input').first();
17
+ input.name = input.name + '[]';
18
+
19
+ var label = e.select('label').first();
20
+ label.setStyle({cursor:'move'});
21
+ label.writeAttribute('for',false);
22
+
23
+ });
24
+ /*$$(\"#row_".$element->getHtmlId()." ul.checkboxes li input\").each(function(e,i)
25
+ {
26
+ e.name = e.name + '[]';
27
+ });
28
+
29
+ $$(\"#row_".$element->getHtmlId()." ul.checkboxes li label\").each(function(e,i)
30
+ {
31
+ e.setStyle({cursor:'move'});
32
+ e.writeAttribute({for}:'');
33
+ });*/
34
+
35
+
36
+ //Sortable.create('".$element->getHtmlId()."',{elements:$$('#".$element->getHtmlId()." option'),handles:$$('#".$element->getHtmlId()." option')});
37
+ var container = $$(\"#row_".$element->getHtmlId()." ul.checkboxes\").first();
38
+ Sortable.create(container);
39
+ </script>";
40
+ $element->setData('after_element_html',$javaScript.$element->getAfterElementHtml());
41
+
42
+ return parent::_getElementHtml($element);
43
+ }
44
+
45
+
46
+ }
app/code/community/Allopass/Hipay/Block/Card.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Block_Card extends Mage_Core_Block_Template
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setTemplate('hipay/card/account.phtml');
10
+
11
+ $cards = Mage::getResourceModel('hipay/card_collection')
12
+ ->addFieldToSelect('*')
13
+ ->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
14
+ ->addFieldToFilter('cc_status', Allopass_Hipay_Model_Card::STATUS_ENABLED)
15
+ ->setOrder('card_id', 'desc')
16
+ ;
17
+
18
+ $this->setCards($cards);
19
+
20
+ Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('hipay')->__("Hipay's Cards"));
21
+ }
22
+
23
+ protected function _prepareLayout()
24
+ {
25
+ parent::_prepareLayout();
26
+
27
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'hipay.card.account.pager')
28
+ ->setCollection($this->getCards());
29
+ $this->setChild('pager', $pager);
30
+ $this->getCards()->load();
31
+ return $this;
32
+ }
33
+
34
+ public function getPagerHtml()
35
+ {
36
+ return $this->getChildHtml('pager');
37
+ }
38
+
39
+ public function getEditUrl($card)
40
+ {
41
+ return $this->getUrl('*/*/edit', array('card_id' => $card->getId()));
42
+ }
43
+
44
+ public function canDelete()
45
+ {
46
+ return true;
47
+ }
48
+
49
+
50
+ public function getDeleteUrl($card)
51
+ {
52
+ return $this->getUrl('*/*/delete', array('card_id' => $card->getId()));
53
+ }
54
+
55
+ public function getBackUrl()
56
+ {
57
+ return $this->getUrl('customer/account/');
58
+ }
59
+ }
app/code/community/Allopass/Hipay/Block/Card/Edit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Block_Card_Edit extends Mage_Core_Block_Template
3
+ {
4
+ protected $_card;
5
+
6
+ protected function _prepareLayout()
7
+ {
8
+ parent::_prepareLayout();
9
+ $this->_card = Mage::registry('current_card');
10
+
11
+
12
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
13
+ $headBlock->setTitle($this->getTitle());
14
+ }
15
+
16
+ if ($postedData = Mage::getSingleton('customer/session')->getCardFormData(true)) {
17
+ $this->_card->addData($postedData);
18
+ }
19
+
20
+ return $this;
21
+ }
22
+
23
+ public function getCard()
24
+ {
25
+ return $this->_card;
26
+ }
27
+
28
+
29
+ public function getBackUrl()
30
+ {
31
+ if ($this->getData('back_url')) {
32
+ return $this->getData('back_url');
33
+ }
34
+
35
+ return $this->getUrl('hipay/card');
36
+
37
+ }
38
+
39
+ public function getSaveUrl()
40
+ {
41
+ return Mage::getUrl('hipay/card/editPost', array('_secure'=>true, 'id'=>$this->getCard()->getId()));
42
+ }
43
+
44
+ }
app/code/community/Allopass/Hipay/Block/Form/Abstract.php CHANGED
@@ -1,6 +1,11 @@
1
  <?php
2
  abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_Form
3
  {
 
 
 
 
 
4
 
5
  /**
6
  * Retrieve payment configuration object
@@ -11,14 +16,50 @@ abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_For
11
  {
12
  return Mage::getSingleton('hipay/config');
13
  }
14
-
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  public function getCustomerHasAlias()
17
  {
18
  return $this->getCustomer()->getHipayAliasOneclick() != "";
19
 
20
  }
21
 
 
 
 
 
 
 
22
  public function getCustomer()
23
  {
24
  return Mage::getSingleton('customer/session')->getCustomer();
@@ -29,6 +70,11 @@ abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_For
29
  return $this->helper('hipay')->checkIfCcExpDateIsValid((int)Mage::getSingleton('customer/session')->getCustomerId());
30
  }
31
 
 
 
 
 
 
32
  public function oneClickIsAllowed()
33
  {
34
  $checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
@@ -40,15 +86,59 @@ abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_For
40
 
41
  }
42
 
 
 
 
 
43
  public function getQuote()
44
  {
45
  return Mage::getSingleton('checkout/session')->getQuote();
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- public function allowUseOneClick()
50
  {
51
- return $this->getMethod()->getConfigData('allow_use_oneclick');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  public function getIframeConfig()
@@ -56,6 +146,7 @@ abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_For
56
  $iframe['iframe_width'] = $this->getMethod()->getConfigData('iframe_width');
57
  $iframe['iframe_height'] = $this->getMethod()->getConfigData('iframe_height');
58
  $iframe['iframe_style'] = $this->getMethod()->getConfigData('iframe_style');
 
59
  return $iframe;
60
  }
61
 
1
  <?php
2
  abstract class Allopass_Hipay_Block_Form_Abstract extends Mage_Payment_Block_Form
3
  {
4
+ /**
5
+ *
6
+ * @var Allopass_Hipay_Model_Resource_Card_Collection
7
+ */
8
+ protected $_cards = null;
9
 
10
  /**
11
  * Retrieve payment configuration object
16
  {
17
  return Mage::getSingleton('hipay/config');
18
  }
 
19
 
20
+ public function getCards()
21
+ {
22
+ if(is_null($this->_cards))
23
+ {
24
+ $today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
25
+
26
+ $currentYear = (int)$today->getYear()->toString("YY");
27
+ $currentMonth = (int)$today->getMonth()->toString("MM");
28
+
29
+ $this->_cards = Mage::getResourceModel('hipay/card_collection')
30
+ ->addFieldToSelect('*')
31
+ ->addFieldToFilter('customer_id', $this->getCustomer()->getId())
32
+ ->addFieldToFilter('cc_status', Allopass_Hipay_Model_Card::STATUS_ENABLED)
33
+ ->addFieldToFilter('cc_exp_year', array("gteq"=>$currentYear))
34
+ ->setOrder('card_id', 'desc')
35
+ ->setOrder('is_default', 'desc');
36
+
37
+ foreach ($this->_cards as $card)
38
+ {
39
+ if($card->ccExpYear == $currentYear && $currentMonth < $card->ccExpMonth)
40
+ $this->_cards->removeItemByKey($card->getId());
41
+ }
42
+ }
43
+
44
+ return $this->_cards;
45
+ }
46
+
47
+ /**
48
+ * @deprecated since v1.0.9
49
+ * @return boolean
50
+ */
51
  public function getCustomerHasAlias()
52
  {
53
  return $this->getCustomer()->getHipayAliasOneclick() != "";
54
 
55
  }
56
 
57
+ public function getCustomerHasCard()
58
+ {
59
+ return $this->getCards()->count() > 0;
60
+
61
+ }
62
+
63
  public function getCustomer()
64
  {
65
  return Mage::getSingleton('customer/session')->getCustomer();
70
  return $this->helper('hipay')->checkIfCcExpDateIsValid((int)Mage::getSingleton('customer/session')->getCustomerId());
71
  }
72
 
73
+ /**
74
+ * If checkout method is GUEST oneclick is not allowed
75
+ * Or We check method configuration
76
+ * @return boolean
77
+ */
78
  public function oneClickIsAllowed()
79
  {
80
  $checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
86
 
87
  }
88
 
89
+ /**
90
+ * @return Mage_Sales_Model_Quote
91
+ *
92
+ * */
93
  public function getQuote()
94
  {
95
  return Mage::getSingleton('checkout/session')->getQuote();
96
  }
97
 
98
+ public function allowSplitPayment()
99
+ {
100
+
101
+ $checkoutMethod = $this->getQuote()->getCheckoutMethod();
102
+ $minAmount = $this->getMethod()->getConfigData('min_order_total_split_payment');
103
+
104
+ if($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST ||
105
+ !$this->getMethod()->getConfigData('allow_split_payment') ||
106
+ ($this->getMethod()->getConfigData('allow_split_payment') && !empty($minAmount) && $minAmount >= $this->getQuote()->getBaseGrandTotal() ))
107
+ return false;
108
+
109
+ return true;
110
+ }
111
+
112
+ public function getSplitPaymentProfiles()
113
+ {
114
+ $profileIds = explode(",", $this->getMethod()->getConfigData('split_payment_profile'));
115
+ $profiles = Mage::getModel('hipay/paymentProfile')->getCollection()->addIdsToFilter($profileIds);
116
+ return $profiles;
117
+
118
+ }
119
+
120
 
121
+ protected function allowUseOneClick()
122
  {
123
+ switch ((int)$this->getMethod()->getConfigData('allow_use_oneclick')) {
124
+ case 0:
125
+ return false;
126
+
127
+ case 1:
128
+ /* @var $rule Allopass_Hipay_Model_Rule */
129
+
130
+ $rule = Mage::getModel('hipay/rule')->load($this->getMethod()->getConfigData('filter_oneclick'));
131
+ if($rule->getId())
132
+ {
133
+ /*$objToValidate = new Varien_Object();
134
+ $objToValidate->setQuoteId($this->getQuote()->getId());
135
+ $objToValidate->setQuote($this->getQuote());
136
+ $objToValidate->setCreatedAt($this->getQuote()->getCreatedAt());*/
137
+ return (int)$rule->validate($this->getQuote());
138
+ }
139
+ return true;
140
+
141
+ }
142
  }
143
 
144
  public function getIframeConfig()
146
  $iframe['iframe_width'] = $this->getMethod()->getConfigData('iframe_width');
147
  $iframe['iframe_height'] = $this->getMethod()->getConfigData('iframe_height');
148
  $iframe['iframe_style'] = $this->getMethod()->getConfigData('iframe_style');
149
+ $iframe['iframe_wrapper_style'] = $this->getMethod()->getConfigData('iframe_style');
150
  return $iframe;
151
  }
152
 
app/code/community/Allopass/Hipay/Block/Form/Cc.php CHANGED
@@ -20,11 +20,25 @@ class Allopass_Hipay_Block_Form_Cc extends Allopass_Hipay_Block_Form_Abstract
20
  $availableTypes = $method->getConfigData('cctypes');
21
  if ($availableTypes) {
22
  $availableTypes = explode(',', $availableTypes);
 
 
 
23
  foreach ($types as $code=>$name) {
24
  if (!in_array($code, $availableTypes)) {
25
  unset($types[$code]);
26
  }
 
 
 
 
 
 
 
 
27
  }
 
 
 
28
  }
29
  }
30
  return $types;
20
  $availableTypes = $method->getConfigData('cctypes');
21
  if ($availableTypes) {
22
  $availableTypes = explode(',', $availableTypes);
23
+
24
+
25
+
26
  foreach ($types as $code=>$name) {
27
  if (!in_array($code, $availableTypes)) {
28
  unset($types[$code]);
29
  }
30
+
31
+ }
32
+ $ordered = array();
33
+ foreach($availableTypes as $key) {
34
+ if(array_key_exists($key,$types)) {
35
+ $ordered[$key] = $types[$key];
36
+ unset($types[$key]);
37
+ }
38
  }
39
+ return $ordered;
40
+
41
+ //todo order $types
42
  }
43
  }
44
  return $types;
app/code/community/Allopass/Hipay/Block/Info/Cc.php CHANGED
@@ -5,6 +5,13 @@
5
  */
6
  class Allopass_Hipay_Block_Info_Cc extends Mage_Payment_Block_Info
7
  {
 
 
 
 
 
 
 
8
  /**
9
  * Retrieve credit card type name
10
  *
@@ -76,6 +83,13 @@ class Allopass_Hipay_Block_Info_Cc extends Mage_Payment_Block_Info
76
  if ($this->getInfo()->getCcLast4()) {
77
  $data[Mage::helper('payment')->__('Credit Card Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
78
  }
 
 
 
 
 
 
 
79
  if (!$this->getIsSecureMode()) {
80
  if ($ccSsIssue = $this->getInfo()->getCcSsIssue()) {
81
  $data[Mage::helper('payment')->__('Switch/Solo/Maestro Issue Number')] = $ccSsIssue;
5
  */
6
  class Allopass_Hipay_Block_Info_Cc extends Mage_Payment_Block_Info
7
  {
8
+
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->setTemplate('hipay/info/cc.phtml');
13
+ }
14
+
15
  /**
16
  * Retrieve credit card type name
17
  *
83
  if ($this->getInfo()->getCcLast4()) {
84
  $data[Mage::helper('payment')->__('Credit Card Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
85
  }
86
+
87
+ if($this->getInfo()->getAdditionalInformation('fraud_type') && $this->getInfo()->getAdditionalInformation('fraud_score'))
88
+ {
89
+ $data[Mage::helper('hipay')->__('Fraud result')] = ucfirst($this->getInfo()->getAdditionalInformation('fraud_type'));
90
+ $data[Mage::helper('hipay')->__('Fraud scoring')] = $this->getInfo()->getAdditionalInformation('fraud_score');
91
+ }
92
+
93
  if (!$this->getIsSecureMode()) {
94
  if ($ccSsIssue = $this->getInfo()->getCcSsIssue()) {
95
  $data[Mage::helper('payment')->__('Switch/Solo/Maestro Issue Number')] = $ccSsIssue;
app/code/community/Allopass/Hipay/Block/Info/Hosted.php CHANGED
@@ -5,5 +5,54 @@
5
  */
6
  class Allopass_Hipay_Block_Info_Hosted extends Mage_Payment_Block_Info
7
  {
8
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
5
  */
6
  class Allopass_Hipay_Block_Info_Hosted extends Mage_Payment_Block_Info
7
  {
8
+
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->setTemplate('hipay/info/cc.phtml');
13
+ }
14
+
15
+ /**
16
+ * Retrieve credit card type name
17
+ *
18
+ * @return string
19
+ */
20
+ public function getCcTypeName()
21
+ {
22
+ $types = Mage::getSingleton('payment/config')->getCcTypes();
23
+ $ccType = $this->getInfo()->getCcType();
24
+ if (isset($types[$ccType])) {
25
+ return $types[$ccType];
26
+ }
27
+ return (empty($ccType)) ? Mage::helper('payment')->__('N/A') : $ccType;
28
+ }
29
+
30
+ /**
31
+ * Prepare credit card related payment info
32
+ *
33
+ * @param Varien_Object|array $transport
34
+ * @return Varien_Object
35
+ */
36
+ protected function _prepareSpecificInformation($transport = null)
37
+ {
38
+ if (null !== $this->_paymentSpecificInformation) {
39
+ return $this->_paymentSpecificInformation;
40
+ }
41
+ $transport = parent::_prepareSpecificInformation($transport);
42
+ $data = array();
43
+ if ($ccType = $this->getCcTypeName()) {
44
+ $data[Mage::helper('payment')->__('Credit Card Type')] = $ccType;
45
+ }
46
+ if ($this->getInfo()->getCcLast4()) {
47
+ $data[Mage::helper('payment')->__('Credit Card Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
48
+ }
49
+
50
+ if($this->getInfo()->getAdditionalInformation('fraud_type') && $this->getInfo()->getAdditionalInformation('fraud_score'))
51
+ {
52
+ $data[Mage::helper('hipay')->__('Fraud result')] = ucfirst($this->getInfo()->getAdditionalInformation('fraud_type'));
53
+ $data[Mage::helper('hipay')->__('Fraud scoring')] = $this->getInfo()->getAdditionalInformation('fraud_score');
54
+ }
55
+
56
+ return $transport->setData(array_merge($data, $transport->getData()));
57
+ }
58
  }
app/code/community/Allopass/Hipay/Controller/Payment.php CHANGED
@@ -13,22 +13,9 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
13
  */
14
  public function preDispatch() {
15
  parent::preDispatch();
16
-
17
- if (!$this->_validateSignature()) {
18
- $this->getResponse()->setBody("NOK. Wrong Signature!");
19
- $this->setFlag('', 'no-dispatch', true);
20
- }
21
- }
22
-
23
-
24
- protected function _validateSignature()
25
- {
26
- return true;
27
- /* @var $_helper Allopass_Hipay_Helper_Data */
28
- $_helper = Mage::helper('hipay');
29
- $signature = $this->getRequest()->getParam('hash');
30
- return $_helper->checkSignature($signature);
31
  }
 
32
 
33
  /**
34
  *
@@ -43,6 +30,7 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
43
  {
44
  $order = $this->getOrder();
45
  $payment = $order->getPayment();
 
46
  $methodInstance = $this->_getMethodInstance();
47
 
48
  try
@@ -92,6 +80,15 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
92
  $profile->save();
93
  }
94
  }
 
 
 
 
 
 
 
 
 
95
  }
96
  /*else
97
  {
@@ -113,6 +110,11 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
113
 
114
  public function declineAction()
115
  {
 
 
 
 
 
116
  $this->processResponse();
117
  $this->_redirect('checkout/onepage/failure');
118
  return $this;
@@ -121,6 +123,12 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
121
 
122
  public function exceptionAction()
123
  {
 
 
 
 
 
 
124
  $this->_redirect('checkout/onepage/failure');
125
  return $this;
126
  }
@@ -182,45 +190,12 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
182
  $this->_order->getPayment()->setAdditionalInformation('token',isset($additionalInfo['token']) ? $additionalInfo['token'] : "");
183
  $this->_order->getPayment()->setAdditionalInformation('create_oneclick',isset($additionalInfo['create_oneclick']) ? $additionalInfo['create_oneclick'] : 1);
184
  $this->_order->getPayment()->setAdditionalInformation('use_oneclick',isset($additionalInfo['use_oneclick']) ? $additionalInfo['use_oneclick'] : 0);
 
185
  }
186
 
187
 
188
 
189
  return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
190
-
191
- //$amount = $this->getAmountFromProfile($profile);
192
-
193
- /*$productItemInfo = new Varien_Object;
194
- $type = "Regular";
195
- if ($type == 'Trial') {
196
- $productItemInfo->setPaymentType(Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_TRIAL);
197
- } elseif ($type == 'Regular') {
198
- $productItemInfo->setPaymentType(Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_REGULAR);
199
- }
200
-
201
-
202
- if($this->isInitialProfileOrder($profile))// because is not additonned in prodile obj
203
- $productItemInfo->setPrice($profile->getBillingAmount() + $profile->getInitAmount());
204
-
205
- $this->_order = $profile->createOrder($productItemInfo);
206
-
207
- $additionalInfo = $profile->getAdditionalInfo();
208
-
209
- $this->_order->getPayment()->setCcType($additionalInfo['ccType']);
210
- $this->_order->getPayment()->setCcExpMonth($additionalInfo['ccExpMonth']);
211
- $this->_order->getPayment()->setCcExpYear($additionalInfo['ccExpYear']);
212
- $this->_order->getPayment()->setAdditionalInformation('token',$additionalInfo['token']);
213
- $this->_order->getPayment()->setAdditionalInformation('create_oneclick',$additionalInfo['create_oneclick']);
214
- $this->_order->getPayment()->setAdditionalInformation('use_oneclick',$additionalInfo['use_oneclick']);
215
-
216
- $orderId = 'create-recurring';
217
- $orderId .= "-".$profileId;
218
- //$this->_order->setIncrementId($orderId);
219
- $this->_order->save();
220
- $profile->addOrderRelation($this->_order->getId());
221
- $profile->save();*/
222
- return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
223
- //break;
224
  }
225
 
226
 
@@ -232,7 +207,9 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
232
 
233
  }
234
  else
 
235
  $this->_order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
 
236
  }
237
 
238
  return $this->_order;
@@ -269,4 +246,57 @@ class Allopass_Hipay_Controller_Payment extends Mage_Core_Controller_Front_Actio
269
  {
270
  return Mage::getSingleton('checkout/session');
271
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  }
13
  */
14
  public function preDispatch() {
15
  parent::preDispatch();
16
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
+
19
 
20
  /**
21
  *
30
  {
31
  $order = $this->getOrder();
32
  $payment = $order->getPayment();
33
+
34
  $methodInstance = $this->_getMethodInstance();
35
 
36
  try
80
  $profile->save();
81
  }
82
  }
83
+
84
+
85
+ $session = Mage::getSingleton('checkout/session');
86
+ if (!$session->getLastSuccessQuoteId()) {
87
+
88
+ $session->setLastSuccessQuoteId($this->getOrder()->getIncrementId());
89
+ $session->setLastQuoteId($this->getOrder()->getId());
90
+ }
91
+
92
  }
93
  /*else
94
  {
110
 
111
  public function declineAction()
112
  {
113
+ $lastOrderId = $this->getOrder()->getIncrementId();
114
+
115
+ Mage::getSingleton('checkout/session')->setLastQuoteId($lastOrderId);
116
+ Mage::getSingleton('checkout/session')->setLastOrderId($lastOrderId);
117
+
118
  $this->processResponse();
119
  $this->_redirect('checkout/onepage/failure');
120
  return $this;
123
 
124
  public function exceptionAction()
125
  {
126
+
127
+ $lastOrderId = $this->getOrder()->getIncrementId();
128
+
129
+ Mage::getSingleton('checkout/session')->setLastQuoteId($lastOrderId);
130
+ Mage::getSingleton('checkout/session')->setLastOrderId($lastOrderId);
131
+
132
  $this->_redirect('checkout/onepage/failure');
133
  return $this;
134
  }
190
  $this->_order->getPayment()->setAdditionalInformation('token',isset($additionalInfo['token']) ? $additionalInfo['token'] : "");
191
  $this->_order->getPayment()->setAdditionalInformation('create_oneclick',isset($additionalInfo['create_oneclick']) ? $additionalInfo['create_oneclick'] : 1);
192
  $this->_order->getPayment()->setAdditionalInformation('use_oneclick',isset($additionalInfo['use_oneclick']) ? $additionalInfo['use_oneclick'] : 0);
193
+ $this->_order->getPayment()->setAdditionalInformation('selected_oneclick_card',isset($additionalInfo['selected_oneclick_card']) ? $additionalInfo['selected_oneclick_card'] : 0);
194
  }
195
 
196
 
197
 
198
  return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
200
 
201
 
207
 
208
  }
209
  else
210
+ {
211
  $this->_order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
212
+ }
213
  }
214
 
215
  return $this->_order;
246
  {
247
  return Mage::getSingleton('checkout/session');
248
  }
249
+
250
+
251
+ public function updateDebitAmountAction()
252
+ {
253
+ /* @var $_helper Allopass_Hipay_Helper_Data */
254
+ $_helper = Mage::helper('hipay');
255
+ $response = array();
256
+ $response['error'] = true;
257
+ $response['success'] = false;
258
+
259
+ $payment_profile_id = $this->getRequest()->getParam('payment_profile_id',false);
260
+ $amount = $this->getCheckout()->getQuote()->getGrandTotal();
261
+
262
+ $response['message'] = Mage::helper('hipay')->__('You will be debit of amount %s only after submit order.',Mage::app()->getStore()->getBaseCurrency()->format($amount, array(), true));
263
+
264
+ if($payment_profile_id)
265
+ {
266
+ try {
267
+
268
+ $splitPayment = $_helper->splitPayment((int)$payment_profile_id, $amount);
269
+ $response['success'] = true;
270
+ $response['error'] = false;
271
+ $response['splitPayment'] = $splitPayment;
272
+ $response['grandTotal'] = $amount;
273
+ $firstAmount = $splitPayment[0]['amountToPay'];
274
+ array_shift($splitPayment);
275
+ $otherPayments = "<p><span>" . Mage::helper('hipay')->__("Your next payments:") . '</span><table class="data-table" id="split-payment-cc-table">';
276
+ foreach ($splitPayment as $value)
277
+ {
278
+ $otherPayments .= '<tr>';
279
+ $amount = Mage::app()->getStore()->getBaseCurrency()->format($value['amountToPay'], array(), true);
280
+ $dateToPay = new Zend_Date($value['dateToPay']);
281
+ $otherPayments .= '<td>' . $dateToPay->toString(Zend_Date::DATE_LONG) . "</td><td> " . $amount . '</td>' ;
282
+ $otherPayments .= '</tr>';
283
+ }
284
+ $otherPayments .= '<table></p>';
285
+
286
+ $response['labelSplitPayment'] = "<p><span>" . Mage::helper('hipay')->__('You will be debit of amount %s only after submit order.',Mage::app()->getStore()->getBaseCurrency()->format($firstAmount, array(), true)) . '</span></p>';
287
+ $response['labelSplitPayment'] .= $otherPayments;
288
+
289
+ } catch (Exception $e) {
290
+
291
+ $response['message'] = $e->getMessage();
292
+
293
+ }
294
+
295
+
296
+ }
297
+
298
+
299
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
300
+
301
+ }
302
  }
app/code/community/Allopass/Hipay/Helper/Data.php CHANGED
@@ -2,6 +2,150 @@
2
  class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  public function getHipayMethods()
6
  {
7
  $methods = array();
@@ -9,7 +153,8 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
9
  foreach (Mage::getStoreConfig('payment') as $code => $data) {
10
  if(strpos($code, 'hipay') !== false)
11
  {
12
- $methods[$code] = $data['model'];
 
13
  }
14
  }
15
 
@@ -17,9 +162,27 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
17
 
18
  }
19
 
20
- public function checkSignature($signature,$fromNotification = false)
21
  {
22
- $passphrase = Mage::getStoreConfig('hipay/hipay_api/secret_passphrase');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  if(empty($passphrase) || empty($signature))
24
  return true;
25
 
@@ -59,7 +222,10 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
59
  if(!empty($expDate) && !empty($alias))
60
  {
61
  list($expMonth,$expYear) = explode("-", $expDate);
62
- $today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
 
 
 
63
 
64
  $currentYear = (int)$today->getYear()->toString("YY");
65
  $currentMonth = (int)$today->getMonth()->toString("MM");
@@ -70,13 +236,29 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
70
  if($currentYear == (int)$expYear && $currentMonth > (int)$expMonth)
71
  return false;
72
 
73
- return true;
74
 
75
  }
76
 
77
  return false;
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  /**
81
  *
82
  * @param Mage_Customer_Model_Customer $customer
@@ -112,6 +294,62 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
112
  return $this;
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  public function reAddToCart($incrementId) {
116
 
117
  $cart = Mage::getSingleton('checkout/cart');
@@ -188,21 +426,22 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
188
  }
189
 
190
  $card = $this->__('Credit Card: xxxx-%s', $payment->getCcLast4());
 
191
 
192
- $pattern = '%s - %s. %s %s.';
193
- $texts = array($operation,$result,$card, $amount);
194
 
195
  if (!is_null($lastTransactionId)) {
196
- $pattern .= ' %s.';
197
  $texts[] = $this->__('Hipay Transaction ID %s', $lastTransactionId);
198
  }
199
 
200
  if ($additionalMessage) {
201
- $pattern .= ' %s.';
202
  $texts[] = $additionalMessage;
203
  }
204
- $pattern .= ' %s';
205
- $texts[] = $exception;
206
 
207
  return call_user_func_array(array($this, '__'), array_merge(array($pattern), $texts));
208
  }
@@ -217,4 +456,122 @@ class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
217
  {
218
  return $payment->getOrder()->getBaseCurrency()->formatTxt($amount);
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
2
  class Allopass_Hipay_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
 
5
+ /**
6
+ *
7
+ * @param Allopass_Hipay_Model_PaymentProfile|int $profile
8
+ * @param float $amount
9
+ */
10
+ public function splitPayment($profile,$amount)
11
+ {
12
+ $paymentsSplit = array();
13
+
14
+ if(is_int($profile))
15
+ $profile = Mage::getModel('hipay/paymentProfile')->load($profile);
16
+
17
+ if($profile)
18
+ {
19
+ $maxCycles = (int)$profile->getPeriodMaxCycles();
20
+
21
+ $periodFrequency = (int)$profile->getPeriodFrequency();
22
+ $periodUnit = $profile->getPeriodUnit();
23
+
24
+ $todayDate = new Zend_Date();
25
+
26
+ if($maxCycles < 1)
27
+ Mage::throwException("Period max cycles is equals zero or negative for Payment Profile ID: ".$profile->getId());
28
+
29
+
30
+ $part = (int)($amount / $maxCycles);
31
+ $reste = $amount%$maxCycles;
32
+ $fmod = fmod($amount, $maxCycles);
33
+ //Mage::log("PART = ".$part." RESTE = ".$reste,null,'hipay_split_debug.log');
34
+
35
+ for ($i=-1;$i<($maxCycles-1);$i++)
36
+ {
37
+ $todayClone = clone $todayDate;
38
+ switch ($periodUnit)
39
+ {
40
+ case Allopass_Hipay_Model_PaymentProfile::PERIOD_UNIT_MONTH:
41
+ {
42
+ $dateToPay = $todayClone->addMonth($periodFrequency+$i)->getDate()->toString('yyyy-MM-dd');
43
+ break;
44
+ }
45
+ case Allopass_Hipay_Model_PaymentProfile::PERIOD_UNIT_DAY:
46
+ {
47
+ $dateToPay = $todayClone->addDay($periodFrequency+$i)->getDate()->toString('yyyy-MM-dd');
48
+
49
+ break;
50
+ }
51
+ case Allopass_Hipay_Model_PaymentProfile::PERIOD_UNIT_SEMI_MONTH://TODO test this case !!!
52
+ {
53
+ $dateToPay = $todayClone->addDay(15 + $periodFrequency+$i)->getDate()->toString('yyyy-MM-dd');
54
+ break;
55
+ }
56
+ case Allopass_Hipay_Model_PaymentProfile::PERIOD_UNIT_WEEK:
57
+ {
58
+ $dateToPay = $todayClone->addWeek($periodFrequency+$i)->getDate()->toString('yyyy-MM-dd');
59
+ break;
60
+ }
61
+ case Allopass_Hipay_Model_PaymentProfile::PERIOD_UNIT_YEAR:
62
+ {
63
+ $dateToPay = $todayClone->addYear($periodFrequency+$i)->getDate()->toString('yyyy-MM-dd');
64
+ break;
65
+ }
66
+ }
67
+
68
+ $amountToPay = $i==($maxCycles-1) ? ($part + $fmod) : $part;
69
+ $paymentsSplit[] = array('dateToPay'=>$dateToPay,'amountToPay'=>$amountToPay);
70
+ }
71
+
72
+ return $paymentsSplit;
73
+
74
+ }
75
+
76
+ Mage::throwException("Payment Profile not found");
77
+
78
+ }
79
+
80
+ /**
81
+ *
82
+ * @param Mage_Sales_Model_Order $order
83
+ * @param Allopass_Hipay_Model_PaymentProfile|int $profile $profile
84
+ */
85
+ public function insertSplitPayment($order,$profile,$customerId,$cardToken)
86
+ {
87
+
88
+
89
+
90
+ if(is_int($profile))
91
+ $profile = Mage::getModel('hipay/paymentProfile')->load($profile);
92
+
93
+ if(!$this->splitPaymentsExists($order->getId()))
94
+ {
95
+
96
+ $paymentsSplit = $this->splitPayment($profile, $order->getBaseGrandTotal());
97
+
98
+
99
+ //remove first element because is already paid
100
+ array_shift($paymentsSplit);
101
+
102
+
103
+ //remove last element because the first split is already paid
104
+ //array_pop($paymentsSplit);
105
+
106
+ foreach ($paymentsSplit as $split)
107
+ {
108
+ $splitPayment = Mage::getModel('hipay/splitPayment');
109
+ $data = array('order_id'=>$order->getId(),
110
+ 'real_order_id'=>(int)$order->getRealOrderId(),
111
+ 'customer_id'=>$customerId,
112
+ 'card_token'=>$cardToken,
113
+ 'total_amount'=>$order->getBaseGrandTotal(),
114
+ 'amount_to_pay'=>$split['amountToPay'],
115
+ 'date_to_pay'=>$split['dateToPay'],
116
+ 'method_code'=>$order->getPayment()->getMethod(),
117
+ 'status'=>Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_PENDING,
118
+ );
119
+
120
+ $splitPayment->setData($data);
121
+
122
+
123
+ try {
124
+ $splitPayment->save();
125
+ } catch (Exception $e) {
126
+
127
+ Mage::throwException("Error on save split payments!");
128
+ }
129
+ }
130
+
131
+ }
132
+ }
133
+
134
+
135
+ /**
136
+ *
137
+ * @param int $orderId
138
+ * @return boolean
139
+ */
140
+ public function splitPaymentsExists($orderId)
141
+ {
142
+ $collection = Mage::getModel('hipay/splitPayment')->getCollection()->addFieldToFilter('order_id',$orderId);
143
+ if($collection->count())
144
+ return true;
145
+
146
+ return false;
147
+ }
148
+
149
  public function getHipayMethods()
150
  {
151
  $methods = array();
153
  foreach (Mage::getStoreConfig('payment') as $code => $data) {
154
  if(strpos($code, 'hipay') !== false)
155
  {
156
+ if (isset($data['model']))
157
+ $methods[$code] = $data['model'];
158
  }
159
  }
160
 
162
 
163
  }
164
 
165
+ public function checkSignature($signature,$fromNotification = false,$response = null)
166
  {
167
+ $passphrase =$this->getConfig()->getSecretPassphrase();
168
+ if(!is_null($response))
169
+ {
170
+ $orderArr = $response->getOrder();
171
+
172
+ /* @var $order Mage_Sales_Model_Order */
173
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderArr['id']);
174
+
175
+ if($order->getId())
176
+ {
177
+ $method = $order->getPayment()->getMethodInstance();
178
+ if($method->getConfigData('is_test_mode'))
179
+ {
180
+ $passphrase = $this->getConfig()->getSecretPassphraseTest();
181
+ }
182
+ }
183
+ }
184
+
185
+
186
  if(empty($passphrase) || empty($signature))
187
  return true;
188
 
222
  if(!empty($expDate) && !empty($alias))
223
  {
224
  list($expMonth,$expYear) = explode("-", $expDate);
225
+
226
+ return $this->checkIfCcIsExpired($expMonth, $expYear);
227
+
228
+ /*$today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
229
 
230
  $currentYear = (int)$today->getYear()->toString("YY");
231
  $currentMonth = (int)$today->getMonth()->toString("MM");
236
  if($currentYear == (int)$expYear && $currentMonth > (int)$expMonth)
237
  return false;
238
 
239
+ return true;*/
240
 
241
  }
242
 
243
  return false;
244
  }
245
 
246
+ public function checkIfCcIsExpired($expMonth,$expYear)
247
+ {
248
+ $today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
249
+
250
+ $currentYear = (int)$today->getYear()->toString("YY");
251
+ $currentMonth = (int)$today->getMonth()->toString("MM");
252
+
253
+ if($currentYear > (int)$expYear)
254
+ return false;
255
+
256
+ if($currentYear == (int)$expYear && $currentMonth > (int)$expMonth)
257
+ return false;
258
+
259
+ return true;
260
+ }
261
+
262
  /**
263
  *
264
  * @param Mage_Customer_Model_Customer $customer
294
  return $this;
295
  }
296
 
297
+ protected function _cardTokenExist($ccToken,$customer_id=0)
298
+ {
299
+ $cards = Mage::getResourceModel('hipay/card_collection')
300
+ ->addFieldToSelect('card_id')
301
+ ->addFieldToFilter('cc_token', $ccToken);
302
+
303
+ if($customer_id > 0)
304
+ {
305
+ $cards->addFieldToFilter('customer_id', $customer_id);
306
+ }
307
+
308
+ return $cards->count() > 0;
309
+ }
310
+
311
+ public function createCustomerCardFromResponse($customerId,$response,$isRecurring = false)
312
+ {
313
+
314
+ $paymentMethod = $response->getPaymentMethod();
315
+ $paymentProduct = $response->getPaymentProduct();
316
+ $token = isset($paymentMethod['token']) ? $paymentMethod['token'] : $response->getData('cardtoken');
317
+
318
+ if($this->_cardTokenExist($token,$customerId))
319
+ {
320
+ return null;
321
+ }
322
+
323
+ $pan = isset($paymentMethod['pan']) ? $paymentMethod['pan'] : $response->getData('cardpan');
324
+
325
+ $newCard = Mage::getModel('hipay/card');
326
+ $newCard->setCustomerId($customerId);
327
+ $newCard->setCcToken($token);
328
+ $newCard->setCcNumberEnc($pan);
329
+ $newCard->setCcType($paymentProduct);
330
+ $newCard->setCcStatus(Allopass_Hipay_Model_Card::STATUS_ENABLED);
331
+ $newCard->setName($this->__('Card %s - %s',$paymentProduct,$pan));
332
+
333
+ if(isset($paymentMethod['card_expiry_month']) && $paymentMethod['card_expiry_year'])
334
+ {
335
+ $newCard->setCcExpMonth($paymentMethod['card_expiry_month']);
336
+ $newCard->setCcExpYear($paymentMethod['card_expiry_year'] );
337
+ }
338
+ else
339
+ {
340
+ $newCard->setCcExpMonth(substr($response->getData('cardexpiry'), 4,2));
341
+ $newCard->setCcExpYear(substr($response->getData('cardexpiry'), 0,4));
342
+ }
343
+
344
+ try {
345
+ $newCard->save();
346
+ return $newCard;
347
+ } catch (Exception $e) {
348
+ Mage::logException($e);
349
+ }
350
+
351
+ }
352
+
353
  public function reAddToCart($incrementId) {
354
 
355
  $cart = Mage::getSingleton('checkout/cart');
426
  }
427
 
428
  $card = $this->__('Credit Card: xxxx-%s', $payment->getCcLast4());
429
+ $cardType = $this->__('Card type: %s',ucfirst($this->getCcTypeHipay($payment->getCcType())));
430
 
431
+ $pattern = '%s - %s.<br /> %s<br /> %s.<br /> %s';
432
+ $texts = array($operation,$result,$card, $amount,$cardType);
433
 
434
  if (!is_null($lastTransactionId)) {
435
+ $pattern .= '<br />%s.';
436
  $texts[] = $this->__('Hipay Transaction ID %s', $lastTransactionId);
437
  }
438
 
439
  if ($additionalMessage) {
440
+ $pattern .= '<br />%s.';
441
  $texts[] = $additionalMessage;
442
  }
443
+ //$pattern .= '<br />%s';
444
+ //$texts[] = $exception;
445
 
446
  return call_user_func_array(array($this, '__'), array_merge(array($pattern), $texts));
447
  }
456
  {
457
  return $payment->getOrder()->getBaseCurrency()->formatTxt($amount);
458
  }
459
+
460
+
461
+ /**
462
+ * Send email id payment is in Fraud status
463
+ * @param Mage_Customer_Model_Customer $receiver
464
+ * @param Mage_Sales_Model_Order $order
465
+ * @param string $message
466
+ * @return Mage_Checkout_Helper_Data
467
+ */
468
+ public function sendFraudPaymentEmail($receiver,$order, $message,$email_key = 'fraud_payment')
469
+ {
470
+ $translate = Mage::getSingleton('core/translate');
471
+ /* @var $translate Mage_Core_Model_Translate */
472
+ $translate->setTranslateInline(false);
473
+
474
+ $mailTemplate = Mage::getModel('core/email_template');
475
+ /* @var $mailTemplate Mage_Core_Model_Email_Template */
476
+
477
+ $template = Mage::getStoreConfig('hipay/'.$email_key.'/template', $order->getStoreId());
478
+
479
+ $copyTo = $this->_getEmails('hipay/'.$email_key.'/copy_to', $order->getStoreId());
480
+ $copyMethod = Mage::getStoreConfig('hipay/'.$email_key.'/copy_method', $order->getStoreId());
481
+ if ($copyTo && $copyMethod == 'bcc') {
482
+ $mailTemplate->addBcc($copyTo);
483
+ }
484
+
485
+ $sendTo = array(
486
+ array(
487
+ 'email' => $receiver->getEmail(),
488
+ 'name' => $receiver->getName()
489
+ )
490
+ );
491
+
492
+ if ($copyTo && $copyMethod == 'copy') {
493
+ foreach ($copyTo as $email) {
494
+ $sendTo[] = array(
495
+ 'email' => $email,
496
+ 'name' => null
497
+ );
498
+ }
499
+ }
500
+ $shippingMethod = '';
501
+ if ($shippingInfo = $order->getShippingAddress()->getShippingMethod()) {
502
+ $data = explode('_', $shippingInfo);
503
+ $shippingMethod = $data[0];
504
+ }
505
+
506
+ $paymentMethod = '';
507
+ if ($paymentInfo = $order->getPayment()) {
508
+ $paymentMethod = $paymentInfo->getMethod();
509
+ }
510
+
511
+ $items = '';
512
+ foreach ($order->getAllVisibleItems() as $_item) {
513
+ /* @var $_item Mage_Sales_Model_Quote_Item */
514
+ $items .= $_item->getProduct()->getName() . ' x '. $_item->getQty() . ' '
515
+ . $order->getStoreCurrencyCode() . ' '
516
+ . $_item->getProduct()->getFinalPrice($_item->getQty()) . "\n";
517
+ }
518
+ $total = $order->getStoreCurrencyCode() . ' ' . $order->getGrandTotal();
519
+
520
+ foreach ($sendTo as $recipient) {
521
+ $mailTemplate->setDesignConfig(array('area'=>'frontend', 'store'=>$order->getStoreId()))
522
+ ->sendTransactional(
523
+ $template,
524
+ Mage::getStoreConfig('hipay/'.$email_key.'/identity', $order->getStoreId()),
525
+ $recipient['email'],
526
+ $recipient['name'],
527
+ array(
528
+ 'reason' => $message,
529
+ 'dateAndTime' => Mage::app()->getLocale()->date(),
530
+ 'customer' => $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname(),
531
+ 'customerEmail' => $order->getCustomerEmail(),
532
+ 'billingAddress' => $order->getBillingAddress(),
533
+ 'shippingAddress' => $order->getShippingAddress(),
534
+ 'shippingMethod' => Mage::getStoreConfig('carriers/'.$shippingMethod.'/title'),
535
+ 'paymentMethod' => Mage::getStoreConfig('payment/'.$paymentMethod.'/title'),
536
+ 'items' => nl2br($items),
537
+ 'total' => $total
538
+ )
539
+ );
540
+ }
541
+
542
+ $translate->setTranslateInline(true);
543
+
544
+ return $this;
545
+ }
546
+
547
+ protected function _getEmails($configPath, $storeId)
548
+ {
549
+ $data = Mage::getStoreConfig($configPath, $storeId);
550
+ if (!empty($data)) {
551
+ return explode(',', $data);
552
+ }
553
+ return false;
554
+ }
555
+
556
+ /**
557
+ *
558
+ * @return Allopass_Hipay_Model_Config
559
+ */
560
+ protected function getConfig()
561
+ {
562
+ return Mage::getSingleton('hipay/config');
563
+ }
564
+
565
+ public function getCcTypeHipay($ccTypeMagento,$exceptionIfNotFound = false)
566
+ {
567
+ $ccTypes = Mage::getSingleton('hipay/config')->getCcTypesHipay();
568
+
569
+ if(isset($ccTypes[$ccTypeMagento]))
570
+ return $ccTypes[$ccTypeMagento];
571
+
572
+ if($exceptionIfNotFound)
573
+ Mage::throwException(Mage::helper('hipay')->__("Code Credit Card Type Hipay not found!"));
574
+
575
+ return $ccTypeMagento;
576
+ }
577
  }
app/code/community/Allopass/Hipay/Model/Api/Request.php CHANGED
@@ -13,6 +13,7 @@ class Allopass_Hipay_Model_Api_Request
13
  const GATEWAY_ACTION_MAINTENANCE = 'maintenance/transaction/';
14
 
15
  const GATEWAY_ACTION_HOSTED = "hpayment";
 
16
 
17
  /**
18
  *
13
  const GATEWAY_ACTION_MAINTENANCE = 'maintenance/transaction/';
14
 
15
  const GATEWAY_ACTION_HOSTED = "hpayment";
16
+
17
 
18
  /**
19
  *
app/code/community/Allopass/Hipay/Model/Card.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_Card extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+ const STATUS_DISABLED = 0;
6
+ const STATUS_ENABLED = 1;
7
+
8
+ /**
9
+ * Init resource model and id field
10
+ */
11
+ protected function _construct()
12
+ {
13
+ parent::_construct();
14
+ $this->_init('hipay/card');
15
+ $this->setIdFieldName('card_id');
16
+ }
17
+
18
+
19
+
20
+ }
app/code/community/Allopass/Hipay/Model/Config.php CHANGED
@@ -11,6 +11,8 @@ class Allopass_Hipay_Model_Config extends Varien_Object
11
 
12
  const SECRET_PASSPHRASE = 'secret_passphrase';
13
 
 
 
14
  const VAULT_ENDPOINT_TEST = 'vault_endpoint_stage';
15
 
16
  const VAULT_ENDPOINT = 'vault_endpoint_production';
@@ -55,10 +57,15 @@ class Allopass_Hipay_Model_Config extends Varien_Object
55
  }
56
 
57
  public function getSecretPassphrase($storeId =null)
58
- {
59
  return $this->getConfigData(self::SECRET_PASSPHRASE,$storeId);
60
  }
61
 
 
 
 
 
 
62
  public function getApiUsername($storeId =null)
63
  {
64
  return $this->getConfigData(self::API_USERNAME,$storeId);
11
 
12
  const SECRET_PASSPHRASE = 'secret_passphrase';
13
 
14
+ const SECRET_PASSPHRASE_TEST = 'secret_passphrase_test';
15
+
16
  const VAULT_ENDPOINT_TEST = 'vault_endpoint_stage';
17
 
18
  const VAULT_ENDPOINT = 'vault_endpoint_production';
57
  }
58
 
59
  public function getSecretPassphrase($storeId =null)
60
+ {
61
  return $this->getConfigData(self::SECRET_PASSPHRASE,$storeId);
62
  }
63
 
64
+ public function getSecretPassphraseTest($storeId =null)
65
+ {
66
+ return $this->getConfigData(self::SECRET_PASSPHRASE_TEST,$storeId);
67
+ }
68
+
69
  public function getApiUsername($storeId =null)
70
  {
71
  return $this->getConfigData(self::API_USERNAME,$storeId);
app/code/community/Allopass/Hipay/Model/Method/Abstract.php CHANGED
@@ -5,6 +5,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
5
  const OPERATION_AUTHORIZATION = "Authorization";
6
  const OPERATION_MAINTENANCE_CAPTURE = "Capture";
7
  const OPERATION_MAINTENANCE_REFUND = "Refund";
 
 
8
 
9
 
10
  const STATE_COMPLETED = "completed";
@@ -13,6 +15,26 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
13
  const STATE_DECLINED = "declined";
14
  const STATE_ERROR = "error";
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  //const STATUS_PENDING_CAPTURE = 'pending_capture';
17
 
18
  /**
@@ -25,7 +47,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
25
  protected $_canRefund = true;
26
  protected $_canRefundInvoicePartial = true;
27
  protected $_canVoid = true;
28
- protected $_canUseInternal = false;
29
  protected $_canUseCheckout = true;
30
  protected $_canUseForMultishipping = false;
31
  protected $_canSaveCc = false;
@@ -69,8 +91,69 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
69
  return $this;
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  /**
76
  *
@@ -98,6 +181,12 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
98
  $defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
99
  break;
100
  }
 
 
 
 
 
 
101
 
102
  switch ($gatewayResponse->getState())
103
  {
@@ -158,31 +247,83 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
158
  )
159
  );
160
  $state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
161
- if(defined('Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW'))
162
- $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
163
  $status = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
164
-
165
- if($fraudScreening = $gatewayResponse->getFraudScreening())
166
  {
 
 
 
167
 
168
- if(isset($fraudScreening['result'])
169
- && ($fraudScreening['result'] == 'pending' || $fraudScreening['result'] == 'challenged') )
170
- {
171
- if(defined('Mage_Sales_Model_Order::STATUS_FRAUD'))
172
- $status = Mage_Sales_Model_Order::STATUS_FRAUD;
173
-
174
- }
175
 
176
- }
177
 
178
  $order->setState($state,$status,$gatewayResponse->getMessage());
179
 
 
 
 
180
  $order->save();
181
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  case 116: //Authorized
184
 
185
- if($order->getStatus() == 'capture_requested' || $order->getStatus() == 'processing' )// for logic process
 
186
  break;
187
  if(!$this->isPreauthorizeCapture($payment))
188
  $this->addTransaction(
@@ -192,13 +333,13 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
192
  array('is_transaction_closed' => 0),
193
  array(),
194
  Mage::helper('hipay')->getTransactionMessage(
195
- $payment, self::OPERATION_AUTHORIZATION, /*$gatewayResponse->getTransactionReference()*/null, $amount
196
  )
197
  );
198
 
199
  $order->setState(
200
  Mage_Sales_Model_Order::STATE_PROCESSING,
201
- 'pending_capture',
202
  Mage::helper('hipay')
203
  ->__("Waiting for capture transaction ID '%s' of amount %s",
204
  $gatewayResponse->getTransactionReference(),
@@ -210,6 +351,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
210
  $order->sendNewOrderEmail();
211
  }
212
 
 
 
213
 
214
 
215
  break;
@@ -225,7 +368,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
225
  array('is_transaction_closed' => 0),
226
  array(),
227
  Mage::helper('hipay')->getTransactionMessage(
228
- $payment, self::OPERATION_SALE, /*$gatewayResponse->getTransactionReference()*/null, $amount
229
  )
230
  );
231
 
@@ -234,12 +377,12 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
234
  $order->setState(
235
  Mage_Sales_Model_Order::STATE_PROCESSING, 'capture_requested', $message, null, false
236
  );
 
 
 
237
 
238
- if(((int)$this->getConfigData('hipay_status_validate_order') == 117) === false /*&& $payment->getCcType() != 'AE'*/ )
239
  break;
240
- /*else {
241
- $order->save();
242
- }*/
243
 
244
  case 118: //Capture
245
 
@@ -255,7 +398,8 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
255
  // Create invoice
256
  if ($this->getConfigData('invoice_create',$order->getStoreId()) && !$order->hasInvoices()) {
257
 
258
- $invoice = $this->create_invoice($order, $gatewayResponse->getTransactionReference());
 
259
  Mage::getModel('core/resource_transaction')
260
  ->addObject($invoice)->addObject($invoice->getOrder())
261
  ->save();
@@ -265,7 +409,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
265
  {
266
  foreach ($order->getInvoiceCollection() as $invoice)
267
  {
268
- if($invoice->getState() == Mage_Sales_Model_Order_Invoice::STATE_OPEN && $invoice->getBaseGrandTotal() == $gatewayResponse->getCapturedAmount())
269
  {
270
  $invoice->pay();
271
  Mage::getModel('core/resource_transaction')
@@ -276,6 +420,12 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
276
  }
277
  }
278
 
 
 
 
 
 
 
279
 
280
  if (!$status = $this->getConfigData('order_status_payment_accepted')) {
281
  $status = $order->getStatus();
@@ -297,11 +447,10 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
297
  $order->addStatusToHistory($status, $message, true);
298
  }
299
 
 
 
300
 
301
 
302
-
303
-
304
-
305
  if (!$order->getEmailSent()) {
306
  $order->sendNewOrderEmail();
307
  }
@@ -321,11 +470,27 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
321
 
322
  if($order->hasCreditmemos())
323
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
325
  foreach ($order->getCreditmemosCollection() as $creditmemo)
326
  {
327
  if($creditmemo->getState() == Mage_Sales_Model_Order_Creditmemo::STATE_OPEN
328
- && $creditmemo->getGrandTotal() == $gatewayResponse->getRefundedAmount())
329
  {
330
  $creditmemo->setState(Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED);
331
 
@@ -357,20 +522,27 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
357
  $transactionSave->save();
358
  }
359
 
 
 
 
 
360
  break;
361
  }
362
 
363
 
364
- if(in_array($gatewayResponse->getPaymentProduct(), array('visa','american-express','mastercard','cb'))
365
- && ((int)$gatewayResponse->getEci() == 9 || $payment->getAdditionalInformation('create_oneclick'))
366
- && !$order->isNominal()) //Recurring E-commerce
367
- {
368
-
369
- if($customer->getId())
370
- {
371
- $this->responseToCustomer($customer,$gatewayResponse);
372
-
373
- }
 
 
 
374
  }
375
  $order->save();
376
  break;
@@ -417,22 +589,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
417
  $status = $order->getStatus();
418
  }
419
 
420
- if($fraudScreening = $gatewayResponse->getFraudScreening())
421
- {
422
-
423
- if(isset($fraudScreening['result']) && $fraudScreening['result'] == 'blocked' )
424
- {
425
- $payment->setIsFraudDetected(true);
426
-
427
- if(defined('Mage_Sales_Model_Order::STATUS_FRAUD'))
428
- $status = Mage_Sales_Model_Order::STATUS_FRAUD;
429
-
430
- $order->addStatusToHistory($status, Mage::helper('hipay')->getTransactionMessage(
431
- $payment, $this->getOperation(), null, $amount,true,$gatewayResponse->getMessage()
432
- ));
433
- }
434
-
435
- }
436
 
437
 
438
 
@@ -458,6 +615,50 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
458
 
459
  }
460
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
  /**
463
  * Create object invoice
@@ -467,12 +668,20 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
467
  * @param boolean $paid
468
  * @return Mage_Sales_Model_Order_Invoice $invoice
469
  */
470
- protected function create_invoice($order,$transactionReference,$capture = true,$paid = true)
471
  {
 
472
  $invoice = $order->prepareInvoice();
473
  $invoice->setTransactionId($transactionReference);
474
- if($capture)
475
- $invoice->register()->capture();
 
 
 
 
 
 
 
476
 
477
  if($paid)
478
  $invoice->setIsPaid(1);
@@ -504,11 +713,16 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
504
  $defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
505
  break;
506
  }
 
 
 
 
 
507
 
508
  switch ($gatewayResponse->getState())
509
  {
510
  case self::STATE_COMPLETED:
511
- return Mage::getUrl('checkout/onepage/success');
512
 
513
  case self::STATE_FORWARDING:
514
  $payment->setIsTransactionPending(1);
@@ -519,14 +733,14 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
519
  if($this->getConfigData('re_add_to_cart'))
520
  $this->getHelper()->reAddToCart($order->getIncrementId());
521
 
522
- return Mage::getUrl($this->getConfigData('pending_redirect_page'));
523
 
524
  case self::STATE_DECLINED:
525
 
526
  if($this->getConfigData('re_add_to_cart'))
527
  $this->getHelper()->reAddToCart($order->getIncrementId());
528
 
529
- return Mage::getUrl('checkout/onepage/failure');
530
 
531
  case self::STATE_ERROR:
532
  default:
@@ -535,7 +749,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
535
  $this->getHelper()->reAddToCart($order->getIncrementId());
536
 
537
  $this->_getCheckout()->setErrorMessage($defaultExceptionMessage);
538
- return Mage::getUrl('checkout/onepage/failure');
539
 
540
  }
541
  }
@@ -558,6 +772,7 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
558
  protected function responseToCustomer($customer,$response)
559
  {
560
  $this->getHelper()->responseToCustomer($customer,$response);
 
561
  return $this;
562
  }
563
 
@@ -619,15 +834,44 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
619
  $params['orderid'] = $payment->getOrder()->getIncrementId();
620
 
621
  $paymentProduct = null;
622
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  $params['description'] = Mage::helper('hipay')->__("Order %s by %s",$payment->getOrder()->getIncrementId(),$payment->getOrder()->getCustomerEmail());//MANDATORY
624
- $params['long_description'] = "";// optional
625
  $params['currency'] = $payment->getOrder()->getOrderCurrencyCode();
626
  $params['amount'] = $amount;
627
  $params['shipping'] = $payment->getOrder()->getShippingAmount();
628
  $params['tax'] = $payment->getOrder()->getTaxAmount();
629
  $params['cid'] = $payment->getOrder()->getCustomerId();//CUSTOMER ID
630
- $params['ipaddr'] = !is_null($payment->getOrder()->getXForwardedFor()) ? $payment->getOrder()->getXForwardedFor() : $payment->getOrder()->getRemoteIp();
 
 
 
 
 
 
 
 
 
 
631
 
632
  $params['http_accept'] = "*/*";
633
  $params['http_user_agent'] = Mage::helper('core/http')->getHttpUserAgent();
@@ -646,10 +890,19 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
646
  $params['authentication_indicator'] = 1;
647
  break;
648
  case 2:
 
649
  /* @var $rule Allopass_Hipay_Model_Rule */
650
  $rule = Mage::getModel('hipay/rule')->load($this->getConfigData('config_3ds_rules'));
651
- if($rule->getId())
652
- $params['authentication_indicator'] = (int)$rule->validate($payment->getOrder());
 
 
 
 
 
 
 
 
653
  break;
654
  }
655
 
@@ -663,14 +916,18 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
663
  /**
664
  * Redirect urls
665
  */
666
- $params['accept_url'] = Mage::getUrl($this->getConfigData('accept_url'));
667
- $params['decline_url'] = Mage::getUrl($this->getConfigData('decline_url'));
668
- $params['pending_url'] = Mage::getUrl($this->getConfigData('pending_url'));
669
- $params['exception_url'] = Mage::getUrl($this->getConfigData('exception_url'));
670
- $params['cancel_url'] = Mage::getUrl($this->getConfigData('cancel_url'));
 
671
 
672
  $params = $this->getCustomerParams($payment,$params);
673
  $params = $this->getShippingParams($payment,$params);
 
 
 
674
 
675
 
676
  return $params;
@@ -716,7 +973,9 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
716
  $params['streetaddress2'] = $order->getBillingAddress()->getStreet2();
717
  $params['city'] = $order->getBillingAddress()->getCity();
718
  //$params['state'] = $order->getBillingAddress(); //TODO checck if country is US or Canada
719
- $params['zipcode'] = $order->getBillingAddress()->getPostcode();
 
 
720
  $params['country'] = $order->getBillingAddress()->getCountry();
721
 
722
  return $params;
@@ -745,6 +1004,45 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
745
  $params['shipto_country'] = $shippingAddress->getCountry();
746
 
747
  return $params;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  }
749
 
750
  /**
@@ -756,12 +1054,18 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
756
  protected function isPreauthorizeCapture($payment)
757
  {
758
  $lastTransaction = $payment->getTransaction($payment->getLastTransId());
759
- if (!$lastTransaction
760
- || (($this->getOperation() == self::OPERATION_SALE) && ($lastTransaction->getTxnType() == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH ) )
761
- || $lastTransaction->getTxnType() != Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH
762
- ) {
 
 
 
 
 
 
 
763
  return false;
764
- }
765
 
766
  return true;
767
  }
@@ -902,13 +1206,6 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
902
  $transaction->setIsClosed((int)$payment->getIsTransactionClosed());
903
  }
904
 
905
- //set transaction addition information
906
- /*if ($payment->_transactionAdditionalInfo) {
907
- foreach ($payment->_transactionAdditionalInfo as $key => $value) {
908
- $transaction->setAdditionalInformation($key, $value);
909
- }
910
- }*/
911
-
912
  // link with sales entities
913
  $payment->setLastTransId($transactionId);
914
  $payment->setCreatedTransaction($transaction);
@@ -985,6 +1282,30 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
985
  }*/
986
  return true;
987
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
 
989
 
990
  /**
@@ -1030,6 +1351,11 @@ abstract class Allopass_Hipay_Model_Method_Abstract extends Mage_Payment_Model_M
1030
  $this->_debug($debugData);
1031
  }
1032
 
 
 
 
 
 
1033
 
1034
 
1035
  }
5
  const OPERATION_AUTHORIZATION = "Authorization";
6
  const OPERATION_MAINTENANCE_CAPTURE = "Capture";
7
  const OPERATION_MAINTENANCE_REFUND = "Refund";
8
+ const OPERATION_MAINTENANCE_ACCEPT_CHALLENGE = 'acceptChallenge';
9
+ const OPERATION_MAINTENANCE_DENY_CHALLENGE = 'denyChallenge';
10
 
11
 
12
  const STATE_COMPLETED = "completed";
15
  const STATE_DECLINED = "declined";
16
  const STATE_ERROR = "error";
17
 
18
+ const STATUS_AUTHORIZATION_REQUESTED = 'authorization_requested';
19
+ const STATUS_EXPIRED = 'expired';
20
+ const STATUS_PARTIAL_REFUND = 'partial_refund';
21
+ const STATUS_PARTIAL_CAPTURE = 'partial_capture';
22
+ const STATUS_CAPTURE_REQUESTED = 'capture_requested';
23
+ const STATUS_PENDING_CAPTURE = 'pending_capture';
24
+
25
+ /**
26
+ * Bit masks to specify different payment method checks.
27
+ * @see Mage_Payment_Model_Method_Abstract::isApplicableToQuote
28
+ */
29
+ const CHECK_USE_FOR_COUNTRY = 1;
30
+ const CHECK_USE_FOR_CURRENCY = 2;
31
+ const CHECK_USE_CHECKOUT = 4;
32
+ const CHECK_USE_FOR_MULTISHIPPING = 8;
33
+ const CHECK_USE_INTERNAL = 16;
34
+ const CHECK_ORDER_TOTAL_MIN_MAX = 32;
35
+ const CHECK_RECURRING_PROFILES = 64;
36
+ const CHECK_ZERO_TOTAL = 128;
37
+
38
  //const STATUS_PENDING_CAPTURE = 'pending_capture';
39
 
40
  /**
47
  protected $_canRefund = true;
48
  protected $_canRefundInvoicePartial = true;
49
  protected $_canVoid = true;
50
+ protected $_canUseInternal = true;
51
  protected $_canUseCheckout = true;
52
  protected $_canUseForMultishipping = false;
53
  protected $_canSaveCc = false;
91
  return $this;
92
  }
93
 
94
+ public function assignInfoData($info,$data)
95
+ {
96
+ $info->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
97
+ ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
98
+ ->setAdditionalInformation('selected_oneclick_card',$data->getOneclickCard() == "" ? 0 : $data->getOneclickCard())
99
+ ->setAdditionalInformation('split_payment_id',$data->getSplitPaymentId() != "" ? $data->getSplitPaymentId() : 0);
100
+
101
+
102
+ }
103
+
104
 
105
+ public function acceptPayment(Mage_Payment_Model_Info $payment)
106
+ {
107
+ parent::acceptPayment($payment);
108
+ $transactionId = $payment->getLastTransId();
109
+ $amount = $payment->getAmountAuthorized();
110
+
111
+ $transactionId = $payment->getLastTransId();
112
+
113
+ $gatewayParams = array('operation'=>self::OPERATION_MAINTENANCE_ACCEPT_CHALLENGE,'amount'=>$amount);
114
+ $this->_debug($gatewayParams);
115
+ /* @var $request Allopass_Hipay_Model_Api_Request */
116
+ $request = Mage::getModel('hipay/api_request',array($this));
117
+ $uri = Allopass_Hipay_Model_Api_Request::GATEWAY_ACTION_MAINTENANCE . $transactionId;
118
+
119
+ $gatewayResponse = $request->gatewayRequest($uri,$gatewayParams,$payment->getOrder()->getStoreId());
120
+
121
+ $this->_debug($gatewayResponse->debug());
122
+ $receiver = Mage::getModel('customer/customer')->load($payment->getOrder()->getCustomerId());
123
+ $message = Mage::helper('hipay')->__('Your transaction has been approved.');
124
+ $email_key = "fraud_payment_accept";
125
+ $this->getHelper()->sendFraudPaymentEmail($receiver, $payment->getOrder(), $message,$email_key);
126
+
127
+ return $this;
128
+ }
129
 
130
+ public function denyPayment(Mage_Payment_Model_Info $payment)
131
+ {
132
+
133
+ /*@var $payment Mage_Sales_Model_Order_Payment */
134
+ parent::denyPayment($payment);
135
+ $transactionId = $payment->getLastTransId();
136
+ $amount = $payment->getAmountAuthorized();
137
+
138
+ $transactionId = $payment->getLastTransId();
139
+
140
+ $gatewayParams = array('operation'=>self::OPERATION_MAINTENANCE_DENY_CHALLENGE,'amount'=>$amount);
141
+ $this->_debug($gatewayParams);
142
+ /* @var $request Allopass_Hipay_Model_Api_Request */
143
+ $request = Mage::getModel('hipay/api_request',array($this));
144
+ $uri = Allopass_Hipay_Model_Api_Request::GATEWAY_ACTION_MAINTENANCE . $transactionId;
145
+
146
+ $gatewayResponse = $request->gatewayRequest($uri,$gatewayParams,$payment->getOrder()->getStoreId());
147
+
148
+ $this->_debug($gatewayResponse->debug());
149
+
150
+ $receiver = Mage::getModel('customer/customer')->load($payment->getOrder()->getCustomerId());
151
+ $message = Mage::helper('hipay')->__('Your transaction has been refused.');
152
+ $email_key = "fraud_payment_deny";
153
+ $this->getHelper()->sendFraudPaymentEmail($receiver, $payment->getOrder(), $message,$email_key);
154
+
155
+ return $this;
156
+ }
157
 
158
  /**
159
  *
181
  $defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
182
  break;
183
  }
184
+
185
+ //add data to payment object
186
+ if($payment->getCcType() == "")
187
+ {
188
+ $payment->setCcType($gatewayResponse->getPaymentProduct());
189
+ }
190
 
191
  switch ($gatewayResponse->getState())
192
  {
247
  )
248
  );
249
  $state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
 
 
250
  $status = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
251
+ if(defined('Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW'))
 
252
  {
253
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
254
+ $status = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
255
+ }
256
 
 
 
 
 
 
 
 
257
 
258
+ $this->_setFraudDetected($gatewayResponse,$customer, $payment,$amount);
259
 
260
  $order->setState($state,$status,$gatewayResponse->getMessage());
261
 
262
+ $payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
263
+ $payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
264
+
265
  $order->save();
266
  break;
267
+
268
+ case 142: //Authorized Requested
269
+ if($order->getStatus() == self::STATUS_CAPTURE_REQUESTED || $order->getStatus() == Mage_Sales_Model_Order::STATE_PROCESSING
270
+ || $order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE || $order->getStatus() == Mage_Sales_Model_Order::STATE_CLOSED
271
+ || $order->getStatus() == self::STATUS_PENDING_CAPTURE )// for logic process
272
+ break;
273
+
274
+ $this->addTransaction(
275
+ $payment,
276
+ $gatewayResponse->getTransactionReference(),
277
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
278
+ array('is_transaction_closed' => 0),
279
+ array(
280
+ $this->_realTransactionIdKey => $gatewayResponse->getTransactionReference(),
281
+ ),
282
+ Mage::helper('hipay')->getTransactionMessage(
283
+ $payment, self::OPERATION_AUTHORIZATION, $gatewayResponse->getTransactionReference(), $amount,true
284
+ )
285
+ );
286
+ $state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
287
+ if(defined('Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW'))
288
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
289
+ $status = self::STATUS_AUTHORIZATION_REQUESTED;
290
+
291
+ $order->setState($state,$status,$gatewayResponse->getMessage());
292
+
293
+ $payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
294
+ $payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
295
+
296
+ $order->save();
297
+ break;
298
+
299
+ case 114: //Expired
300
+ if($order->getStatus() != self::STATUS_PENDING_CAPTURE)// for logic process
301
+ break;
302
+
303
+ $this->addTransaction(
304
+ $payment,
305
+ $gatewayResponse->getTransactionReference(),
306
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID,
307
+ array('is_transaction_closed' => 1),
308
+ array(
309
+ $this->_realTransactionIdKey => $gatewayResponse->getTransactionReference(),
310
+ ),
311
+ Mage::helper('hipay')->getTransactionMessage(
312
+ $payment, self::OPERATION_AUTHORIZATION, $gatewayResponse->getTransactionReference(), $amount,true
313
+ )
314
+ );
315
+ $state = Mage_Sales_Model_Order::STATE_CLOSED;
316
+ $status = self::STATUS_EXPIRED;
317
+
318
+ $order->setState($state,$status,$gatewayResponse->getMessage());
319
+
320
+ $order->save();
321
+ break;
322
 
323
  case 116: //Authorized
324
 
325
+ if($order->getStatus() == 'capture_requested' /*|| $order->getStatus() == 'processing' */ //uncommented for payment review
326
+ || $order->getStatus() == 'complete' || $order->getStatus() == 'closed' )// for logic process
327
  break;
328
  if(!$this->isPreauthorizeCapture($payment))
329
  $this->addTransaction(
333
  array('is_transaction_closed' => 0),
334
  array(),
335
  Mage::helper('hipay')->getTransactionMessage(
336
+ $payment, self::OPERATION_AUTHORIZATION, null, $amount
337
  )
338
  );
339
 
340
  $order->setState(
341
  Mage_Sales_Model_Order::STATE_PROCESSING,
342
+ self::STATUS_PENDING_CAPTURE,
343
  Mage::helper('hipay')
344
  ->__("Waiting for capture transaction ID '%s' of amount %s",
345
  $gatewayResponse->getTransactionReference(),
351
  $order->sendNewOrderEmail();
352
  }
353
 
354
+ $payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
355
+ $payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
356
 
357
 
358
  break;
368
  array('is_transaction_closed' => 0),
369
  array(),
370
  Mage::helper('hipay')->getTransactionMessage(
371
+ $payment, self::OPERATION_SALE, null, $amount
372
  )
373
  );
374
 
377
  $order->setState(
378
  Mage_Sales_Model_Order::STATE_PROCESSING, 'capture_requested', $message, null, false
379
  );
380
+
381
+ $payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
382
+ $payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
383
 
384
+ if(((int)$this->getConfigData('hipay_status_validate_order') == 117) === false )
385
  break;
 
 
 
386
 
387
  case 118: //Capture
388
 
398
  // Create invoice
399
  if ($this->getConfigData('invoice_create',$order->getStoreId()) && !$order->hasInvoices()) {
400
 
401
+ $invoice = $this->create_invoice($order, $gatewayResponse->getTransactionReference(),false);
402
+
403
  Mage::getModel('core/resource_transaction')
404
  ->addObject($invoice)->addObject($invoice->getOrder())
405
  ->save();
409
  {
410
  foreach ($order->getInvoiceCollection() as $invoice)
411
  {
412
+ if($invoice->getState() == Mage_Sales_Model_Order_Invoice::STATE_OPEN && round(($invoice->getBaseGrandTotal() + $order->getBaseTotalPaid()),2) == $gatewayResponse->getCapturedAmount())
413
  {
414
  $invoice->pay();
415
  Mage::getModel('core/resource_transaction')
420
  }
421
  }
422
 
423
+ if(($profile = (int)$payment->getAdditionalInformation('split_payment_id')) && $customer->getId())
424
+ {
425
+ $token = isset( $gatewayResponse->paymentMethod['token']) ? $gatewayResponse->paymentMethod['token'] : $gatewayResponse->getData('cardtoken');
426
+ $this->getHelper()->insertSplitPayment($order, $profile,$customer->getId(),$token);
427
+ }
428
+
429
 
430
  if (!$status = $this->getConfigData('order_status_payment_accepted')) {
431
  $status = $order->getStatus();
447
  $order->addStatusToHistory($status, $message, true);
448
  }
449
 
450
+ $payment->setAmountAuthorized($gatewayResponse->getAuthorizedAmount());
451
+ $payment->setBaseAmountAuthorized($gatewayResponse->getAuthorizedAmount());
452
 
453
 
 
 
 
454
  if (!$order->getEmailSent()) {
455
  $order->sendNewOrderEmail();
456
  }
470
 
471
  if($order->hasCreditmemos())
472
  {
473
+
474
+ $total_already_refunded = 0;
475
+
476
+ /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
477
+ //We get total already refunded for found the amount of this creditmemo
478
+ foreach ($order->getCreditmemosCollection() as $creditmemo)
479
+ {
480
+ if($creditmemo->getState() == Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED)
481
+ {
482
+ $total_already_refunded += $creditmemo->getGrandTotal();
483
+ }
484
+ }
485
+
486
+ $cm_amount_check = round($gatewayResponse->getRefundedAmount() - $total_already_refunded,2);
487
+
488
+
489
  /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
490
  foreach ($order->getCreditmemosCollection() as $creditmemo)
491
  {
492
  if($creditmemo->getState() == Mage_Sales_Model_Order_Creditmemo::STATE_OPEN
493
+ && round($creditmemo->getGrandTotal(),2) == $cm_amount_check)
494
  {
495
  $creditmemo->setState(Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED);
496
 
522
  $transactionSave->save();
523
  }
524
 
525
+ break;
526
+ default:
527
+ $message = Mage::helper("hipay")->__('Message Hipay: %s. Status: %s',$gatewayResponse->getMessage(),$gatewayResponse->getStatus());
528
+ $order->addStatusToHistory($order->getStatus(), $message);
529
  break;
530
  }
531
 
532
 
533
+ if($gatewayResponse->getState() == self::STATE_COMPLETED)
534
+ {
535
+ if(in_array($gatewayResponse->getPaymentProduct(), array('visa','american-express','mastercard','cb'))
536
+ && ((int)$gatewayResponse->getEci() == 9 || $payment->getAdditionalInformation('create_oneclick'))
537
+ && !$order->isNominal()) //Recurring E-commerce
538
+ {
539
+
540
+ if($customer->getId())
541
+ {
542
+ $this->responseToCustomer($customer,$gatewayResponse);
543
+
544
+ }
545
+ }
546
  }
547
  $order->save();
548
  break;
589
  $status = $order->getStatus();
590
  }
591
 
592
+ $this->_setFraudDetected($gatewayResponse,$customer, $payment,$amount,true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
 
594
 
595
 
615
 
616
  }
617
  }
618
+
619
+ /**
620
+ *
621
+ * @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
622
+ * @param Mage_Sales_Model_Order_Payment $payment
623
+ */
624
+ protected function _setFraudDetected($gatewayResponse,$customer,$payment,$amount,$addToHistory = false)
625
+ {
626
+
627
+
628
+ if($fraudScreening = $gatewayResponse->getFraudScreening())
629
+ {
630
+
631
+ if(isset($fraudScreening['result']) && isset($fraudScreening['scoring']))
632
+ {
633
+ $order = $payment->getOrder();
634
+ $payment->setIsFraudDetected(true);
635
+
636
+ if(defined('Mage_Sales_Model_Order::STATUS_FRAUD'))
637
+ $status = Mage_Sales_Model_Order::STATUS_FRAUD;
638
+
639
+ $payment->setAdditionalInformation('fraud_type',$fraudScreening['result']);
640
+ $payment->setAdditionalInformation('fraud_score',$fraudScreening['scoring']);
641
+ $payment->setAdditionalInformation('fraud_review',$fraudScreening['review']);
642
+
643
+ if($addToHistory)
644
+ $order->addStatusToHistory($status, Mage::helper('hipay')->getTransactionMessage(
645
+ $payment, $this->getOperation(), null, $amount,true,$gatewayResponse->getMessage()
646
+ ));
647
+
648
+ $message = Mage::helper('hipay')->__($gatewayResponse->getMessage());
649
+
650
+ if($this->getConfigData('send_fraud_payment_email',$order->getStoreId()));
651
+ {
652
+ $email_key='fraud_payment';
653
+ if($fraudScreening['result'] != 'challenged' || $gatewayResponse->getState() == self::STATE_DECLINED)
654
+ $email_key = 'fraud_payment_deny';
655
+
656
+ $this->getHelper()->sendFraudPaymentEmail($customer, $order, $message,$email_key);
657
+ }
658
+ }
659
+
660
+ }
661
+ }
662
 
663
  /**
664
  * Create object invoice
668
  * @param boolean $paid
669
  * @return Mage_Sales_Model_Order_Invoice $invoice
670
  */
671
+ protected function create_invoice($order,$transactionReference,$capture = true,$paid = false)
672
  {
673
+ /* @var $invoice Mage_Sales_Model_Order_Invoice */
674
  $invoice = $order->prepareInvoice();
675
  $invoice->setTransactionId($transactionReference);
676
+
677
+ $capture_case = Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE;
678
+ if($capture)
679
+ $capture_case = Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE;
680
+ $invoice->setRequestedCaptureCase($capture_case);
681
+
682
+ $invoice->register();
683
+
684
+ $invoice->getOrder()->setIsInProcess(true);
685
 
686
  if($paid)
687
  $invoice->setIsPaid(1);
713
  $defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
714
  break;
715
  }
716
+
717
+ $urlAdmin = Mage::getUrl('adminhtml/sales_order/index');
718
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
719
+ $urlAdmin = Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId()));
720
+ }
721
 
722
  switch ($gatewayResponse->getState())
723
  {
724
  case self::STATE_COMPLETED:
725
+ return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/success');
726
 
727
  case self::STATE_FORWARDING:
728
  $payment->setIsTransactionPending(1);
733
  if($this->getConfigData('re_add_to_cart'))
734
  $this->getHelper()->reAddToCart($order->getIncrementId());
735
 
736
+ return $this->isAdmin() ? $urlAdmin : Mage::getUrl($this->getConfigData('pending_redirect_page'));
737
 
738
  case self::STATE_DECLINED:
739
 
740
  if($this->getConfigData('re_add_to_cart'))
741
  $this->getHelper()->reAddToCart($order->getIncrementId());
742
 
743
+ return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/failure');
744
 
745
  case self::STATE_ERROR:
746
  default:
749
  $this->getHelper()->reAddToCart($order->getIncrementId());
750
 
751
  $this->_getCheckout()->setErrorMessage($defaultExceptionMessage);
752
+ return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/failure');
753
 
754
  }
755
  }
772
  protected function responseToCustomer($customer,$response)
773
  {
774
  $this->getHelper()->responseToCustomer($customer,$response);
775
+ $this->getHelper()->createCustomerCardFromResponse($customer->getId(), $response);
776
  return $this;
777
  }
778
 
834
  $params['orderid'] = $payment->getOrder()->getIncrementId();
835
 
836
  $paymentProduct = null;
837
+
838
+ $longDesc ="";
839
+
840
+ if(($profile = $payment->getAdditionalInformation('split_payment_id')))
841
+ {
842
+ //Check if this order is already split
843
+ $spCollection = Mage::getModel('hipay/splitPayment')->getCollection()
844
+ ->addFieldToFilter('order_id',$payment->getOrder()->getId());
845
+
846
+ if(!$spCollection->count())
847
+ {
848
+ $longDesc = Mage::helper('hipay')->__('Split payment');
849
+ $paymentsSplit = $this->getHelper()->splitPayment((int)$profile, $amount);
850
+ Mage::log($paymentsSplit,null,'hipay_split_debug.log');
851
+
852
+ $amount = $paymentsSplit[0]['amountToPay'];
853
+ }
854
+
855
+ }
856
+
857
  $params['description'] = Mage::helper('hipay')->__("Order %s by %s",$payment->getOrder()->getIncrementId(),$payment->getOrder()->getCustomerEmail());//MANDATORY
858
+ $params['long_description'] = $longDesc;// optional
859
  $params['currency'] = $payment->getOrder()->getOrderCurrencyCode();
860
  $params['amount'] = $amount;
861
  $params['shipping'] = $payment->getOrder()->getShippingAmount();
862
  $params['tax'] = $payment->getOrder()->getTaxAmount();
863
  $params['cid'] = $payment->getOrder()->getCustomerId();//CUSTOMER ID
864
+
865
+ $remoteIp = $payment->getOrder()->getRemoteIp();
866
+
867
+ //Check if it's forwarded and in this case, explode and retrieve the first part
868
+ if(!is_null($payment->getOrder()->getXForwardedFor()) && strpos($payment->getOrder()->getXForwardedFor(), ",") !== false)
869
+ {
870
+ $xfParts = explode(",",$payment->getOrder()->getXForwardedFor());
871
+ $remoteIp = current($xfParts);
872
+ }
873
+
874
+ $params['ipaddr'] = $remoteIp;
875
 
876
  $params['http_accept'] = "*/*";
877
  $params['http_user_agent'] = Mage::helper('core/http')->getHttpUserAgent();
890
  $params['authentication_indicator'] = 1;
891
  break;
892
  case 2:
893
+ case 3:
894
  /* @var $rule Allopass_Hipay_Model_Rule */
895
  $rule = Mage::getModel('hipay/rule')->load($this->getConfigData('config_3ds_rules'));
896
+ if($rule->getId() && $rule->validate($payment->getOrder()) )
897
+ {
898
+ $params['authentication_indicator'] = 1;
899
+ if((int)$this->getConfigData('use_3d_secure') == 3)//case for force 3ds if rules are validated
900
+ $params['authentication_indicator'] = 2;
901
+
902
+ }
903
+ break;
904
+ case 4:
905
+ $params['authentication_indicator'] = 2;
906
  break;
907
  }
908
 
916
  /**
917
  * Redirect urls
918
  */
919
+ $isAdmin = $this->isAdmin();
920
+ $params['accept_url'] = $isAdmin ? Mage::getUrl('hipay/adminhtml_payment/accept') : Mage::getUrl($this->getConfigData('accept_url'));
921
+ $params['decline_url'] = $isAdmin ? Mage::getUrl('hipay/adminhtml_payment/decline') : Mage::getUrl($this->getConfigData('decline_url'));
922
+ $params['pending_url'] = $isAdmin ? Mage::getUrl('hipay/adminhtml_payment/pending') : Mage::getUrl($this->getConfigData('pending_url'));
923
+ $params['exception_url'] = $isAdmin ? Mage::getUrl('hipay/adminhtml_payment/exception') : Mage::getUrl($this->getConfigData('exception_url'));
924
+ $params['cancel_url'] = $isAdmin ? Mage::getUrl('hipay/adminhtml_payment/cancel') : Mage::getUrl($this->getConfigData('cancel_url'));
925
 
926
  $params = $this->getCustomerParams($payment,$params);
927
  $params = $this->getShippingParams($payment,$params);
928
+
929
+ //add url to order in BO Magento
930
+ $params['cdata1'] = Mage::getUrl('adminhtml/sales_order/view',array('_secure'=>true,'order_id'=>$payment->getOrder()->getId()));
931
 
932
 
933
  return $params;
973
  $params['streetaddress2'] = $order->getBillingAddress()->getStreet2();
974
  $params['city'] = $order->getBillingAddress()->getCity();
975
  //$params['state'] = $order->getBillingAddress(); //TODO checck if country is US or Canada
976
+ $zipcode = explode('-',$order->getBillingAddress()->getPostcode());
977
+ $params['zipcode'] = $zipcode[0];
978
+ //$params['zipcode'] = $order->getBillingAddress()->getPostcode();
979
  $params['country'] = $order->getBillingAddress()->getCountry();
980
 
981
  return $params;
1004
  $params['shipto_country'] = $shippingAddress->getCountry();
1005
 
1006
  return $params;
1007
+ }
1008
+
1009
+ /**
1010
+ *
1011
+ * @param Allopass_Hipay_Model_SplitPayment $spiltPayment
1012
+ */
1013
+ public function paySplitPayment($splitPayment)
1014
+ {
1015
+ $request = Mage::getModel('hipay/api_request',array($this));
1016
+
1017
+ $order = Mage::getModel('sales/order')->load($splitPayment->getOrderId());
1018
+ if($order->getId())
1019
+ {
1020
+ $gatewayParams = $this->getGatewayParams($order->getPayment(), $splitPayment->getAmountToPay());
1021
+ $gatewayParams['orderid'] .= "-split-".$splitPayment->getId();//added because if the same order_id tpp respond "Max Attempts exceed!"
1022
+ $gatewayParams['description'] = Mage::helper('hipay')->__("Order SPLIT %s by %s",$order->getIncrementId(),$order->getCustomerEmail());//MANDATORY;
1023
+ $gatewayParams['eci'] = 9;
1024
+ $gatewayParams['operation'] =self::OPERATION_SALE;
1025
+ $gatewayParams['payment_product'] = $this->getCcTypeHipay($order->getPayment()->getCcType());
1026
+
1027
+ /**
1028
+ * Parameters specific to the payment product
1029
+ */
1030
+ $gatewayParams['cardtoken'] = $splitPayment->getCardToken();
1031
+
1032
+ $gatewayParams['authentication_indicator'] = 0;//$this->getConfigData('use_3d_secure');
1033
+ $this->_debug($gatewayParams);
1034
+
1035
+ $gatewayResponse = $request->gatewayRequest(Allopass_Hipay_Model_Api_Request::GATEWAY_ACTION_ORDER,$gatewayParams);
1036
+
1037
+ $this->_debug($gatewayResponse->debug());
1038
+
1039
+
1040
+ return $gatewayResponse->getState();
1041
+ }
1042
+
1043
+
1044
+
1045
+
1046
  }
1047
 
1048
  /**
1054
  protected function isPreauthorizeCapture($payment)
1055
  {
1056
  $lastTransaction = $payment->getTransaction($payment->getLastTransId());
1057
+
1058
+ if(!$lastTransaction)
1059
+ return false;
1060
+
1061
+ /*if ($this->getOperation() == self::OPERATION_SALE && $lastTransaction->getTxnType() == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH )
1062
+ return false;
1063
+ */
1064
+ if($lastTransaction->getTxnType() == Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE && $this->orderDue($payment->getOrder()))
1065
+ return true;
1066
+
1067
+ if ($lastTransaction->getTxnType() != Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH )
1068
  return false;
 
1069
 
1070
  return true;
1071
  }
1206
  $transaction->setIsClosed((int)$payment->getIsTransactionClosed());
1207
  }
1208
 
 
 
 
 
 
 
 
1209
  // link with sales entities
1210
  $payment->setLastTransId($transactionId);
1211
  $payment->setCreatedTransaction($transaction);
1282
  }*/
1283
  return true;
1284
  }
1285
+
1286
+ /**
1287
+ * Whether this method can accept or deny payment
1288
+ *
1289
+ * @param Mage_Payment_Model_Info $payment
1290
+ *
1291
+ * @return bool
1292
+ */
1293
+ public function canReviewPayment(Mage_Payment_Model_Info $payment)
1294
+ {
1295
+ $fraud_type = $payment->getAdditionalInformation('fraud_type');
1296
+ $fraud_review = $payment->getAdditionalInformation('fraud_review');
1297
+ return parent::canReviewPayment($payment) && ($fraud_type == 'challenged' && $fraud_review != 'allowed');
1298
+ }
1299
+
1300
+ public function canRefund()
1301
+ {
1302
+ return $this->_canRefund;
1303
+ }
1304
+
1305
+ protected function orderDue($order)
1306
+ {
1307
+ return $order->hasInvoices() && $order->getBaseTotalDue() > 0;
1308
+ }
1309
 
1310
 
1311
  /**
1351
  $this->_debug($debugData);
1352
  }
1353
 
1354
+ public function isAdmin()
1355
+ {
1356
+ return Mage::app()->getStore()->isAdmin();
1357
+ }
1358
+
1359
 
1360
 
1361
  }
app/code/community/Allopass/Hipay/Model/Method/Cc.php CHANGED
@@ -2,6 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstract
3
  {
4
 
 
5
  const STATUS_PENDING_CAPTURE = 'pending_capture';
6
 
7
  protected $_code = 'hipay_cc';
@@ -32,10 +33,10 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
32
  ->setCcSsIssue($data->getCcSsIssue())
33
  ->setCcSsStartMonth($data->getCcSsStartMonth())
34
  ->setCcSsStartYear($data->getCcSsStartYear())
35
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
36
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
37
  ;
38
 
 
 
39
  return $this;
40
  }
41
 
@@ -101,11 +102,16 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
101
  $payment = $this->getInfoInstance();
102
  $order = $payment->getOrder();
103
  $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
104
-
105
 
106
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
107
  {
108
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
109
  }
110
  else
111
  {
@@ -128,6 +134,8 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
128
  */
129
  public function capture(Varien_Object $payment, $amount)
130
  {
 
 
131
  parent::capture($payment, $amount);
132
 
133
  if ($this->isPreauthorizeCapture($payment) /*|| $this->orderDue($payment->getOrder())*/)
@@ -158,7 +166,16 @@ class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstrac
158
 
159
  $paymentProduct = null;
160
  if($payment->getAdditionalInformation('use_oneclick'))
161
- $paymentProduct = Mage::getSingleton('customer/session')->getCustomer()->getHipayCcType();
 
 
 
 
 
 
 
 
 
162
  else
163
  $paymentProduct = $this->getCcTypeHipay($payment->getCcType());
164
 
2
  class Allopass_Hipay_Model_Method_Cc extends Allopass_Hipay_Model_Method_Abstract
3
  {
4
 
5
+ protected $_canReviewPayment = true;
6
  const STATUS_PENDING_CAPTURE = 'pending_capture';
7
 
8
  protected $_code = 'hipay_cc';
33
  ->setCcSsIssue($data->getCcSsIssue())
34
  ->setCcSsStartMonth($data->getCcSsStartMonth())
35
  ->setCcSsStartYear($data->getCcSsStartYear())
 
 
36
  ;
37
 
38
+ $this->assignInfoData($info, $data);
39
+
40
  return $this;
41
  }
42
 
102
  $payment = $this->getInfoInstance();
103
  $order = $payment->getOrder();
104
  $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
105
+ $token = "";
106
 
107
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
108
  {
109
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
110
+ $card = Mage::getModel('hipay/card')->load($cardId);
111
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
112
+ $token = $card->getCcToken();
113
+ else
114
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
115
  }
116
  else
117
  {
134
  */
135
  public function capture(Varien_Object $payment, $amount)
136
  {
137
+ //TODO CHECK AMOUNT FOR SPLIT PAYMENT
138
+
139
  parent::capture($payment, $amount);
140
 
141
  if ($this->isPreauthorizeCapture($payment) /*|| $this->orderDue($payment->getOrder())*/)
166
 
167
  $paymentProduct = null;
168
  if($payment->getAdditionalInformation('use_oneclick'))
169
+ {
170
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
171
+ $card = Mage::getModel('hipay/card')->load($cardId);
172
+
173
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
174
+ $paymentProduct = $card->getCcType();
175
+ else
176
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
177
+
178
+ }
179
  else
180
  $paymentProduct = $this->getCcTypeHipay($payment->getCcType());
181
 
app/code/community/Allopass/Hipay/Model/Method/Dexia.php CHANGED
@@ -2,4 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Dexia extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_dexia';
 
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Dexia extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_dexia';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/Giropay.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
  class Allopass_Hipay_Model_Method_Giropay extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
- protected $_code = 'hipay_giropay';
 
 
 
5
  }
1
  <?php
2
  class Allopass_Hipay_Model_Method_Giropay extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
+ protected $_code = 'hipay_giropay';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/Hosted.php CHANGED
@@ -2,6 +2,8 @@
2
  class Allopass_Hipay_Model_Method_Hosted extends Allopass_Hipay_Model_Method_Abstract
3
  {
4
 
 
 
5
  protected $_code = 'hipay_hosted';
6
 
7
  protected $_formBlockType = 'hipay/form_hosted';
@@ -26,9 +28,7 @@ class Allopass_Hipay_Model_Method_Hosted extends Allopass_Hipay_Model_Method_Abs
26
  $data = new Varien_Object($data);
27
  }
28
  $info = $this->getInfoInstance();
29
- $info->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -63,7 +63,14 @@ class Allopass_Hipay_Model_Method_Hosted extends Allopass_Hipay_Model_Method_Abs
63
  $token = null;
64
  if($payment->getAdditionalInformation('use_oneclick'))
65
  {
66
- $token = Mage::getSingleton('customer/session')->getCustomer()->getHipayAliasOneclick();
 
 
 
 
 
 
 
67
  }
68
 
69
  $gatewayParams = $this->getGatewayParams($payment, $amount,$token);
2
  class Allopass_Hipay_Model_Method_Hosted extends Allopass_Hipay_Model_Method_Abstract
3
  {
4
 
5
+ protected $_canReviewPayment = true;
6
+
7
  protected $_code = 'hipay_hosted';
8
 
9
  protected $_formBlockType = 'hipay/form_hosted';
28
  $data = new Varien_Object($data);
29
  }
30
  $info = $this->getInfoInstance();
31
+ $this->assignInfoData($info, $data);
 
 
32
 
33
  return $this;
34
  }
63
  $token = null;
64
  if($payment->getAdditionalInformation('use_oneclick'))
65
  {
66
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
67
+ $card = Mage::getModel('hipay/card')->load($cardId);
68
+
69
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
70
+ $token = $card->getCcToken();
71
+ else
72
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
73
+
74
  }
75
 
76
  $gatewayParams = $this->getGatewayParams($payment, $amount,$token);
app/code/community/Allopass/Hipay/Model/Method/Ideal.php CHANGED
@@ -2,4 +2,6 @@
2
  class Allopass_Hipay_Model_Method_Ideal extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_ideal';
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Ideal extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_ideal';
5
+ protected $_canRefund = false;
6
+ protected $_canRefundInvoicePartial = false;
7
  }
app/code/community/Allopass/Hipay/Model/Method/Ing.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
  class Allopass_Hipay_Model_Method_Ing extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
- protected $_code = 'hipay_ing';
 
 
 
5
  }
1
  <?php
2
  class Allopass_Hipay_Model_Method_Ing extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
+ protected $_code = 'hipay_ing';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/Kbc.php CHANGED
@@ -2,4 +2,6 @@
2
  class Allopass_Hipay_Model_Method_Kbc extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_kbc';
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Kbc extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_kbc';
5
+ protected $_canRefund = false;
6
+ protected $_canRefundInvoicePartial = false;
7
  }
app/code/community/Allopass/Hipay/Model/Method/PaypalApi.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_Method_PaypalApi extends Allopass_Hipay_Model_Method_Cc
3
+ {
4
+ protected $_code = 'hipay_paypalapi';
5
+
6
+ protected $_formBlockType = 'hipay/form_hosted';
7
+ protected $_infoBlockType = 'hipay/info_hosted';
8
+
9
+
10
+ public function getOrderPlaceRedirectUrl()
11
+ {
12
+ return Mage::getUrl(str_replace("_", "/", $this->getCode()).'/sendRequest',array('_secure' => true));
13
+ }
14
+
15
+
16
+ /**
17
+ * Assign data to info model instance
18
+ *
19
+ * @param mixed $data
20
+ * @return Mage_Payment_Model_Info
21
+ */
22
+ public function assignData($data)
23
+ {
24
+ if (!($data instanceof Varien_Object)) {
25
+ $data = new Varien_Object($data);
26
+ }
27
+ $info = $this->getInfoInstance();
28
+ $info->setCcType($this->getConfigData('cctypes'));
29
+
30
+ $this->assignInfoData($info, $data);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function initialize($paymentAction, $stateObject)
36
+ {
37
+ /* @var $payment Mage_Sales_Model_Order_Payment */
38
+ $payment = $this->getInfoInstance();
39
+ $order = $payment->getOrder();
40
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
41
+
42
+
43
+ if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
44
+ {
45
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
46
+ $card = Mage::getModel('hipay/card')->load($cardId);
47
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
48
+ $token = $card->getCcToken();
49
+ else
50
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
51
+ $payment->setAdditionalInformation('token',$token);
52
+ }
53
+
54
+ return $this;
55
+
56
+ }
57
+
58
+
59
+ protected function getCcTypeHipay($ccTypeMagento)
60
+ {
61
+ return $ccTypeMagento;
62
+ }
63
+
64
+ /**
65
+ * Validate payment method information object
66
+ *
67
+ * @param Mage_Payment_Model_Info $info
68
+ * @return Mage_Payment_Model_Abstract
69
+ */
70
+ public function validate()
71
+ {
72
+ /**
73
+ * to validate payment method is allowed for billing country or not
74
+ */
75
+ $paymentInfo = $this->getInfoInstance();
76
+ if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
77
+ $billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
78
+ } else {
79
+ $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
80
+ }
81
+ if (!$this->canUseForCountry($billingCountry)) {
82
+ Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));
83
+ }
84
+ return $this;
85
+ }
86
+
87
+ }
app/code/community/Allopass/Hipay/Model/Method/Przelewy24Api.php CHANGED
@@ -25,10 +25,9 @@ class Allopass_Hipay_Model_Method_Przelewy24Api extends Allopass_Hipay_Model_Met
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
- $info->setCcType($this->getConfigData('cctypes'))
29
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -43,7 +42,13 @@ class Allopass_Hipay_Model_Method_Przelewy24Api extends Allopass_Hipay_Model_Met
43
 
44
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
45
  {
46
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
 
47
  $payment->setAdditionalInformation('token',$token);
48
  }
49
 
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
+ $info->setCcType($this->getConfigData('cctypes'));
29
+
30
+ $this->assignInfoData($info, $data);
 
31
 
32
  return $this;
33
  }
42
 
43
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
44
  {
45
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
46
+ $card = Mage::getModel('hipay/card')->load($cardId);
47
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
48
+ $token = $card->getCcToken();
49
+ else
50
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
51
+
52
  $payment->setAdditionalInformation('token',$token);
53
  }
54
 
app/code/community/Allopass/Hipay/Model/Method/Qiwi.php CHANGED
@@ -2,4 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Qiwi extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_qiwi';
 
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Qiwi extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_qiwi';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/Sisal.php CHANGED
@@ -2,4 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Sisal extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_sisal';
 
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Sisal extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_sisal';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/SisalApi.php CHANGED
@@ -6,6 +6,9 @@ class Allopass_Hipay_Model_Method_SisalApi extends Allopass_Hipay_Model_Method_C
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
 
 
 
9
 
10
  public function getOrderPlaceRedirectUrl()
11
  {
@@ -25,10 +28,9 @@ class Allopass_Hipay_Model_Method_SisalApi extends Allopass_Hipay_Model_Method_C
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
- $info->setCcType($this->getConfigData('cctypes'))
29
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -43,7 +45,12 @@ class Allopass_Hipay_Model_Method_SisalApi extends Allopass_Hipay_Model_Method_C
43
 
44
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
45
  {
46
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
47
  $payment->setAdditionalInformation('token',$token);
48
  }
49
 
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
9
+ protected $_canRefund = false;
10
+ protected $_canRefundInvoicePartial = false;
11
+
12
 
13
  public function getOrderPlaceRedirectUrl()
14
  {
28
  $data = new Varien_Object($data);
29
  }
30
  $info = $this->getInfoInstance();
31
+ $info->setCcType($this->getConfigData('cctypes'));
32
+
33
+ $this->assignInfoData($info, $data);
 
34
 
35
  return $this;
36
  }
45
 
46
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
47
  {
48
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
49
+ $card = Mage::getModel('hipay/card')->load($cardId);
50
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
51
+ $token = $card->getCcToken();
52
+ else
53
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
54
  $payment->setAdditionalInformation('token',$token);
55
  }
56
 
app/code/community/Allopass/Hipay/Model/Method/SofortApi.php CHANGED
@@ -25,10 +25,9 @@ class Allopass_Hipay_Model_Method_SofortApi extends Allopass_Hipay_Model_Method_
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
- $info->setCcType($this->getConfigData('cctypes'))
29
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -43,7 +42,12 @@ class Allopass_Hipay_Model_Method_SofortApi extends Allopass_Hipay_Model_Method_
43
 
44
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
45
  {
46
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
47
  $payment->setAdditionalInformation('token',$token);
48
  }
49
 
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
+ $info->setCcType($this->getConfigData('cctypes'));
29
+
30
+ $this->assignInfoData($info, $data);
 
31
 
32
  return $this;
33
  }
42
 
43
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
44
  {
45
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
46
+ $card = Mage::getModel('hipay/card')->load($cardId);
47
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
48
+ $token = $card->getCcToken();
49
+ else
50
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
51
  $payment->setAdditionalInformation('token',$token);
52
  }
53
 
app/code/community/Allopass/Hipay/Model/Method/Webmoney.php CHANGED
@@ -2,4 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Webmoney extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_webmoney';
 
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Webmoney extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_webmoney';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/WebmoneyApi.php CHANGED
@@ -6,6 +6,9 @@ class Allopass_Hipay_Model_Method_WebmoneyApi extends Allopass_Hipay_Model_Metho
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
 
 
 
9
 
10
  public function getOrderPlaceRedirectUrl()
11
  {
@@ -25,10 +28,9 @@ class Allopass_Hipay_Model_Method_WebmoneyApi extends Allopass_Hipay_Model_Metho
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
- $info->setCcType($this->getConfigData('cctypes'))
29
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -43,7 +45,12 @@ class Allopass_Hipay_Model_Method_WebmoneyApi extends Allopass_Hipay_Model_Metho
43
 
44
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
45
  {
46
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
47
  $payment->setAdditionalInformation('token',$token);
48
  }
49
 
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
9
+ protected $_canRefund = false;
10
+ protected $_canRefundInvoicePartial = false;
11
+
12
 
13
  public function getOrderPlaceRedirectUrl()
14
  {
28
  $data = new Varien_Object($data);
29
  }
30
  $info = $this->getInfoInstance();
31
+ $info->setCcType($this->getConfigData('cctypes'));
32
+
33
+ $this->assignInfoData($info, $data);
 
34
 
35
  return $this;
36
  }
45
 
46
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
47
  {
48
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
49
+ $card = Mage::getModel('hipay/card')->load($cardId);
50
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
51
+ $token = $card->getCcToken();
52
+ else
53
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
54
  $payment->setAdditionalInformation('token',$token);
55
  }
56
 
app/code/community/Allopass/Hipay/Model/Method/Yandex.php CHANGED
@@ -2,4 +2,7 @@
2
  class Allopass_Hipay_Model_Method_Yandex extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_yandex';
 
 
 
5
  }
2
  class Allopass_Hipay_Model_Method_Yandex extends Allopass_Hipay_Model_Method_Hosted
3
  {
4
  protected $_code = 'hipay_yandex';
5
+
6
+ protected $_canRefund = false;
7
+ protected $_canRefundInvoicePartial = false;
8
  }
app/code/community/Allopass/Hipay/Model/Method/YandexApi.php CHANGED
@@ -6,6 +6,9 @@ class Allopass_Hipay_Model_Method_YandexApi extends Allopass_Hipay_Model_Method_
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
 
 
 
9
 
10
  public function getOrderPlaceRedirectUrl()
11
  {
@@ -25,10 +28,9 @@ class Allopass_Hipay_Model_Method_YandexApi extends Allopass_Hipay_Model_Method_
25
  $data = new Varien_Object($data);
26
  }
27
  $info = $this->getInfoInstance();
28
- $info->setCcType($this->getConfigData('cctypes'))
29
- ->setAdditionalInformation('create_oneclick',$data->getOneclick() == "create_oneclick" ? 1 : 0)
30
- ->setAdditionalInformation('use_oneclick',$data->getOneclick() == "use_oneclick" ? 1 : 0)
31
- ;
32
 
33
  return $this;
34
  }
@@ -43,7 +45,12 @@ class Allopass_Hipay_Model_Method_YandexApi extends Allopass_Hipay_Model_Method_
43
 
44
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
45
  {
46
- $token = $customer->getHipayAliasOneclick();
 
 
 
 
 
47
  $payment->setAdditionalInformation('token',$token);
48
  }
49
 
6
  protected $_formBlockType = 'hipay/form_hosted';
7
  protected $_infoBlockType = 'hipay/info_hosted';
8
 
9
+ protected $_canRefund = false;
10
+ protected $_canRefundInvoicePartial = false;
11
+
12
 
13
  public function getOrderPlaceRedirectUrl()
14
  {
28
  $data = new Varien_Object($data);
29
  }
30
  $info = $this->getInfoInstance();
31
+ $info->setCcType($this->getConfigData('cctypes'));
32
+
33
+ $this->assignInfoData($info, $data);
 
34
 
35
  return $this;
36
  }
45
 
46
  if($payment->getAdditionalInformation('use_oneclick') && $customer->getId())
47
  {
48
+ $cardId = $payment->getAdditionalInformation('selected_oneclick_card');
49
+ $card = Mage::getModel('hipay/card')->load($cardId);
50
+ if($card->getId() && $card->getCustomerId() == $customer->getId())
51
+ $token = $card->getCcToken();
52
+ else
53
+ Mage::throwException(Mage::helper('hipay')->__("Error with your card!"));
54
  $payment->setAdditionalInformation('token',$token);
55
  }
56
 
app/code/community/Allopass/Hipay/Model/Observer.php CHANGED
@@ -94,4 +94,137 @@ class Allopass_Hipay_Model_Observer
94
  return $this;
95
 
96
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
94
  return $this;
95
 
96
  }
97
+
98
+ public function paySplitPayments()
99
+ {
100
+
101
+ $date = new Zend_Date();
102
+
103
+ //TODO add filter for max attempts
104
+ $splitPayments = Mage::getModel('hipay/splitPayment')->getCollection()
105
+ ->addFieldToFilter('status',array('in'=>array(Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_PENDING,
106
+ Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_FAILED)))
107
+ ->addFieldTofilter('date_to_pay',array('to' => $date->toString('Y-MM-dd 00:00:00')));
108
+
109
+
110
+ foreach ($splitPayments as $splitPayment) {
111
+ try {
112
+ $splitPayment->pay();
113
+ } catch (Exception $e) {
114
+ $splitPayment->sendErrorEmail();
115
+ Mage::logException($e);
116
+ }
117
+ }
118
+ }
119
+
120
+ public function arrangeOrderView($observer)
121
+ {
122
+ /* @var $block Mage_Adminhtml_Block_Sales_Order_View|Mage_Adminhtml_Block_Sales_Transactions_Detail */
123
+ $block = $observer->getBlock();
124
+
125
+ /* @var $order Mage_Sales_Model_Order */
126
+ if($block instanceof Mage_Adminhtml_Block_Sales_Order_View)
127
+ {
128
+ $isAllowedAction = Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/review_payment');
129
+ if(!$isAllowedAction)
130
+ return $this;
131
+
132
+ $order = $block->getOrder();
133
+
134
+ if(strpos($order->getPayment()->getMethod(), "hipay") === false)
135
+ return $this;
136
+
137
+ if($order->canReviewPayment())
138
+ {
139
+ $url = $block->getUrl("hipay/adminhtml_payment/reviewCapturePayment");
140
+ $message = Mage::helper('sales')->__('Are you sure you want to accept this payment?');
141
+ $block->addButton('accept_capture_payment', array(
142
+ 'label' => Mage::helper('sales')->__('Accept and Capture Payment'),
143
+ 'onclick' => "confirmSetLocation('{$message}', '{$url}')",
144
+ ));
145
+ }
146
+
147
+
148
+ }
149
+ elseif($block instanceof Mage_Adminhtml_Block_Sales_Transactions_Detail)
150
+ {
151
+ $txnId = $block->getTxnIdHtml();
152
+ $orderIncrementId = $block->getOrderIncrementIdHtml();
153
+
154
+
155
+ $order = Mage::getModel('sales/order')->loadByIncrementId(trim($orderIncrementId));
156
+ if($order->getId() && strpos($order->getPayment()->getMethod(), 'hipay') !== false)
157
+ {
158
+ $link = '<a href="https://merchant.hipay-tpp.com//transaction/detail/index/trxid/'.$txnId.'" target="_blank">'.$txnId.'</a>';
159
+ $block->setTxnIdHtml($link);
160
+ }
161
+
162
+
163
+
164
+ }
165
+ }
166
+
167
+ public function orderCanRefund($observer)
168
+ {
169
+ $order = $observer->getOrder();
170
+ if($order->getStatus() == Allopass_Hipay_Model_Method_Abstract::STATUS_CAPTURE_REQUESTED)
171
+ $order->setForcedCanCreditmemo(false);
172
+
173
+ if($order->getPayment()->getMethod() == 'hipay_cc' && strtolower($order->getPayment()->getCcType()) == 'bcmc')
174
+ {
175
+ $order->setForcedCanCreditmemo(false);
176
+ }
177
+
178
+ }
179
+
180
+
181
+ /**
182
+ * Authorize redirect to Hipay payment
183
+ */
184
+ public function initRedirect4Multishipping($observer) {
185
+ Mage::getSingleton('checkout/session')->setCanRedirect4Multishipping(true);
186
+ }
187
+
188
+ /**
189
+ * Return Redirect URL for payment
190
+ *
191
+ * @return string Place Order Redirect URL
192
+ */
193
+ public function multishippingRedirectUrl($observer) {
194
+ if (Mage::getSingleton('checkout/session')->getCanRedirect4Multishipping()) {
195
+
196
+ $orderIds = Mage::getSingleton('core/session')->getOrderIds();
197
+ $orderIdsTmp = $orderIds;
198
+ $key = array_pop($orderIdsTmp);
199
+ $order = Mage::getModel('sales/order')->loadByIncrementId($key);
200
+
201
+ if (!(strpos($order->getPayment()->getMethod(), 'hipay') === false)) {
202
+ $methodController = str_replace("_","/",$order->getPayment()->getMethod());
203
+ Mage::getSingleton('checkout/session')
204
+ ->setLastRealOrderId($order->getIncrementId())
205
+ ->setLastOrderId($order->getId())
206
+ ->setRealOrderIds(implode(',', $orderIds));
207
+ Mage::app()->getResponse()->setRedirect(Mage::getUrl($methodController.'/sendRequest',array('_secure' => true)));
208
+ }
209
+ } else {
210
+ Mage::getSingleton('checkout/session')->unsRealOrderIds();
211
+ }
212
+
213
+ return $this;
214
+ }
215
+
216
+ /**
217
+ * Disables sending email after the order creation
218
+ *
219
+ * @return updated order
220
+ */
221
+ public function disableEmail4Multishipping($observer) {
222
+ $order = $observer->getOrder();
223
+
224
+ if (!(strpos($order->getPayment()->getMethod(), 'hipay') === false)) {
225
+ $order->setCanSendNewEmailFlag(false)->save();
226
+ }
227
+
228
+ return $this;
229
+ }
230
  }
app/code/community/Allopass/Hipay/Model/PaymentProfile.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_PaymentProfile extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+
6
+ /**
7
+ * Period units
8
+ *
9
+ * @var string
10
+ */
11
+ const PERIOD_UNIT_DAY = 'day';
12
+ const PERIOD_UNIT_WEEK = 'week';
13
+ const PERIOD_UNIT_SEMI_MONTH = 'semi_month';
14
+ const PERIOD_UNIT_MONTH = 'month';
15
+ const PERIOD_UNIT_YEAR = 'year';
16
+
17
+ /**
18
+ * Payment types
19
+ */
20
+ const PAYMENT_TYPE_SPLIT = 'split_payment';
21
+ const PAYMENT_TYPE_RECURRING = 'recurring_payment';
22
+
23
+ protected function _construct()
24
+ {
25
+ parent::_construct();
26
+ $this->_init('hipay/paymentProfile');
27
+ $this->setIdFieldName('profile_id');
28
+ }
29
+
30
+ public function getAllPaymentTypes($withLabels = true)
31
+ {
32
+ $paymenTypes = array(
33
+ self::PAYMENT_TYPE_SPLIT,
34
+ self::PAYMENT_TYPE_RECURRING,
35
+ );
36
+
37
+ if ($withLabels) {
38
+ $result = array();
39
+ foreach ($paymenTypes as $paymenType) {
40
+ $result[$paymenType] = $this->getPaymentTypeLabel($paymenType);
41
+ }
42
+ return $result;
43
+ }
44
+ return $paymenTypes;
45
+ }
46
+
47
+ public function getPaymentTypeLabel($paymentType)
48
+ {
49
+ switch ($paymentType)
50
+ {
51
+ case self::PAYMENT_TYPE_SPLIT: return Mage::helper('hipay')->__('Split payment');
52
+ case self::PAYMENT_TYPE_RECURRING: return Mage::helper('hipay')->__('Recurring Payment');
53
+ }
54
+ return $paymentType;
55
+ }
56
+
57
+ /**
58
+ * Getter for available period units
59
+ *
60
+ * @param bool $withLabels
61
+ * @return array
62
+ */
63
+ public function getAllPeriodUnits($withLabels = true)
64
+ {
65
+ $units = array(
66
+ self::PERIOD_UNIT_DAY,
67
+ self::PERIOD_UNIT_WEEK,
68
+ self::PERIOD_UNIT_SEMI_MONTH,
69
+ self::PERIOD_UNIT_MONTH,
70
+ self::PERIOD_UNIT_YEAR
71
+ );
72
+
73
+ if ($withLabels) {
74
+ $result = array();
75
+ foreach ($units as $unit) {
76
+ $result[$unit] = $this->getPeriodUnitLabel($unit);
77
+ }
78
+ return $result;
79
+ }
80
+ return $units;
81
+ }
82
+
83
+ /**
84
+ * Render label for specified period unit
85
+ *
86
+ * @param string $unit
87
+ */
88
+ public function getPeriodUnitLabel($unit)
89
+ {
90
+ switch ($unit) {
91
+ case self::PERIOD_UNIT_DAY: return Mage::helper('payment')->__('Day');
92
+ case self::PERIOD_UNIT_WEEK: return Mage::helper('payment')->__('Week');
93
+ case self::PERIOD_UNIT_SEMI_MONTH: return Mage::helper('payment')->__('Two Weeks');
94
+ case self::PERIOD_UNIT_MONTH: return Mage::helper('payment')->__('Month');
95
+ case self::PERIOD_UNIT_YEAR: return Mage::helper('payment')->__('Year');
96
+ }
97
+ return $unit;
98
+ }
99
+
100
+ /**
101
+ * Getter for field label
102
+ *
103
+ * @param string $field
104
+ * @return string|null
105
+ */
106
+ public function getFieldLabel($field)
107
+ {
108
+ switch ($field) {
109
+ case 'subscriber_name':
110
+ return Mage::helper('payment')->__('Subscriber Name');
111
+ case 'start_datetime':
112
+ return Mage::helper('payment')->__('Start Date');
113
+ case 'internal_reference_id':
114
+ return Mage::helper('payment')->__('Internal Reference ID');
115
+ case 'schedule_description':
116
+ return Mage::helper('payment')->__('Schedule Description');
117
+ case 'suspension_threshold':
118
+ return Mage::helper('payment')->__('Maximum Payment Failures');
119
+ case 'bill_failed_later':
120
+ return Mage::helper('payment')->__('Auto Bill on Next Cycle');
121
+ case 'period_unit':
122
+ return Mage::helper('payment')->__('Billing Period Unit');
123
+ case 'period_frequency':
124
+ return Mage::helper('payment')->__('Billing Frequency');
125
+ case 'period_max_cycles':
126
+ return Mage::helper('payment')->__('Maximum Billing Cycles');
127
+ case 'billing_amount':
128
+ return Mage::helper('payment')->__('Billing Amount');
129
+ case 'trial_period_unit':
130
+ return Mage::helper('payment')->__('Trial Billing Period Unit');
131
+ case 'trial_period_frequency':
132
+ return Mage::helper('payment')->__('Trial Billing Frequency');
133
+ case 'trial_period_max_cycles':
134
+ return Mage::helper('payment')->__('Maximum Trial Billing Cycles');
135
+ case 'trial_billing_amount':
136
+ return Mage::helper('payment')->__('Trial Billing Amount');
137
+ case 'currency_code':
138
+ return Mage::helper('payment')->__('Currency');
139
+ case 'shipping_amount':
140
+ return Mage::helper('payment')->__('Shipping Amount');
141
+ case 'tax_amount':
142
+ return Mage::helper('payment')->__('Tax Amount');
143
+ case 'init_amount':
144
+ return Mage::helper('payment')->__('Initial Fee');
145
+ case 'init_may_fail':
146
+ return Mage::helper('payment')->__('Allow Initial Fee Failure');
147
+ case 'method_code':
148
+ return Mage::helper('payment')->__('Payment Method');
149
+ case 'reference_id':
150
+ return Mage::helper('payment')->__('Payment Reference ID');
151
+ }
152
+ }
153
+
154
+
155
+ }
app/code/community/Allopass/Hipay/Model/Resource/Card.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_Resource_Card extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('hipay/card','card_id');
7
+ }
8
+
9
+
10
+
11
+
12
+ }
app/code/community/Allopass/Hipay/Model/Resource/Card/Collection.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Hipay resource collection model
6
+ *
7
+ */
8
+ class Allopass_Hipay_Model_Resource_Card_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+
11
+ /**
12
+ * Set resource model and determine field mapping
13
+ */
14
+ protected function _construct()
15
+ {
16
+ $this->_init('hipay/card');
17
+ }
18
+
19
+ }
app/code/community/Allopass/Hipay/Model/Resource/PaymentProfile.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_Resource_PaymentProfile extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('hipay/paymentProfile','profile_id');
7
+ }
8
+
9
+
10
+
11
+
12
+ }
app/code/community/Allopass/Hipay/Model/Resource/PaymentProfile/Collection.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Hipay resource collection model
6
+ *
7
+ */
8
+ class Allopass_Hipay_Model_Resource_PaymentProfile_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+
11
+ /**
12
+ * Set resource model and determine field mapping
13
+ */
14
+ protected function _construct()
15
+ {
16
+ $this->_init('hipay/paymentProfile');
17
+ }
18
+
19
+
20
+ public function toOptionArray()
21
+ {
22
+ return $this->_toOptionArray('profile_id');
23
+ }
24
+
25
+ /**
26
+ * Add filtering by profile ids
27
+ *
28
+ * @param mixed $profileIds
29
+ * @return Allopass_Hipay_Model_Resource_PaymentProfile_Collection
30
+ */
31
+ public function addIdsToFilter($profileIds)
32
+ {
33
+ $this->addFieldToFilter('main_table.profile_id', $profileIds);
34
+ return $this;
35
+ }
36
+
37
+ }
app/code/community/Allopass/Hipay/Model/Resource/SplitPayment.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_Resource_SplitPayment extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('hipay/splitPayment','split_payment_id');
7
+ }
8
+
9
+
10
+
11
+
12
+ }
app/code/community/Allopass/Hipay/Model/Resource/SplitPayment/Collection.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Hipay resource collection model
6
+ *
7
+ */
8
+ class Allopass_Hipay_Model_Resource_SplitPayment_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+
11
+ /**
12
+ * Set resource model and determine field mapping
13
+ */
14
+ protected function _construct()
15
+ {
16
+ $this->_init('hipay/splitPayment');
17
+ }
18
+
19
+ }
app/code/community/Allopass/Hipay/Model/Rule.php CHANGED
@@ -19,7 +19,7 @@ class Allopass_Hipay_Model_Rule extends Mage_Rule_Model_Rule
19
  */
20
  public function getConditionsInstance()
21
  {
22
- return Mage::getModel('hipay/rule_condition_combine')->setPaymentMethodCode($this->getMethodCode());
23
  }
24
 
25
  /**
@@ -36,9 +36,14 @@ class Allopass_Hipay_Model_Rule extends Mage_Rule_Model_Rule
36
  {
37
  parent::getConditions();
38
 
39
- $this->_conditions->setPaymentMethodCode($this->getMethodCode());
40
 
41
  return $this->_conditions;
42
  }
 
 
 
 
 
43
 
44
  }
19
  */
20
  public function getConditionsInstance()
21
  {
22
+ return Mage::getModel('hipay/rule_condition_combine')->setPaymentMethodCode($this->_getPaymentMethodCode());
23
  }
24
 
25
  /**
36
  {
37
  parent::getConditions();
38
 
39
+ $this->_conditions->setPaymentMethodCode($this->_getPaymentMethodCode());
40
 
41
  return $this->_conditions;
42
  }
43
+
44
+ protected function _getPaymentMethodCode()
45
+ {
46
+ return str_replace("/", "_", $this->getConfigPath());
47
+ }
48
 
49
  }
app/code/community/Allopass/Hipay/Model/Rule/Condition/Address.php CHANGED
@@ -92,12 +92,16 @@ class Allopass_Hipay_Model_Rule_Condition_Address extends Mage_Rule_Model_Condit
92
  /**
93
  * Validate Address Rule Condition
94
  *
95
- * @param Varien_Object $object
96
  * @return bool
97
  */
98
  public function validate(Varien_Object $object)
99
  {
100
- $quote = Mage::getModel('sales/quote')->load($object->getQuoteId());
 
 
 
 
101
  $address = $quote->getBillingAddress();
102
 
103
  //Get infos from billing address
92
  /**
93
  * Validate Address Rule Condition
94
  *
95
+ * @param Varien_Object|Mage_Sales_Model_Order|Mage_Sales_Model_Quote $object
96
  * @return bool
97
  */
98
  public function validate(Varien_Object $object)
99
  {
100
+ $quote = $object;
101
+
102
+ if (!($object instanceof Mage_Sales_Model_Quote))
103
+ $quote = Mage::getModel('sales/quote')->load($object->getQuoteId());
104
+
105
  $address = $quote->getBillingAddress();
106
 
107
  //Get infos from billing address
app/code/community/Allopass/Hipay/Model/Rule/Condition/Customer.php CHANGED
@@ -7,6 +7,7 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
7
  'orders_count' => Mage::helper('hipay')->__('Orders count'),
8
  'customer_is_guest' => Mage::helper('sales')->__('Customer is guest'),
9
  'diff_addresses' => Mage::helper('hipay')->__('Billing and shipping addresses are differents'),
 
10
  );
11
 
12
  $this->setAttributeOption($attributes);
@@ -19,8 +20,11 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
19
  switch ($this->getAttribute()) {
20
  case 'orders_count':
21
  return 'numeric';
22
- case 'customer_is_guest': case 'diff_addresses':
23
- return 'boolean';
 
 
 
24
  }
25
  return 'string';
26
  }
@@ -28,8 +32,11 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
28
  public function getValueElementType()
29
  {
30
  switch ($this->getAttribute()) {
31
- case 'customer_is_guest': case 'diff_addresses':
 
32
  return 'select';
 
 
33
  }
34
  return 'text';
35
  }
@@ -43,6 +50,10 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
43
  $options = Mage::getModel('adminhtml/system_config_source_yesno')
44
  ->toOptionArray();
45
  break;
 
 
 
 
46
  default:
47
  $options = array();
48
  }
@@ -54,22 +65,25 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
54
  /**
55
  * Validate Address Rule Condition
56
  *
57
- * @param Varien_Object $object
58
  * @return bool
59
  */
60
  public function validate(Varien_Object $object)
61
  {
62
- /* @var $order Mage_Sales_Model_Order */
63
- $order = $object;
 
 
64
 
65
  //Get infos from billing address
66
  $toValidate = new Varien_Object();
67
 
68
  $customer_id = $object->getCustomerId();
69
- $orders_count = $order->getCollection()->addAttributeToFilter('customer_id',$customer_id)->count();
70
  $toValidate->setOrdersCount($orders_count);
71
- $toValidate->setCustomerIsGuest(is_null($order->getCustomerIsGuest()) ? 0 : $order->getCustomerIsGuest());
72
- $toValidate->setDiffAddresses($this->_addressesesAreDifferent($order));
 
73
 
74
  return parent::validate($toValidate);
75
 
@@ -81,7 +95,7 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
81
  */
82
  protected function _addressesesAreDifferent($order)
83
  {
84
- $isDifferent = false;
85
  if($order->getIsVirtual())
86
  return $isDifferent;
87
 
@@ -96,7 +110,7 @@ class Allopass_Hipay_Model_Rule_Condition_Customer extends Mage_Rule_Model_Condi
96
  $shippingValue = call_user_func(array($shippingAddress,$method_name));
97
  if($billingValue != $shippingValue)
98
  {
99
- $isDifferent = true;
100
  break;
101
  }
102
  }
7
  'orders_count' => Mage::helper('hipay')->__('Orders count'),
8
  'customer_is_guest' => Mage::helper('sales')->__('Customer is guest'),
9
  'diff_addresses' => Mage::helper('hipay')->__('Billing and shipping addresses are differents'),
10
+ 'customer_group' => Mage::helper('adminhtml')->__('Customer Groups')
11
  );
12
 
13
  $this->setAttributeOption($attributes);
20
  switch ($this->getAttribute()) {
21
  case 'orders_count':
22
  return 'numeric';
23
+ case 'customer_is_guest':
24
+ case 'diff_addresses':
25
+ return 'boolean';
26
+ case 'customer_group':
27
+ return 'multiselect';
28
  }
29
  return 'string';
30
  }
32
  public function getValueElementType()
33
  {
34
  switch ($this->getAttribute()) {
35
+ case 'customer_is_guest':
36
+ case 'diff_addresses':
37
  return 'select';
38
+ case 'customer_group':
39
+ return 'multiselect';
40
  }
41
  return 'text';
42
  }
50
  $options = Mage::getModel('adminhtml/system_config_source_yesno')
51
  ->toOptionArray();
52
  break;
53
+ case 'customer_group':
54
+ $options = Mage::getModel('adminhtml/system_config_source_customer_group_multiselect')
55
+ ->toOptionArray();
56
+ break;
57
  default:
58
  $options = array();
59
  }
65
  /**
66
  * Validate Address Rule Condition
67
  *
68
+ * @param Varien_Object|Mage_Sales_Model_Order|Mage_Sales_Model_Quote $object
69
  * @return bool
70
  */
71
  public function validate(Varien_Object $object)
72
  {
73
+
74
+
75
+ /* @var $object Mage_Sales_Model_Order|Mage_Sales_Model_Quote */
76
+
77
 
78
  //Get infos from billing address
79
  $toValidate = new Varien_Object();
80
 
81
  $customer_id = $object->getCustomerId();
82
+ $orders_count = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id',$customer_id)->count();
83
  $toValidate->setOrdersCount($orders_count);
84
+ $toValidate->setCustomerIsGuest(is_null($object->getCustomerIsGuest()) ? 0 : $object->getCustomerIsGuest());
85
+ $toValidate->setDiffAddresses($this->_addressesesAreDifferent($object));
86
+ $toValidate->setCustomerGroup($object->getCustomerGroupId());
87
 
88
  return parent::validate($toValidate);
89
 
95
  */
96
  protected function _addressesesAreDifferent($order)
97
  {
98
+ $isDifferent = 0;
99
  if($order->getIsVirtual())
100
  return $isDifferent;
101
 
110
  $shippingValue = call_user_func(array($shippingAddress,$method_name));
111
  if($billingValue != $shippingValue)
112
  {
113
+ $isDifferent = 1;
114
  break;
115
  }
116
  }
app/code/community/Allopass/Hipay/Model/Rule/Config.php CHANGED
@@ -30,9 +30,13 @@ class Allopass_Hipay_Model_Rule_Config extends Mage_Core_Model_Config_Data
30
  $rule = Mage::getModel('hipay/rule');
31
  $rule->setMethodCode($this->_getMethodCode());
32
 
 
33
  if($this->getValue())
34
  $rule->load($this->getValue());
35
-
 
 
 
36
  $this->setRule($rule);
37
 
38
  return $this;
@@ -54,6 +58,8 @@ class Allopass_Hipay_Model_Rule_Config extends Mage_Core_Model_Config_Data
54
  }
55
 
56
  $rule->setMethodCode($this->_getMethodCode());
 
 
57
  $rule->loadPost($this->_getRuleData());
58
 
59
  try{
@@ -78,14 +84,27 @@ class Allopass_Hipay_Model_Rule_Config extends Mage_Core_Model_Config_Data
78
  return $group;
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
81
  protected function _getRuleData()
82
  {
83
  if(is_null($this->_ruleData))
84
  {
85
  $post = Mage::app()->getRequest()->getPost();
 
86
  $this->_ruleData = array();
87
- if(isset($post['rule_' . $this->_getMethodCode()]['conditions']))
88
- $this->_ruleData['conditions'] = $post['rule_' . $this->_getMethodCode()]['conditions'];
 
 
89
  }
90
 
91
  return $this->_ruleData;
30
  $rule = Mage::getModel('hipay/rule');
31
  $rule->setMethodCode($this->_getMethodCode());
32
 
33
+
34
  if($this->getValue())
35
  $rule->load($this->getValue());
36
+
37
+ if($rule->getConfigPath() == "")
38
+ $rule->setConfigPath($this->_getConfigPath());
39
+
40
  $this->setRule($rule);
41
 
42
  return $this;
58
  }
59
 
60
  $rule->setMethodCode($this->_getMethodCode());
61
+ $rule->setConfigPath($this->_getConfigPath());
62
+
63
  $rule->loadPost($this->_getRuleData());
64
 
65
  try{
84
  return $group;
85
  }
86
 
87
+ protected function _getConfigPath()
88
+ {
89
+ return $this->getData('path');
90
+ }
91
+
92
+ protected function _getFormName()
93
+ {
94
+ return str_replace("/", "_", $this->_getConfigPath());
95
+ }
96
+
97
  protected function _getRuleData()
98
  {
99
  if(is_null($this->_ruleData))
100
  {
101
  $post = Mage::app()->getRequest()->getPost();
102
+
103
  $this->_ruleData = array();
104
+
105
+ if(isset($post['rule_' . $this->_getFormName()]['conditions']))
106
+ $this->_ruleData['conditions'] = $post['rule_' . $this->_getFormName()]['conditions'];
107
+
108
  }
109
 
110
  return $this->_ruleData;
app/code/community/Allopass/Hipay/Model/Source/3ds.php CHANGED
@@ -15,8 +15,10 @@ class Allopass_Hipay_Model_Source_3ds
15
  public function toOptionArray()
16
  {
17
  return array(
18
- array('value' => 1, 'label'=>Mage::helper('hipay')->__('Enable for all transactions')),
19
- array('value' => 2, 'label'=>Mage::helper('hipay')->__('Enable for configured 3ds rules')),
 
 
20
  array('value' => 0, 'label'=>Mage::helper('hipay')->__('Disabled')),
21
 
22
  );
@@ -33,6 +35,8 @@ class Allopass_Hipay_Model_Source_3ds
33
  0 => Mage::helper('hipay')->__('Disabled'),
34
  1 => Mage::helper('hipay')->__('Enable for all transactions'),
35
  2 => Mage::helper('hipay')->__('Enable for configured 3ds rules'),
 
 
36
  );
37
  }
38
 
15
  public function toOptionArray()
16
  {
17
  return array(
18
+ array('value' => 1, 'label'=>Mage::helper('hipay')->__('Try to enable for all transactions.')),
19
+ array('value' => 2, 'label'=>Mage::helper('hipay')->__('Try to enable for configured 3ds rules')),
20
+ array('value' => 3, 'label'=>Mage::helper('hipay')->__('Force for configured 3ds rules')),
21
+ array('value' => 4, 'label'=>Mage::helper('hipay')->__('Force for all transactions.')),
22
  array('value' => 0, 'label'=>Mage::helper('hipay')->__('Disabled')),
23
 
24
  );
35
  0 => Mage::helper('hipay')->__('Disabled'),
36
  1 => Mage::helper('hipay')->__('Enable for all transactions'),
37
  2 => Mage::helper('hipay')->__('Enable for configured 3ds rules'),
38
+ 3 => Mage::helper('hipay')->__('Force for configured 3ds rules'),
39
+ 4 => Mage::helper('hipay')->__('Force for all transactions.'),
40
  );
41
  }
42
 
app/code/community/Allopass/Hipay/Model/Source/CcType.php CHANGED
@@ -5,7 +5,7 @@
5
  * Allopass Hipay Credit cards types
6
  *
7
  */
8
- class Allopass_Hipay_Model_Source_CcType
9
  {
10
  public function toOptionArray()
11
  {
@@ -21,4 +21,26 @@ class Allopass_Hipay_Model_Source_CcType
21
 
22
  return $options;
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
5
  * Allopass Hipay Credit cards types
6
  *
7
  */
8
+ class Allopass_Hipay_Model_Source_CcType extends Varien_Object
9
  {
10
  public function toOptionArray()
11
  {
21
 
22
  return $options;
23
  }
24
+
25
+ public function toConfigOption()
26
+ {
27
+ $types = Mage::getSingleton('hipay/config')->getCcTypes();
28
+ if($this->getPath())
29
+ {
30
+ $configData = Mage::getStoreConfig($this->getPath());
31
+ $availableTypes = explode(",", $configData);
32
+ $ordered = array();
33
+ foreach($availableTypes as $key) {
34
+ if(array_key_exists($key,$types)) {
35
+ $ordered[$key] = $types[$key];
36
+ unset($types[$key]);
37
+ }
38
+ }
39
+
40
+ return array_merge($ordered,$types);
41
+ }
42
+ return $types;
43
+ }
44
+
45
+
46
  }
app/code/community/Allopass/Hipay/Model/Source/CcTypeHosted.php CHANGED
@@ -5,7 +5,7 @@
5
  * Allopass Hipay Credit cards types
6
  *
7
  */
8
- class Allopass_Hipay_Model_Source_CcTypeHosted
9
  {
10
  public function toOptionArray()
11
  {
@@ -21,4 +21,24 @@ class Allopass_Hipay_Model_Source_CcTypeHosted
21
 
22
  return $options;
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
5
  * Allopass Hipay Credit cards types
6
  *
7
  */
8
+ class Allopass_Hipay_Model_Source_CcTypeHosted extends Varien_Object
9
  {
10
  public function toOptionArray()
11
  {
21
 
22
  return $options;
23
  }
24
+
25
+ public function toConfigOption()
26
+ {
27
+ $types = Mage::getSingleton('hipay/config')->getCcTypesCodeHipay();
28
+ if($this->getPath())
29
+ {
30
+ $configData = Mage::getStoreConfig($this->getPath());
31
+ $availableTypes = explode(",", $configData);
32
+ $ordered = array();
33
+ foreach($availableTypes as $key) {
34
+ if(array_key_exists($key,$types)) {
35
+ $ordered[$key] = $types[$key];
36
+ unset($types[$key]);
37
+ }
38
+ }
39
+
40
+ return array_merge($ordered,$types);
41
+ }
42
+ return $types;
43
+ }
44
  }
app/code/community/Allopass/Hipay/Model/Source/PaymentProfile.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * Allopass Hipay Payments Profiles
6
+ *
7
+ */
8
+ class Allopass_Hipay_Model_Source_PaymentProfile extends Varien_Object
9
+ {
10
+
11
+
12
+ protected $_collection = null;
13
+
14
+ protected function _getCollection()
15
+ {
16
+ if(is_null($this->_collection))
17
+ $this->_collection = Mage::getModel('hipay/paymentProfile')->getCollection();
18
+
19
+ return $this->_collection;
20
+ }
21
+
22
+ public function splitPaymentsToOptionArray()
23
+ {
24
+ /*$options = array();
25
+ foreach ($this->_getCollection()->addFieldToFilter('payment_type','split_payment') as $profile) {
26
+ $options[$profile->getId()] = $profile->getName();
27
+ }
28
+
29
+ return $options;
30
+ */
31
+ return $this->_getCollection()->addFieldToFilter('payment_type','split_payment')->toOptionArray();
32
+ }
33
+
34
+ /**
35
+ * Options getter
36
+ *
37
+ * @return array
38
+ */
39
+ public function toOptionArray()
40
+ {
41
+
42
+ return $this->_getCollection()->toOptionArray();
43
+
44
+ }
45
+
46
+
47
+
48
+ }
app/code/community/Allopass/Hipay/Model/Source/Template.php CHANGED
@@ -6,18 +6,7 @@
6
  *
7
  */
8
  class Allopass_Hipay_Model_Source_Template
9
- {
10
- /*public function toOptionArray()
11
- {
12
-
13
- return array(
14
- array('value' => 'basic', 'label' => Mage::helper('hipay')->__('basic')),
15
- array('value' => 'basic2', 'label' => Mage::helper('hipay')->__('basic2')),
16
- array('value' => 'basic3', 'label' => Mage::helper('hipay')->__('basic3')),
17
- array('value' => 'basic4', 'label' => Mage::helper('hipay')->__('basic4')),
18
- );
19
- }*/
20
-
21
  public function toOptionArray()
22
  {
23
 
6
  *
7
  */
8
  class Allopass_Hipay_Model_Source_Template
9
+ {
 
 
 
 
 
 
 
 
 
 
 
10
  public function toOptionArray()
11
  {
12
 
app/code/community/Allopass/Hipay/Model/SplitPayment.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_SplitPayment extends Mage_Core_Model_Abstract
3
+ {
4
+
5
+ const SPLIT_PAYMENT_STATUS_PENDING = 'pending';
6
+ const SPLIT_PAYMENT_STATUS_FAILED = 'failed';
7
+ const SPLIT_PAYMENT_STATUS_COMPLETE = 'complete';
8
+
9
+ protected function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('hipay/splitPayment');
13
+ $this->setIdFieldName('split_payment_id');
14
+ }
15
+
16
+
17
+ static function getStatues()
18
+ {
19
+ $statues = array(self::SPLIT_PAYMENT_STATUS_PENDING=>Mage::helper('sales')->__('Pending'),
20
+ self::SPLIT_PAYMENT_STATUS_FAILED=>Mage::helper('sales')->__('Failed'),
21
+ self::SPLIT_PAYMENT_STATUS_COMPLETE=>Mage::helper('sales')->__('Complete')
22
+ );
23
+
24
+ return $statues;
25
+ }
26
+
27
+ /**
28
+ *
29
+ * @return boolean|string
30
+ */
31
+ public function pay()
32
+ {
33
+
34
+ if(!$this->canPay())
35
+ Mage::throwException("This split payment is already paid!");
36
+
37
+ if(!$this->getId())
38
+ {
39
+ Mage::throwException("Split Payment not found!");
40
+ }
41
+
42
+ $state = $this->getMethodInstance()->paySplitPayment($this);
43
+
44
+ switch ($state)
45
+ {
46
+ case Allopass_Hipay_Model_Method_Abstract::STATE_COMPLETED:
47
+ case Allopass_Hipay_Model_Method_Abstract::STATE_FORWARDING:
48
+ case Allopass_Hipay_Model_Method_Abstract::STATE_PENDING:
49
+ $this->setStatus(self::SPLIT_PAYMENT_STATUS_COMPLETE);
50
+ break;
51
+ case Allopass_Hipay_Model_Method_Abstract::STATE_DECLINED:
52
+ case Allopass_Hipay_Model_Method_Abstract::STATE_ERROR:
53
+ default:
54
+ $this->setStatus(self::SPLIT_PAYMENT_STATUS_FAILED);
55
+ $this->sendErrorEmail();
56
+ break;
57
+
58
+ }
59
+
60
+ $this->setAttempts($this->getAttempts() + 1);
61
+ $this->save();
62
+ return $this;
63
+
64
+ }
65
+
66
+ public function sendErrorEmail()
67
+ {
68
+ /* @var $helperCheckout Mage_Checkout_Helper_Data */
69
+ $helperCheckout = Mage::helper('checkout');
70
+ $order = Mage::getModel('sales/order')->load($this->getOrderId());
71
+ $message = Mage::helper('hipay')->__("Error on request split Payment HIPAY. Split Payment Id: ".$this->getSplitPaymentId());
72
+ $helperCheckout->sendPaymentFailedEmail($order, $message,'Split Payment Hipay');
73
+ }
74
+
75
+ /**
76
+ * @return Allopass_Hipay_Model_Method_Abstract
77
+ */
78
+ public function getMethodInstance()
79
+ {
80
+ list($moduleName,$methodClass) = explode("_",$this->getMethodCode());
81
+ return MAge::getSingleton($moduleName . "/method_" . $methodClass );
82
+ }
83
+
84
+ public function canPay()
85
+ {
86
+ return $this->getStatus() == self::SPLIT_PAYMENT_STATUS_FAILED || $this->getStatus() == self::SPLIT_PAYMENT_STATUS_PENDING;
87
+ }
88
+
89
+
90
+
91
+ }
app/code/community/Allopass/Hipay/Model/System/Config/Backend/CcTypes.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Model_System_Config_Backend_CcTypes extends Mage_Core_Model_Config_Data
3
+ {
4
+
5
+ protected function _afterload()
6
+ {
7
+ if(!is_array($this->getValue()))
8
+ $this->setValue(explode(",", $this->getValue()));
9
+ return parent::_afterload();
10
+
11
+ }
12
+ }
app/code/community/Allopass/Hipay/controllers/Adminhtml/CardController.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Adminhtml_CardController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+
5
+ /**
6
+ * Init actions
7
+ *
8
+ * @return Allopass_Hipay_Adminhtml_CardController
9
+ */
10
+ protected function _initAction()
11
+ {
12
+ // load layout, set active menu and breadcrumbs
13
+ $this->loadLayout()
14
+ ->_addBreadcrumb(Mage::helper('hipay')->__('Hipay cards'), Mage::helper('hipay')->__('Hipay cards'))
15
+ ;
16
+ return $this;
17
+ }
18
+
19
+ protected function _initCustomer($idFieldName = 'id')
20
+ {
21
+ $this->_title($this->__('Customers'))->_title($this->__('Manage Customers'));
22
+
23
+ $customerId = (int) $this->getRequest()->getParam($idFieldName);
24
+ $customer = Mage::getModel('customer/customer');
25
+
26
+ if ($customerId) {
27
+ $customer->load($customerId);
28
+ }
29
+
30
+ Mage::register('current_customer', $customer);
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ * @return Mage_Core_Controller_Front_Action
36
+ */
37
+ public function preDispatch() {
38
+ parent::preDispatch();
39
+
40
+
41
+ }
42
+
43
+ protected function _getCustomer()
44
+ {
45
+ return Mage::registry('current_customer');
46
+ }
47
+
48
+ public function cardsAction()
49
+ {
50
+ $this->_initCustomer();
51
+ $this->loadLayout()
52
+ ->renderLayout();
53
+
54
+ return $this;
55
+
56
+
57
+ }
58
+
59
+ public function editAction()
60
+ {
61
+ $this->_title($this->__('Hipay'))
62
+ ->_title($this->__('Hipay Card'));
63
+
64
+ // 1. Get ID and create model
65
+ $id = $this->getRequest()->getParam('card_id');
66
+ $model = Mage::getModel('hipay/card');
67
+
68
+ // 2. Initial checking
69
+ if ($id) {
70
+ $model->load($id);
71
+ if (! $model->getId()) {
72
+ Mage::getSingleton('adminhtml/session')->addError(
73
+ Mage::helper('hipay')->__('This card no longer exists.'));
74
+ $this->_redirect('*/*/');
75
+ return;
76
+ }
77
+ }
78
+
79
+ $this->_title($model->getId() ? $this->__("Card %s",$model->getName()) : $this->__('New card'));
80
+
81
+ // 3. Set entered data if was error when we do save
82
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
83
+ if (! empty($data)) {
84
+ $model->setData($data);
85
+ }
86
+
87
+ // 4. Register model to use later in blocks
88
+ Mage::register('current_card', $model);
89
+
90
+ // 5. Build edit form
91
+
92
+ $this->_initAction()->renderLayout();
93
+ }
94
+
95
+ public function newAction()
96
+ {
97
+ $this->_redirect('*/*/edit');
98
+ }
99
+
100
+ public function saveAction()
101
+ {
102
+ // check if data sent
103
+ if ($data = $this->getRequest()->getPost()) {
104
+
105
+ //init model and set data
106
+ $model = Mage::getModel('hipay/card');
107
+
108
+ if ($id = $this->getRequest()->getParam('card_id')) {
109
+ $model->load($id);
110
+ }
111
+
112
+ $model->setData($data);
113
+
114
+ // try to save it
115
+ try {
116
+ // save the data
117
+ $model->save();
118
+
119
+ // display success message
120
+ Mage::getSingleton('adminhtml/session')->addSuccess(
121
+ Mage::helper('hipay')->__('The card has been saved.'));
122
+ // clear previously saved data from session
123
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
124
+ // check if 'Save and Continue'
125
+ if ($this->getRequest()->getParam('back')) {
126
+ $this->_redirect('*/*/edit', array('card_id' => $model->getId(), '_current'=>true));
127
+ return;
128
+ }
129
+
130
+ // go to grid
131
+ $this->_redirect('adminhtml/customer/edit',array('id'=>$model->getCustomerId()));
132
+ return;
133
+
134
+ } catch (Mage_Core_Exception $e) {
135
+ $this->_getSession()->addError($e->getMessage());
136
+ }
137
+ catch (Exception $e) {
138
+ $this->_getSession()->addException($e,
139
+ Mage::helper('hipay')->__('An error occurred while saving the card.'));
140
+ }
141
+
142
+ $this->_getSession()->setFormData($data);
143
+ $this->_redirect('*/*/edit', array('card_id' => $this->getRequest()->getParam('card_id')));
144
+ return;
145
+
146
+ }
147
+ $this->_redirect('adminhtml/customer/index');
148
+ }
149
+
150
+ }
app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentController.php ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_Adminhtml_PaymentController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ /**
5
+ *
6
+ * @var Mage_Sales_Model_Order $order
7
+ */
8
+ protected $_order = null;
9
+
10
+
11
+ /**
12
+ *
13
+ * @return Allopass_Hipay_Model_Method_Abstract $methodInstance
14
+ */
15
+ protected function _getMethodInstance()
16
+ {
17
+
18
+ //list($module,$method) = explode("_", $this->getCheckout()->getMethod());
19
+ //$modelName = $module . "/method_" . $method;
20
+ $modelName = Mage::getStoreConfig('payment/'.$this->getCheckout()->getMethod()."/model");
21
+
22
+ Mage::log($modelName,null,"debug_bo_hipay.log");
23
+ return Mage::getSingleton($modelName);
24
+ //Mage::throwException("Method: '" . __METHOD__ . "' must be implemented!");
25
+ }
26
+
27
+ public function reviewCapturePaymentAction()
28
+ {
29
+ /* @var $order Mage_Sales_Model_Order */
30
+ $id = $this->getRequest()->getParam('order_id');
31
+ $order = Mage::getModel('sales/order')->load($id);
32
+
33
+ if (!$order->getId()) {
34
+ $this->_getSession()->addError($this->__('This order no longer exists.'));
35
+ $this->_redirect('*/*/');
36
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
37
+ return false;
38
+ }
39
+ Mage::register('sales_order', $order);
40
+ Mage::register('current_order', $order);
41
+
42
+ try {
43
+
44
+ $order->getPayment()->accept();
45
+ $message = $this->__('The payment has been accepted.');
46
+ $order->save();
47
+ $this->_getSession()->addSuccess($message);
48
+
49
+ //Capture Payment
50
+ /**
51
+ * Check invoice create availability
52
+ */
53
+ if (!$order->canInvoice()) {
54
+ $this->_getSession()->addError($this->__('The order does not allow creating an invoice.'));
55
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $order->getId()));
56
+ return $this;
57
+ }
58
+
59
+ $invoice = $order->prepareInvoice();
60
+ if (!$invoice->getTotalQty()) {
61
+ Mage::throwException($this->__('Cannot create an invoice without products.'));
62
+ }
63
+
64
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
65
+
66
+ $invoice->register();
67
+ $invoice->getOrder()->setIsInProcess(true);
68
+
69
+ $transactionSave = Mage::getModel('core/resource_transaction')
70
+ ->addObject($invoice)
71
+ ->addObject($invoice->getOrder());
72
+
73
+ $transactionSave->save();
74
+
75
+ $message = $this->__('The payment has been captured.');
76
+ $this->_getSession()->addSuccess($message);
77
+
78
+ } catch (Mage_Core_Exception $e) {
79
+ $this->_getSession()->addError($e->getMessage());
80
+ } catch (Exception $e) {
81
+ $this->_getSession()->addError($this->__('Failed to update the payment.'));
82
+ Mage::logException($e);
83
+ }
84
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $order->getId()));
85
+ }
86
+
87
+ public function sendRequestAction()
88
+ {
89
+ $order = $this->getOrder();
90
+ $payment = $order->getPayment();
91
+
92
+ $methodInstance = $this->_getMethodInstance();
93
+
94
+ try
95
+ {
96
+ $redirectUrl = $methodInstance->place($payment,$order->getBaseTotalDue());
97
+ }
98
+ catch (Exception $e)
99
+ {
100
+ Mage::logException($e);
101
+ $this->_getSession()->addError($e->getMessage());
102
+ $this->_redirect('adminhtml/sales_order/index');
103
+ return $this;
104
+ }
105
+
106
+
107
+ $this->_redirectUrl($redirectUrl);
108
+
109
+ return $this;
110
+
111
+ }
112
+
113
+
114
+ public function acceptAction()
115
+ {
116
+ if(($profileIds = Mage::getSingleton('checkout/session')->getLastRecurringProfileIds()))
117
+ {
118
+ if(is_array($profileIds))
119
+ {
120
+ /* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
121
+ $gatewayResponse = Mage::getSingleton('hipay/api_response_gateway',$this->getRequest()->getParams());
122
+ $collection = Mage::getModel('sales/recurring_profile')->getCollection()
123
+ ->addFieldToFilter('profile_id', array('in' => $profileIds))
124
+ ;
125
+ $profiles = array();
126
+ foreach ($collection as $profile) {
127
+ //$referenceId = $gatewayResponse->getToken()."-".$profile->getId();
128
+ $additionalInfo = array();
129
+ $additionalInfo['ccType'] = $gatewayResponse->getBrand();
130
+ $additionalInfo['ccExpMonth'] = $gatewayResponse->getCardExpiryMonth() ;
131
+ $additionalInfo['ccExpYear'] = $gatewayResponse->getCardExpiryYear();
132
+ $additionalInfo['token'] = $gatewayResponse->getToken();
133
+ $additionalInfo['transaction_id'] = $gatewayResponse->getTransactionReference();
134
+ $profile->setAdditionalInfo($additionalInfo);
135
+ //$profile->setReferenceId($referenceId);
136
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
137
+
138
+ $profile->save();
139
+ }
140
+ }
141
+ }
142
+ /*else
143
+ {
144
+ $this->processResponse();
145
+ }*/
146
+ $this->processResponse();
147
+ Mage::log($this->getUrl('adminhtml/sales_order/view', array('order_id' => $this->getOrder()->getId())),null,"debug_hipay_redirect.log");
148
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
149
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $this->getOrder()->getId()));
150
+ } else {
151
+ $this->_redirect('adminhtml/sales_order/index');
152
+ }
153
+ //$this->_redirect('checkout/onepage/success');
154
+
155
+ return $this;
156
+ }
157
+
158
+ public function pendingAction()
159
+ {
160
+ $this->processResponse();
161
+ $this->_redirect($this->_getMethodInstance()->getConfigData('pending_redirect_page'));
162
+
163
+ return $this;
164
+ }
165
+
166
+ public function declineAction()
167
+ {
168
+ $this->processResponse();
169
+ $this->_redirect('adminhtml/sales_order_create/');
170
+ //$this->_redirect('checkout/onepage/failure');
171
+ return $this;
172
+ }
173
+
174
+
175
+ public function exceptionAction()
176
+ {
177
+ //$this->_redirect('checkout/onepage/failure');
178
+ $this->_redirect('adminhtml/sales_order_create/');
179
+ return $this;
180
+ }
181
+
182
+
183
+ public function cancelAction()
184
+ {
185
+ $this->processResponse();
186
+ //$this->_redirect('checkout/cart');
187
+ $this->_redirect('adminhtml/sales_order_create/');
188
+ return $this;
189
+ }
190
+
191
+ protected function processResponse()
192
+ {
193
+ $order = $this->getOrder();
194
+ $payment = $order->getPayment();
195
+
196
+ /* @var $gatewayResponse Allopass_Hipay_Model_Api_Response_Gateway */
197
+ $gatewayResponse = Mage::getSingleton('hipay/api_response_gateway',$this->getRequest()->getParams());
198
+
199
+ $this->_getMethodInstance()->processResponseToRedirect($gatewayResponse, $payment, $order->getBaseTotalDue());
200
+ }
201
+
202
+
203
+
204
+ /**
205
+ *
206
+ * @return Mage_Sales_Model_Order
207
+ */
208
+ protected function getOrder()
209
+ {
210
+ if(is_null($this->_order))
211
+ {
212
+
213
+ if(($profileIds = $this->getCheckout()->getLastRecurringProfileIds()))
214
+ {
215
+
216
+ if (is_array($profileIds)) {
217
+
218
+ foreach ($profileIds as $profileId)
219
+ {
220
+ /* @var $profile Mage_Sales_Model_Recurring_Profile */
221
+ $profile = Mage::getModel('sales/recurring_profile')->load($profileId);
222
+ /* @var $_helperRecurring Allopass_Hipayrecurring_Helper_Data */
223
+ $_helperRecurring = Mage::helper('hipayrecurring');
224
+
225
+ if($_helperRecurring->isInitialProfileOrder($profile))
226
+ $this->_order = $_helperRecurring->createOrderFromProfile($profile);
227
+ else
228
+ {
229
+ $orderId = current($profile->getChildOrderIds());
230
+ $this->_order = Mage::getModel('sales/order')->load($orderId);
231
+
232
+ $additionalInfo = $profile->getAdditionalInfo();
233
+
234
+ $this->_order->getPayment()->setCcType(isset($additionalInfo['ccType']) ? $additionalInfo['ccType'] : "");
235
+ $this->_order->getPayment()->setCcExpMonth(isset($additionalInfo['ccExpMonth']) ? $additionalInfo['ccExpMonth'] : "");
236
+ $this->_order->getPayment()->setCcExpYear(isset($additionalInfo['ccExpYear']) ? $additionalInfo['ccExpYear'] : "");
237
+ $this->_order->getPayment()->setAdditionalInformation('token',isset($additionalInfo['token']) ? $additionalInfo['token'] : "");
238
+ $this->_order->getPayment()->setAdditionalInformation('create_oneclick',isset($additionalInfo['create_oneclick']) ? $additionalInfo['create_oneclick'] : 1);
239
+ $this->_order->getPayment()->setAdditionalInformation('use_oneclick',isset($additionalInfo['use_oneclick']) ? $additionalInfo['use_oneclick'] : 0);
240
+ $this->_order->getPayment()->setAdditionalInformation('selected_oneclick_card',isset($additionalInfo['selected_oneclick_card']) ? $additionalInfo['selected_oneclick_card'] : 0);
241
+ }
242
+
243
+
244
+
245
+ return $this->_order; //because only one nominal item in cart is authorized and Hipay not manage many profiles
246
+ }
247
+
248
+
249
+ }
250
+
251
+ Mage::throwException("An error occured. Profile Ids not present!");
252
+
253
+
254
+
255
+ }
256
+ else
257
+ {
258
+ $this->_order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
259
+
260
+ }
261
+ }
262
+
263
+ return $this->_order;
264
+ }
265
+
266
+ /**
267
+ * Add method to calculate amount from recurring profile
268
+ * @param Mage_Sales_Model_Recurring_Profile $profile
269
+ * @return int $amount
270
+ **/
271
+ public function getAmountFromProfile(Mage_Sales_Model_Recurring_Profile $profile) {
272
+ $amount = $profile->getBillingAmount() + $profile->getTaxAmount() + $profile->getShippingAmount();
273
+
274
+ if($this->isInitialProfileOrder($profile))
275
+ $amount += $profile->getInitAmount() ;
276
+
277
+ return $amount;
278
+ }
279
+
280
+ protected function isInitialProfileOrder(Mage_Sales_Model_Recurring_Profile $profile)
281
+ {
282
+ if(count($profile->getChildOrderIds()) && current($profile->getChildOrderIds()) == "-1")
283
+ return true;
284
+
285
+ return false;
286
+ }
287
+
288
+
289
+ /**
290
+ *
291
+ * @return Mage_Checkout_Model_Session
292
+ */
293
+ protected function getCheckout()
294
+ {
295
+ return Mage::getSingleton('checkout/session');
296
+ }
297
+ }
app/code/community/Allopass/Hipay/controllers/Adminhtml/PaymentProfileController.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Adminhtml_PaymentProfileController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+
6
+ /**
7
+ * Init actions
8
+ *
9
+ * @return Allopass_Hipay_Adminhtml_PaymentProfileController
10
+ */
11
+ protected function _initAction()
12
+ {
13
+ // load layout, set active menu and breadcrumbs
14
+ $this->loadLayout()
15
+ ->_setActiveMenu('sale/hipay_payment')
16
+ ->_addBreadcrumb(Mage::helper('hipay')->__('Hipay Payment Profiles'), Mage::helper('hipay')->__('Hipay Payment Profiles'))
17
+ ;
18
+ return $this;
19
+ }
20
+
21
+
22
+ public function indexAction()
23
+ {
24
+ $this->_title($this->__('Hipay'))
25
+ ->_title($this->__('Hipay Payment Profiles'));
26
+
27
+ $this->_initAction()
28
+ ->renderLayout();
29
+ }
30
+
31
+ public function editAction()
32
+ {
33
+ $this->_title($this->__('Hipay'))
34
+ ->_title($this->__('Hipay Payment Profiles'));
35
+
36
+ // 1. Get ID and create model
37
+ $id = $this->getRequest()->getParam('profile_id');
38
+ $model = Mage::getModel('hipay/paymentProfile');
39
+
40
+ // 2. Initial checking
41
+ if ($id) {
42
+ $model->load($id);
43
+ if (! $model->getId()) {
44
+ Mage::getSingleton('adminhtml/session')->addError(
45
+ Mage::helper('hipay')->__('This payment profile no longer exists.'));
46
+ $this->_redirect('*/*/');
47
+ return;
48
+ }
49
+ }
50
+
51
+ $this->_title($model->getId() ? $model->getName() : $this->__('New payment profile'));
52
+
53
+ // 3. Set entered data if was error when we do save
54
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
55
+ if (! empty($data)) {
56
+ $model->setData($data);
57
+ }
58
+
59
+ // 4. Register model to use later in blocks
60
+ Mage::register('payment_profile', $model);
61
+
62
+ // 5. Build edit form
63
+
64
+ $this->_initAction()->renderLayout();
65
+ }
66
+
67
+ public function newAction()
68
+ {
69
+ $this->_redirect('*/*/edit');
70
+ }
71
+
72
+ public function saveAction()
73
+ {
74
+ // check if data sent
75
+ if ($data = $this->getRequest()->getPost()) {
76
+
77
+ //init model and set data
78
+ $model = Mage::getModel('hipay/paymentProfile');
79
+
80
+ if ($id = $this->getRequest()->getParam('profile_id')) {
81
+ $model->load($id);
82
+ }
83
+
84
+ $model->setData($data);
85
+
86
+ // try to save it
87
+ try {
88
+ // save the data
89
+ $model->save();
90
+
91
+ // display success message
92
+ Mage::getSingleton('adminhtml/session')->addSuccess(
93
+ Mage::helper('hipay')->__('The payment profile has been saved.'));
94
+ // clear previously saved data from session
95
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
96
+ // check if 'Save and Continue'
97
+ if ($this->getRequest()->getParam('back')) {
98
+ $this->_redirect('*/*/edit', array('profile_id' => $model->getId(), '_current'=>true));
99
+ return;
100
+ }
101
+ // go to grid
102
+ $this->_redirect('*/*/');
103
+ return;
104
+
105
+ } catch (Mage_Core_Exception $e) {
106
+ $this->_getSession()->addError($e->getMessage());
107
+ }
108
+ catch (Exception $e) {
109
+ $this->_getSession()->addException($e,
110
+ Mage::helper('hipay')->__('An error occurred while saving the payment profile.'));
111
+ }
112
+
113
+ $this->_getSession()->setFormData($data);
114
+ $this->_redirect('*/*/edit', array('profile_id' => $this->getRequest()->getParam('profile_id')));
115
+ return;
116
+
117
+ }
118
+ $this->_redirect('*/*/');
119
+ }
120
+
121
+ public function deleteAction()
122
+ {
123
+ // check if we know what should be deleted
124
+ if ($id = $this->getRequest()->getParam('profile_id')) {
125
+
126
+ try {
127
+ // init model and delete
128
+ $model = Mage::getModel('hipay/paymentProfile');
129
+ $model->load($id);
130
+
131
+ $model->delete();
132
+ // display success message
133
+ Mage::getSingleton('adminhtml/session')->addSuccess(
134
+ Mage::helper('hipay')->__('The payment profile has been deleted.'));
135
+ // go to grid
136
+ $this->_redirect('*/*/');
137
+ return;
138
+
139
+ } catch (Exception $e) {
140
+ // display error message
141
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
142
+ // go back to edit form
143
+ $this->_redirect('*/*/edit', array('profile_id' => $id));
144
+ return;
145
+ }
146
+ }
147
+ // display error message
148
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('hipay')->__('Unable to find a payment profile to delete.'));
149
+ // go to grid
150
+ $this->_redirect('*/*/');
151
+ }
152
+
153
+ }
app/code/community/Allopass/Hipay/controllers/Adminhtml/RuleController.php CHANGED
@@ -7,6 +7,7 @@ class Allopass_Hipay_Adminhtml_RuleController extends Mage_Adminhtml_Controller_
7
  public function newConditionHtmlAction()
8
  {
9
  $id = $this->getRequest()->getParam('id');
 
10
  $typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
11
  $type = $typeArr[0];
12
  $method_code = $typeArr[2];
7
  public function newConditionHtmlAction()
8
  {
9
  $id = $this->getRequest()->getParam('id');
10
+
11
  $typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
12
  $type = $typeArr[0];
13
  $method_code = $typeArr[2];
app/code/community/Allopass/Hipay/controllers/Adminhtml/SplitPaymentController.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Allopass_Hipay_Adminhtml_SplitPaymentController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+
6
+ /**
7
+ * Init actions
8
+ *
9
+ * @return Allopass_Hipay_Adminhtml_SplitPaymentController
10
+ */
11
+ protected function _initAction()
12
+ {
13
+ // load layout, set active menu and breadcrumbs
14
+ $this->loadLayout()
15
+ ->_setActiveMenu('sale/hipay_payment')
16
+ ->_addBreadcrumb(Mage::helper('hipay')->__('Hipay Split payments'), Mage::helper('hipay')->__('Hipay Split payments'))
17
+ ;
18
+ return $this;
19
+ }
20
+
21
+
22
+ public function indexAction()
23
+ {
24
+ $this->_title($this->__('Hipay'))
25
+ ->_title($this->__('Hipay Split payments'));
26
+
27
+ $this->_initAction()
28
+ ->renderLayout();
29
+
30
+ return $this;
31
+ }
32
+
33
+ public function editAction()
34
+ {
35
+ $this->_title($this->__('Hipay'))
36
+ ->_title($this->__('Hipay Split Payment'));
37
+
38
+ // 1. Get ID and create model
39
+ $id = $this->getRequest()->getParam('split_payment_id');
40
+ $model = Mage::getModel('hipay/splitPayment');
41
+
42
+ // 2. Initial checking
43
+ if ($id) {
44
+ $model->load($id);
45
+ if (! $model->getId()) {
46
+ Mage::getSingleton('adminhtml/session')->addError(
47
+ Mage::helper('hipay')->__('This split payment no longer exists.'));
48
+ $this->_redirect('*/*/');
49
+ return;
50
+ }
51
+ }
52
+
53
+ $this->_title($model->getId() ? $this->__("Split Payment for order %s",$model->getRealOrderId()) : $this->__('New split payment'));
54
+
55
+ // 3. Set entered data if was error when we do save
56
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
57
+ if (! empty($data)) {
58
+ $model->setData($data);
59
+ }
60
+
61
+ // 4. Register model to use later in blocks
62
+ Mage::register('split_payment', $model);
63
+
64
+ // 5. Build edit form
65
+
66
+ $this->_initAction()->renderLayout();
67
+ }
68
+
69
+ public function newAction()
70
+ {
71
+ $this->_redirect('*/*/edit');
72
+ }
73
+
74
+ public function saveAction()
75
+ {
76
+ // check if data sent
77
+ if ($data = $this->getRequest()->getPost()) {
78
+ $data = $this->_filterDates($data, array("date_to_pay"));
79
+ //init model and set data
80
+ $model = Mage::getModel('hipay/splitPayment');
81
+
82
+ if ($id = $this->getRequest()->getParam('split_payment_id')) {
83
+ $model->load($id);
84
+ }
85
+
86
+ $model->setData($data);
87
+
88
+ // try to save it
89
+ try {
90
+ // save the data
91
+ $model->save();
92
+
93
+ // display success message
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(
95
+ Mage::helper('hipay')->__('The split payment has been saved.'));
96
+ // clear previously saved data from session
97
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
98
+ // check if 'Save and Continue'
99
+ if ($this->getRequest()->getParam('back')) {
100
+ $this->_redirect('*/*/edit', array('split_payment_id' => $model->getId(), '_current'=>true));
101
+ return;
102
+ }
103
+ // go to grid
104
+ $this->_redirect('*/*/');
105
+ return;
106
+
107
+ } catch (Mage_Core_Exception $e) {
108
+ $this->_getSession()->addError($e->getMessage());
109
+ }
110
+ catch (Exception $e) {
111
+ $this->_getSession()->addException($e,
112
+ Mage::helper('hipay')->__('An error occurred while saving the split payment.'));
113
+ }
114
+
115
+ $this->_getSession()->setFormData($data);
116
+ $this->_redirect('*/*/edit', array('split_payment_id' => $this->getRequest()->getParam('split_payment_id')));
117
+ return;
118
+
119
+ }
120
+ $this->_redirect('*/*/');
121
+ }
122
+
123
+ public function payNowAction()
124
+ {
125
+
126
+ //init model and set data
127
+ /* @var $model Allopass_Hipay_Model_SplitPayment */
128
+ $model = Mage::getModel('hipay/splitPayment');
129
+
130
+ if ($id = $this->getRequest()->getParam('split_payment_id')) {
131
+ $model->load($id);
132
+
133
+ try {
134
+ $model->pay();
135
+ switch ($model->getStatus()) {
136
+ case Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_COMPLETE:
137
+ $this->_getSession()->addSuccess(
138
+ Mage::helper('hipay')->__('The split payment has been paid'));
139
+ break;
140
+ case Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_FAILED:
141
+ default:
142
+ $this->_getSession()->addError(
143
+ Mage::helper('hipay')->__('The split payment has NOT been paid'));
144
+ break;
145
+ }
146
+
147
+ } catch (Exception $e) {
148
+
149
+ $this->_getSession()->addException($e,
150
+ Mage::helper('hipay')->__('An error occurred while paid the split payment.'));
151
+
152
+ }
153
+
154
+ if ($this->getRequest()->getParam('back')) {
155
+ $this->_redirect('*/*/edit', array('split_payment_id' => $model->getId(), '_current'=>true));
156
+ return;
157
+ }
158
+ }
159
+
160
+ $this->_redirect('*/*/');
161
+ }
162
+
163
+ }
app/code/community/Allopass/Hipay/controllers/CardController.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_CardController extends Mage_Core_Controller_Front_Action
3
+ {
4
+
5
+ /**
6
+ * Retrieve customer session object
7
+ *
8
+ * @return Mage_Customer_Model_Session
9
+ */
10
+ protected function _getSession()
11
+ {
12
+ return Mage::getSingleton('customer/session');
13
+ }
14
+
15
+ /**
16
+ * @return Mage_Core_Controller_Front_Action
17
+ */
18
+ public function preDispatch() {
19
+ parent::preDispatch();
20
+
21
+ if (!Mage::getSingleton('customer/session')->authenticate($this)) {
22
+ $this->setFlag('', 'no-dispatch', true);
23
+ }
24
+
25
+ }
26
+
27
+ public function indexAction()
28
+ {
29
+
30
+ $this->loadLayout();
31
+ $this->_initLayoutMessages('customer/session');
32
+ $this->renderLayout();
33
+
34
+ return $this;
35
+
36
+
37
+ }
38
+
39
+ public function editAction()
40
+ {
41
+ $card = Mage::getModel('hipay/card');
42
+ // Init card object
43
+ if ($id = $this->getRequest()->getParam('card_id')) {
44
+ $card->load($id);
45
+ if ($card->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId()) {
46
+ $this->_redirect('*/*');
47
+ return;
48
+ }
49
+ else {
50
+ Mage::register('current_card', $card);
51
+ }
52
+ }
53
+
54
+ $this->loadLayout();
55
+ $this->_initLayoutMessages('customer/session');
56
+ $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
57
+ if ($navigationBlock) {
58
+ $navigationBlock->setActive('hipay/card');
59
+ }
60
+ $this->renderLayout();
61
+
62
+ return $this;
63
+
64
+
65
+ }
66
+
67
+ public function editPostAction()
68
+ {
69
+
70
+ if (!$this->_validateFormKey()) {
71
+ return $this->_redirect('*/*/');
72
+ }
73
+ // Save data
74
+ if ($this->getRequest()->isPost()) {
75
+
76
+ $customer = $this->_getSession()->getCustomer();
77
+ $card = Mage::getModel('hipay/card');
78
+ $cardId = $this->getRequest()->getParam('id');
79
+ if ($cardId) {
80
+ $existsCard = $card->load($cardId);
81
+ if ($existsCard->getId() && $existsCard->getCustomerId() == $customer->getId()) {
82
+ $card->setId($existsCard->getId());
83
+ }
84
+ }
85
+
86
+ if(!$card->getId())
87
+ {
88
+ $this->_getSession()->addError("This card no longer exists!");
89
+ return $this->_redirectError(Mage::getUrl('*/*/'));
90
+ }
91
+
92
+ try {
93
+
94
+ $is_default = $this->getRequest()->getPost('is_default');
95
+ if($is_default)
96
+ {
97
+ $cardsByDefault = Mage::getModel('hipay/card')->getCollection()->addFieldToFilter('customer_id',$customer->getId())
98
+ ->addFieldToFilter('is_default',1);
99
+ foreach ($cardsByDefault as $c) {
100
+ $c->setIsDefault(0)->save();
101
+ }
102
+ }
103
+
104
+ $card->setName($this->getRequest()->getPost('name'));
105
+ $card->setIsDefault(empty($is_default) ? 0 : 1);
106
+
107
+ $card->save();
108
+ $this->_getSession()->addSuccess($this->__('The card has been saved.'));
109
+ $this->_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=>true)));
110
+
111
+ return $this;
112
+
113
+ } catch (Mage_Core_Exception $e) {
114
+ $this->_getSession()->setCardFormData($this->getRequest()->getPost())
115
+ ->addException($e, $e->getMessage());
116
+ } catch (Exception $e) {
117
+ $this->_getSession()->setCardFormData($this->getRequest()->getPost())
118
+ ->addException($e, $this->__('Cannot save card.'));
119
+ }
120
+ }
121
+
122
+ return $this->_redirectError(Mage::getUrl('*/*/edit', array('card_id' => $card->getId())));
123
+
124
+ }
125
+
126
+ public function deleteAction()
127
+ {
128
+
129
+ // check if we know what should be deleted
130
+ if ($cardId = $this->getRequest()->getParam('card_id')) {
131
+ $customer = $this->_getSession()->getCustomer();
132
+ $card = Mage::getModel('hipay/card');
133
+
134
+ if ($cardId) {
135
+ $existsCard = $card->load($cardId);
136
+ if ($existsCard->getId() && $existsCard->getCustomerId() == $customer->getId()) {
137
+ $card->setId($existsCard->getId());
138
+ }
139
+ }
140
+
141
+ if(!$card->getId())
142
+ {
143
+ $this->_getSession()->addError("This card no longer exists!");
144
+ return $this->_redirectError(Mage::getUrl('*/*/'));
145
+ }
146
+
147
+ try {
148
+
149
+ //just disable the card
150
+ $card->setCcStatus(Allopass_Hipay_Model_Card::STATUS_DISABLED);
151
+ $card->save();
152
+ // display success message
153
+ $this->_getSession()->addSuccess(
154
+ Mage::helper('hipay')->__('The card has been deleted.'));
155
+ // go to grid
156
+ $this->_redirect('*/*/');
157
+ return;
158
+
159
+ } catch (Exception $e) {
160
+ // display error message
161
+ $this->_getSession()->addError($e->getMessage());
162
+ // go back to edit form
163
+ $this->_redirect('*/*/edit', array('card_id' => $cardId));
164
+ return;
165
+ }
166
+ }
167
+ // display error message
168
+ $this->_getSession()->addError(Mage::helper('hipay')->__('Unable to find a card to delete.'));
169
+ // go to grid
170
+ $this->_redirect('*/*/');
171
+
172
+ }
173
+
174
+
175
+ }
app/code/community/Allopass/Hipay/controllers/NotifyController.php CHANGED
@@ -26,9 +26,11 @@ class Allopass_Hipay_NotifyController extends Mage_Core_Controller_Front_Action
26
  /* @var $_helper Allopass_Hipay_Helper_Data */
27
  $_helper = Mage::helper('hipay');
28
 
 
 
29
 
30
  $signature = $this->getRequest()->getServer('HTTP_X_ALLOPASS_SIGNATURE');
31
- return $_helper->checkSignature($signature,true);
32
  }
33
 
34
 
@@ -42,8 +44,8 @@ class Allopass_Hipay_NotifyController extends Mage_Core_Controller_Front_Action
42
  /* @var $order Mage_Sales_Model_Order */
43
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderArr['id']);
44
 
45
- if(!$order->getId() && strpos($orderArr['id'], 'recurring') === false)
46
- Mage::throwException("Order not found in notification");
47
 
48
  if(strpos($orderArr['id'], 'recurring') !== false)
49
  {
@@ -68,12 +70,18 @@ class Allopass_Hipay_NotifyController extends Mage_Core_Controller_Front_Action
68
 
69
  }
70
  else
71
- Mage::throwException(Mage::helper('hipay')->__("Profile for ID: %d doesn't exists (Recurring).",$profileId));
72
  }
73
  else
74
- Mage::throwException(Mage::helper('hipay')->__("Order Id not present (Recurring)."));
75
 
76
  }
 
 
 
 
 
 
77
 
78
  $payment = $order->getPayment();
79
  /* @var $methodInstance Allopass_Hipay_Model_Method_Abstract */
@@ -137,7 +145,8 @@ class Allopass_Hipay_NotifyController extends Mage_Core_Controller_Front_Action
137
  $order->getPayment()->setAdditionalInformation('token',$additionalInfo['token']);
138
  $order->getPayment()->setAdditionalInformation('create_oneclick',$additionalInfo['create_oneclick']);
139
  $order->getPayment()->setAdditionalInformation('use_oneclick',$additionalInfo['use_oneclick']);
140
-
 
141
  $order->setState(Mage_Sales_Model_Order::STATE_NEW,'pending',Mage::helper('hipay')->__("New Order Recurring!"));
142
 
143
  $order->save();
26
  /* @var $_helper Allopass_Hipay_Helper_Data */
27
  $_helper = Mage::helper('hipay');
28
 
29
+ /* @var $response Allopass_Hipay_Model_Api_Response_Notification */
30
+ $response = Mage::getSingleton('hipay/api_response_notification',$this->getRequest()->getParams());
31
 
32
  $signature = $this->getRequest()->getServer('HTTP_X_ALLOPASS_SIGNATURE');
33
+ return $_helper->checkSignature($signature,true,$response);
34
  }
35
 
36
 
44
  /* @var $order Mage_Sales_Model_Order */
45
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderArr['id']);
46
 
47
+ if(!$order->getId() && (strpos($orderArr['id'], 'recurring') === false && strpos($orderArr['id'], 'split') === false))
48
+ die("Order not found in notification");
49
 
50
  if(strpos($orderArr['id'], 'recurring') !== false)
51
  {
70
 
71
  }
72
  else
73
+ die(Mage::helper('hipay')->__("Profile for ID: %d doesn't exists (Recurring).",$profileId));
74
  }
75
  else
76
+ die(Mage::helper('hipay')->__("Order Id not present (Recurring)."));
77
 
78
  }
79
+ elseif (strpos($orderArr['id'], 'split') !== false)
80
+ {
81
+ list($id,$type,$splitPaymentId) = explode("-", $orderArr['id']);
82
+ /* @var $order Mage_Sales_Model_Order */
83
+ $order = Mage::getModel('sales/order')->loadByIncrementId($id);
84
+ }
85
 
86
  $payment = $order->getPayment();
87
  /* @var $methodInstance Allopass_Hipay_Model_Method_Abstract */
145
  $order->getPayment()->setAdditionalInformation('token',$additionalInfo['token']);
146
  $order->getPayment()->setAdditionalInformation('create_oneclick',$additionalInfo['create_oneclick']);
147
  $order->getPayment()->setAdditionalInformation('use_oneclick',$additionalInfo['use_oneclick']);
148
+ //$order->getPayment()->setAdditionalInformation('selected_oneclick_card', $additionalInfo['selected_oneclick_card']);
149
+
150
  $order->setState(Mage_Sales_Model_Order::STATE_NEW,'pending',Mage::helper('hipay')->__("New Order Recurring!"));
151
 
152
  $order->save();
app/code/community/Allopass/Hipay/controllers/PaypalapiController.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Allopass_Hipay_PaypalapiController extends Allopass_Hipay_Controller_Payment
3
+ {
4
+ protected function _getMethodInstance()
5
+ {
6
+ return Mage::getSingleton('hipay/method_paypalApi');
7
+ }
8
+ }
app/code/community/Allopass/Hipay/controllers/Sales/Order/CreateController.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Adminhtml/controllers/Sales/Order/CreateController.php';
4
+
5
+ class Allopass_Hipay_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController
6
+ {
7
+
8
+
9
+
10
+ /**
11
+ * Saving quote and create order
12
+ */
13
+ public function saveAction()
14
+ {
15
+ try {
16
+ $this->_processActionData('save');
17
+ $paymentData = $this->getRequest()->getPost('payment');
18
+ if ($paymentData) {
19
+ $paymentData['checks'] = Mage_Payment_Model_Method_Abstract::CHECK_USE_INTERNAL
20
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY
21
+ | Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY
22
+ | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
23
+ | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL;
24
+ $this->_getOrderCreateModel()->setPaymentData($paymentData);
25
+ $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
26
+ }
27
+
28
+ $order = $this->_getOrderCreateModel()
29
+ ->setIsValidate(true)
30
+ ->importPostData($this->getRequest()->getPost('order'))
31
+ ->createOrder();
32
+
33
+ $this->_getSession()->clear();
34
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));
35
+
36
+
37
+ /**
38
+ * if payment method is hipay so we need to change redirection
39
+ */
40
+ if(strpos($order->getPayment()->getMethod(), 'hipay') !== false)
41
+ {
42
+
43
+ $this->_redirect('hipay/adminhtml_payment/sendRequest',array('_secure' => true));
44
+
45
+ // add order information to the session
46
+ Mage::getSingleton('checkout/session')->setLastOrderId($order->getId())
47
+ ->setMethod($order->getPayment()->getMethod())
48
+ ->setLastRealOrderId($order->getIncrementId());
49
+ }
50
+ else
51
+ {
52
+
53
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
54
+ $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
55
+ } else {
56
+ $this->_redirect('*/sales_order/index');
57
+ }
58
+ }
59
+ } catch (Mage_Payment_Model_Info_Exception $e) {
60
+ $this->_getOrderCreateModel()->saveQuote();
61
+ $message = $e->getMessage();
62
+ if( !empty($message) ) {
63
+ $this->_getSession()->addError($message);
64
+ }
65
+ $this->_redirect('*/*/');
66
+ } catch (Mage_Core_Exception $e){
67
+ $message = $e->getMessage();
68
+ if( !empty($message) ) {
69
+ $this->_getSession()->addError($message);
70
+ }
71
+ $this->_redirect('*/*/');
72
+ }
73
+ catch (Exception $e){
74
+ $this->_getSession()->addException($e, $this->__('Order saving error: %s', $e->getMessage()));
75
+ $this->_redirect('*/*/');
76
+ }
77
+ }
78
+
79
+ }
app/code/community/Allopass/Hipay/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Allopass_Hipay>
5
- <version>1.0.3</version>
6
  </Allopass_Hipay>
7
  </modules>
8
  <global>
@@ -28,6 +28,15 @@
28
  <rule>
29
  <table>hipay_rule</table>
30
  </rule>
 
 
 
 
 
 
 
 
 
31
  </entities>
32
  </hipay_resource>
33
  </models>
@@ -38,6 +47,25 @@
38
  </setup>
39
  </allopass_hipay_setup>
40
  </resources>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  <template_hipay>
42
  <hosted>
43
  <basic>
@@ -127,6 +155,10 @@
127
  <pending_capture translate="label"><label>Pending Capture</label></pending_capture>
128
  <capture_requested translate="label"><label>Capture Requested</label></capture_requested>
129
  <refund_requested translate="label"><label>Refund Requested</label></refund_requested>
 
 
 
 
130
  </statuses>
131
  </order>
132
  </sales>
@@ -171,16 +203,18 @@
171
  </controller_action_postdispatch_checkout_onepage_saveOrder>
172
  </events>
173
  </frontend>
174
- <adminhtml>
175
- <routers>
176
- <hipay>
177
- <use>admin</use>
178
  <args>
179
- <module>Allopass_Hipay</module>
180
- <frontName>hipay</frontName>
 
181
  </args>
182
- </hipay>
183
  </routers>
 
 
184
  <translate>
185
  <modules>
186
  <Allopass_Hipay>
@@ -190,6 +224,28 @@
190
  </Allopass_Hipay>
191
  </modules>
192
  </translate>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  <acl>
194
  <resources>
195
  <admin>
@@ -212,6 +268,21 @@
212
  </config>
213
  </children>
214
  </system>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  </children>
216
  </admin>
217
  </resources>
@@ -223,10 +294,28 @@
223
  </hipay>
224
  </updates>
225
  </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  </adminhtml>
227
  <default>
228
  <hipay>
229
- <hipay_api>
230
  <api_password backend_model="adminhtml/system_config_backend_encrypted"/>
231
  <api_password_test backend_model="adminhtml/system_config_backend_encrypted"/>
232
  <secret_passphrase backend_model="adminhtml/system_config_backend_encrypted"/>
@@ -235,19 +324,33 @@
235
  <gateway_endpoint_stage>https://stage-secure-gateway.allopass.com/rest/v1/</gateway_endpoint_stage>
236
  <gateway_endpoint_production>https://secure-gateway.allopass.com/rest/v1/</gateway_endpoint_production>
237
  </hipay_api>
 
 
 
 
 
 
 
 
 
 
 
 
238
  </hipay>
239
  <payment>
240
  <hipay_cc>
241
  <active>0</active>
242
  <title>HiPay Credit Card</title>
243
  <payment_action>authorize_capture</payment_action>
244
- <cctypes>AE,VI,MC</cctypes>
 
245
  <useccv>1</useccv>
246
  <order_status_payment_accepted>processing</order_status_payment_accepted>
247
  <order_status_payment_refused>canceled</order_status_payment_refused>
248
  <order_status_payment_canceled>canceled</order_status_payment_canceled>
249
  <hipay_status_validate_order>118</hipay_status_validate_order>
250
  <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
 
251
  <allow_use_oneclick>0</allow_use_oneclick>
252
  <invoice_create>1</invoice_create>
253
  <re_add_to_cart>0</re_add_to_cart>
@@ -261,6 +364,7 @@
261
  <exception_url>hipay/cc/exception</exception_url>
262
  <cancel_url>hipay/cc/cancel</cancel_url>
263
  <use_3d_secure>1</use_3d_secure>
 
264
  </hipay_cc>
265
  <hipay_hosted>
266
  <active>0</active>
@@ -272,6 +376,7 @@
272
  <order_status_payment_canceled>canceled</order_status_payment_canceled>
273
  <hipay_status_validate_order>118</hipay_status_validate_order>
274
  <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
 
275
  <display_selector>1</display_selector>
276
  <template>basic</template>
277
  <allow_use_oneclick>0</allow_use_oneclick>
@@ -279,9 +384,10 @@
279
  <re_add_to_cart>0</re_add_to_cart>
280
  <cancel_pending_order>1</cancel_pending_order>
281
  <display_iframe>0</display_iframe>
282
- <iframe_width>450</iframe_width>
283
- <iframe_height>670</iframe_height>
284
- <iframe_style>border:1px solid #CCC;border-radius:15px;padding:10px;max-width:500px;</iframe_style>
 
285
  <is_test_mode>0</is_test_mode>
286
  <debug>0</debug>
287
  <model>hipay/method_hosted</model>
@@ -291,6 +397,7 @@
291
  <exception_url>hipay/hosted/exception</exception_url>
292
  <cancel_url>hipay/hosted/cancel</cancel_url>
293
  <use_3d_secure>1</use_3d_secure>
 
294
  </hipay_hosted>
295
  <hipay_sofortapi>
296
  <active>0</active> <!-- Activé ou non -->
@@ -317,6 +424,7 @@
317
  <exception_url>hipay/sofortapi/exception</exception_url><!-- Url execption de la méthode -->
318
  <cancel_url>hipay/sofortapi/cancel</cancel_url><!-- Url cancel de la méthode -->
319
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
320
  </hipay_sofortapi>
321
  <hipay_ideal>
322
  <active>0</active> <!-- Activé ou non -->
@@ -345,6 +453,7 @@
345
  <exception_url>hipay/ideal/exception</exception_url><!-- Url execption de la méthode -->
346
  <cancel_url>hipay/ideal/cancel</cancel_url><!-- Url cancel de la méthode -->
347
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
348
  </hipay_ideal>
349
  <hipay_ing>
350
  <active>0</active> <!-- Activé ou non -->
@@ -373,6 +482,7 @@
373
  <exception_url>hipay/ing/exception</exception_url><!-- Url execption de la méthode -->
374
  <cancel_url>hipay/ing/cancel</cancel_url><!-- Url cancel de la méthode -->
375
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
376
  </hipay_ing>
377
  <hipay_dexia>
378
  <active>0</active> <!-- Activé ou non -->
@@ -401,63 +511,66 @@
401
  <exception_url>hipay/dexia/exception</exception_url><!-- Url execption de la méthode -->
402
  <cancel_url>hipay/dexia/cancel</cancel_url><!-- Url cancel de la méthode -->
403
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
404
  </hipay_dexia>
405
- <hipay_cbc>
406
- <active>0</active> <!-- Activé ou non -->
407
- <title>HiPay CBC Online</title> <!-- Titre par défaut modifiable en admin -->
408
- <payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
409
- <cctypes>cbc-online</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
410
- <!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
411
- <order_status_payment_accepted>processing</order_status_payment_accepted><!-- valeur par défaut du statut quand le paiement est accepté -->
412
- <order_status_payment_refused>canceled</order_status_payment_refused><!-- valeur par défaut du statut quand le paiement est refusé -->
413
- <order_status_payment_canceled>canceled</order_status_payment_canceled><!-- valeur par défaut du statut quand le paiement est annulé -->
414
- <hipay_status_validate_order>118</hipay_status_validate_order><!-- valeur par défaut du statut hipay qui valide la commande (118 ou 117)-->
415
- <pending_redirect_page>hipay/checkout/pending</pending_redirect_page><!-- valeur par défaut pour la page de redirection en cas de state "pending"-->
416
- <display_selector>0</display_selector><!-- valeur par défaut l'affichage du selecteur de carte (uniquement en mode Hosted)-->
417
- <template>basic</template><!-- valeur par défaut du template de la page hénergé (uniquement en mode Hosted)-->
418
- <allow_use_oneclick>0</allow_use_oneclick><!-- valeur par défaut de l'utilisation du oneclick -->
419
- <invoice_create>1</invoice_create><!-- valeur par défaut de la création de la facture -->
420
- <re_add_to_cart>0</re_add_to_cart><!-- valeur par défaut du re-remplissage du panier -->
421
- <cancel_pending_order>1</cancel_pending_order><!-- valeur par défaut des annulation de commande "en attente" depuis 30 minutes -->
422
- <display_iframe>0</display_iframe><!-- valeur par défaut mode Iframe (uniquement en mode Hosted)-->
423
- <is_test_mode>0</is_test_mode><!-- valeur par défaut du mode test -->
424
- <debug>0</debug><!-- valeur par défaut du mode debug -->
425
- <model>hipay/method_cbc</model><!-- Classe model de la méthode -->
426
- <accept_url>hipay/cbc/accept</accept_url><!-- Url accept de la méthode -->
427
- <pending_url>hipay/cbc/pending</pending_url><!-- Url pending de la méthode -->
428
- <decline_url>hipay/cbc/decline</decline_url><!-- Url decline de la méthode -->
429
- <exception_url>hipay/cbc/exception</exception_url><!-- Url execption de la méthode -->
430
- <cancel_url>hipay/cbc/cancel</cancel_url><!-- Url cancel de la méthode -->
431
- <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
432
- </hipay_cbc>
433
- <hipay_kbc>
434
- <active>0</active> <!-- Activé ou non -->
435
- <title>HiPay KBC Online</title> <!-- Titre par défaut modifiable en admin -->
436
- <payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
437
- <cctypes>kbc-online</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
438
- <!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
439
- <order_status_payment_accepted>processing</order_status_payment_accepted><!-- valeur par défaut du statut quand le paiement est accepté -->
440
- <order_status_payment_refused>canceled</order_status_payment_refused><!-- valeur par défaut du statut quand le paiement est refusé -->
441
- <order_status_payment_canceled>canceled</order_status_payment_canceled><!-- valeur par défaut du statut quand le paiement est annulé -->
442
- <hipay_status_validate_order>118</hipay_status_validate_order><!-- valeur par défaut du statut hipay qui valide la commande (118 ou 117)-->
443
- <pending_redirect_page>hipay/checkout/pending</pending_redirect_page><!-- valeur par défaut pour la page de redirection en cas de state "pending"-->
444
- <display_selector>0</display_selector><!-- valeur par défaut l'affichage du selecteur de carte (uniquement en mode Hosted)-->
445
- <template>basic</template><!-- valeur par défaut du template de la page hénergé (uniquement en mode Hosted)-->
446
- <allow_use_oneclick>0</allow_use_oneclick><!-- valeur par défaut de l'utilisation du oneclick -->
447
- <invoice_create>1</invoice_create><!-- valeur par défaut de la création de la facture -->
448
- <re_add_to_cart>0</re_add_to_cart><!-- valeur par défaut du re-remplissage du panier -->
449
- <cancel_pending_order>1</cancel_pending_order><!-- valeur par défaut des annulation de commande "en attente" depuis 30 minutes -->
450
- <display_iframe>0</display_iframe><!-- valeur par défaut mode Iframe (uniquement en mode Hosted)-->
451
- <is_test_mode>0</is_test_mode><!-- valeur par défaut du mode test -->
452
- <debug>0</debug><!-- valeur par défaut du mode debug -->
453
- <model>hipay/method_kbc</model><!-- Classe model de la méthode -->
454
- <accept_url>hipay/kbc/accept</accept_url><!-- Url accept de la méthode -->
455
- <pending_url>hipay/kbc/pending</pending_url><!-- Url pending de la méthode -->
456
- <decline_url>hipay/kbc/decline</decline_url><!-- Url decline de la méthode -->
457
- <exception_url>hipay/kbc/exception</exception_url><!-- Url execption de la méthode -->
458
- <cancel_url>hipay/kbc/cancel</cancel_url><!-- Url cancel de la méthode -->
459
- <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
460
- </hipay_kbc>
 
 
461
  <hipay_giropay>
462
  <active>0</active> <!-- Activé ou non -->
463
  <title>HiPay Giropay</title> <!-- Titre par défaut modifiable en admin -->
@@ -485,6 +598,7 @@
485
  <exception_url>hipay/giropay/exception</exception_url><!-- Url execption de la méthode -->
486
  <cancel_url>hipay/giropay/cancel</cancel_url><!-- Url cancel de la méthode -->
487
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
488
  </hipay_giropay>
489
  <hipay_przelewy24api>
490
  <active>0</active> <!-- Activé ou non -->
@@ -513,6 +627,7 @@
513
  <exception_url>hipay/przelewy24api/exception</exception_url><!-- Url execption de la méthode -->
514
  <cancel_url>hipay/przelewy24api/cancel</cancel_url><!-- Url cancel de la méthode -->
515
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
516
  </hipay_przelewy24api>
517
  <hipay_sisalapi>
518
  <active>0</active> <!-- Activé ou non -->
@@ -539,7 +654,8 @@
539
  <exception_url>hipay/sisalapi/exception</exception_url><!-- Url execption de la méthode -->
540
  <cancel_url>hipay/sisalapi/cancel</cancel_url><!-- Url cancel de la méthode -->
541
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
542
- </hipay_sisalapi>
 
543
  <hipay_qiwi>
544
  <active>0</active> <!-- Activé ou non -->
545
  <title>HiPay Visa Qiwi Wallet</title> <!-- Titre par défaut modifiable en admin -->
@@ -567,6 +683,7 @@
567
  <exception_url>hipay/qiwi/exception</exception_url><!-- Url execption de la méthode -->
568
  <cancel_url>hipay/qiwi/cancel</cancel_url><!-- Url cancel de la méthode -->
569
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
570
  </hipay_qiwi>
571
  <hipay_webmoneyapi>
572
  <active>0</active> <!-- Activé ou non -->
@@ -595,6 +712,7 @@
595
  <exception_url>hipay/webmoneyapi/exception</exception_url><!-- Url execption de la méthode -->
596
  <cancel_url>hipay/webmoneyapi/cancel</cancel_url><!-- Url cancel de la méthode -->
597
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
598
  </hipay_webmoneyapi>
599
  <hipay_yandexapi>
600
  <active>0</active> <!-- Activé ou non -->
@@ -623,15 +741,47 @@
623
  <exception_url>hipay/yandexapi/exception</exception_url><!-- Url execption de la méthode -->
624
  <cancel_url>hipay/yandexapi/cancel</cancel_url><!-- Url cancel de la méthode -->
625
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
 
626
  </hipay_yandexapi>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
627
  </payment>
628
  </default>
629
  <crontab>
630
  <jobs>
 
 
 
 
631
  <clean_orders_hipay_in_pending>
632
  <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
633
  <run><model>hipay/observer::cancelOrdersInPending</model></run>
634
- </clean_orders_hipay_in_pending>
635
  </jobs>
636
  </crontab>
637
- </config>
2
  <config>
3
  <modules>
4
  <Allopass_Hipay>
5
+ <version>1.2.2</version>
6
  </Allopass_Hipay>
7
  </modules>
8
  <global>
28
  <rule>
29
  <table>hipay_rule</table>
30
  </rule>
31
+ <paymentProfile>
32
+ <table>hipay_payment_profile</table>
33
+ </paymentProfile>
34
+ <splitPayment>
35
+ <table>hipay_split_payment</table>
36
+ </splitPayment>
37
+ <card>
38
+ <table>hipay_customer_card</table>
39
+ </card>
40
  </entities>
41
  </hipay_resource>
42
  </models>
47
  </setup>
48
  </allopass_hipay_setup>
49
  </resources>
50
+ <template>
51
+ <email>
52
+ <hipay_fraud_payment_template translate="label" module="hipay">
53
+ <label>Fraud Payment</label>
54
+ <file>hipay_fraud_payment.html</file>
55
+ <type>html</type>
56
+ </hipay_fraud_payment_template>
57
+ <hipay_fraud_payment_accept_template translate="label" module="hipay">
58
+ <label>Fraud Payment Accepted</label>
59
+ <file>hipay_fraud_payment_accept.html</file>
60
+ <type>html</type>
61
+ </hipay_fraud_payment_accept_template>
62
+ <hipay_fraud_payment_deny_template translate="label" module="hipay">
63
+ <label>Fraud Payment Deny</label>
64
+ <file>hipay_fraud_payment_deny.html</file>
65
+ <type>html</type>
66
+ </hipay_fraud_payment_deny_template>
67
+ </email>
68
+ </template>
69
  <template_hipay>
70
  <hosted>
71
  <basic>
155
  <pending_capture translate="label"><label>Pending Capture</label></pending_capture>
156
  <capture_requested translate="label"><label>Capture Requested</label></capture_requested>
157
  <refund_requested translate="label"><label>Refund Requested</label></refund_requested>
158
+ <authorization_requested translate="label"><label>Authorization Requested</label></authorization_requested>
159
+ <expired translate="label"><label>Transaction Expired</label></expired>
160
+ <partial_refund translate="label"><label>Partial Refund</label></partial_refund>
161
+ <partial_capture translate="label"><label>Partial capture</label></partial_capture>
162
  </statuses>
163
  </order>
164
  </sales>
203
  </controller_action_postdispatch_checkout_onepage_saveOrder>
204
  </events>
205
  </frontend>
206
+ <admin>
207
+ <routers>
208
+ <adminhtml>
 
209
  <args>
210
+ <modules>
211
+ <allopass_hipay before="Mage_Adminhtml">Allopass_Hipay_Adminhtml</allopass_hipay>
212
+ </modules>
213
  </args>
214
+ </adminhtml>
215
  </routers>
216
+ </admin>
217
+ <adminhtml>
218
  <translate>
219
  <modules>
220
  <Allopass_Hipay>
224
  </Allopass_Hipay>
225
  </modules>
226
  </translate>
227
+ <menu>
228
+ <sales>
229
+ <children>
230
+ <hipay_payment translate="title" module="hipay">
231
+ <title>Hipay</title>
232
+ <sort_order>200</sort_order>
233
+ <children>
234
+ <payment_profile translate="title" module="hipay">
235
+ <title>Split Payment Profiles</title>
236
+ <action>adminhtml/paymentProfile</action>
237
+ <sort_order>10</sort_order>
238
+ </payment_profile>
239
+ <split_payment translate="title" module="hipay">
240
+ <title>Split payments</title>
241
+ <action>adminhtml/splitPayment</action>
242
+ <sort_order>20</sort_order>
243
+ </split_payment>
244
+ </children>
245
+ </hipay_payment>
246
+ </children>
247
+ </sales>
248
+ </menu>
249
  <acl>
250
  <resources>
251
  <admin>
268
  </config>
269
  </children>
270
  </system>
271
+ <sales>
272
+ <children>
273
+ <hipay_payment translate="title" module="hipay">
274
+ <title>Hipay Payment</title>
275
+ <children>
276
+ <payment_profile translate="title" module="hipay">
277
+ <title>Split Payment Profile</title>
278
+ </payment_profile>
279
+ <split_payment translate="title" module="hipay">
280
+ <title>Split payments</title>
281
+ </split_payment>
282
+ </children>
283
+ </hipay_payment>
284
+ </children>
285
+ </sales>
286
  </children>
287
  </admin>
288
  </resources>
294
  </hipay>
295
  </updates>
296
  </layout>
297
+ <events>
298
+ <adminhtml_widget_container_html_before>
299
+ <observers>
300
+ <arrange_order_view>
301
+ <class>hipay/observer</class>
302
+ <method>arrangeOrderView</method>
303
+ </arrange_order_view>
304
+ </observers>
305
+ </adminhtml_widget_container_html_before>
306
+ <sales_order_load_after>
307
+ <observers>
308
+ <order_can_refund>
309
+ <class>hipay/observer</class>
310
+ <method>orderCanRefund</method>
311
+ </order_can_refund>
312
+ </observers>
313
+ </sales_order_load_after>
314
+ </events>
315
  </adminhtml>
316
  <default>
317
  <hipay>
318
+ <hipay_api>
319
  <api_password backend_model="adminhtml/system_config_backend_encrypted"/>
320
  <api_password_test backend_model="adminhtml/system_config_backend_encrypted"/>
321
  <secret_passphrase backend_model="adminhtml/system_config_backend_encrypted"/>
324
  <gateway_endpoint_stage>https://stage-secure-gateway.allopass.com/rest/v1/</gateway_endpoint_stage>
325
  <gateway_endpoint_production>https://secure-gateway.allopass.com/rest/v1/</gateway_endpoint_production>
326
  </hipay_api>
327
+ <fraud_payment>
328
+ <identity>general</identity>
329
+ <template>hipay_fraud_payment_template</template>
330
+ </fraud_payment>
331
+ <fraud_payment_accept>
332
+ <identity>general</identity>
333
+ <template>hipay_fraud_payment_accept_template</template>
334
+ </fraud_payment_accept>
335
+ <fraud_payment_deny>
336
+ <identity>general</identity>
337
+ <template>hipay_fraud_payment_deny_template</template>
338
+ </fraud_payment_deny>
339
  </hipay>
340
  <payment>
341
  <hipay_cc>
342
  <active>0</active>
343
  <title>HiPay Credit Card</title>
344
  <payment_action>authorize_capture</payment_action>
345
+ <cctypes>VI,MC,AE</cctypes>
346
+ <display_card_owner>0</display_card_owner>
347
  <useccv>1</useccv>
348
  <order_status_payment_accepted>processing</order_status_payment_accepted>
349
  <order_status_payment_refused>canceled</order_status_payment_refused>
350
  <order_status_payment_canceled>canceled</order_status_payment_canceled>
351
  <hipay_status_validate_order>118</hipay_status_validate_order>
352
  <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
353
+ <allow_split_payment>0</allow_split_payment>
354
  <allow_use_oneclick>0</allow_use_oneclick>
355
  <invoice_create>1</invoice_create>
356
  <re_add_to_cart>0</re_add_to_cart>
364
  <exception_url>hipay/cc/exception</exception_url>
365
  <cancel_url>hipay/cc/cancel</cancel_url>
366
  <use_3d_secure>1</use_3d_secure>
367
+ <send_fraud_payment_email>0</send_fraud_payment_email>
368
  </hipay_cc>
369
  <hipay_hosted>
370
  <active>0</active>
376
  <order_status_payment_canceled>canceled</order_status_payment_canceled>
377
  <hipay_status_validate_order>118</hipay_status_validate_order>
378
  <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>
379
+ <allow_split_payment>0</allow_split_payment>
380
  <display_selector>1</display_selector>
381
  <template>basic</template>
382
  <allow_use_oneclick>0</allow_use_oneclick>
384
  <re_add_to_cart>0</re_add_to_cart>
385
  <cancel_pending_order>1</cancel_pending_order>
386
  <display_iframe>0</display_iframe>
387
+ <iframe_width>485px</iframe_width>
388
+ <iframe_height>450px</iframe_height>
389
+ <iframe_style>margin: 10px 0; border: 1px solid #BEBCB7;</iframe_style>
390
+ <iframe_wrapper_style>text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;</iframe_wrapper_style>
391
  <is_test_mode>0</is_test_mode>
392
  <debug>0</debug>
393
  <model>hipay/method_hosted</model>
397
  <exception_url>hipay/hosted/exception</exception_url>
398
  <cancel_url>hipay/hosted/cancel</cancel_url>
399
  <use_3d_secure>1</use_3d_secure>
400
+ <send_fraud_payment_email>0</send_fraud_payment_email>
401
  </hipay_hosted>
402
  <hipay_sofortapi>
403
  <active>0</active> <!-- Activé ou non -->
424
  <exception_url>hipay/sofortapi/exception</exception_url><!-- Url execption de la méthode -->
425
  <cancel_url>hipay/sofortapi/cancel</cancel_url><!-- Url cancel de la méthode -->
426
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
427
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
428
  </hipay_sofortapi>
429
  <hipay_ideal>
430
  <active>0</active> <!-- Activé ou non -->
453
  <exception_url>hipay/ideal/exception</exception_url><!-- Url execption de la méthode -->
454
  <cancel_url>hipay/ideal/cancel</cancel_url><!-- Url cancel de la méthode -->
455
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
456
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
457
  </hipay_ideal>
458
  <hipay_ing>
459
  <active>0</active> <!-- Activé ou non -->
482
  <exception_url>hipay/ing/exception</exception_url><!-- Url execption de la méthode -->
483
  <cancel_url>hipay/ing/cancel</cancel_url><!-- Url cancel de la méthode -->
484
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
485
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
486
  </hipay_ing>
487
  <hipay_dexia>
488
  <active>0</active> <!-- Activé ou non -->
511
  <exception_url>hipay/dexia/exception</exception_url><!-- Url execption de la méthode -->
512
  <cancel_url>hipay/dexia/cancel</cancel_url><!-- Url cancel de la méthode -->
513
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
514
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
515
  </hipay_dexia>
516
+ <!-- <hipay_cbc> -->
517
+ <!-- <active>0</active> Activé ou non -->
518
+ <!-- <title>HiPay CBC Online</title> Titre par défaut modifiable en admin -->
519
+ <!-- <payment_action>authorize_capture</payment_action> Type d'action de paiement (authorize_capture ou authorize) -->
520
+ <!-- <cctypes>cbc-online</cctypes> Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
521
+ <!-- <useccv>1</useccv> permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
522
+ <!-- <order_status_payment_accepted>processing</order_status_payment_accepted>valeur par défaut du statut quand le paiement est accepté -->
523
+ <!-- <order_status_payment_refused>canceled</order_status_payment_refused>valeur par défaut du statut quand le paiement est refusé -->
524
+ <!-- <order_status_payment_canceled>canceled</order_status_payment_canceled>valeur par défaut du statut quand le paiement est annulé -->
525
+ <!-- <hipay_status_validate_order>118</hipay_status_validate_order>valeur par défaut du statut hipay qui valide la commande (118 ou 117) -->
526
+ <!-- <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>valeur par défaut pour la page de redirection en cas de state "pending" -->
527
+ <!-- <display_selector>0</display_selector>valeur par défaut l'affichage du selecteur de carte (uniquement en mode Hosted) -->
528
+ <!-- <template>basic</template>valeur par défaut du template de la page hénergé (uniquement en mode Hosted) -->
529
+ <!-- <allow_use_oneclick>0</allow_use_oneclick>valeur par défaut de l'utilisation du oneclick -->
530
+ <!-- <invoice_create>1</invoice_create>valeur par défaut de la création de la facture -->
531
+ <!-- <re_add_to_cart>0</re_add_to_cart>valeur par défaut du re-remplissage du panier -->
532
+ <!-- <cancel_pending_order>1</cancel_pending_order>valeur par défaut des annulation de commande "en attente" depuis 30 minutes -->
533
+ <!-- <display_iframe>0</display_iframe>valeur par défaut mode Iframe (uniquement en mode Hosted) -->
534
+ <!-- <is_test_mode>0</is_test_mode>valeur par défaut du mode test -->
535
+ <!-- <debug>0</debug>valeur par défaut du mode debug -->
536
+ <!-- <model>hipay/method_cbc</model>Classe model de la méthode -->
537
+ <!-- <accept_url>hipay/cbc/accept</accept_url>Url accept de la méthode -->
538
+ <!-- <pending_url>hipay/cbc/pending</pending_url>Url pending de la méthode -->
539
+ <!-- <decline_url>hipay/cbc/decline</decline_url>Url decline de la méthode -->
540
+ <!-- <exception_url>hipay/cbc/exception</exception_url>Url execption de la méthode -->
541
+ <!-- <cancel_url>hipay/cbc/cancel</cancel_url>Url cancel de la méthode -->
542
+ <!-- <use_3d_secure>0</use_3d_secure>valeur par défaut pour activer le 3ds -->
543
+ <!-- <send_fraud_payment_email>0</send_fraud_payment_email> Envoi le mail de fraud au client final -->
544
+ <!-- </hipay_cbc> -->
545
+ <!-- <hipay_kbc> -->
546
+ <!-- <active>0</active> Activé ou non -->
547
+ <!-- <title>HiPay KBC Online</title> Titre par défaut modifiable en admin -->
548
+ <!-- <payment_action>authorize_capture</payment_action> Type d'action de paiement (authorize_capture ou authorize) -->
549
+ <!-- <cctypes>kbc-online</cctypes> Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
550
+ <!-- <useccv>1</useccv> permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
551
+ <!-- <order_status_payment_accepted>processing</order_status_payment_accepted>valeur par défaut du statut quand le paiement est accepté -->
552
+ <!-- <order_status_payment_refused>canceled</order_status_payment_refused>valeur par défaut du statut quand le paiement est refusé -->
553
+ <!-- <order_status_payment_canceled>canceled</order_status_payment_canceled>valeur par défaut du statut quand le paiement est annulé -->
554
+ <!-- <hipay_status_validate_order>118</hipay_status_validate_order>valeur par défaut du statut hipay qui valide la commande (118 ou 117) -->
555
+ <!-- <pending_redirect_page>hipay/checkout/pending</pending_redirect_page>valeur par défaut pour la page de redirection en cas de state "pending" -->
556
+ <!-- <display_selector>0</display_selector>valeur par défaut l'affichage du selecteur de carte (uniquement en mode Hosted) -->
557
+ <!-- <template>basic</template>valeur par défaut du template de la page hénergé (uniquement en mode Hosted) -->
558
+ <!-- <allow_use_oneclick>0</allow_use_oneclick>valeur par défaut de l'utilisation du oneclick -->
559
+ <!-- <invoice_create>1</invoice_create>valeur par défaut de la création de la facture -->
560
+ <!-- <re_add_to_cart>0</re_add_to_cart>valeur par défaut du re-remplissage du panier -->
561
+ <!-- <cancel_pending_order>1</cancel_pending_order>valeur par défaut des annulation de commande "en attente" depuis 30 minutes -->
562
+ <!-- <display_iframe>0</display_iframe>valeur par défaut mode Iframe (uniquement en mode Hosted) -->
563
+ <!-- <is_test_mode>0</is_test_mode>valeur par défaut du mode test -->
564
+ <!-- <debug>0</debug>valeur par défaut du mode debug -->
565
+ <!-- <model>hipay/method_kbc</model>Classe model de la méthode -->
566
+ <!-- <accept_url>hipay/kbc/accept</accept_url>Url accept de la méthode -->
567
+ <!-- <pending_url>hipay/kbc/pending</pending_url>Url pending de la méthode -->
568
+ <!-- <decline_url>hipay/kbc/decline</decline_url>Url decline de la méthode -->
569
+ <!-- <exception_url>hipay/kbc/exception</exception_url>Url execption de la méthode -->
570
+ <!-- <cancel_url>hipay/kbc/cancel</cancel_url>Url cancel de la méthode -->
571
+ <!-- <use_3d_secure>0</use_3d_secure>valeur par défaut pour activer le 3ds -->
572
+ <!-- <send_fraud_payment_email>0</send_fraud_payment_email> Envoi le mail de fraud au client final -->
573
+ <!-- </hipay_kbc> -->
574
  <hipay_giropay>
575
  <active>0</active> <!-- Activé ou non -->
576
  <title>HiPay Giropay</title> <!-- Titre par défaut modifiable en admin -->
598
  <exception_url>hipay/giropay/exception</exception_url><!-- Url execption de la méthode -->
599
  <cancel_url>hipay/giropay/cancel</cancel_url><!-- Url cancel de la méthode -->
600
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
601
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
602
  </hipay_giropay>
603
  <hipay_przelewy24api>
604
  <active>0</active> <!-- Activé ou non -->
627
  <exception_url>hipay/przelewy24api/exception</exception_url><!-- Url execption de la méthode -->
628
  <cancel_url>hipay/przelewy24api/cancel</cancel_url><!-- Url cancel de la méthode -->
629
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
630
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
631
  </hipay_przelewy24api>
632
  <hipay_sisalapi>
633
  <active>0</active> <!-- Activé ou non -->
654
  <exception_url>hipay/sisalapi/exception</exception_url><!-- Url execption de la méthode -->
655
  <cancel_url>hipay/sisalapi/cancel</cancel_url><!-- Url cancel de la méthode -->
656
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
657
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
658
+ </hipay_sisalapi>
659
  <hipay_qiwi>
660
  <active>0</active> <!-- Activé ou non -->
661
  <title>HiPay Visa Qiwi Wallet</title> <!-- Titre par défaut modifiable en admin -->
683
  <exception_url>hipay/qiwi/exception</exception_url><!-- Url execption de la méthode -->
684
  <cancel_url>hipay/qiwi/cancel</cancel_url><!-- Url cancel de la méthode -->
685
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
686
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
687
  </hipay_qiwi>
688
  <hipay_webmoneyapi>
689
  <active>0</active> <!-- Activé ou non -->
712
  <exception_url>hipay/webmoneyapi/exception</exception_url><!-- Url execption de la méthode -->
713
  <cancel_url>hipay/webmoneyapi/cancel</cancel_url><!-- Url cancel de la méthode -->
714
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
715
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
716
  </hipay_webmoneyapi>
717
  <hipay_yandexapi>
718
  <active>0</active> <!-- Activé ou non -->
741
  <exception_url>hipay/yandexapi/exception</exception_url><!-- Url execption de la méthode -->
742
  <cancel_url>hipay/yandexapi/cancel</cancel_url><!-- Url cancel de la méthode -->
743
  <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
744
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
745
  </hipay_yandexapi>
746
+ <hipay_paypalapi>
747
+ <active>0</active> <!-- Activé ou non -->
748
+ <title>HiPay PayPal</title> <!-- Titre par défaut modifiable en admin -->
749
+ <payment_action>authorize_capture</payment_action> <!-- Type d'action de paiement (authorize_capture ou authorize) -->
750
+ <cctypes>paypal</cctypes> <!-- Types de carte disponibles (valeur Hipay pour le mode hosted, valeur Magento pour le mode API) -->
751
+ <!-- <useccv>1</useccv> --> <!-- permet de rendre obligatoire la saisie du CCV (uniquement en mode API) -->
752
+ <order_status_payment_accepted>processing</order_status_payment_accepted><!-- valeur par défaut du statut quand le paiement est accepté -->
753
+ <order_status_payment_refused>canceled</order_status_payment_refused><!-- valeur par défaut du statut quand le paiement est refusé -->
754
+ <order_status_payment_canceled>canceled</order_status_payment_canceled><!-- valeur par défaut du statut quand le paiement est annulé -->
755
+ <hipay_status_validate_order>118</hipay_status_validate_order><!-- valeur par défaut du statut hipay qui valide la commande (118 ou 117)-->
756
+ <pending_redirect_page>hipay/checkout/pending</pending_redirect_page><!-- valeur par défaut pour la page de redirection en cas de state "pending"-->
757
+ <allow_use_oneclick>0</allow_use_oneclick><!-- valeur par défaut de l'utilisation du oneclick -->
758
+ <invoice_create>1</invoice_create><!-- valeur par défaut de la création de la facture -->
759
+ <re_add_to_cart>0</re_add_to_cart><!-- valeur par défaut du re-remplissage du panier -->
760
+ <cancel_pending_order>1</cancel_pending_order><!-- valeur par défaut des annulation de commande "en attente" depuis 30 minutes -->
761
+ <display_iframe>0</display_iframe><!-- valeur par défaut mode Iframe (uniquement en mode Hosted)-->
762
+ <is_test_mode>0</is_test_mode><!-- valeur par défaut du mode test -->
763
+ <debug>0</debug><!-- valeur par défaut du mode debug -->
764
+ <model>hipay/method_paypalApi</model><!-- Classe model de la méthode -->
765
+ <accept_url>hipay/paypalapi/accept</accept_url><!-- Url accept de la méthode -->
766
+ <pending_url>hipay/paypalapi/pending</pending_url><!-- Url pending de la méthode -->
767
+ <decline_url>hipay/paypalapi/decline</decline_url><!-- Url decline de la méthode -->
768
+ <exception_url>hipay/paypalapi/exception</exception_url><!-- Url execption de la méthode -->
769
+ <cancel_url>hipay/paypalapi/cancel</cancel_url><!-- Url cancel de la méthode -->
770
+ <use_3d_secure>0</use_3d_secure><!-- valeur par défaut pour activer le 3ds -->
771
+ <send_fraud_payment_email>0</send_fraud_payment_email> <!-- Envoi le mail de fraud au client final -->
772
+ </hipay_paypalapi>
773
  </payment>
774
  </default>
775
  <crontab>
776
  <jobs>
777
+ <hipay_pay_split_payment>
778
+ <schedule><cron_expr>0 1 * * *</cron_expr></schedule>
779
+ <run><model>hipay/observer::paySplitPayments</model></run>
780
+ </hipay_pay_split_payment>
781
  <clean_orders_hipay_in_pending>
782
  <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
783
  <run><model>hipay/observer::cancelOrdersInPending</model></run>
784
+ </clean_orders_hipay_in_pending>
785
  </jobs>
786
  </crontab>
787
+ </config>
app/code/community/Allopass/Hipay/etc/system.xml CHANGED
@@ -17,7 +17,7 @@
17
  <sort_order>10</sort_order>
18
  <show_in_default>1</show_in_default>
19
  <show_in_website>1</show_in_website>
20
- <show_in_store>0</show_in_store>
21
  <fields>
22
  <api_username translate="label">
23
  <label>Api username (production account)</label>
@@ -25,7 +25,7 @@
25
  <sort_order>10</sort_order>
26
  <show_in_default>1</show_in_default>
27
  <show_in_website>1</show_in_website>
28
- <show_in_store>0</show_in_store>
29
  </api_username>
30
  <api_password translate="label">
31
  <label>Api password (production account)</label>
@@ -34,7 +34,7 @@
34
  <sort_order>20</sort_order>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
- <show_in_store>0</show_in_store>
38
  </api_password>
39
  <secret_passphrase translate="label comment">
40
  <label>Secret passphrase (production account)</label>
@@ -44,7 +44,7 @@
44
  <sort_order>25</sort_order>
45
  <show_in_default>1</show_in_default>
46
  <show_in_website>1</show_in_website>
47
- <show_in_store>0</show_in_store>
48
  </secret_passphrase>
49
  <api_username_test translate="label">
50
  <label>Api username (test account)</label>
@@ -52,7 +52,7 @@
52
  <sort_order>30</sort_order>
53
  <show_in_default>1</show_in_default>
54
  <show_in_website>1</show_in_website>
55
- <show_in_store>0</show_in_store>
56
  </api_username_test>
57
  <api_password_test translate="label">
58
  <label>Api password (test account)</label>
@@ -61,10 +61,161 @@
61
  <sort_order>40</sort_order>
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
- <show_in_store>0</show_in_store>
65
  </api_password_test>
 
 
 
 
 
 
 
 
 
 
66
  </fields>
67
  </hipay_api>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  </groups>
69
  </hipay>
70
  <payment>
@@ -151,13 +302,26 @@
151
  </payment_action>
152
  <cctypes translate="label">
153
  <label>Credit Card Types</label>
154
- <frontend_type>multiselect</frontend_type>
155
- <source_model>hipay/source_ccType</source_model>
 
 
 
156
  <sort_order>40</sort_order>
157
  <show_in_default>1</show_in_default>
158
  <show_in_website>1</show_in_website>
159
  <show_in_store>0</show_in_store>
160
  </cctypes>
 
 
 
 
 
 
 
 
 
 
161
  <useccv translate="label">
162
  <label>Credit Card Verification</label>
163
  <frontend_type>select</frontend_type>
@@ -186,6 +350,42 @@
186
  <show_in_website>1</show_in_website>
187
  <show_in_store>0</show_in_store>
188
  </config_3ds_rules>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  <allow_use_oneclick translate="label">
190
  <label>Use Oneclick</label>
191
  <frontend_type>select</frontend_type>
@@ -195,6 +395,16 @@
195
  <show_in_website>1</show_in_website>
196
  <show_in_store>0</show_in_store>
197
  </allow_use_oneclick>
 
 
 
 
 
 
 
 
 
 
198
  <re_add_to_cart translate="label comment">
199
  <label>Add product to cart</label>
200
  <comment>Fill cart when payment canceled or refused</comment>
@@ -215,6 +425,15 @@
215
  <show_in_website>1</show_in_website>
216
  <show_in_store>0</show_in_store>
217
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
218
  <allowspecific translate="label">
219
  <label>Payment from applicable countries</label>
220
  <frontend_type>allowspecific</frontend_type>
@@ -361,8 +580,11 @@
361
  </payment_action>
362
  <cctypes translate="label">
363
  <label>Credit Card Types</label>
364
- <frontend_type>multiselect</frontend_type>
365
- <source_model>hipay/source_ccTypeHosted</source_model>
 
 
 
366
  <sort_order>29</sort_order>
367
  <show_in_default>1</show_in_default>
368
  <show_in_website>1</show_in_website>
@@ -419,6 +641,14 @@
419
  <show_in_website>1</show_in_website>
420
  <show_in_store>1</show_in_store>
421
  </iframe_style>
 
 
 
 
 
 
 
 
422
  <display_selector translate="label">
423
  <label>Display card selector</label>
424
  <frontend_type>select</frontend_type>
@@ -447,6 +677,42 @@
447
  <show_in_website>1</show_in_website>
448
  <show_in_store>0</show_in_store>
449
  </config_3ds_rules>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  <allow_use_oneclick translate="label">
451
  <label>Use Oneclick</label>
452
  <frontend_type>select</frontend_type>
@@ -456,6 +722,16 @@
456
  <show_in_website>1</show_in_website>
457
  <show_in_store>0</show_in_store>
458
  </allow_use_oneclick>
 
 
 
 
 
 
 
 
 
 
459
  <re_add_to_cart translate="label comment">
460
  <label>Add product to cart</label>
461
  <comment>Fill cart when payment canceled or refused</comment>
@@ -476,6 +752,15 @@
476
  <show_in_website>1</show_in_website>
477
  <show_in_store>0</show_in_store>
478
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
479
  <allowspecific translate="label">
480
  <label>Payment from applicable countries</label>
481
  <frontend_type>allowspecific</frontend_type>
@@ -649,6 +934,15 @@
649
  <show_in_website>1</show_in_website>
650
  <show_in_store>0</show_in_store>
651
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
652
  <allowspecific translate="label">
653
  <label>Payment from applicable countries</label>
654
  <frontend_type>allowspecific</frontend_type>
@@ -822,6 +1116,15 @@
822
  <show_in_website>1</show_in_website>
823
  <show_in_store>0</show_in_store>
824
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
825
  <allowspecific translate="label">
826
  <label>Payment from applicable countries</label>
827
  <frontend_type>allowspecific</frontend_type>
@@ -995,6 +1298,15 @@
995
  <show_in_website>1</show_in_website>
996
  <show_in_store>0</show_in_store>
997
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
998
  <allowspecific translate="label">
999
  <label>Payment from applicable countries</label>
1000
  <frontend_type>allowspecific</frontend_type>
@@ -1059,8 +1371,372 @@
1059
  </is_test_mode>
1060
  </fields>
1061
  </hipay_dexia>
1062
- <hipay_cbc translate="label" module="hipay">
1063
- <label>HiPay Fullservice CBC Online</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1064
  <frontend_type>text</frontend_type>
1065
  <sort_order>220</sort_order>
1066
  <show_in_default>1</show_in_default>
@@ -1168,179 +1844,15 @@
1168
  <show_in_website>1</show_in_website>
1169
  <show_in_store>0</show_in_store>
1170
  </cancel_pending_order>
1171
- <allowspecific translate="label">
1172
- <label>Payment from applicable countries</label>
1173
- <frontend_type>allowspecific</frontend_type>
1174
- <sort_order>100</sort_order>
1175
- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1176
- <show_in_default>1</show_in_default>
1177
- <show_in_website>1</show_in_website>
1178
- <show_in_store>1</show_in_store>
1179
- </allowspecific>
1180
- <specificcountry translate="label">
1181
- <label>Payment from Specific countries</label>
1182
- <frontend_type>multiselect</frontend_type>
1183
- <sort_order>110</sort_order>
1184
- <source_model>adminhtml/system_config_source_country</source_model>
1185
- <show_in_default>1</show_in_default>
1186
- <show_in_website>1</show_in_website>
1187
- <show_in_store>1</show_in_store>
1188
- </specificcountry>
1189
- <min_order_total translate="label">
1190
- <label>Minimum Order Total</label>
1191
- <frontend_type>text</frontend_type>
1192
- <sort_order>120</sort_order>
1193
- <show_in_default>1</show_in_default>
1194
- <show_in_website>1</show_in_website>
1195
- <show_in_store>1</show_in_store>
1196
- </min_order_total>
1197
- <max_order_total translate="label">
1198
- <label>Maximum Order Total</label>
1199
- <frontend_type>text</frontend_type>
1200
- <sort_order>121</sort_order>
1201
- <show_in_default>1</show_in_default>
1202
- <show_in_website>1</show_in_website>
1203
- <show_in_store>1</show_in_store>
1204
- </max_order_total>
1205
- <sort_order translate="label">
1206
- <label>Sort Order</label>
1207
- <frontend_type>text</frontend_type>
1208
- <sort_order>130</sort_order>
1209
- <show_in_default>1</show_in_default>
1210
- <show_in_website>1</show_in_website>
1211
- <show_in_store>1</show_in_store>
1212
- </sort_order>
1213
- <debug translate="label">
1214
- <label>Enable debug log</label>
1215
- <comment></comment>
1216
- <frontend_type>select</frontend_type>
1217
- <source_model>adminhtml/system_config_source_yesno</source_model>
1218
- <sort_order>150</sort_order>
1219
- <show_in_default>1</show_in_default>
1220
- <show_in_website>1</show_in_website>
1221
- <show_in_store>0</show_in_store>
1222
- </debug>
1223
- <is_test_mode translate="label comment">
1224
- <label>Enable test mode</label>
1225
- <comment></comment>
1226
- <frontend_type>select</frontend_type>
1227
- <source_model>adminhtml/system_config_source_yesno</source_model>
1228
- <sort_order>200</sort_order>
1229
- <show_in_default>1</show_in_default>
1230
- <show_in_website>1</show_in_website>
1231
- <show_in_store>1</show_in_store>
1232
- </is_test_mode>
1233
- </fields>
1234
- </hipay_cbc>
1235
- <hipay_kbc translate="label" module="hipay">
1236
- <label>HiPay Fullservice KBC Online</label>
1237
- <frontend_type>text</frontend_type>
1238
- <sort_order>220</sort_order>
1239
- <show_in_default>1</show_in_default>
1240
- <show_in_website>1</show_in_website>
1241
- <show_in_store>1</show_in_store>
1242
- <fields>
1243
- <active translate="label">
1244
- <label>Enabled</label>
1245
  <frontend_type>select</frontend_type>
1246
  <source_model>adminhtml/system_config_source_yesno</source_model>
1247
- <sort_order>10</sort_order>
1248
- <show_in_default>1</show_in_default>
1249
- <show_in_website>1</show_in_website>
1250
- <show_in_store>1</show_in_store>
1251
- </active>
1252
- <title translate="label">
1253
- <label>Title</label>
1254
- <frontend_type>text</frontend_type>
1255
- <sort_order>20</sort_order>
1256
  <show_in_default>1</show_in_default>
1257
  <show_in_website>1</show_in_website>
1258
  <show_in_store>1</show_in_store>
1259
- </title>
1260
- <order_status_payment_accepted translate="label">
1261
- <label>Order status when payment accepted</label>
1262
- <frontend_type>select</frontend_type>
1263
- <source_model>hipay/source_order_status_accepted</source_model>
1264
- <sort_order>23</sort_order>
1265
- <show_in_default>1</show_in_default>
1266
- <show_in_website>1</show_in_website>
1267
- <show_in_store>0</show_in_store>
1268
- </order_status_payment_accepted>
1269
- <order_status_payment_refused translate="label">
1270
- <label>Order status when payment refused</label>
1271
- <frontend_type>select</frontend_type>
1272
- <source_model>hipay/source_order_status_refused</source_model>
1273
- <sort_order>24</sort_order>
1274
- <show_in_default>1</show_in_default>
1275
- <show_in_website>1</show_in_website>
1276
- <show_in_store>0</show_in_store>
1277
- </order_status_payment_refused>
1278
- <order_status_payment_canceled translate="label">
1279
- <label>Order status when payment canceled by customer</label>
1280
- <frontend_type>select</frontend_type>
1281
- <source_model>hipay/source_order_status_canceled</source_model>
1282
- <sort_order>25</sort_order>
1283
- <show_in_default>1</show_in_default>
1284
- <show_in_website>1</show_in_website>
1285
- <show_in_store>0</show_in_store>
1286
- </order_status_payment_canceled>
1287
- <hipay_status_validate_order translate="label">
1288
- <label>Hipay status to validate order</label>
1289
- <frontend_type>select</frontend_type>
1290
- <source_model>hipay/source_order_hipayStatusValidate</source_model>
1291
- <sort_order>26</sort_order>
1292
- <show_in_default>1</show_in_default>
1293
- <show_in_website>1</show_in_website>
1294
- <show_in_store>0</show_in_store>
1295
- </hipay_status_validate_order>
1296
- <pending_redirect_page translate="label">
1297
- <label>Redirect page pending status</label>
1298
- <comment>Page to redirect when transaction is in pending status</comment>
1299
- <frontend_type>select</frontend_type>
1300
- <source_model>hipay/source_pendingredirect</source_model>
1301
- <sort_order>27</sort_order>
1302
- <show_in_default>1</show_in_default>
1303
- <show_in_website>1</show_in_website>
1304
- <show_in_store>0</show_in_store>
1305
- </pending_redirect_page>
1306
- <css_url translate="label coment">
1307
- <label>Css Url</label>
1308
- <comment>Important, HTTPS protocol is required</comment>
1309
- <frontend_type>text</frontend_type>
1310
- <sort_order>30</sort_order>
1311
- <show_in_default>1</show_in_default>
1312
- <show_in_website>1</show_in_website>
1313
- <show_in_store>1</show_in_store>
1314
- </css_url>
1315
- <template translate="label">
1316
- <label>Page payment template</label>
1317
- <frontend_type>select</frontend_type>
1318
- <source_model>hipay/source_template</source_model>
1319
- <sort_order>35</sort_order>
1320
- <show_in_default>1</show_in_default>
1321
- <show_in_website>1</show_in_website>
1322
- <show_in_store>0</show_in_store>
1323
- </template>
1324
- <re_add_to_cart translate="label comment">
1325
- <label>Add product to cart</label>
1326
- <comment>Fill cart when payment canceled or refused</comment>
1327
- <frontend_type>select</frontend_type>
1328
- <source_model>adminhtml/system_config_source_yesno</source_model>
1329
- <sort_order>95</sort_order>
1330
- <show_in_default>1</show_in_default>
1331
- <show_in_website>1</show_in_website>
1332
- <show_in_store>0</show_in_store>
1333
- </re_add_to_cart>
1334
- <cancel_pending_order translate="label comment">
1335
- <label>Cancel pending order</label>
1336
- <comment>Cancel orders stayed in pending because customer not validated payment</comment>
1337
- <frontend_type>select</frontend_type>
1338
- <source_model>adminhtml/system_config_source_yesno</source_model>
1339
- <sort_order>97</sort_order>
1340
- <show_in_default>1</show_in_default>
1341
- <show_in_website>1</show_in_website>
1342
- <show_in_store>0</show_in_store>
1343
- </cancel_pending_order>
1344
  <allowspecific translate="label">
1345
  <label>Payment from applicable countries</label>
1346
  <frontend_type>allowspecific</frontend_type>
@@ -1404,9 +1916,9 @@
1404
  <show_in_store>1</show_in_store>
1405
  </is_test_mode>
1406
  </fields>
1407
- </hipay_kbc>
1408
- <hipay_giropay translate="label" module="hipay">
1409
- <label>HiPay Fullservice Giropay</label>
1410
  <frontend_type>text</frontend_type>
1411
  <sort_order>220</sort_order>
1412
  <show_in_default>1</show_in_default>
@@ -1514,6 +2026,15 @@
1514
  <show_in_website>1</show_in_website>
1515
  <show_in_store>0</show_in_store>
1516
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
1517
  <allowspecific translate="label">
1518
  <label>Payment from applicable countries</label>
1519
  <frontend_type>allowspecific</frontend_type>
@@ -1577,9 +2098,9 @@
1577
  <show_in_store>1</show_in_store>
1578
  </is_test_mode>
1579
  </fields>
1580
- </hipay_giropay>
1581
- <hipay_przelewy24api translate="label" module="hipay">
1582
- <label>HiPay Fullservice Przelewy24</label>
1583
  <frontend_type>text</frontend_type>
1584
  <sort_order>220</sort_order>
1585
  <show_in_default>1</show_in_default>
@@ -1687,6 +2208,15 @@
1687
  <show_in_website>1</show_in_website>
1688
  <show_in_store>0</show_in_store>
1689
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
1690
  <allowspecific translate="label">
1691
  <label>Payment from applicable countries</label>
1692
  <frontend_type>allowspecific</frontend_type>
@@ -1750,9 +2280,9 @@
1750
  <show_in_store>1</show_in_store>
1751
  </is_test_mode>
1752
  </fields>
1753
- </hipay_przelewy24api>
1754
- <hipay_qiwi translate="label" module="hipay">
1755
- <label>HiPay Fullservice Visa Qiwi Wallet</label>
1756
  <frontend_type>text</frontend_type>
1757
  <sort_order>220</sort_order>
1758
  <show_in_default>1</show_in_default>
@@ -1860,6 +2390,15 @@
1860
  <show_in_website>1</show_in_website>
1861
  <show_in_store>0</show_in_store>
1862
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
1863
  <allowspecific translate="label">
1864
  <label>Payment from applicable countries</label>
1865
  <frontend_type>allowspecific</frontend_type>
@@ -1923,9 +2462,9 @@
1923
  <show_in_store>1</show_in_store>
1924
  </is_test_mode>
1925
  </fields>
1926
- </hipay_qiwi>
1927
- <hipay_webmoneyapi translate="label" module="hipay">
1928
- <label>HiPay Fullservice WebMoney Transfer</label>
1929
  <frontend_type>text</frontend_type>
1930
  <sort_order>220</sort_order>
1931
  <show_in_default>1</show_in_default>
@@ -2033,6 +2572,15 @@
2033
  <show_in_website>1</show_in_website>
2034
  <show_in_store>0</show_in_store>
2035
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
2036
  <allowspecific translate="label">
2037
  <label>Payment from applicable countries</label>
2038
  <frontend_type>allowspecific</frontend_type>
@@ -2096,11 +2644,11 @@
2096
  <show_in_store>1</show_in_store>
2097
  </is_test_mode>
2098
  </fields>
2099
- </hipay_webmoneyapi>
2100
- <hipay_yandexapi translate="label" module="hipay">
2101
- <label>HiPay Fullservice Yandex.Money</label>
2102
  <frontend_type>text</frontend_type>
2103
- <sort_order>220</sort_order>
2104
  <show_in_default>1</show_in_default>
2105
  <show_in_website>1</show_in_website>
2106
  <show_in_store>1</show_in_store>
@@ -2168,24 +2716,6 @@
2168
  <show_in_website>1</show_in_website>
2169
  <show_in_store>0</show_in_store>
2170
  </pending_redirect_page>
2171
- <css_url translate="label coment">
2172
- <label>Css Url</label>
2173
- <comment>Important, HTTPS protocol is required</comment>
2174
- <frontend_type>text</frontend_type>
2175
- <sort_order>30</sort_order>
2176
- <show_in_default>1</show_in_default>
2177
- <show_in_website>1</show_in_website>
2178
- <show_in_store>1</show_in_store>
2179
- </css_url>
2180
- <template translate="label">
2181
- <label>Page payment template</label>
2182
- <frontend_type>select</frontend_type>
2183
- <source_model>hipay/source_template</source_model>
2184
- <sort_order>35</sort_order>
2185
- <show_in_default>1</show_in_default>
2186
- <show_in_website>1</show_in_website>
2187
- <show_in_store>0</show_in_store>
2188
- </template>
2189
  <re_add_to_cart translate="label comment">
2190
  <label>Add product to cart</label>
2191
  <comment>Fill cart when payment canceled or refused</comment>
@@ -2206,6 +2736,15 @@
2206
  <show_in_website>1</show_in_website>
2207
  <show_in_store>0</show_in_store>
2208
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
2209
  <allowspecific translate="label">
2210
  <label>Payment from applicable countries</label>
2211
  <frontend_type>allowspecific</frontend_type>
@@ -2269,9 +2808,9 @@
2269
  <show_in_store>1</show_in_store>
2270
  </is_test_mode>
2271
  </fields>
2272
- </hipay_yandexapi>
2273
- <hipay_sofortapi translate="label" module="hipay">
2274
- <label>HiPay Fullservice Sofort Überweisung</label>
2275
  <frontend_type>text</frontend_type>
2276
  <sort_order>225</sort_order>
2277
  <show_in_default>1</show_in_default>
@@ -2361,6 +2900,15 @@
2361
  <show_in_website>1</show_in_website>
2362
  <show_in_store>0</show_in_store>
2363
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
2364
  <allowspecific translate="label">
2365
  <label>Payment from applicable countries</label>
2366
  <frontend_type>allowspecific</frontend_type>
@@ -2424,9 +2972,9 @@
2424
  <show_in_store>1</show_in_store>
2425
  </is_test_mode>
2426
  </fields>
2427
- </hipay_sofortapi>
2428
- <hipay_sisalapi translate="label" module="hipay">
2429
- <label>HiPay Fullservice Sisal</label>
2430
  <frontend_type>text</frontend_type>
2431
  <sort_order>225</sort_order>
2432
  <show_in_default>1</show_in_default>
@@ -2516,6 +3064,15 @@
2516
  <show_in_website>1</show_in_website>
2517
  <show_in_store>0</show_in_store>
2518
  </cancel_pending_order>
 
 
 
 
 
 
 
 
 
2519
  <allowspecific translate="label">
2520
  <label>Payment from applicable countries</label>
2521
  <frontend_type>allowspecific</frontend_type>
@@ -2579,7 +3136,7 @@
2579
  <show_in_store>1</show_in_store>
2580
  </is_test_mode>
2581
  </fields>
2582
- </hipay_sisalapi>
2583
  </groups>
2584
  </payment>
2585
  </sections>
17
  <sort_order>10</sort_order>
18
  <show_in_default>1</show_in_default>
19
  <show_in_website>1</show_in_website>
20
+ <show_in_store>1</show_in_store>
21
  <fields>
22
  <api_username translate="label">
23
  <label>Api username (production account)</label>
25
  <sort_order>10</sort_order>
26
  <show_in_default>1</show_in_default>
27
  <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
  </api_username>
30
  <api_password translate="label">
31
  <label>Api password (production account)</label>
34
  <sort_order>20</sort_order>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
  </api_password>
39
  <secret_passphrase translate="label comment">
40
  <label>Secret passphrase (production account)</label>
44
  <sort_order>25</sort_order>
45
  <show_in_default>1</show_in_default>
46
  <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
  </secret_passphrase>
49
  <api_username_test translate="label">
50
  <label>Api username (test account)</label>
52
  <sort_order>30</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
  </api_username_test>
57
  <api_password_test translate="label">
58
  <label>Api password (test account)</label>
61
  <sort_order>40</sort_order>
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
  </api_password_test>
66
+ <secret_passphrase_test translate="label comment">
67
+ <label>Secret passphrase (test account)</label>
68
+ <comment>The same of your HiPay Fullservice test account</comment>
69
+ <frontend_type>obscure</frontend_type>
70
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
71
+ <sort_order>50</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ </secret_passphrase_test>
76
  </fields>
77
  </hipay_api>
78
+ <fraud_payment translate="label">
79
+ <label>Fraud Payment Review Email</label>
80
+ <comment>This email is sended to customer, if his payment is in fraud state</comment>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>20</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <fields>
87
+ <identity translate="label">
88
+ <label>Payment Fraud Email Sender</label>
89
+ <frontend_type>select</frontend_type>
90
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
91
+ <sort_order>1</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ </identity>
96
+ <template translate="label">
97
+ <label>Payment Fraud Template</label>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>adminhtml/system_config_source_email_template</source_model>
100
+ <sort_order>2</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>1</show_in_store>
104
+ </template>
105
+ <copy_to translate="label comment">
106
+ <label>Send Payment Fraud Email Copy To</label>
107
+ <frontend_type>text</frontend_type>
108
+ <sort_order>4</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ <comment>Separate by ",".</comment>
113
+ </copy_to>
114
+ <copy_method translate="label">
115
+ <label>Send Payment Fraud Email Copy Method</label>
116
+ <frontend_type>select</frontend_type>
117
+ <source_model>adminhtml/system_config_source_email_method</source_model>
118
+ <sort_order>5</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
+ </copy_method>
123
+ </fields>
124
+ </fraud_payment>
125
+ <fraud_payment_accept translate="label">
126
+ <label>Fraud Payment Accept Email</label>
127
+ <comment>This email is sended to customer, if his payment is validated by merchant</comment>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>30</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>1</show_in_store>
133
+ <fields>
134
+ <identity translate="label">
135
+ <label>Payment Fraud Accept Email Sender</label>
136
+ <frontend_type>select</frontend_type>
137
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
138
+ <sort_order>1</sort_order>
139
+ <show_in_default>1</show_in_default>
140
+ <show_in_website>1</show_in_website>
141
+ <show_in_store>1</show_in_store>
142
+ </identity>
143
+ <template translate="label">
144
+ <label>Payment Fraud Accept Template</label>
145
+ <frontend_type>select</frontend_type>
146
+ <source_model>adminhtml/system_config_source_email_template</source_model>
147
+ <sort_order>2</sort_order>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>1</show_in_website>
150
+ <show_in_store>1</show_in_store>
151
+ </template>
152
+ <copy_to translate="label comment">
153
+ <label>Send Payment Accept Email Copy To</label>
154
+ <frontend_type>text</frontend_type>
155
+ <sort_order>4</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ <comment>Separate by ",".</comment>
160
+ </copy_to>
161
+ <copy_method translate="label">
162
+ <label>Send Payment Accept Email Copy Method</label>
163
+ <frontend_type>select</frontend_type>
164
+ <source_model>adminhtml/system_config_source_email_method</source_model>
165
+ <sort_order>5</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ </copy_method>
170
+ </fields>
171
+ </fraud_payment_accept>
172
+ <fraud_payment_deny translate="label">
173
+ <label>Fraud Payment Deny Email</label>
174
+ <comment>This email is sended to customer, if his payment is denied by merchant</comment>
175
+ <frontend_type>text</frontend_type>
176
+ <sort_order>40</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>1</show_in_store>
180
+ <fields>
181
+ <identity translate="label">
182
+ <label>Payment Fraud Deny Email Sender</label>
183
+ <frontend_type>select</frontend_type>
184
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
185
+ <sort_order>1</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>1</show_in_website>
188
+ <show_in_store>1</show_in_store>
189
+ </identity>
190
+ <template translate="label">
191
+ <label>Payment Fraud Deny Template</label>
192
+ <frontend_type>select</frontend_type>
193
+ <source_model>adminhtml/system_config_source_email_template</source_model>
194
+ <sort_order>2</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>1</show_in_website>
197
+ <show_in_store>1</show_in_store>
198
+ </template>
199
+ <copy_to translate="label comment">
200
+ <label>Send Payment Deny Email Copy To</label>
201
+ <frontend_type>text</frontend_type>
202
+ <sort_order>4</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
+ <comment>Separate by ",".</comment>
207
+ </copy_to>
208
+ <copy_method translate="label">
209
+ <label>Send Payment Deny Email Copy Method</label>
210
+ <frontend_type>select</frontend_type>
211
+ <source_model>adminhtml/system_config_source_email_method</source_model>
212
+ <sort_order>5</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ </copy_method>
217
+ </fields>
218
+ </fraud_payment_deny>
219
  </groups>
220
  </hipay>
221
  <payment>
302
  </payment_action>
303
  <cctypes translate="label">
304
  <label>Credit Card Types</label>
305
+ <comment>Sort the list by drag'n/drop credit card type</comment>
306
+ <frontend_type>checkboxes</frontend_type>
307
+ <frontend_model>hipay/adminhtml_system_config_form_field_multiselectSortable</frontend_model>
308
+ <backend_model>hipay/system_config_backend_ccTypes</backend_model>
309
+ <source_model>hipay/source_ccType::toConfigOption</source_model>
310
  <sort_order>40</sort_order>
311
  <show_in_default>1</show_in_default>
312
  <show_in_website>1</show_in_website>
313
  <show_in_store>0</show_in_store>
314
  </cctypes>
315
+ <display_card_owner translate="label comment">
316
+ <label>Display card owner</label>
317
+ <comment>Display card owner in card form</comment>
318
+ <frontend_type>select</frontend_type>
319
+ <source_model>adminhtml/system_config_source_yesno</source_model>
320
+ <sort_order>45</sort_order>
321
+ <show_in_default>1</show_in_default>
322
+ <show_in_website>1</show_in_website>
323
+ <show_in_store>0</show_in_store>
324
+ </display_card_owner>
325
  <useccv translate="label">
326
  <label>Credit Card Verification</label>
327
  <frontend_type>select</frontend_type>
350
  <show_in_website>1</show_in_website>
351
  <show_in_store>0</show_in_store>
352
  </config_3ds_rules>
353
+ <send_fraud_payment_email translate="label">
354
+ <label>Send fraud payment email</label>
355
+ <frontend_type>select</frontend_type>
356
+ <source_model>adminhtml/system_config_source_yesno</source_model>
357
+ <sort_order>63</sort_order>
358
+ <show_in_default>1</show_in_default>
359
+ <show_in_website>1</show_in_website>
360
+ <show_in_store>1</show_in_store>
361
+ </send_fraud_payment_email>
362
+ <allow_split_payment translate="label">
363
+ <label>Use Split Payment</label>
364
+ <frontend_type>select</frontend_type>
365
+ <frontend_model>hipay/adminhtml_system_config_form_field_allowsplitpayment</frontend_model>
366
+ <source_model>adminhtml/system_config_source_yesno</source_model>
367
+ <sort_order>65</sort_order>
368
+ <show_in_default>1</show_in_default>
369
+ <show_in_website>1</show_in_website>
370
+ <show_in_store>0</show_in_store>
371
+ </allow_split_payment>
372
+ <split_payment_profile translate="label">
373
+ <label>Payment Profile</label>
374
+ <frontend_type>multiselect</frontend_type>
375
+ <source_model>hipay/source_paymentProfile::splitPaymentsToOptionArray</source_model>
376
+ <sort_order>66</sort_order>
377
+ <show_in_default>1</show_in_default>
378
+ <show_in_website>1</show_in_website>
379
+ <show_in_store>0</show_in_store>
380
+ </split_payment_profile>
381
+ <min_order_total_split_payment translate="label">
382
+ <label>Minimum Order Total for Split Payment</label>
383
+ <frontend_type>text</frontend_type>
384
+ <sort_order>68</sort_order>
385
+ <show_in_default>1</show_in_default>
386
+ <show_in_website>1</show_in_website>
387
+ <show_in_store>1</show_in_store>
388
+ </min_order_total_split_payment>
389
  <allow_use_oneclick translate="label">
390
  <label>Use Oneclick</label>
391
  <frontend_type>select</frontend_type>
395
  <show_in_website>1</show_in_website>
396
  <show_in_store>0</show_in_store>
397
  </allow_use_oneclick>
398
+ <filter_oneclick translate="label comment">
399
+ <label>Rules Oneclick</label>
400
+ <comment>Configure Rules to activate oneclick</comment>
401
+ <frontend_model>hipay/adminhtml_system_config_form_field_3dsRule</frontend_model>
402
+ <backend_model>hipay/rule_config</backend_model>
403
+ <sort_order>80</sort_order>
404
+ <show_in_default>1</show_in_default>
405
+ <show_in_website>1</show_in_website>
406
+ <show_in_store>0</show_in_store>
407
+ </filter_oneclick>
408
  <re_add_to_cart translate="label comment">
409
  <label>Add product to cart</label>
410
  <comment>Fill cart when payment canceled or refused</comment>
425
  <show_in_website>1</show_in_website>
426
  <show_in_store>0</show_in_store>
427
  </cancel_pending_order>
428
+ <send_fraud_payment_email translate="label">
429
+ <label>Send fraud payment email</label>
430
+ <frontend_type>select</frontend_type>
431
+ <source_model>adminhtml/system_config_source_yesno</source_model>
432
+ <sort_order>99</sort_order>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>1</show_in_website>
435
+ <show_in_store>1</show_in_store>
436
+ </send_fraud_payment_email>
437
  <allowspecific translate="label">
438
  <label>Payment from applicable countries</label>
439
  <frontend_type>allowspecific</frontend_type>
580
  </payment_action>
581
  <cctypes translate="label">
582
  <label>Credit Card Types</label>
583
+ <comment>Sort the list by drag'n/drop credit card type</comment>
584
+ <frontend_type>checkboxes</frontend_type>
585
+ <frontend_model>hipay/adminhtml_system_config_form_field_multiselectSortable</frontend_model>
586
+ <backend_model>hipay/system_config_backend_ccTypes</backend_model>
587
+ <source_model>hipay/source_ccTypeHosted::toConfigOption</source_model>
588
  <sort_order>29</sort_order>
589
  <show_in_default>1</show_in_default>
590
  <show_in_website>1</show_in_website>
641
  <show_in_website>1</show_in_website>
642
  <show_in_store>1</show_in_store>
643
  </iframe_style>
644
+ <iframe_wrapper_style translate="label">
645
+ <label>Wrapper iFrame Style</label>
646
+ <frontend_type>text</frontend_type>
647
+ <sort_order>39</sort_order>
648
+ <show_in_default>1</show_in_default>
649
+ <show_in_website>1</show_in_website>
650
+ <show_in_store>1</show_in_store>
651
+ </iframe_wrapper_style>
652
  <display_selector translate="label">
653
  <label>Display card selector</label>
654
  <frontend_type>select</frontend_type>
677
  <show_in_website>1</show_in_website>
678
  <show_in_store>0</show_in_store>
679
  </config_3ds_rules>
680
+ <send_fraud_payment_email translate="label">
681
+ <label>Send fraud payment email</label>
682
+ <frontend_type>select</frontend_type>
683
+ <source_model>adminhtml/system_config_source_yesno</source_model>
684
+ <sort_order>63</sort_order>
685
+ <show_in_default>1</show_in_default>
686
+ <show_in_website>1</show_in_website>
687
+ <show_in_store>1</show_in_store>
688
+ </send_fraud_payment_email>
689
+ <allow_split_payment translate="label">
690
+ <label>Use Split Payment</label>
691
+ <frontend_type>select</frontend_type>
692
+ <frontend_model>hipay/adminhtml_system_config_form_field_allowsplitpayment</frontend_model>
693
+ <source_model>adminhtml/system_config_source_yesno</source_model>
694
+ <sort_order>65</sort_order>
695
+ <show_in_default>1</show_in_default>
696
+ <show_in_website>1</show_in_website>
697
+ <show_in_store>0</show_in_store>
698
+ </allow_split_payment>
699
+ <split_payment_profile translate="label">
700
+ <label>Payment Profile</label>
701
+ <frontend_type>multiselect</frontend_type>
702
+ <source_model>hipay/source_paymentProfile::splitPaymentsToOptionArray</source_model>
703
+ <sort_order>66</sort_order>
704
+ <show_in_default>1</show_in_default>
705
+ <show_in_website>1</show_in_website>
706
+ <show_in_store>0</show_in_store>
707
+ </split_payment_profile>
708
+ <min_order_total_split_payment translate="label">
709
+ <label>Minimum Order Total for Split Payment</label>
710
+ <frontend_type>text</frontend_type>
711
+ <sort_order>68</sort_order>
712
+ <show_in_default>1</show_in_default>
713
+ <show_in_website>1</show_in_website>
714
+ <show_in_store>1</show_in_store>
715
+ </min_order_total_split_payment>
716
  <allow_use_oneclick translate="label">
717
  <label>Use Oneclick</label>
718
  <frontend_type>select</frontend_type>
722
  <show_in_website>1</show_in_website>
723
  <show_in_store>0</show_in_store>
724
  </allow_use_oneclick>
725
+ <filter_oneclick translate="label comment">
726
+ <label>Rules Oneclick</label>
727
+ <comment>Configure Rules to activate oneclick</comment>
728
+ <frontend_model>hipay/adminhtml_system_config_form_field_3dsRule</frontend_model>
729
+ <backend_model>hipay/rule_config</backend_model>
730
+ <sort_order>80</sort_order>
731
+ <show_in_default>1</show_in_default>
732
+ <show_in_website>1</show_in_website>
733
+ <show_in_store>0</show_in_store>
734
+ </filter_oneclick>
735
  <re_add_to_cart translate="label comment">
736
  <label>Add product to cart</label>
737
  <comment>Fill cart when payment canceled or refused</comment>
752
  <show_in_website>1</show_in_website>
753
  <show_in_store>0</show_in_store>
754
  </cancel_pending_order>
755
+ <send_fraud_payment_email translate="label">
756
+ <label>Send fraud payment email</label>
757
+ <frontend_type>select</frontend_type>
758
+ <source_model>adminhtml/system_config_source_yesno</source_model>
759
+ <sort_order>99</sort_order>
760
+ <show_in_default>1</show_in_default>
761
+ <show_in_website>1</show_in_website>
762
+ <show_in_store>1</show_in_store>
763
+ </send_fraud_payment_email>
764
  <allowspecific translate="label">
765
  <label>Payment from applicable countries</label>
766
  <frontend_type>allowspecific</frontend_type>
934
  <show_in_website>1</show_in_website>
935
  <show_in_store>0</show_in_store>
936
  </cancel_pending_order>
937
+ <send_fraud_payment_email translate="label">
938
+ <label>Send fraud payment email</label>
939
+ <frontend_type>select</frontend_type>
940
+ <source_model>adminhtml/system_config_source_yesno</source_model>
941
+ <sort_order>99</sort_order>
942
+ <show_in_default>1</show_in_default>
943
+ <show_in_website>1</show_in_website>
944
+ <show_in_store>1</show_in_store>
945
+ </send_fraud_payment_email>
946
  <allowspecific translate="label">
947
  <label>Payment from applicable countries</label>
948
  <frontend_type>allowspecific</frontend_type>
1116
  <show_in_website>1</show_in_website>
1117
  <show_in_store>0</show_in_store>
1118
  </cancel_pending_order>
1119
+ <send_fraud_payment_email translate="label">
1120
+ <label>Send fraud payment email</label>
1121
+ <frontend_type>select</frontend_type>
1122
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1123
+ <sort_order>99</sort_order>
1124
+ <show_in_default>1</show_in_default>
1125
+ <show_in_website>1</show_in_website>
1126
+ <show_in_store>1</show_in_store>
1127
+ </send_fraud_payment_email>
1128
  <allowspecific translate="label">
1129
  <label>Payment from applicable countries</label>
1130
  <frontend_type>allowspecific</frontend_type>
1298
  <show_in_website>1</show_in_website>
1299
  <show_in_store>0</show_in_store>
1300
  </cancel_pending_order>
1301
+ <send_fraud_payment_email translate="label">
1302
+ <label>Send fraud payment email</label>
1303
+ <frontend_type>select</frontend_type>
1304
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1305
+ <sort_order>99</sort_order>
1306
+ <show_in_default>1</show_in_default>
1307
+ <show_in_website>1</show_in_website>
1308
+ <show_in_store>1</show_in_store>
1309
+ </send_fraud_payment_email>
1310
  <allowspecific translate="label">
1311
  <label>Payment from applicable countries</label>
1312
  <frontend_type>allowspecific</frontend_type>
1371
  </is_test_mode>
1372
  </fields>
1373
  </hipay_dexia>
1374
+ <!-- <hipay_cbc translate="label" module="hipay"> -->
1375
+ <!-- <label>HiPay Fullservice CBC Online</label> -->
1376
+ <!-- <frontend_type>text</frontend_type> -->
1377
+ <!-- <sort_order>220</sort_order> -->
1378
+ <!-- <show_in_default>1</show_in_default> -->
1379
+ <!-- <show_in_website>1</show_in_website> -->
1380
+ <!-- <show_in_store>1</show_in_store> -->
1381
+ <!-- <fields> -->
1382
+ <!-- <active translate="label"> -->
1383
+ <!-- <label>Enabled</label> -->
1384
+ <!-- <frontend_type>select</frontend_type> -->
1385
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1386
+ <!-- <sort_order>10</sort_order> -->
1387
+ <!-- <show_in_default>1</show_in_default> -->
1388
+ <!-- <show_in_website>1</show_in_website> -->
1389
+ <!-- <show_in_store>1</show_in_store> -->
1390
+ <!-- </active> -->
1391
+ <!-- <title translate="label"> -->
1392
+ <!-- <label>Title</label> -->
1393
+ <!-- <frontend_type>text</frontend_type> -->
1394
+ <!-- <sort_order>20</sort_order> -->
1395
+ <!-- <show_in_default>1</show_in_default> -->
1396
+ <!-- <show_in_website>1</show_in_website> -->
1397
+ <!-- <show_in_store>1</show_in_store> -->
1398
+ <!-- </title> -->
1399
+ <!-- <order_status_payment_accepted translate="label"> -->
1400
+ <!-- <label>Order status when payment accepted</label> -->
1401
+ <!-- <frontend_type>select</frontend_type> -->
1402
+ <!-- <source_model>hipay/source_order_status_accepted</source_model> -->
1403
+ <!-- <sort_order>23</sort_order> -->
1404
+ <!-- <show_in_default>1</show_in_default> -->
1405
+ <!-- <show_in_website>1</show_in_website> -->
1406
+ <!-- <show_in_store>0</show_in_store> -->
1407
+ <!-- </order_status_payment_accepted> -->
1408
+ <!-- <order_status_payment_refused translate="label"> -->
1409
+ <!-- <label>Order status when payment refused</label> -->
1410
+ <!-- <frontend_type>select</frontend_type> -->
1411
+ <!-- <source_model>hipay/source_order_status_refused</source_model> -->
1412
+ <!-- <sort_order>24</sort_order> -->
1413
+ <!-- <show_in_default>1</show_in_default> -->
1414
+ <!-- <show_in_website>1</show_in_website> -->
1415
+ <!-- <show_in_store>0</show_in_store> -->
1416
+ <!-- </order_status_payment_refused> -->
1417
+ <!-- <order_status_payment_canceled translate="label"> -->
1418
+ <!-- <label>Order status when payment canceled by customer</label> -->
1419
+ <!-- <frontend_type>select</frontend_type> -->
1420
+ <!-- <source_model>hipay/source_order_status_canceled</source_model> -->
1421
+ <!-- <sort_order>25</sort_order> -->
1422
+ <!-- <show_in_default>1</show_in_default> -->
1423
+ <!-- <show_in_website>1</show_in_website> -->
1424
+ <!-- <show_in_store>0</show_in_store> -->
1425
+ <!-- </order_status_payment_canceled> -->
1426
+ <!-- <hipay_status_validate_order translate="label"> -->
1427
+ <!-- <label>Hipay status to validate order</label> -->
1428
+ <!-- <frontend_type>select</frontend_type> -->
1429
+ <!-- <source_model>hipay/source_order_hipayStatusValidate</source_model> -->
1430
+ <!-- <sort_order>26</sort_order> -->
1431
+ <!-- <show_in_default>1</show_in_default> -->
1432
+ <!-- <show_in_website>1</show_in_website> -->
1433
+ <!-- <show_in_store>0</show_in_store> -->
1434
+ <!-- </hipay_status_validate_order> -->
1435
+ <!-- <pending_redirect_page translate="label"> -->
1436
+ <!-- <label>Redirect page pending status</label> -->
1437
+ <!-- <comment>Page to redirect when transaction is in pending status</comment> -->
1438
+ <!-- <frontend_type>select</frontend_type> -->
1439
+ <!-- <source_model>hipay/source_pendingredirect</source_model> -->
1440
+ <!-- <sort_order>27</sort_order> -->
1441
+ <!-- <show_in_default>1</show_in_default> -->
1442
+ <!-- <show_in_website>1</show_in_website> -->
1443
+ <!-- <show_in_store>0</show_in_store> -->
1444
+ <!-- </pending_redirect_page> -->
1445
+ <!-- <css_url translate="label coment"> -->
1446
+ <!-- <label>Css Url</label> -->
1447
+ <!-- <comment>Important, HTTPS protocol is required</comment> -->
1448
+ <!-- <frontend_type>text</frontend_type> -->
1449
+ <!-- <sort_order>30</sort_order> -->
1450
+ <!-- <show_in_default>1</show_in_default> -->
1451
+ <!-- <show_in_website>1</show_in_website> -->
1452
+ <!-- <show_in_store>1</show_in_store> -->
1453
+ <!-- </css_url> -->
1454
+ <!-- <template translate="label"> -->
1455
+ <!-- <label>Page payment template</label> -->
1456
+ <!-- <frontend_type>select</frontend_type> -->
1457
+ <!-- <source_model>hipay/source_template</source_model> -->
1458
+ <!-- <sort_order>35</sort_order> -->
1459
+ <!-- <show_in_default>1</show_in_default> -->
1460
+ <!-- <show_in_website>1</show_in_website> -->
1461
+ <!-- <show_in_store>0</show_in_store> -->
1462
+ <!-- </template> -->
1463
+ <!-- <re_add_to_cart translate="label comment"> -->
1464
+ <!-- <label>Add product to cart</label> -->
1465
+ <!-- <comment>Fill cart when payment canceled or refused</comment> -->
1466
+ <!-- <frontend_type>select</frontend_type> -->
1467
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1468
+ <!-- <sort_order>95</sort_order> -->
1469
+ <!-- <show_in_default>1</show_in_default> -->
1470
+ <!-- <show_in_website>1</show_in_website> -->
1471
+ <!-- <show_in_store>0</show_in_store> -->
1472
+ <!-- </re_add_to_cart> -->
1473
+ <!-- <cancel_pending_order translate="label comment"> -->
1474
+ <!-- <label>Cancel pending order</label> -->
1475
+ <!-- <comment>Cancel orders stayed in pending because customer not validated payment</comment> -->
1476
+ <!-- <frontend_type>select</frontend_type> -->
1477
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1478
+ <!-- <sort_order>97</sort_order> -->
1479
+ <!-- <show_in_default>1</show_in_default> -->
1480
+ <!-- <show_in_website>1</show_in_website> -->
1481
+ <!-- <show_in_store>0</show_in_store> -->
1482
+ <!-- </cancel_pending_order> -->
1483
+ <!-- <send_fraud_payment_email translate="label"> -->
1484
+ <!-- <label>Send fraud payment email</label> -->
1485
+ <!-- <frontend_type>select</frontend_type> -->
1486
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1487
+ <!-- <sort_order>99</sort_order> -->
1488
+ <!-- <show_in_default>1</show_in_default> -->
1489
+ <!-- <show_in_website>1</show_in_website> -->
1490
+ <!-- <show_in_store>1</show_in_store> -->
1491
+ <!-- </send_fraud_payment_email> -->
1492
+ <!-- <allowspecific translate="label"> -->
1493
+ <!-- <label>Payment from applicable countries</label> -->
1494
+ <!-- <frontend_type>allowspecific</frontend_type> -->
1495
+ <!-- <sort_order>100</sort_order> -->
1496
+ <!-- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> -->
1497
+ <!-- <show_in_default>1</show_in_default> -->
1498
+ <!-- <show_in_website>1</show_in_website> -->
1499
+ <!-- <show_in_store>1</show_in_store> -->
1500
+ <!-- </allowspecific> -->
1501
+ <!-- <specificcountry translate="label"> -->
1502
+ <!-- <label>Payment from Specific countries</label> -->
1503
+ <!-- <frontend_type>multiselect</frontend_type> -->
1504
+ <!-- <sort_order>110</sort_order> -->
1505
+ <!-- <source_model>adminhtml/system_config_source_country</source_model> -->
1506
+ <!-- <show_in_default>1</show_in_default> -->
1507
+ <!-- <show_in_website>1</show_in_website> -->
1508
+ <!-- <show_in_store>1</show_in_store> -->
1509
+ <!-- </specificcountry> -->
1510
+ <!-- <min_order_total translate="label"> -->
1511
+ <!-- <label>Minimum Order Total</label> -->
1512
+ <!-- <frontend_type>text</frontend_type> -->
1513
+ <!-- <sort_order>120</sort_order> -->
1514
+ <!-- <show_in_default>1</show_in_default> -->
1515
+ <!-- <show_in_website>1</show_in_website> -->
1516
+ <!-- <show_in_store>1</show_in_store> -->
1517
+ <!-- </min_order_total> -->
1518
+ <!-- <max_order_total translate="label"> -->
1519
+ <!-- <label>Maximum Order Total</label> -->
1520
+ <!-- <frontend_type>text</frontend_type> -->
1521
+ <!-- <sort_order>121</sort_order> -->
1522
+ <!-- <show_in_default>1</show_in_default> -->
1523
+ <!-- <show_in_website>1</show_in_website> -->
1524
+ <!-- <show_in_store>1</show_in_store> -->
1525
+ <!-- </max_order_total> -->
1526
+ <!-- <sort_order translate="label"> -->
1527
+ <!-- <label>Sort Order</label> -->
1528
+ <!-- <frontend_type>text</frontend_type> -->
1529
+ <!-- <sort_order>130</sort_order> -->
1530
+ <!-- <show_in_default>1</show_in_default> -->
1531
+ <!-- <show_in_website>1</show_in_website> -->
1532
+ <!-- <show_in_store>1</show_in_store> -->
1533
+ <!-- </sort_order> -->
1534
+ <!-- <debug translate="label"> -->
1535
+ <!-- <label>Enable debug log</label> -->
1536
+ <!-- <comment></comment> -->
1537
+ <!-- <frontend_type>select</frontend_type> -->
1538
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1539
+ <!-- <sort_order>150</sort_order> -->
1540
+ <!-- <show_in_default>1</show_in_default> -->
1541
+ <!-- <show_in_website>1</show_in_website> -->
1542
+ <!-- <show_in_store>0</show_in_store> -->
1543
+ <!-- </debug> -->
1544
+ <!-- <is_test_mode translate="label comment"> -->
1545
+ <!-- <label>Enable test mode</label> -->
1546
+ <!-- <comment></comment> -->
1547
+ <!-- <frontend_type>select</frontend_type> -->
1548
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1549
+ <!-- <sort_order>200</sort_order> -->
1550
+ <!-- <show_in_default>1</show_in_default> -->
1551
+ <!-- <show_in_website>1</show_in_website> -->
1552
+ <!-- <show_in_store>1</show_in_store> -->
1553
+ <!-- </is_test_mode> -->
1554
+ <!-- </fields> -->
1555
+ <!-- </hipay_cbc> -->
1556
+ <!-- <hipay_kbc translate="label" module="hipay"> -->
1557
+ <!-- <label>HiPay Fullservice KBC Online</label> -->
1558
+ <!-- <frontend_type>text</frontend_type> -->
1559
+ <!-- <sort_order>220</sort_order> -->
1560
+ <!-- <show_in_default>1</show_in_default> -->
1561
+ <!-- <show_in_website>1</show_in_website> -->
1562
+ <!-- <show_in_store>1</show_in_store> -->
1563
+ <!-- <fields> -->
1564
+ <!-- <active translate="label"> -->
1565
+ <!-- <label>Enabled</label> -->
1566
+ <!-- <frontend_type>select</frontend_type> -->
1567
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1568
+ <!-- <sort_order>10</sort_order> -->
1569
+ <!-- <show_in_default>1</show_in_default> -->
1570
+ <!-- <show_in_website>1</show_in_website> -->
1571
+ <!-- <show_in_store>1</show_in_store> -->
1572
+ <!-- </active> -->
1573
+ <!-- <title translate="label"> -->
1574
+ <!-- <label>Title</label> -->
1575
+ <!-- <frontend_type>text</frontend_type> -->
1576
+ <!-- <sort_order>20</sort_order> -->
1577
+ <!-- <show_in_default>1</show_in_default> -->
1578
+ <!-- <show_in_website>1</show_in_website> -->
1579
+ <!-- <show_in_store>1</show_in_store> -->
1580
+ <!-- </title> -->
1581
+ <!-- <order_status_payment_accepted translate="label"> -->
1582
+ <!-- <label>Order status when payment accepted</label> -->
1583
+ <!-- <frontend_type>select</frontend_type> -->
1584
+ <!-- <source_model>hipay/source_order_status_accepted</source_model> -->
1585
+ <!-- <sort_order>23</sort_order> -->
1586
+ <!-- <show_in_default>1</show_in_default> -->
1587
+ <!-- <show_in_website>1</show_in_website> -->
1588
+ <!-- <show_in_store>0</show_in_store> -->
1589
+ <!-- </order_status_payment_accepted> -->
1590
+ <!-- <order_status_payment_refused translate="label"> -->
1591
+ <!-- <label>Order status when payment refused</label> -->
1592
+ <!-- <frontend_type>select</frontend_type> -->
1593
+ <!-- <source_model>hipay/source_order_status_refused</source_model> -->
1594
+ <!-- <sort_order>24</sort_order> -->
1595
+ <!-- <show_in_default>1</show_in_default> -->
1596
+ <!-- <show_in_website>1</show_in_website> -->
1597
+ <!-- <show_in_store>0</show_in_store> -->
1598
+ <!-- </order_status_payment_refused> -->
1599
+ <!-- <order_status_payment_canceled translate="label"> -->
1600
+ <!-- <label>Order status when payment canceled by customer</label> -->
1601
+ <!-- <frontend_type>select</frontend_type> -->
1602
+ <!-- <source_model>hipay/source_order_status_canceled</source_model> -->
1603
+ <!-- <sort_order>25</sort_order> -->
1604
+ <!-- <show_in_default>1</show_in_default> -->
1605
+ <!-- <show_in_website>1</show_in_website> -->
1606
+ <!-- <show_in_store>0</show_in_store> -->
1607
+ <!-- </order_status_payment_canceled> -->
1608
+ <!-- <hipay_status_validate_order translate="label"> -->
1609
+ <!-- <label>Hipay status to validate order</label> -->
1610
+ <!-- <frontend_type>select</frontend_type> -->
1611
+ <!-- <source_model>hipay/source_order_hipayStatusValidate</source_model> -->
1612
+ <!-- <sort_order>26</sort_order> -->
1613
+ <!-- <show_in_default>1</show_in_default> -->
1614
+ <!-- <show_in_website>1</show_in_website> -->
1615
+ <!-- <show_in_store>0</show_in_store> -->
1616
+ <!-- </hipay_status_validate_order> -->
1617
+ <!-- <pending_redirect_page translate="label"> -->
1618
+ <!-- <label>Redirect page pending status</label> -->
1619
+ <!-- <comment>Page to redirect when transaction is in pending status</comment> -->
1620
+ <!-- <frontend_type>select</frontend_type> -->
1621
+ <!-- <source_model>hipay/source_pendingredirect</source_model> -->
1622
+ <!-- <sort_order>27</sort_order> -->
1623
+ <!-- <show_in_default>1</show_in_default> -->
1624
+ <!-- <show_in_website>1</show_in_website> -->
1625
+ <!-- <show_in_store>0</show_in_store> -->
1626
+ <!-- </pending_redirect_page> -->
1627
+ <!-- <css_url translate="label coment"> -->
1628
+ <!-- <label>Css Url</label> -->
1629
+ <!-- <comment>Important, HTTPS protocol is required</comment> -->
1630
+ <!-- <frontend_type>text</frontend_type> -->
1631
+ <!-- <sort_order>30</sort_order> -->
1632
+ <!-- <show_in_default>1</show_in_default> -->
1633
+ <!-- <show_in_website>1</show_in_website> -->
1634
+ <!-- <show_in_store>1</show_in_store> -->
1635
+ <!-- </css_url> -->
1636
+ <!-- <template translate="label"> -->
1637
+ <!-- <label>Page payment template</label> -->
1638
+ <!-- <frontend_type>select</frontend_type> -->
1639
+ <!-- <source_model>hipay/source_template</source_model> -->
1640
+ <!-- <sort_order>35</sort_order> -->
1641
+ <!-- <show_in_default>1</show_in_default> -->
1642
+ <!-- <show_in_website>1</show_in_website> -->
1643
+ <!-- <show_in_store>0</show_in_store> -->
1644
+ <!-- </template> -->
1645
+ <!-- <re_add_to_cart translate="label comment"> -->
1646
+ <!-- <label>Add product to cart</label> -->
1647
+ <!-- <comment>Fill cart when payment canceled or refused</comment> -->
1648
+ <!-- <frontend_type>select</frontend_type> -->
1649
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1650
+ <!-- <sort_order>95</sort_order> -->
1651
+ <!-- <show_in_default>1</show_in_default> -->
1652
+ <!-- <show_in_website>1</show_in_website> -->
1653
+ <!-- <show_in_store>0</show_in_store> -->
1654
+ <!-- </re_add_to_cart> -->
1655
+ <!-- <cancel_pending_order translate="label comment"> -->
1656
+ <!-- <label>Cancel pending order</label> -->
1657
+ <!-- <comment>Cancel orders stayed in pending because customer not validated payment</comment> -->
1658
+ <!-- <frontend_type>select</frontend_type> -->
1659
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1660
+ <!-- <sort_order>97</sort_order> -->
1661
+ <!-- <show_in_default>1</show_in_default> -->
1662
+ <!-- <show_in_website>1</show_in_website> -->
1663
+ <!-- <show_in_store>0</show_in_store> -->
1664
+ <!-- </cancel_pending_order> -->
1665
+ <!-- <send_fraud_payment_email translate="label"> -->
1666
+ <!-- <label>Send fraud payment email</label> -->
1667
+ <!-- <frontend_type>select</frontend_type> -->
1668
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1669
+ <!-- <sort_order>99</sort_order> -->
1670
+ <!-- <show_in_default>1</show_in_default> -->
1671
+ <!-- <show_in_website>1</show_in_website> -->
1672
+ <!-- <show_in_store>1</show_in_store> -->
1673
+ <!-- </send_fraud_payment_email> -->
1674
+ <!-- <allowspecific translate="label"> -->
1675
+ <!-- <label>Payment from applicable countries</label> -->
1676
+ <!-- <frontend_type>allowspecific</frontend_type> -->
1677
+ <!-- <sort_order>100</sort_order> -->
1678
+ <!-- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> -->
1679
+ <!-- <show_in_default>1</show_in_default> -->
1680
+ <!-- <show_in_website>1</show_in_website> -->
1681
+ <!-- <show_in_store>1</show_in_store> -->
1682
+ <!-- </allowspecific> -->
1683
+ <!-- <specificcountry translate="label"> -->
1684
+ <!-- <label>Payment from Specific countries</label> -->
1685
+ <!-- <frontend_type>multiselect</frontend_type> -->
1686
+ <!-- <sort_order>110</sort_order> -->
1687
+ <!-- <source_model>adminhtml/system_config_source_country</source_model> -->
1688
+ <!-- <show_in_default>1</show_in_default> -->
1689
+ <!-- <show_in_website>1</show_in_website> -->
1690
+ <!-- <show_in_store>1</show_in_store> -->
1691
+ <!-- </specificcountry> -->
1692
+ <!-- <min_order_total translate="label"> -->
1693
+ <!-- <label>Minimum Order Total</label> -->
1694
+ <!-- <frontend_type>text</frontend_type> -->
1695
+ <!-- <sort_order>120</sort_order> -->
1696
+ <!-- <show_in_default>1</show_in_default> -->
1697
+ <!-- <show_in_website>1</show_in_website> -->
1698
+ <!-- <show_in_store>1</show_in_store> -->
1699
+ <!-- </min_order_total> -->
1700
+ <!-- <max_order_total translate="label"> -->
1701
+ <!-- <label>Maximum Order Total</label> -->
1702
+ <!-- <frontend_type>text</frontend_type> -->
1703
+ <!-- <sort_order>121</sort_order> -->
1704
+ <!-- <show_in_default>1</show_in_default> -->
1705
+ <!-- <show_in_website>1</show_in_website> -->
1706
+ <!-- <show_in_store>1</show_in_store> -->
1707
+ <!-- </max_order_total> -->
1708
+ <!-- <sort_order translate="label"> -->
1709
+ <!-- <label>Sort Order</label> -->
1710
+ <!-- <frontend_type>text</frontend_type> -->
1711
+ <!-- <sort_order>130</sort_order> -->
1712
+ <!-- <show_in_default>1</show_in_default> -->
1713
+ <!-- <show_in_website>1</show_in_website> -->
1714
+ <!-- <show_in_store>1</show_in_store> -->
1715
+ <!-- </sort_order> -->
1716
+ <!-- <debug translate="label"> -->
1717
+ <!-- <label>Enable debug log</label> -->
1718
+ <!-- <comment></comment> -->
1719
+ <!-- <frontend_type>select</frontend_type> -->
1720
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1721
+ <!-- <sort_order>150</sort_order> -->
1722
+ <!-- <show_in_default>1</show_in_default> -->
1723
+ <!-- <show_in_website>1</show_in_website> -->
1724
+ <!-- <show_in_store>0</show_in_store> -->
1725
+ <!-- </debug> -->
1726
+ <!-- <is_test_mode translate="label comment"> -->
1727
+ <!-- <label>Enable test mode</label> -->
1728
+ <!-- <comment></comment> -->
1729
+ <!-- <frontend_type>select</frontend_type> -->
1730
+ <!-- <source_model>adminhtml/system_config_source_yesno</source_model> -->
1731
+ <!-- <sort_order>200</sort_order> -->
1732
+ <!-- <show_in_default>1</show_in_default> -->
1733
+ <!-- <show_in_website>1</show_in_website> -->
1734
+ <!-- <show_in_store>1</show_in_store> -->
1735
+ <!-- </is_test_mode> -->
1736
+ <!-- </fields> -->
1737
+ <!-- </hipay_kbc> -->
1738
+ <hipay_giropay translate="label" module="hipay">
1739
+ <label>HiPay Fullservice Giropay</label>
1740
  <frontend_type>text</frontend_type>
1741
  <sort_order>220</sort_order>
1742
  <show_in_default>1</show_in_default>
1844
  <show_in_website>1</show_in_website>
1845
  <show_in_store>0</show_in_store>
1846
  </cancel_pending_order>
1847
+ <send_fraud_payment_email translate="label">
1848
+ <label>Send fraud payment email</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1849
  <frontend_type>select</frontend_type>
1850
  <source_model>adminhtml/system_config_source_yesno</source_model>
1851
+ <sort_order>99</sort_order>
 
 
 
 
 
 
 
 
1852
  <show_in_default>1</show_in_default>
1853
  <show_in_website>1</show_in_website>
1854
  <show_in_store>1</show_in_store>
1855
+ </send_fraud_payment_email>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1856
  <allowspecific translate="label">
1857
  <label>Payment from applicable countries</label>
1858
  <frontend_type>allowspecific</frontend_type>
1916
  <show_in_store>1</show_in_store>
1917
  </is_test_mode>
1918
  </fields>
1919
+ </hipay_giropay>
1920
+ <hipay_przelewy24api translate="label" module="hipay">
1921
+ <label>HiPay Fullservice Przelewy24</label>
1922
  <frontend_type>text</frontend_type>
1923
  <sort_order>220</sort_order>
1924
  <show_in_default>1</show_in_default>
2026
  <show_in_website>1</show_in_website>
2027
  <show_in_store>0</show_in_store>
2028
  </cancel_pending_order>
2029
+ <send_fraud_payment_email translate="label">
2030
+ <label>Send fraud payment email</label>
2031
+ <frontend_type>select</frontend_type>
2032
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2033
+ <sort_order>99</sort_order>
2034
+ <show_in_default>1</show_in_default>
2035
+ <show_in_website>1</show_in_website>
2036
+ <show_in_store>1</show_in_store>
2037
+ </send_fraud_payment_email>
2038
  <allowspecific translate="label">
2039
  <label>Payment from applicable countries</label>
2040
  <frontend_type>allowspecific</frontend_type>
2098
  <show_in_store>1</show_in_store>
2099
  </is_test_mode>
2100
  </fields>
2101
+ </hipay_przelewy24api>
2102
+ <hipay_qiwi translate="label" module="hipay">
2103
+ <label>HiPay Fullservice Visa Qiwi Wallet</label>
2104
  <frontend_type>text</frontend_type>
2105
  <sort_order>220</sort_order>
2106
  <show_in_default>1</show_in_default>
2208
  <show_in_website>1</show_in_website>
2209
  <show_in_store>0</show_in_store>
2210
  </cancel_pending_order>
2211
+ <send_fraud_payment_email translate="label">
2212
+ <label>Send fraud payment email</label>
2213
+ <frontend_type>select</frontend_type>
2214
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2215
+ <sort_order>99</sort_order>
2216
+ <show_in_default>1</show_in_default>
2217
+ <show_in_website>1</show_in_website>
2218
+ <show_in_store>1</show_in_store>
2219
+ </send_fraud_payment_email>
2220
  <allowspecific translate="label">
2221
  <label>Payment from applicable countries</label>
2222
  <frontend_type>allowspecific</frontend_type>
2280
  <show_in_store>1</show_in_store>
2281
  </is_test_mode>
2282
  </fields>
2283
+ </hipay_qiwi>
2284
+ <hipay_webmoneyapi translate="label" module="hipay">
2285
+ <label>HiPay Fullservice WebMoney Transfer</label>
2286
  <frontend_type>text</frontend_type>
2287
  <sort_order>220</sort_order>
2288
  <show_in_default>1</show_in_default>
2390
  <show_in_website>1</show_in_website>
2391
  <show_in_store>0</show_in_store>
2392
  </cancel_pending_order>
2393
+ <send_fraud_payment_email translate="label">
2394
+ <label>Send fraud payment email</label>
2395
+ <frontend_type>select</frontend_type>
2396
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2397
+ <sort_order>99</sort_order>
2398
+ <show_in_default>1</show_in_default>
2399
+ <show_in_website>1</show_in_website>
2400
+ <show_in_store>1</show_in_store>
2401
+ </send_fraud_payment_email>
2402
  <allowspecific translate="label">
2403
  <label>Payment from applicable countries</label>
2404
  <frontend_type>allowspecific</frontend_type>
2462
  <show_in_store>1</show_in_store>
2463
  </is_test_mode>
2464
  </fields>
2465
+ </hipay_webmoneyapi>
2466
+ <hipay_yandexapi translate="label" module="hipay">
2467
+ <label>HiPay Fullservice Yandex.Money</label>
2468
  <frontend_type>text</frontend_type>
2469
  <sort_order>220</sort_order>
2470
  <show_in_default>1</show_in_default>
2572
  <show_in_website>1</show_in_website>
2573
  <show_in_store>0</show_in_store>
2574
  </cancel_pending_order>
2575
+ <send_fraud_payment_email translate="label">
2576
+ <label>Send fraud payment email</label>
2577
+ <frontend_type>select</frontend_type>
2578
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2579
+ <sort_order>99</sort_order>
2580
+ <show_in_default>1</show_in_default>
2581
+ <show_in_website>1</show_in_website>
2582
+ <show_in_store>1</show_in_store>
2583
+ </send_fraud_payment_email>
2584
  <allowspecific translate="label">
2585
  <label>Payment from applicable countries</label>
2586
  <frontend_type>allowspecific</frontend_type>
2644
  <show_in_store>1</show_in_store>
2645
  </is_test_mode>
2646
  </fields>
2647
+ </hipay_yandexapi>
2648
+ <hipay_sofortapi translate="label" module="hipay">
2649
+ <label>HiPay Fullservice Sofort Überweisung</label>
2650
  <frontend_type>text</frontend_type>
2651
+ <sort_order>225</sort_order>
2652
  <show_in_default>1</show_in_default>
2653
  <show_in_website>1</show_in_website>
2654
  <show_in_store>1</show_in_store>
2716
  <show_in_website>1</show_in_website>
2717
  <show_in_store>0</show_in_store>
2718
  </pending_redirect_page>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2719
  <re_add_to_cart translate="label comment">
2720
  <label>Add product to cart</label>
2721
  <comment>Fill cart when payment canceled or refused</comment>
2736
  <show_in_website>1</show_in_website>
2737
  <show_in_store>0</show_in_store>
2738
  </cancel_pending_order>
2739
+ <send_fraud_payment_email translate="label">
2740
+ <label>Send fraud payment email</label>
2741
+ <frontend_type>select</frontend_type>
2742
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2743
+ <sort_order>99</sort_order>
2744
+ <show_in_default>1</show_in_default>
2745
+ <show_in_website>1</show_in_website>
2746
+ <show_in_store>1</show_in_store>
2747
+ </send_fraud_payment_email>
2748
  <allowspecific translate="label">
2749
  <label>Payment from applicable countries</label>
2750
  <frontend_type>allowspecific</frontend_type>
2808
  <show_in_store>1</show_in_store>
2809
  </is_test_mode>
2810
  </fields>
2811
+ </hipay_sofortapi>
2812
+ <hipay_sisalapi translate="label" module="hipay">
2813
+ <label>HiPay Fullservice Sisal</label>
2814
  <frontend_type>text</frontend_type>
2815
  <sort_order>225</sort_order>
2816
  <show_in_default>1</show_in_default>
2900
  <show_in_website>1</show_in_website>
2901
  <show_in_store>0</show_in_store>
2902
  </cancel_pending_order>
2903
+ <send_fraud_payment_email translate="label">
2904
+ <label>Send fraud payment email</label>
2905
+ <frontend_type>select</frontend_type>
2906
+ <source_model>adminhtml/system_config_source_yesno</source_model>
2907
+ <sort_order>99</sort_order>
2908
+ <show_in_default>1</show_in_default>
2909
+ <show_in_website>1</show_in_website>
2910
+ <show_in_store>1</show_in_store>
2911
+ </send_fraud_payment_email>
2912
  <allowspecific translate="label">
2913
  <label>Payment from applicable countries</label>
2914
  <frontend_type>allowspecific</frontend_type>
2972
  <show_in_store>1</show_in_store>
2973
  </is_test_mode>
2974
  </fields>
2975
+ </hipay_sisalapi>
2976
+ <hipay_paypalapi translate="label" module="hipay">
2977
+ <label>HiPay Fullservice PayPal</label>
2978
  <frontend_type>text</frontend_type>
2979
  <sort_order>225</sort_order>
2980
  <show_in_default>1</show_in_default>
3064
  <show_in_website>1</show_in_website>
3065
  <show_in_store>0</show_in_store>
3066
  </cancel_pending_order>
3067
+ <send_fraud_payment_email translate="label">
3068
+ <label>Send fraud payment email</label>
3069
+ <frontend_type>select</frontend_type>
3070
+ <source_model>adminhtml/system_config_source_yesno</source_model>
3071
+ <sort_order>99</sort_order>
3072
+ <show_in_default>1</show_in_default>
3073
+ <show_in_website>1</show_in_website>
3074
+ <show_in_store>1</show_in_store>
3075
+ </send_fraud_payment_email>
3076
  <allowspecific translate="label">
3077
  <label>Payment from applicable countries</label>
3078
  <frontend_type>allowspecific</frontend_type>
3136
  <show_in_store>1</show_in_store>
3137
  </is_test_mode>
3138
  </fields>
3139
+ </hipay_paypalapi>
3140
  </groups>
3141
  </payment>
3142
  </sections>
app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-install-0.1.0.php CHANGED
@@ -6,8 +6,8 @@ $installer = $this;
6
 
7
  $installer->startSetup();
8
 
9
- $currentVersion = Mage::getVersion();
10
- if (version_compare($currentVersion, '1.4.2') == 1)
11
  {
12
 
13
  $statusTable = $installer->getTable('sales/order_status');
@@ -26,19 +26,19 @@ if (version_compare($currentVersion, '1.4.2') == 1)
26
 
27
  $installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
28
  //Insert relation between state and status
29
- $data[0] = array(
30
- 'status' => $status,
31
- 'state' => $code,
32
- 'is_default'=> 0,
33
- );
34
-
35
- $installer->getConnection()->insertArray(
36
- $statusStateTable,
37
- array('status', 'state', 'is_default'),
38
- $data
39
  );
40
- }
41
-
42
 
43
 
44
  $installer->endSetup();
6
 
7
  $installer->startSetup();
8
 
9
+ $currentVersion = Mage::getVersion();
10
+ if (version_compare($currentVersion, '1.4.2') == 1)
11
  {
12
 
13
  $statusTable = $installer->getTable('sales/order_status');
26
 
27
  $installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
28
  //Insert relation between state and status
29
+ $data[0] = array(
30
+ 'status' => $status,
31
+ 'state' => $code,
32
+ 'is_default'=> 0,
33
+ );
34
+
35
+ $installer->getConnection()->insertArray(
36
+ $statusStateTable,
37
+ array('status', 'state', 'is_default'),
38
+ $data
39
  );
40
+ }
41
+
42
 
43
 
44
  $installer->endSetup();
app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.6-1.0.7.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+
10
+ -- DROP TABLE IF EXISTS {$this->getTable('hipay_payment_profile')};
11
+ CREATE TABLE {$this->getTable('hipay_payment_profile')} (
12
+ `profile_id` int(10) unsigned NOT NULL auto_increment,
13
+ `name` varchar(150) NOT NULL,
14
+ `period_unit` varchar(30) NOT NULL,
15
+ `period_frequency` int(10) unsigned NOT NULL ,
16
+ `period_max_cycles` int(10) unsigned NOT NULL ,
17
+ `payment_type` varchar(60) NOT NULL default 'split_payment',
18
+ PRIMARY KEY (`profile_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ -- DROP TABLE IF EXISTS {$this->getTable('hipay_split_payment')};
22
+ CREATE TABLE {$this->getTable('hipay_split_payment')} (
23
+ `split_payment_id` int(10) unsigned NOT NULL auto_increment,
24
+ `order_id` int(10) unsigned NOT NULL ,
25
+ `real_order_id` int(10) unsigned NOT NULL ,
26
+ `customer_id` int(10) unsigned NOT NULL ,
27
+ `card_token` text NOT NULL ,
28
+ `total_amount` decimal(12,4) NOT NULL,
29
+ `amount_to_pay` decimal(12,4) NOT NULL,
30
+ `date_to_pay` datetime NOT NULL ,
31
+ `method_code` varchar(150) NOT NULL,
32
+ `attempts` int(4) unsigned NOT NULL DEFAULT '0' ,
33
+ `status` varchar(60) NOT NULL default 'pending',
34
+ PRIMARY KEY (`split_payment_id`)
35
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
36
+
37
+ "
38
+ );
39
+
40
+
41
+
42
+ $installer->endSetup();
43
+
app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.7-1.0.8.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+
10
+ ALTER TABLE {$this->getTable('hipay_rule')} ADD `config_path` VARCHAR(60) NOT NULL AFTER `method_code` ;
11
+
12
+ "
13
+ );
14
+
15
+
16
+
17
+ $installer->endSetup();
18
+
app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.8-1.0.9.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+
10
+ CREATE TABLE {$this->getTable('hipay_customer_card')} (
11
+ `card_id` int(10) unsigned NOT NULL auto_increment,
12
+ `customer_id` int(10) unsigned NOT NULL,
13
+ `name` varchar(255) NOT NULL,
14
+ `cc_exp_month` varchar(2) NOT NULL COMMENT 'Cc Exp Month',
15
+ `cc_exp_year` varchar(4) NOT NULL COMMENT 'Cc Exp Year',
16
+ `cc_secure_verify` varchar(10) DEFAULT NULL COMMENT 'Cc Secure Verify',
17
+ `cc_last4` varchar(4) DEFAULT NULL COMMENT 'Cc Last4',
18
+ `cc_owner` varchar(255) DEFAULT NULL COMMENT 'Cc Owner',
19
+ `cc_type` varchar(255) NOT NULL COMMENT 'Cc Type',
20
+ `cc_number_enc` varchar(40) NOT NULL COMMENT 'Cc Number Enc',
21
+ `cc_status` TINYINT( 1 ) NOT NULL COMMENT 'Cc Status',
22
+ `cc_token` varchar(255) NOT NULL COMMENT 'Cc Token',
23
+ `is_default` TINYINT( 1 ) NOT NULL DEFAULT '0' COMMENT 'Cc is default',
24
+ PRIMARY KEY (`card_id`)
25
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
26
+
27
+ "
28
+ );
29
+
30
+
31
+
32
+ $installer->endSetup();
app/code/community/Allopass/Hipay/sql/allopass_hipay_setup/mysql4-upgrade-1.0.9-1.1.0.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+
6
+ $installer->startSetup();
7
+
8
+ $currentVersion = Mage::getVersion();
9
+ if (version_compare($currentVersion, '1.4.2') == 1)
10
+ {
11
+
12
+
13
+ $statusTable = $installer->getTable('sales/order_status');
14
+ $statusStateTable = $installer->getTable('sales/order_status_state');
15
+ $statusLabelTable = $installer->getTable('sales/order_status_label');
16
+
17
+ $statues = array('authorization_requested'=>
18
+ array('label'=>'Authorization Requested',
19
+ 'code'=>'processing',
20
+ 'is_default'=>0
21
+ ),
22
+ 'expired' => array('label'=>'Transaction Expired',
23
+ 'code'=>'holded',
24
+ 'is_default'=>0
25
+ ),
26
+ 'partial_refund'=> array('label'=>'Partial Refund',
27
+ 'code'=>'processing',
28
+ 'is_default'=>0
29
+ ),
30
+ 'partial_capture'=> array('label'=>'Partial Capture',
31
+ 'code'=>'processing',
32
+ 'is_default'=>0
33
+ ),
34
+ );
35
+
36
+ foreach ($statues as $status=>$infos)
37
+ {
38
+ $label = $infos['label'];
39
+ $code = $infos['code'];
40
+ $is_default = $infos['is_default'];
41
+
42
+ //Insert new Status in DB
43
+ $data[0] = array(
44
+ 'status' => $status,
45
+ 'label' => $label,
46
+ );
47
+
48
+ $installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
49
+ //Insert relation between state and status
50
+ $data[0] = array(
51
+ 'status' => $status,
52
+ 'state' => $code,
53
+ 'is_default'=> $is_default,
54
+ );
55
+
56
+ $installer->getConnection()->insertArray(
57
+ $statusStateTable,
58
+ array('status', 'state', 'is_default'),
59
+ $data
60
+ );
61
+ }
62
+
63
+
64
+ }
65
+
66
+
67
+
68
+ $installer->endSetup();
69
+
app/design/adminhtml/default/default/layout/hipay.xml CHANGED
@@ -1,5 +1,5 @@
1
  <?xml version="1.0"?>
2
- <layout>
3
 
4
  <adminhtml_system_config_edit>
5
  <reference name="head">
@@ -9,4 +9,41 @@
9
  </reference>
10
  </adminhtml_system_config_edit>
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  </layout>
1
  <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
 
4
  <adminhtml_system_config_edit>
5
  <reference name="head">
9
  </reference>
10
  </adminhtml_system_config_edit>
11
 
12
+ <adminhtml_paymentprofile_index>
13
+ <reference name="content">
14
+ <block type="hipay/adminhtml_paymentProfile" name="paymentProfile.grid.container"></block>
15
+ </reference>
16
+ </adminhtml_paymentprofile_index>
17
+
18
+ <adminhtml_paymentprofile_edit>
19
+ <reference name="content">
20
+ <block type="hipay/adminhtml_paymentProfile_edit" name="paymentProfile.edit.container"></block>
21
+ </reference>
22
+ </adminhtml_paymentprofile_edit>
23
+
24
+ <adminhtml_splitpayment_index>
25
+ <reference name="content">
26
+ <block type="hipay/adminhtml_splitPayment" name="splitPayment.grid.container"></block>
27
+ </reference>
28
+ </adminhtml_splitpayment_index>
29
+
30
+ <adminhtml_splitpayment_edit>
31
+ <reference name="content">
32
+ <block type="hipay/adminhtml_splitPayment_edit" name="splitPayment.edit.container"></block>
33
+ </reference>
34
+ </adminhtml_splitpayment_edit>
35
+
36
+ <adminhtml_customer_edit>
37
+ <reference name="customer_edit_tabs">
38
+ <block type="hipay/adminhtml_customer_edit_tab_card" name="customer_edit_tab_card" />
39
+ <action method="addTab"><name>customer_edit_tab_card</name><block>customer_edit_tab_card</block></action>
40
+ </reference>
41
+ </adminhtml_customer_edit>
42
+
43
+ <adminhtml_card_edit>
44
+ <reference name="content">
45
+ <block type="hipay/adminhtml_card_edit" name="card.edit.container"></block>
46
+ </reference>
47
+ </adminhtml_card_edit>
48
+
49
  </layout>
app/design/{frontend → adminhtml}/default/default/template/hipay/form/cc.phtml RENAMED
@@ -11,51 +11,60 @@
11
  </li>
12
  */ ?>
13
  <li>
14
- <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
15
- <div class="input-box">
16
- <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
17
- <option value=""><?php echo $this->__('--Please Select--')?></option>
18
- <?php $_ccType = $this->getInfoData('cc_type') ?>
19
- <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
20
- <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
21
- <?php endforeach ?>
22
- </select>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
24
  </li>
25
  <li>
26
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
27
  <div class="input-box">
28
- <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
 
29
  </div>
30
  </li>
31
  <li id="<?php echo $_code ?>_cc_type_exp_div">
32
- <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
33
  <div class="input-box">
34
- <div class="v-fix">
35
  <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
36
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
37
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
38
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
39
  <?php endforeach ?>
40
  </select>
41
- </div>
42
- <div class="v-fix">
43
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
44
  <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
45
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
46
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
47
  <?php endforeach ?>
48
  </select>
49
- </div>
50
  </div>
51
  </li>
52
  <?php echo $this->getChildHtml() ?>
53
  <?php if($this->hasVerification()): ?>
54
  <li id="<?php echo $_code ?>_cc_type_cvv_div">
55
- <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
56
  <div class="input-box">
 
57
  <div class="v-fix">
58
- <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
59
  </div>
60
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
61
  </div>
@@ -63,6 +72,21 @@
63
  <?php endif; ?>
64
 
65
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <?php if ($this->oneClickIsAllowed()) : ?>
67
  <ul class="form-list" id="oneclick_card_payment_form_<?php echo $_code ?>">
68
  <li>
11
  </li>
12
  */ ?>
13
  <li>
14
+ <?php if(count($this->getCcAvailableTypes()) == 1) :?>
15
+ <label for="<?php echo $_code ?>_cc_type" ><?php echo $this->__('Credit Card Type') ?>:
16
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
17
+ <?php echo $_typeName ?>
18
+ <input value="<?php echo $_typeCode ?>" type="hidden" name="payment[cc_type]" />
19
+ <?php endforeach ?>
20
+ </label>
21
+ <?php else:?>
22
+
23
+ <div class="input-box">
24
+ <label for="<?php echo $_code ?>_cc_type"><?php echo $this->__('Credit Card Type') ?> <span class="required">*</span></label><br />
25
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
26
+ <option value=""><?php echo $this->__('--Please Select--')?></option>
27
+ <?php $_ccType = $this->getInfoData('cc_type') ?>
28
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
29
+ <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
30
+ <?php endforeach ?>
31
+
32
+ </select>
33
+ </div>
34
+ <?php endif;?>
35
  </li>
36
  <li>
37
+
38
  <div class="input-box">
39
+ <label for="<?php echo $_code ?>_cc_number" ><?php echo $this->__('Credit Card Number') ?> <span class="required">*</span></label><br />
40
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="<?php echo $this->getInfoData('cc_number')?>" />
41
  </div>
42
  </li>
43
  <li id="<?php echo $_code ?>_cc_type_exp_div">
 
44
  <div class="input-box">
45
+ <label for="<?php echo $_code ?>_expiration" ><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br />
46
  <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
47
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
48
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
49
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
50
  <?php endforeach ?>
51
  </select>
 
 
52
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
53
  <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
54
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
55
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
56
  <?php endforeach ?>
57
  </select>
 
58
  </div>
59
  </li>
60
  <?php echo $this->getChildHtml() ?>
61
  <?php if($this->hasVerification()): ?>
62
  <li id="<?php echo $_code ?>_cc_type_cvv_div">
63
+
64
  <div class="input-box">
65
+ <label for="<?php echo $_code ?>_cc_cid"><?php echo $this->__('Card Verification Number') ?> <span class="required">*</span></label>
66
  <div class="v-fix">
67
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="<?php echo $this->getInfoData('cc_cid')?> " />
68
  </div>
69
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
70
  </div>
72
  <?php endif; ?>
73
 
74
  </ul>
75
+ <?php if($this->allowSplitPayment()) : ?>
76
+ <ul class="form-list" id="splitpayment_card_payment_form_<?php echo $_code ?>" >
77
+ <li>
78
+ <div class="input-box">
79
+ <select id="<?php echo $_code ?>_split_payment" name="payment[split_payment_id]">
80
+ <option value=""><?php echo $this->__('-- Please Select --')?></option>
81
+ <?php foreach ($this->getSplitPaymentProfiles() as $profile) : ?>
82
+ <option value="<?php echo $profile->getId()?>"><?php echo $profile->getName()?></option>
83
+ <?php endforeach;?>
84
+ </select>
85
+ <label style="float: none;" for="<?php echo $_code ?>_split_payment"><?php echo $this->__('Split Payment') ?></label>
86
+ </div>
87
+ </li>
88
+ </ul>
89
+ <?php endif; ?>
90
  <?php if ($this->oneClickIsAllowed()) : ?>
91
  <ul class="form-list" id="oneclick_card_payment_form_<?php echo $_code ?>">
92
  <li>
app/design/adminhtml/default/default/template/hipay/form/hosted.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_code=$this->getMethodCode() ?>
2
+ <div id="payment_form_<?php echo $_code ?>" style="display:none;">
3
+ <?php if ($this->oneClickIsAllowed()) : ?>
4
+ <ul class="form-list" id="oneclick_hosted_payment_form_<?php echo $_code ?>">
5
+ <li>
6
+
7
+ <?php if (!$this->getCustomerHasAlias() || ($this->getCustomerHasAlias() && !$this->ccExpDateIsValid())) :?>
8
+ <div class="input-box">
9
+ <input id="<?php echo $_code ?>_create_alias_oneclick" value="create_oneclick" type="checkbox" name="payment[oneclick]" />
10
+ <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record your card data for a next buy.') ?></label>
11
+ </div>
12
+ <?php elseif ($this->getCustomerHasAlias() && $this->ccExpDateIsValid()): ?>
13
+ <div class="input-box">
14
+ <input id="<?php echo $_code ?>_use_alias_oneclick" value="use_oneclick" checked="checked" type="radio" name="payment[oneclick]" />
15
+ <label style="float: none;" for="<?php echo $_code ?>_use_alias_oneclick"><?php echo $this->__('Use my recorded card') ?></label>
16
+ </div>
17
+ <div class="input-box info-card">
18
+ <label><?php echo $this->__('Actual card') ?> :</label>
19
+ <span><?php echo $this->getCustomer()->getHipayCcNumberEnc() ?></span>
20
+ </div>
21
+ <div class="input-box info-card">
22
+ <label><?php echo $this->__('Expiration date') ?> : <?php echo $this->getCustomer()->getHipayCcExpDate() ?></label>
23
+ </div>
24
+ <div class="input-box">
25
+ <input id="<?php echo $_code ?>_create_alias_oneclick" type="radio" name="payment[oneclick]" value="create_oneclick"/>
26
+ <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record new card data') ?></label>
27
+ </div>
28
+
29
+ <div class="input-box">
30
+ <input id="<?php echo $_code ?>_not_oneclick" type="radio" name="payment[oneclick]" value="not_oneclick" />
31
+ <label style="float: none;" for="<?php echo $_code ?>_not_oneclick"><?php echo $this->__('Not use record card data') ?></label>
32
+ </div>
33
+
34
+ <?php endif;?>
35
+ </li>
36
+
37
+ </ul>
38
+ <?php endif; ?>
39
+ <?php echo $this->__('You will be redirect to payment page after submit order.')?>
40
+ <!-- @TODO MANAGE Iframe -->
41
+ </div>
app/design/adminhtml/default/default/template/hipay/info/cc.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see Mage_Payment_Block_Info
4
+ */
5
+ ?>
6
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
7
+
8
+ <?php if ($_specificInfo = $this->getSpecificInformation()):?>
9
+ <table>
10
+ <?php foreach ($_specificInfo as $_label => $_value):?>
11
+ <tr>
12
+ <td><?php echo $this->escapeHtml($_label)?>:</td>
13
+ <td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
14
+ </tr>
15
+ <?php endforeach; ?>
16
+ </table>
17
+ <?php endif;?>
18
+
19
+ <?php echo $this->getChildHtml()?>
app/design/adminhtml/default/default/template/hipay/info/hosted.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see Mage_Payment_Block_Info
4
+ */
5
+ ?>
6
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
7
+
8
+ <?php if ($_specificInfo = $this->getSpecificInformation()):?>
9
+ <table>
10
+ <?php foreach ($_specificInfo as $_label => $_value):?>
11
+ <tr>
12
+ <td><?php echo $this->escapeHtml($_label)?>:</td>
13
+ <td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
14
+ </tr>
15
+ <?php endforeach; ?>
16
+ </table>
17
+ <?php endif;?>
18
+
19
+ <?php echo $this->getChildHtml()?>
app/design/frontend/base/default/layout/hipay.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?><layout version="0.1.0">
2
+ <hipay_checkout_pending translate="label">
3
+ <label>Hipay Checkout Pending</label>
4
+ <reference name="root">
5
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
6
+ </reference>
7
+ <reference name="content">
8
+ <block type="hipay/checkout_pending" name="checkout.pending" template="hipay/checkout/pending.phtml"/>
9
+ </reference>
10
+ </hipay_checkout_pending>
11
+
12
+ <customer_account>
13
+ <!-- Allopass_Hipay -->
14
+ <reference name="customer_account_navigation">
15
+ <!-- @TODO Add config for enable it -->
16
+ <!-- ifconfig="hipay/general/card_front_active"-->
17
+ <action method="addLink" translate="label" module="hipay" ><name>hipay</name><path>hipay/card/</path><label>Hipay's cards</label></action>
18
+ </reference>
19
+ </customer_account>
20
+
21
+ <hipay_card_index translate="label">
22
+ <label>Customer My Account Hipay's Card</label>
23
+ <update handle="customer_account" />
24
+ <reference name="my.account.wrapper">
25
+ <block type="hipay/card" name="hipay.card.account">
26
+ <block type="core/text_list" name="hipay.card.account.info" as="info" translate="label">
27
+ <label>Cards account Info</label>
28
+ </block>
29
+ </block>
30
+ <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
31
+ </reference>
32
+ </hipay_card_index>
33
+
34
+ <hipay_card_edit translate="label">
35
+ <label>Customer Edit Hipay Card</label>
36
+ <update handle="customer_account" />
37
+ <reference name="my.account.wrapper">
38
+ <block type="hipay/card_edit" name="hipay.card.account.edit" template="hipay/card/form/edit.phtml" />
39
+ </reference>
40
+ </hipay_card_edit>
41
+ </layout>
app/design/frontend/base/default/template/hipay/card/account.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
2
+ <?php $_cards = $this->getCards(); ?>
3
+ <div class="page-title">
4
+ <h1><?php echo $this->__("My hipay credit cards") ?></h1>
5
+ </div>
6
+ <?php echo $this->getPagerHtml(); ?>
7
+ <?php if($_cards->getSize()): ?>
8
+ <table class="data-table" id="my-hipay-cards-table">
9
+ <col />
10
+ <col width="1" />
11
+ <col />
12
+ <col width="1" />
13
+ <col width="1" />
14
+ <col width="1" />
15
+ <col width="1" />
16
+ <thead>
17
+ <tr>
18
+ <th><span class="nobr"><?php echo $this->__('Card name') ?></span></th>
19
+ <th><?php echo $this->__('Card type') ?></th>
20
+ <th><?php echo $this->__('Exp. Month') ?></th>
21
+ <th><?php echo $this->__('Exp. Year') ?></th>
22
+ <th><span class="nobr"><?php echo $this->__('Card Number') ?></span></th>
23
+ <th><span class="nobr"><?php echo $this->__('Card Status') ?></span></th>
24
+ <th><?php echo $this->__('Is default')?></th>
25
+ <th>&nbsp;</th>
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ <?php $_odd = ''; ?>
30
+ <?php foreach ($_cards as $_card): ?>
31
+ <tr>
32
+ <td><span class="nobr"><?php echo $_card->getName() ?></span></td>
33
+ <td><span style="text-transform: capitalize;"><?php echo $_card->getCcType() ?><span></span></td>
34
+ <td><?php echo $_card->getCcExpMonth() ?></td>
35
+ <td><?php echo $_card->getCcExpYear() ?></td>
36
+ <td><?php echo $_card->getCcNumberEnc() ?></td>
37
+ <td><em><?php echo $_card->getCcStatus() == Allopass_Hipay_Model_Card::STATUS_ENABLED ? $this->__('Enabled') : $this->__('Disabled') ?></em></td>
38
+ <td><?php echo $_card->getIsDefault() == 1 ? $this->__('Yes') : $this->__('No')?></td>
39
+ <td class="a-center">
40
+ <span class="nobr">
41
+ <a href="<?php echo $this->getEditUrl($_card) ?>"><?php echo $this->__('Edit Card') ?></a>
42
+ <span class="separator">|</span>
43
+ <?php if ($this->canDelete()) :?>
44
+ <a href="<?php echo $this->getDeleteUrl($_card) ?>" class="link-delete link-remove"><?php echo $this->__('Delete') ?></a>
45
+ <?php endif; ?>
46
+ </span>
47
+ </td>
48
+ </tr>
49
+ <?php endforeach; ?>
50
+ </tbody>
51
+ </table>
52
+ <script type="text/javascript">decorateTable('my-hipay-cards-table');</script>
53
+ <?php echo $this->getPagerHtml(); ?>
54
+ <?php else: ?>
55
+ <p><?php echo $this->__('You have saved no cards.'); ?></p>
56
+ <?php endif ?>
app/design/frontend/base/default/template/hipay/card/form/edit.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="page-title">
2
+ <h1><?php echo $this->__('Edit Card') ?></h1>
3
+ </div>
4
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
5
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
6
+ <div class="fieldset">
7
+ <?php echo $this->getBlockHtml('formkey')?>
8
+ <h2 class="legend"><?php echo $this->__('Card %s',$this->htmlEscape($this->getCard()->getName())) ?></h2>
9
+ <ul class="form-list">
10
+ <li>
11
+ <label for="name" class="required"><em>*</em><?php echo $this->__('Card Name') ?></label>
12
+ <div class="input-box">
13
+ <input type="text" name="name" id="name" value="<?php echo $this->htmlEscape($this->getCard()->getName()) ?>" title="<?php echo $this->__('Card Name') ?>" class="input-text required-entry" />
14
+ </div>
15
+ </li>
16
+ <li class="control">
17
+ <input type="checkbox" name="is_default" id="is_default" value="1" title="<?php echo $this->__('Is default') ?>"<?php if($this->getCard()->getIsDefault()==1): ?> checked="checked"<?php endif; ?> class="checkbox" />
18
+ <label for="is_default"><?php echo $this->__('Is default') ?></label>
19
+ </li>
20
+ </ul>
21
+ </div>
22
+ <div class="fieldset">
23
+ <ul class=forme-list>
24
+ <li><label><?php echo $this->__('Card Number') ?>: <?php echo $this->getCard()->getCcNumberEnc()?></label></li>
25
+ <li><label><?php echo $this->__('Exp. Date') ?>: <?php echo $this->getCard()->getCcExpMonth()?>/<?php echo $this->getCard()->getCcExpYear()?></label></li>
26
+ </ul>
27
+ </div>
28
+ <div class="buttons-set">
29
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
30
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
31
+ <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
32
+ </div>
33
+ </form>
app/design/frontend/{default → base}/default/template/hipay/checkout/pending.phtml RENAMED
File without changes
app/design/frontend/base/default/template/hipay/form/cc.phtml ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_code=$this->getMethodCode();
3
+ $_cards = $this->getCards();
4
+
5
+ ?>
6
+ <div id="payment_form_<?php echo $_code ?>" style="display:none;">
7
+ <?php if($this->allowSplitPayment()) : ?>
8
+ <ul class="form-list" id="splitpayment_card_payment_form_<?php echo $_code ?>" >
9
+ <li>
10
+ <div class="input-box">
11
+ <label style="float: none;" for="<?php echo $_code ?>_split_payment"><?php echo $this->__('Split your Payment') ?></label><br />
12
+ <select id="<?php echo $_code ?>_split_payment" name="payment[split_payment_id]">
13
+ <option value=""><?php echo $this->__('-- Please select your split payment --')?></option>
14
+ <?php foreach ($this->getSplitPaymentProfiles() as $profile) : ?>
15
+ <option value="<?php echo $profile->getId()?>"><?php echo $profile->getName()?></option>
16
+ <?php endforeach;?>
17
+ </select>
18
+ </div>
19
+ </li>
20
+ </ul>
21
+ <br />
22
+ <?php endif; ?>
23
+ <ul class="form-list" id="card_payment_form_<?php echo $_code ?>" >
24
+
25
+ <li>
26
+ <?php if(count($this->getCcAvailableTypes()) == 1) :?>
27
+ <label for="<?php echo $_code ?>_cc_type" ><?php echo $this->__('Credit Card Type') ?>:
28
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
29
+ <?php echo $_typeName ?>
30
+ <input id="<?php echo $_code ?>_cc_type" value="<?php echo $_typeCode ?>" type="hidden" name="payment[cc_type]" />
31
+ <?php endforeach ?>
32
+ </label>
33
+ <?php else:?>
34
+ <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
35
+ <div class="input-box">
36
+
37
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
38
+ <option value=""><?php echo $this->__('--Please Select--')?></option>
39
+ <?php $_ccType = $this->getInfoData('cc_type') ?>
40
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
41
+ <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
42
+ <?php endforeach ?>
43
+
44
+ </select>
45
+ </div>
46
+ <?php endif;?>
47
+ </li>
48
+ <?php if(Mage::getStoreConfigFlag('payment/'.$_code.'/display_card_owner')) : ?>
49
+ <li>
50
+ <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
51
+ <div class="input-box">
52
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
53
+ </div>
54
+ </li>
55
+ <?php endif; ?>
56
+ <li>
57
+ <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
58
+ <div class="input-box">
59
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="<?php echo $_SERVER['HTTP_HOST'] == 'magento1910.sirateck.com' ? '4111111111111111' : '' ?>" />
60
+ </div>
61
+ </li>
62
+ <li id="<?php echo $_code ?>_cc_type_exp_div">
63
+ <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
64
+ <div class="input-box">
65
+ <div class="v-fix">
66
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp validate-cc-exp-split required-entry">
67
+ <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
68
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
69
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
70
+ <?php endforeach ?>
71
+ </select>
72
+ </div>
73
+ <div class="v-fix">
74
+ <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
75
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
76
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
77
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
78
+ <?php endforeach ?>
79
+ </select>
80
+ </div>
81
+ </div>
82
+ </li>
83
+ <?php echo $this->getChildHtml() ?>
84
+ <?php if($this->hasVerification()): ?>
85
+ <li id="<?php echo $_code ?>_cc_type_cvv_div">
86
+ <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
87
+ <div class="input-box">
88
+ <div class="v-fix">
89
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
90
+ </div>
91
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
92
+ </div>
93
+ </li>
94
+ <?php endif; ?>
95
+
96
+ </ul>
97
+ <?php if ($this->oneClickIsAllowed()) : ?>
98
+ <ul class="form-list" id="oneclick_card_payment_form_<?php echo $_code ?>">
99
+ <li>
100
+
101
+ <?php if (!$this->getCustomerHasCard()) :?>
102
+ <div class="input-box">
103
+ <input id="<?php echo $_code ?>_create_alias_oneclick" value="create_oneclick" type="checkbox" name="payment[oneclick]" />
104
+ <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record your card data for a next buy.') ?></label>
105
+ </div>
106
+ <?php else :?>
107
+ <script type="text/javascript">$('card_payment_form_<?php echo $_code ?>').hide();</script>
108
+
109
+ <div class="input-box">
110
+ <input id="<?php echo $_code ?>_use_alias_oneclick" value="use_oneclick" checked="checked" type="radio" name="payment[oneclick]" onclick="$('card_payment_form_<?php echo $_code ?>').hide();" />
111
+ <label style="float: none;" for="<?php echo $_code ?>_use_alias_oneclick"><?php echo $this->__('Use my recorded card') ?></label>
112
+ </div>
113
+
114
+ <div class="input-box info-card">
115
+ <select id="<?php echo $_code ?>_oneclick_selected_card" name="payment[oneclick_card]" >
116
+ <?php foreach ($_cards as $card):?>
117
+ <option value="<?php echo $card->getId()?>"><?php echo $card->getName()?></option>
118
+ <?php endforeach;?>
119
+ </select>
120
+ </div>
121
+
122
+ <!-- <div class="input-box info-card">
123
+ <label><?php echo $this->__('Actual card') ?> :</label>
124
+ <span><?php echo $this->getCustomer()->getHipayCcNumberEnc() ?></span>
125
+ </div>
126
+ <div class="input-box info-card">
127
+ <label><?php echo $this->__('Expiration date') ?> : <?php echo $this->getCustomer()->getHipayCcExpDate() ?></label>
128
+ </div>-->
129
+
130
+
131
+
132
+ <div class="input-box">
133
+ <input id="<?php echo $_code ?>_create_alias_oneclick" type="radio" name="payment[oneclick]" value="create_oneclick" onclick="$('card_payment_form_<?php echo $_code ?>').show();"/>
134
+ <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record new card data') ?></label>
135
+ </div>
136
+
137
+ <div class="input-box">
138
+ <input id="<?php echo $_code ?>_not_oneclick" type="radio" name="payment[oneclick]" value="not_oneclick" onclick="$('card_payment_form_<?php echo $_code ?>').show();" />
139
+ <label style="float: none;" for="<?php echo $_code ?>_not_oneclick"><?php echo $this->__('Not use record card data') ?></label>
140
+ </div>
141
+
142
+ <?php endif;?>
143
+ </li>
144
+
145
+ </ul>
146
+ <br />
147
+ <script type="text/javascript">
148
+ //<![CDATA[
149
+
150
+ var ToogleOneclick<?php echo $_code ?> = function() {
151
+ var elm = $('<?php echo $_code ?>_cc_type');
152
+ if (['','VI','MC','AE'].indexOf(elm.value) != -1) {
153
+ $('oneclick_card_payment_form_<?php echo $_code ?>').show();
154
+ } else {
155
+ $('<?php echo $_code ?>_create_alias_oneclick').checked = false;
156
+ $('oneclick_card_payment_form_<?php echo $_code ?>').hide();
157
+ }
158
+ };
159
+
160
+ Event.observe($('<?php echo $_code ?>_cc_type'), 'change', ToogleOneclick<?php echo $_code ?>);
161
+ document.observe("dom:loaded", function() {
162
+ ToogleOneclick<?php echo $_code ?>();
163
+ });
164
+
165
+ //]]>
166
+ </script>
167
+ <?php endif; ?>
168
+ <div id="debit_amount">
169
+ <?php echo $this->__('You will be debit of amount %s only after submit order.',Mage::app()->getStore()->getBaseCurrency()->format($this->getQuote()->getGrandTotal(), array(), true))?>
170
+ </div>
171
+ <script type="text/javascript">
172
+ //<![CDATA[
173
+
174
+ Validation.creditCartTypes.set('BCMC',[false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), false]);
175
+
176
+ var ToogleCvn<?php echo $_code ?> = function() {
177
+ var elm = $('<?php echo $_code ?>_cc_type');
178
+ if (['BCMC'].indexOf(elm.value) != -1) {
179
+ $('<?php echo $_code ?>_cc_type_cvv_div').hide();
180
+ } else {
181
+ $('<?php echo $_code ?>_cc_type_cvv_div').show();
182
+ }
183
+ };
184
+
185
+ Event.observe($('<?php echo $_code ?>_cc_type'), 'change', ToogleCvn<?php echo $_code ?>);
186
+ ToogleCvn<?php echo $_code ?>();
187
+
188
+ var UpdateDebitAmount<?php echo $_code ?> = function(){
189
+
190
+ new Ajax.Request('<?php echo Mage::getUrl('hipay/cc/updateDebitAmount') ?>', {
191
+ evalScripts: true,
192
+ parameters: {'payment_profile_id': $('<?php echo $_code ?>_split_payment').value},
193
+ onSuccess: function(transport) {
194
+
195
+ if (transport.responseText.isJSON()) {
196
+ var response = transport.responseText.evalJSON();
197
+
198
+ if (response.error) {
199
+ $('debit_amount').innerHTML = response.message;
200
+ Validation.add('validate-cc-exp-split', 'Incorrect credit card expiration date.', function(v,elm) {
201
+ return true;
202
+ });
203
+
204
+ }
205
+
206
+ if(response.success)
207
+ {
208
+ //Add validation for the last debit of split payments
209
+ var splitPayment = response.splitPayment;
210
+ var dateArr = splitPayment[splitPayment.length - 1]['dateToPay'].split("-");
211
+
212
+ Validation.add('validate-cc-exp-split', 'Incorrect credit card expiration date.', function(v,elm) {
213
+ console.log("Enter in validation");
214
+ var ccExpMonth = v;
215
+ var ccExpYear = $(elm.id.substr(0,elm.id.indexOf('_expiration')) + '_expiration_yr').value;
216
+ var currentTime = new Date();
217
+ var currentMonth = parseInt(dateArr[1]);//currentTime.getMonth() + 1;
218
+ var currentYear = parseInt(dateArr[0])//currentTime.getFullYear();
219
+ console.log(ccExpMonth +'<'+ currentMonth +'&&'+ ccExpYear + '==' + currentYear);
220
+ if (ccExpMonth < currentMonth && ccExpYear == currentYear) {
221
+ return false;
222
+ }
223
+ return true;
224
+ });
225
+
226
+ //Update HTMl
227
+ $('debit_amount').innerHTML = response.labelSplitPayment;
228
+ decorateTable('split-payment-cc-table')
229
+
230
+ }
231
+ }
232
+
233
+
234
+ }
235
+ });
236
+
237
+ };
238
+
239
+ Event.observe($('<?php echo $_code ?>_split_payment'), 'change', UpdateDebitAmount<?php echo $_code ?>);
240
+
241
+ //]]>
242
+ </script>
243
+
244
+ </div>
245
+
app/design/frontend/{default → base}/default/template/hipay/form/hosted.phtml RENAMED
@@ -1,26 +1,57 @@
1
- <?php $_code=$this->getMethodCode() ?>
 
 
 
2
  <div id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  <?php if ($this->oneClickIsAllowed()) : ?>
4
  <ul class="form-list" id="oneclick_hosted_payment_form_<?php echo $_code ?>">
5
  <li>
6
 
7
- <?php if (!$this->getCustomerHasAlias() || ($this->getCustomerHasAlias() && !$this->ccExpDateIsValid())) :?>
8
  <div class="input-box">
9
  <input id="<?php echo $_code ?>_create_alias_oneclick" value="create_oneclick" type="checkbox" name="payment[oneclick]" />
10
  <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record your card data for a next buy.') ?></label>
11
  </div>
12
- <?php elseif ($this->getCustomerHasAlias() && $this->ccExpDateIsValid()): ?>
 
13
  <div class="input-box">
14
- <input id="<?php echo $_code ?>_use_alias_oneclick" value="use_oneclick" checked="checked" type="radio" name="payment[oneclick]" />
15
  <label style="float: none;" for="<?php echo $_code ?>_use_alias_oneclick"><?php echo $this->__('Use my recorded card') ?></label>
16
  </div>
 
17
  <div class="input-box info-card">
 
 
 
 
 
 
 
 
18
  <label><?php echo $this->__('Actual card') ?> :</label>
19
  <span><?php echo $this->getCustomer()->getHipayCcNumberEnc() ?></span>
20
  </div>
21
  <div class="input-box info-card">
22
  <label><?php echo $this->__('Expiration date') ?> : <?php echo $this->getCustomer()->getHipayCcExpDate() ?></label>
23
- </div>
 
 
24
  <div class="input-box">
25
  <input id="<?php echo $_code ?>_create_alias_oneclick" type="radio" name="payment[oneclick]" value="create_oneclick"/>
26
  <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record new card data') ?></label>
@@ -35,10 +66,12 @@
35
  </li>
36
 
37
  </ul>
 
38
  <?php endif; ?>
39
  <?php echo $this->__('You will be redirect to payment page after submit order.')?>
40
  <script type="text/javascript">
41
  //<![CDATA[
 
42
 
43
  Review.prototype.displayIframe = function(url) {
44
 
@@ -47,18 +80,13 @@
47
  // Create container Iframe
48
  var hipayIframeWrapper = $('hipay_iframe_wrapper');
49
  if (hipayIframeWrapper === null) {
50
- hipayIframeWrapper = new Element('div', {id: 'hipay_iframe_wrapper', style: 'text-align: center; border-bottom: 1px solid #BEBCB7; border-left: 1px solid #BEBCB7; border-right: 1px solid #BEBCB7;'});
51
  $('checkout-review-table-wrapper').insert({after: hipayIframeWrapper});
52
 
53
  }
54
 
55
  // generate Iframe
56
- hipayIframeWrapper.appendChild(new Element('iframe', {frameBorder: 0, width: '485px', height: '450px', src: url, style: 'margin: 10px 0; border: 1px solid #BEBCB7;'}));
57
- //var button = new Element('button', {'class': 'button', type: 'button'}).update('<span><span>Cancel</span></span>');
58
- //Event.observe(button, 'click', this.cancel.bind(this));
59
- //hipayIframeWrapper.appendChild(button);
60
-
61
-
62
 
63
  };
64
 
1
+ <?php
2
+ $_code=$this->getMethodCode();
3
+ $_cards = $this->getCards();
4
+ ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;">
6
+ <?php if($this->allowSplitPayment()) : ?>
7
+ <ul class="form-list" id="splitpayment_card_payment_form_<?php echo $_code ?>" >
8
+ <li>
9
+ <div class="input-box">
10
+ <label style="float: none;" for="<?php echo $_code ?>_split_payment"><?php echo $this->__('Split your Payment') ?></label><br />
11
+ <select id="<?php echo $_code ?>_split_payment" name="payment[split_payment_id]">
12
+ <option value=""><?php echo $this->__('-- Please select your split payment --')?></option>
13
+ <?php foreach ($this->getSplitPaymentProfiles() as $profile) : ?>
14
+ <option value="<?php echo $profile->getId()?>"><?php echo $profile->getName()?></option>
15
+ <?php endforeach;?>
16
+ </select>
17
+ </div>
18
+ </li>
19
+ </ul>
20
+ <br />
21
+ <?php endif; ?>
22
  <?php if ($this->oneClickIsAllowed()) : ?>
23
  <ul class="form-list" id="oneclick_hosted_payment_form_<?php echo $_code ?>">
24
  <li>
25
 
26
+ <?php if (!$this->getCustomerHasCard()) :?>
27
  <div class="input-box">
28
  <input id="<?php echo $_code ?>_create_alias_oneclick" value="create_oneclick" type="checkbox" name="payment[oneclick]" />
29
  <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record your card data for a next buy.') ?></label>
30
  </div>
31
+ <?php else :?>
32
+
33
  <div class="input-box">
34
+ <input id="<?php echo $_code ?>_use_alias_oneclick" value="use_oneclick" checked="checked" type="radio" name="payment[oneclick]" checked/>
35
  <label style="float: none;" for="<?php echo $_code ?>_use_alias_oneclick"><?php echo $this->__('Use my recorded card') ?></label>
36
  </div>
37
+
38
  <div class="input-box info-card">
39
+ <select id="<?php echo $_code ?>_oneclick_selected_card" name="payment[oneclick_card]" >
40
+ <?php foreach ($_cards as $card):?>
41
+ <option value="<?php echo $card->getId()?>"><?php echo $card->getName()?></option>
42
+ <?php endforeach;?>
43
+ </select>
44
+ </div>
45
+
46
+ <!-- <div class="input-box info-card">
47
  <label><?php echo $this->__('Actual card') ?> :</label>
48
  <span><?php echo $this->getCustomer()->getHipayCcNumberEnc() ?></span>
49
  </div>
50
  <div class="input-box info-card">
51
  <label><?php echo $this->__('Expiration date') ?> : <?php echo $this->getCustomer()->getHipayCcExpDate() ?></label>
52
+ </div>-->
53
+
54
+
55
  <div class="input-box">
56
  <input id="<?php echo $_code ?>_create_alias_oneclick" type="radio" name="payment[oneclick]" value="create_oneclick"/>
57
  <label style="float: none;" for="<?php echo $_code ?>_create_alias_oneclick"><?php echo $this->__('Record new card data') ?></label>
66
  </li>
67
 
68
  </ul>
69
+ <br />
70
  <?php endif; ?>
71
  <?php echo $this->__('You will be redirect to payment page after submit order.')?>
72
  <script type="text/javascript">
73
  //<![CDATA[
74
+ <?php $iFrameConfig = $this->getIframeConfig() ?>
75
 
76
  Review.prototype.displayIframe = function(url) {
77
 
80
  // Create container Iframe
81
  var hipayIframeWrapper = $('hipay_iframe_wrapper');
82
  if (hipayIframeWrapper === null) {
83
+ hipayIframeWrapper = new Element('div', {id: 'hipay_iframe_wrapper', style: '<?php echo $iFrameConfig['iframe_wrapper_style']?>'});
84
  $('checkout-review-table-wrapper').insert({after: hipayIframeWrapper});
85
 
86
  }
87
 
88
  // generate Iframe
89
+ hipayIframeWrapper.appendChild(new Element('iframe', {frameBorder: 0, width: '<?php echo $iFrameConfig['iframe_width']?>', height: '<?php echo $iFrameConfig['iframe_height']?>', src: url, style: '<?php echo $iFrameConfig['iframe_style']?>'}));
 
 
 
 
 
90
 
91
  };
92
 
app/design/frontend/base/default/template/hipay/info/cc.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see Mage_Payment_Block_Info
4
+ */
5
+ ?>
6
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
7
+
8
+ <?php if ($_specificInfo = $this->getSpecificInformation()):?>
9
+ <table>
10
+ <?php foreach ($_specificInfo as $_label => $_value):?>
11
+ <tr>
12
+ <td><?php echo $this->escapeHtml($_label)?>:</td>
13
+ <td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
14
+ </tr>
15
+ <?php endforeach; ?>
16
+ </table>
17
+ <?php endif;?>
18
+
19
+ <?php echo $this->getChildHtml()?>
app/design/frontend/base/default/template/hipay/info/hosted.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see Mage_Payment_Block_Info
4
+ */
5
+ ?>
6
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
7
+
8
+ <?php if ($_specificInfo = $this->getSpecificInformation()):?>
9
+ <table>
10
+ <?php foreach ($_specificInfo as $_label => $_value):?>
11
+ <tr>
12
+ <td><?php echo $this->escapeHtml($_label)?>:</td>
13
+ <td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
14
+ </tr>
15
+ <?php endforeach; ?>
16
+ </table>
17
+ <?php endif;?>
18
+
19
+ <?php echo $this->getChildHtml()?>
app/design/frontend/default/default/layout/hipay.xml DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <layout version="0.1.0">
3
- <hipay_checkout_pending translate="label">
4
- <label>Hipay Checkout Pending</label>
5
- <reference name="root">
6
- <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
7
- </reference>
8
- <reference name="content">
9
- <block type="hipay/checkout_pending" name="checkout.pending" template="hipay/checkout/pending.phtml"/>
10
- </reference>
11
- </hipay_checkout_pending>
12
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/en_US/Allopass_Hipay.csv CHANGED
@@ -33,8 +33,8 @@
33
  "Expiration Date","Expiration Date"
34
  "Card Verification Number","Card Verification Number"
35
  "Record your card data for a next buy.","Record your card data for a next buy."
36
- "Use my recorded card","Use my recorded card"
37
- "Record new card data","Record new card data"
38
  "Not use record card data","Not use record card data"
39
  "You will be redirect to payment page after submit order.","You will be redirect to payment page after submit order."
40
  "Hipay Credit Card","Hipay Credit Card"
@@ -104,4 +104,36 @@
104
  "Orders count","Orders count"
105
  "Customer is guest","Customer is guest"
106
  "Billing and shipping addresses are differents","Billing and shipping addresses are differents"
107
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  "Expiration Date","Expiration Date"
34
  "Card Verification Number","Card Verification Number"
35
  "Record your card data for a next buy.","Record your card data for a next buy."
36
+ "Use my recorded card","Select your favorite credit card"
37
+ "Record new card data","Record new credit card data"
38
  "Not use record card data","Not use record card data"
39
  "You will be redirect to payment page after submit order.","You will be redirect to payment page after submit order."
40
  "Hipay Credit Card","Hipay Credit Card"
104
  "Orders count","Orders count"
105
  "Customer is guest","Customer is guest"
106
  "Billing and shipping addresses are differents","Billing and shipping addresses are differents"
107
+ "Sort the list by drag'n/drop credit card type","Sort the list by drag'n/drop credit card type"
108
+ "Split your Payment","Split your Payment"
109
+ "-- Please select your card --","-- Please select your card --"
110
+ "Try to enable for all transactions.","Try to enable for all transactions."
111
+ "Try to enable for configured 3ds rules","Try to enable for configured 3ds rules"
112
+ "Force for configured 3ds rules","Force for configured 3ds rules"
113
+ "Force for all transactions.","Force for all transactions."
114
+ "Your next payments:","Your next payments:"
115
+ "Name on Card","Name on Card"
116
+ "Use Split Payment","Use Split Payment"
117
+ "Payment Profile","Payment Profile"
118
+ "Minimum Order Total for Split Payment","Minimum Order Total for Split Payment"
119
+ "Rules Oneclick","Rules Oneclick"
120
+ "Send fraud payment email","Send fraud payment email"
121
+ "Display card owner","Display card owner"
122
+ "Display card owner in card form","Display card owner in card form"
123
+ "Split Payment Profiles","Split Payment Profiles"
124
+ "Split payments","Split payments"
125
+ "Hipay Split Payments","Hipay Split Payments"
126
+ "Card token","Card token"
127
+ "Amount to pay","Amount to pay"
128
+ "Date to pay","Date to pay"
129
+ "Attempts","Attempts"
130
+ "Status","Status"
131
+ "Pay now","Pay now"
132
+ "Hipay Payment Profiles","Hipay Payment Profiles"
133
+ "payment_type","payment_type"
134
+ "Add payment profile","Add payment profile"
135
+ "Payment Profile","Payment Profile"
136
+ "Wrapper iFrame Style","Wrapper iFrame Style"
137
+ "iFrame Width","iFrame Width"
138
+ "iFrame Height","iFrame Height"
139
+ "iFrame Style","iFrame Style"
app/locale/en_US/template/email/hipay_fraud_payment.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction waiting for validation @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction Failed Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is waiting for review.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/en_US/template/email/hipay_fraud_payment_accept.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction is accepted @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction success Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is accepted.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/en_US/template/email/hipay_fraud_payment_deny.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction is not accepted @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction deny Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is not accepted.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/fr_FR/Allopass_Hipay.csv CHANGED
@@ -38,9 +38,9 @@
38
  "Expiration Date","Date d'expiration"
39
  "Card Verification Number","Numéro de vérification"
40
  "Record your card data for a next buy.","Enregistrez une empreinte de carte bancaire pour un prochain achat."
41
- "Use my recorded card","Utiliser ma carte pré-enregistrée."
42
  "Actual card","Carte actuelle"
43
- "Record new card data","Remplacer vos données de Carte Bancaire."
44
  "Not use record card data","Payer directement avec une autre Carte Bancaire."
45
  "You will be redirect to payment page after submit order.","Vous serez redirigé vers la page de paiment après la validation de la commande."
46
  "Order status when payment accepted","Statut de la commande quand le paiement est accepté."
@@ -105,3 +105,39 @@
105
  "Orders count","Nombre de commande passées (inclu celle en cours)"
106
  "Customer is guest","Commande en tant qu'invité"
107
  "Billing and shipping addresses are differents","Adresses de facturation et de livraison différentes"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  "Expiration Date","Date d'expiration"
39
  "Card Verification Number","Numéro de vérification"
40
  "Record your card data for a next buy.","Enregistrez une empreinte de carte bancaire pour un prochain achat."
41
+ "Use my recorded card","Sélectionner une de mes cartes pré-enregistrées."
42
  "Actual card","Carte actuelle"
43
+ "Record new card data","Enregistrer l'empreinte d'une nouvelle carte"
44
  "Not use record card data","Payer directement avec une autre Carte Bancaire."
45
  "You will be redirect to payment page after submit order.","Vous serez redirigé vers la page de paiment après la validation de la commande."
46
  "Order status when payment accepted","Statut de la commande quand le paiement est accepté."
105
  "Orders count","Nombre de commande passées (inclu celle en cours)"
106
  "Customer is guest","Commande en tant qu'invité"
107
  "Billing and shipping addresses are differents","Adresses de facturation et de livraison différentes"
108
+ "Sort the list by drag'n/drop credit card type","Vous pouvez choisir l'ordre d'affichage en faisant un glisser/déposer de chaque type de paiement."
109
+ "Split your Payment","Payer en plusieurs fois"
110
+ "-- Please select your split payment --","-- Sélectionnez votre mode de paiement --"
111
+ "Try to enable for all transactions.","Demander l'activation pour toutes les transactions"
112
+ "Try to enable for configured 3ds rules","Demander l'activation pour les transactions défini par les règles 3DS (ci-dessous)"
113
+ "Force for configured 3ds rules","Forcer l'activation pour les transactions défini par les règles 3DS (ci-dessous)"
114
+ "Force for all transactions.","Forcer l'activation pour toutes les transactions."
115
+ "Your next payments:","Vos prochains paiements: "
116
+ "Name on Card","Propriétaire de la carte"
117
+ "Use Split Payment","Activer le paiement en plusieurs fois"
118
+ "Payment Profile","Profile de paiement"
119
+ "Minimum Order Total for Split Payment","Minimum de commande pour les paiements en plusieurs fois"
120
+ "Rules Oneclick","Règle d'activation du oneClick"
121
+ "Send fraud payment email","Envoyer un mail au client an cas de fraude"
122
+ "Display card owner","Afficher le porteur de carte"
123
+ "Display card owner in card form","Affiche le champs de saisi pour le porteur de carte"
124
+ "Split Payment Profiles","Profils de paiement en plusieurs fois"
125
+ "Split payments","Liste des paiements en plusieurs fois"
126
+ "Hipay Split Payments","Hipay paiement en plusieurs fois"
127
+ "Card token","Jeton de carte"
128
+ "Amount to pay","Montant à payer"
129
+ "Date to pay","Date de l'échéance"
130
+ "Attempts","Tentatives"
131
+ "Status","Statut"
132
+ "Pay now","Payer maintenant"
133
+ "Hipay Payment Profiles","Hipay profils de paiement"
134
+ "payment_type","Type de paiement"
135
+ "Add payment profile","Ajouter un profile de paiement"
136
+ "Payment Profile","Profil de paiement"
137
+ "Wrapper iFrame Style","Style du container de l'iframe"
138
+ "iFrame Width","Largeur de l'iframe"
139
+ "iFrame Height","Hauteur de l'iframe"
140
+ "iFrame Style","Style de l'iframe"
141
+
142
+
143
+
app/locale/fr_FR/template/email/hipay_fraud_payment.html ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ Use vars: {{var var_name}}
4
+ *}<!--@subject Votre transaction est en attente de validation @-->
5
+ <!--@vars
6
+ {"var reason":"Transaction Failed Reason",
7
+ "var checkoutType":"Checkout Type",
8
+ "var customerEmail":"Customer Email",
9
+ "var customer":"Customer Name",
10
+ "var items":"Shopping Cart Items",
11
+ "var total":"Total",
12
+ "var billingAddress.format('html')":"Billing Address",
13
+ "var shippingAddress.format('html')":"Shipping Address",
14
+ "var shippingMethod":"Shipping Method",
15
+ "var paymentMethod":"Payment Method",
16
+ "var dateAndTime":"Date and Time of Transaction"}
17
+ @-->
18
+
19
+ <table>
20
+ <thead>
21
+ <tr>
22
+ <th>Une transaction de paiement est en attente de validation.</th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td>
28
+ <p>
29
+ <b>Raison</b><br />
30
+ {{var reason}}
31
+ </p>
32
+ <p>
33
+ <b>Client&nbsp;:</b><br />
34
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
35
+ </p>
36
+ <p><b>Articles&nbsp;:</b><br />
37
+ {{var items}}
38
+ </p>
39
+ <p>
40
+ <b>Total&nbsp;:</b><br />
41
+ {{var total}}
42
+ </p>
43
+ <p>
44
+ <b>Adresse de facturation&nbsp;:</b><br />
45
+ {{var billingAddress.format('html')}}
46
+ </p>
47
+ <p>
48
+ <b>Adresse de livraison&nbsp;:</b><br />
49
+ {{var shippingAddress.format('html')}}
50
+ </p>
51
+ <p>
52
+ <b>Mode de livraison&nbsp;:</b><br />
53
+ {{var shippingMethod}}
54
+ </p>
55
+ <p>
56
+ <b>Mode de paiement&nbsp;:</b><br />
57
+ {{var paymentMethod}}
58
+ </p>
59
+ <p>
60
+ <b>Date &amp; Heure&nbsp;:</b><br />
61
+ {{var dateAndTime}}
62
+ </p>
63
+ </td>
64
+ </tr>
65
+ </tbody>
66
+ </table>
app/locale/fr_FR/template/email/hipay_fraud_payment_accept.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Votre transaction est acceptée @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction success Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Votre transaction est acceptée</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/fr_FR/template/email/hipay_fraud_payment_deny.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Votre transaction est refusée @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction deny Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Votre transaction n'a pas été acceptée</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/it_IT/Allopass_Hipay.csv CHANGED
@@ -84,3 +84,36 @@
84
  "Redirect page pending status","Reindirizzamento alla pagina di attesa"
85
  "Page to redirect when transaction is in pending status","Pagina cui reindirizzare quando la transazione è in attesa"
86
  "Record your card data for recurring.","Registra i dati della tua carta per operazioni ricorrenti."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  "Redirect page pending status","Reindirizzamento alla pagina di attesa"
85
  "Page to redirect when transaction is in pending status","Pagina cui reindirizzare quando la transazione è in attesa"
86
  "Record your card data for recurring.","Registra i dati della tua carta per operazioni ricorrenti."
87
+ "Sort the list by drag'n/drop credit card type","Sort the list by drag'n/drop credit card type"
88
+ "Split your Payment","Split your Payment"
89
+ "-- Please select your split payment --","-- Please select your split payment --"
90
+ "Try to enable for all transactions.","Try to enable for all transactions."
91
+ "Try to enable for configured 3ds rules","Try to enable for configured 3ds rules"
92
+ "Force for configured 3ds rules","Force for configured 3ds rules"
93
+ "Force for all transactions.","Force for all transactions."
94
+ "Your next payments:","Your next payments:"
95
+ "Name on Card","Name on Card"
96
+ "Use Split Payment","Use Split Payment"
97
+ "Payment Profile","Payment Profile"
98
+ "Minimum Order Total for Split Payment","Minimum Order Total for Split Payment"
99
+ "Rules Oneclick","Rules Oneclick"
100
+ "Send fraud payment email","Send fraud payment email"
101
+ "Display card owner","Display card owner"
102
+ "Display card owner in card form","Display card owner in card form"
103
+ "Split Payment Profiles","Split Payment Profiles"
104
+ "Split payments","Split payments"
105
+ "Hipay Split Payments","Hipay Split Payments"
106
+ "Card token","Card token"
107
+ "Amount to pay","Amount to pay"
108
+ "Date to pay","Date to pay"
109
+ "Attempts","Attempts"
110
+ "Status","Status"
111
+ "Pay now","Pay now"
112
+ "Hipay Payment Profiles","Hipay Payment Profiles"
113
+ "payment_type","payment_type"
114
+ "Add payment profile","Add payment profile"
115
+ "Payment Profile","Payment Profile"
116
+ "Wrapper iFrame Style","Wrapper iFrame Style"
117
+ "iFrame Width","iFrame Width"
118
+ "iFrame Height","iFrame Height"
119
+ "iFrame Style","iFrame Style"
app/locale/it_IT/template/email/hipay_fraud_payment.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction waiting for validation @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction Failed Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is waiting for review.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/it_IT/template/email/hipay_fraud_payment_accept.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction is accepted @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction success Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is accepted.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
app/locale/it_IT/template/email/hipay_fraud_payment_deny.html ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Payment transaction is not accepted @-->
2
+ <!--@vars
3
+ {"var reason":"Transaction deny Reason",
4
+ "var checkoutType":"Checkout Type",
5
+ "var customerEmail":"Customer Email",
6
+ "var customer":"Customer Name",
7
+ "var items":"Shopping Cart Items",
8
+ "var total":"Total",
9
+ "var billingAddress.format('html')":"Billing Address",
10
+ "var shippingAddress.format('html')":"Shipping Address",
11
+ "var shippingMethod":"Shipping Method",
12
+ "var paymentMethod":"Payment Method",
13
+ "var dateAndTime":"Date and Time of Transaction"}
14
+ @-->
15
+
16
+ <table>
17
+ <thead>
18
+ <tr>
19
+ <th>Payment transaction is not accepted.</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr>
24
+ <td>
25
+ <p>
26
+ <b>Reason</b><br />
27
+ {{var reason}}
28
+ </p>
29
+ <p>
30
+ <b>Customer:</b><br />
31
+ <a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
32
+ </p>
33
+ <p>
34
+ <b>Items</b><br />
35
+ {{var items}}
36
+ </p>
37
+ <p>
38
+ <b>Total:</b><br />
39
+ {{var total}}
40
+ </p>
41
+ <p>
42
+ <b>Billing Address:</b><br />
43
+ {{var billingAddress.format('html')}}
44
+ </p>
45
+ <p>
46
+ <b>Shipping Address:</b><br />
47
+ {{var shippingAddress.format('html')}}
48
+ </p>
49
+ <p>
50
+ <b>Shipping Method:</b><br />
51
+ {{var shippingMethod}}
52
+ </p>
53
+ <p>
54
+ <b>Payment Method:</b><br />
55
+ {{var paymentMethod}}
56
+ </p>
57
+ <p>
58
+ <b>Date & Time:</b><br />
59
+ {{var dateAndTime}}
60
+ </p>
61
+ </td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Allopass_Hipay</name>
4
- <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Payment method HIPAY</summary>
10
  <description>Payment method with hosted page and API</description>
11
- <notes>-added order status filter if hipay response is "Authorized" (116) but order is already captured</notes>
12
  <authors><author><name>Kassim_Profileo</name><user>Kassim_Profileo</user><email>kassim@profileo.com</email></author></authors>
13
- <date>2014-12-10</date>
14
- <time>14:25:11</time>
15
- <contents><target name="magecommunity"><dir name="Allopass"><dir name="Hipay"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="3dsRule.php" hash="b2e3f5307617948a1c74262ce55419eb"/></dir></dir></dir></dir></dir><dir name="Checkout"><file name="Pending.php" hash="48112f7e2fdcc79ee9431cf5350e223f"/></dir><dir name="Form"><file name="Abstract.php" hash="3a93bc3c0ee9162617437875a86bd36a"/><file name="Cc.php" hash="8be2f51b1ce2274e8afbc9666ed4c9ba"/><file name="Hosted.php" hash="1cbc3fe21de97bba192cd5e651dfaeae"/></dir><dir name="Info"><file name="Cc.php" hash="2f477423660d446c8956b5353b349172"/><file name="Hosted.php" hash="09bc0d102e35da8aad2c81f27cd8ba82"/></dir></dir><dir name="Controller"><file name="Payment.php" hash="b23dffe0f85a48dea1562626e2ab2598"/></dir><dir name="Helper"><file name="Data.php" hash="c703b3c4e2db70fe202a597b773e473d"/></dir><dir name="Model"><dir name="Api"><dir name="Http"><dir name="Client"><dir name="Adapter"><file name="Curl.php" hash="cebf9e03d310e65f23a2a4ddc980e26f"/><file name="Stream.php" hash="5a110dd1f33ee4c8319cec396fc4fa40"/></dir></dir></dir><file name="Request.php" hash="eb2b07876f1544ae2066ba23f947dd06"/><dir name="Response"><file name="Abstract.php" hash="a430ca978e61796696ae4ead61efdb60"/><file name="Error.php" hash="57386fde5e5993c1126418025093a58a"/><file name="Gateway.php" hash="49b0e43a55e223df601884cfd9a0d2c5"/><file name="Notification.php" hash="0f7373ec3435b477424352c058f42255"/><file name="Vault.php" hash="47b962a59c150ffd653ba4054bc053d0"/></dir></dir><file name="Config.php" hash="7b2b6b8d4568d5ce33decc529e45b60b"/><dir name="Log"><file name="Adapter.php" hash="9d5533d5d3622c72cbc84abfd4e3116c"/></dir><dir name="Method"><file name="Abstract.php" hash="36b247c58b3a0897dc02deafc0bb610e"/><file name="Cbc.php" hash="49d1b0e2ad320c1a78043bb7231de930"/><file name="Cc.php" hash="3b7ef2efb0995a6d8fef4dfd3eec1f58"/><file name="Dexia.php" hash="32d47390b7d48e19e4e5cf2b2abfa0cd"/><file name="Giropay.php" hash="ad5965ae76b9b2b9061f351e9f5fac74"/><file name="Hosted.php" hash="8270e4e2ae24e922f9b2dcaabcc24eae"/><file name="Ideal.php" hash="2a29b8ae0df1e3ae4e1f27fba31af70b"/><file name="Ing.php" hash="9a8f0a6e4a193c2c234987e4d68d6184"/><file name="Kbc.php" hash="7c3e32222e86261b55b0a64c382d8df9"/><file name="Przelewy24.php" hash="00b695e7b34b69f36d593587a9b5dcdd"/><file name="Przelewy24Api.php" hash="7d594585e929de59d5295bfeeff6b219"/><file name="Qiwi.php" hash="be4c74c534076b8cebd6ca1f74fe3b3b"/><file name="Sisal.php" hash="94565498ace1b5e29ae80e84951d655e"/><file name="SisalApi.php" hash="e0f93a847f833509255e36086faedaa6"/><file name="Sofort.php" hash="fa6cb68aff431c2dc91e7b3c62a29aaa"/><file name="SofortApi.php" hash="7f889f5f0986fc6dce71d847a854f1ab"/><file name="Webmoney.php" hash="33e86795573edcea55546c78ae9267f6"/><file name="WebmoneyApi.php" hash="ce8bc5c4c7ab75907b1ca63fd0ebedee"/><file name="Yandex.php" hash="ad5c8a351029b0f2f2df9806fb3cbb9b"/><file name="YandexApi.php" hash="ef4e7f17fa81f5ed63988054dee12c97"/></dir><file name="Observer.php" hash="0e9460f5e10db055cc9058291d72305c"/><dir name="Resource"><dir name="Rule"><file name="Collection.php" hash="b4dd0d851cda670c6aafad0cf588b106"/></dir><file name="Rule.php" hash="115bccaa9e4d37ed03e179147ab3788d"/></dir><dir name="Rule"><dir name="Condition"><file name="Address.php" hash="a3cce578d61204adbc4a3e6c4791d055"/><file name="Combine.php" hash="e57da0bfd13c85721ef06d9f5c1d5a45"/><file name="Customer.php" hash="71117a9fe5f0cba3828da17c316a95a5"/><dir name="Product"><file name="Combine.php" hash="b99adc27124c3c6f56d04f0bcb5a42be"/><file name="Found.php" hash="bc266762458faaba326b7d7245b688a8"/><file name="Subselect.php" hash="5c0d482cddd69d82350bc5fec15c40b7"/></dir><file name="Product.php" hash="5186cb9be313c7a772a11613ff4d1406"/></dir><file name="Config.php" hash="7ae56d141ffa1da19faa2d26831f1c7d"/></dir><file name="Rule.php" hash="f4f865fc7e0e2204fd5b804b0a000ddb"/><dir name="Source"><file name="3ds.php" hash="26e27c20dd31babe710cb9470491fc40"/><file name="CcType.php" hash="1f53fb6d8b95c5457e0e59ab910681ca"/><file name="CcTypeHosted.php" hash="7ba8a5fe85f5a0fd93a8a99064ea5487"/><dir name="Order"><file name="HipayStatusValidate.php" hash="63414f71ce035909310f27842bc1b511"/><dir name="Status"><file name="Accepted.php" hash="20cfc4b9ec26a2b458f8ffc43f6195aa"/><file name="Canceled.php" hash="49a6f0b6033e698fbefe01967b81b21d"/><file name="New.php" hash="226d2f1a5d441dbd6404ea342555e893"/><file name="Refused.php" hash="dbf1ed822488bb0d03f71461c872154d"/></dir><file name="Status.php" hash="395ac5e1567ee6095769abc6ce64fec0"/></dir><file name="PaymentAction.php" hash="10638f85360e7693819cbbfd156bed72"/><file name="Pendingredirect.php" hash="f0c3125415535637c159c97fc2627740"/><file name="Template.php" hash="47d84783ef5e3041bbbe9c5622e7e65f"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RuleController.php" hash="5fcf2a0b9807d0f8089b3f0cdfe30a24"/></dir><file name="CbcController.php" hash="11a793cfef50322482b4d1e44f7fb427"/><file name="CcController.php" hash="2e45012894cac90a24c2017a427258b5"/><file name="CheckoutController.php" hash="8d565df4627074dd62c59e6d5b301ce0"/><file name="DexiaController.php" hash="abafa7205262125aef603f0d51445ebd"/><file name="GiropayController.php" hash="93ebe6d63e60627ee86815a7cc23006b"/><file name="HostedController.php" hash="f0bd2d41f36b0453e42063531b88d4a3"/><file name="IdealController.php" hash="49bc5c1a52c98cef934b45ce27da574a"/><file name="IngController.php" hash="43b8ae9e752d5268a51a164abc98df9f"/><file name="KbcController.php" hash="fad29361513cc354dcf200fde25265da"/><file name="NotifyController.php" hash="00a9240f4d73645ada386477c6643eb1"/><file name="Przelewy24Controller.php" hash="d6923f98e8a53d8b8becd1d5ef99e0d0"/><file name="Przelewy24apiController.php" hash="bc488ef00a5a063d05aa12c545d8e8fe"/><file name="QiwiController.php" hash="6b3e05b2910dae0b919c50cb06363c57"/><file name="SisalController.php" hash="32bdb5bf400fa1c6ee5bfb2c79b889f9"/><file name="SisalapiController.php" hash="23a04c3fe9470ef98ce84fcf5c1dd9fe"/><file name="SofortController.php" hash="5479f2e8c3043ad0dd51167bd9bcf623"/><file name="SofortapiController.php" hash="74aa59c7c7795f9f61c6b4bfeae193e3"/><file name="WebmoneyController.php" hash="b52fdbc662da23f839750c9919aad809"/><file name="WebmoneyapiController.php" hash="f34dc66aca5218930be548c88e7e9004"/><file name="YandexController.php" hash="629ec07271f8a11d7c88824154b637f0"/><file name="YandexapiController.php" hash="9741c2a9427866895907629af1e9ed98"/></dir><dir name="etc"><file name="config.xml" hash="576c11d95b633d1dbb6e1979cac78452"/><file name="system.xml" hash="22626c43e9acdf8b67b6d9deb9793b53"/></dir><dir name="sql"><dir name="allopass_hipay_setup"><file name="mysql4-install-0.1.0.php" hash="820dc1e282c2c88deeb167d61918088b"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="af83b289e454c2d2ab91d2a6800d079a"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="1aa9291c5ac40a03ccbf3bcb6ce0c47e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="17ddfaae63edc655fec04dcd5f96136a"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="5dfaafe02016ff47dfd80c89effaaabb"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="hipay.xml" hash="3b054d16830742a04ff9fc49038ddb61"/></dir><dir name="template"><dir name="hipay"><dir name="checkout"><file name="pending.phtml" hash="34e6bba88ea5fdd6b4ea71595de638d6"/></dir><dir name="form"><file name="cc.phtml" hash="402c6497783c1b1a0449e60777b61b9d"/><file name="hosted.phtml" hash="c5775f3b8d2c10b2aa097159385bcca6"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="hipay.xml" hash="d55ac9fc80fa05741c4f7a1457211a77"/></dir><dir name="template"><dir name="hipay"><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="rules.phtml" hash="b25ca0397baffa2306ab70776b2febac"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Allopass_Hipay.xml" hash="fd0ac2e9080c0a432a3a7b6d969171c0"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Allopass_Hipay.csv" hash="3879d574afc3e028875e4f4f846ac104"/></dir><dir name="fr_FR"><file name="Allopass_Hipay.csv" hash="fdc5bb9fe8061f5d0d381d28defa3056"/></dir><dir name="it_IT"><file name="Allopass_Hipay.csv" hash="c663845b70b3fd451df283dd18d8e0bf"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="hipay"><dir name="js"><file name="rules.js" hash="c9f87ded0b3a8505e78ab2584c2f098f"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Allopass_Hipay</name>
4
+ <version>1.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Payment method HIPAY</summary>
10
  <description>Payment method with hosted page and API</description>
11
+ <notes>Add paypal API</notes>
12
  <authors><author><name>Kassim_Profileo</name><user>Kassim_Profileo</user><email>kassim@profileo.com</email></author></authors>
13
+ <date>2015-10-29</date>
14
+ <time>15:03:24</time>
15
+ <contents><target name="magecommunity"><dir name="Allopass"><dir name="Hipay"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Card"><dir name="Edit"><file name="Form.php" hash="addfd57cd54aff9ce5b57759105ad221"/></dir><file name="Edit.php" hash="5f1896bb299030ade2090e2743ce2f95"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Card.php" hash="3b88e16a00bcc97ad984613a8716448d"/></dir></dir></dir><dir name="PaymentProfile"><dir name="Edit"><file name="Form.php" hash="e17cc9773f3d4b1ef0981b513c659841"/></dir><file name="Edit.php" hash="7e51c6f1ea8d6012b6850329f7d574e8"/><file name="Grid.php" hash="f8ac0daa082f3c6d2be6289e935dbd31"/></dir><file name="PaymentProfile.php" hash="b02de6e3cf69724d7f901f9b4f42e333"/><dir name="SplitPayment"><dir name="Edit"><file name="Form.php" hash="06f8e4c7714d8e362c00ac8a4d88e292"/></dir><file name="Edit.php" hash="2aa5f311f6ba084420a6adc0fa518cc5"/><file name="Grid.php" hash="42031ca1b4a9a399e6e148378880ad82"/></dir><file name="SplitPayment.php" hash="1f5b84881308b79f0ada533862568e28"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="3dsRule.php" hash="e3808525b924001037cb93d497f86518"/><file name="Allowsplitpayment.php" hash="0c6e4378ba1537584417870c9eb2c59c"/><file name="MultiselectSortable.php" hash="afba089fed75aefece6155de1210a856"/></dir></dir></dir></dir></dir><dir name="Card"><file name="Edit.php" hash="530cd326480c2d074dfdc59a578dd1db"/></dir><file name="Card.php" hash="8e9a964e1b44c4664b78a2f9a5f7b1ae"/><dir name="Checkout"><file name="Pending.php" hash="48112f7e2fdcc79ee9431cf5350e223f"/></dir><dir name="Form"><file name="Abstract.php" hash="2605f4c23be03a4460f3ac6d0803b56c"/><file name="Cc.php" hash="64b899c98ee3edd77c5262eccd0bdfd1"/><file name="Hosted.php" hash="1cbc3fe21de97bba192cd5e651dfaeae"/></dir><dir name="Info"><file name="Cc.php" hash="d4ed3d7c3bbc82c1b3b13e19abdd4ddc"/><file name="Hosted.php" hash="40355126a48bd854c21bb0201840229c"/></dir></dir><dir name="Controller"><file name="Payment.php" hash="442236e180888eac3036a88784515841"/></dir><dir name="Helper"><file name="Data.php" hash="724d4cb5a12657237d03ef2731c4f89c"/></dir><dir name="Model"><dir name="Api"><dir name="Http"><dir name="Client"><dir name="Adapter"><file name="Curl.php" hash="cebf9e03d310e65f23a2a4ddc980e26f"/><file name="Stream.php" hash="5a110dd1f33ee4c8319cec396fc4fa40"/></dir></dir></dir><file name="Request.php" hash="cd99b338ce6487765b2c100f2009f37f"/><dir name="Response"><file name="Abstract.php" hash="a430ca978e61796696ae4ead61efdb60"/><file name="Error.php" hash="57386fde5e5993c1126418025093a58a"/><file name="Gateway.php" hash="49b0e43a55e223df601884cfd9a0d2c5"/><file name="Notification.php" hash="0f7373ec3435b477424352c058f42255"/><file name="Vault.php" hash="47b962a59c150ffd653ba4054bc053d0"/></dir></dir><file name="Card.php" hash="d649838a367dfc2f69649268f6b7998a"/><file name="Config.php" hash="58b729e16f5ac9ec28535013274d465a"/><dir name="Log"><file name="Adapter.php" hash="9d5533d5d3622c72cbc84abfd4e3116c"/></dir><dir name="Method"><file name="Abstract.php" hash="b8944016a1fb3e88aea08593eed373f7"/><file name="Cbc.php" hash="49d1b0e2ad320c1a78043bb7231de930"/><file name="Cc.php" hash="ed8e077db41c1d2c2bacdb6eb416b524"/><file name="Dexia.php" hash="a385bcf6b0826917fecec6917a8230f9"/><file name="Giropay.php" hash="8f924fea486cd68e22dd55039c7cda77"/><file name="Hosted.php" hash="5bd41f736ddc997d5620932838b38849"/><file name="Ideal.php" hash="0cf882d667b36c0e89bc1800ea9fa7a1"/><file name="Ing.php" hash="774c41e17868dcfe8031d047703a8b1c"/><file name="Kbc.php" hash="77981ab4ebd64d3555bd9fddccadf283"/><file name="PaypalApi.php" hash="7b107d521c52c39380bb5daf4716da52"/><file name="Przelewy24.php" hash="00b695e7b34b69f36d593587a9b5dcdd"/><file name="Przelewy24Api.php" hash="ff20c8621b68fea2b9d96cf131d320e7"/><file name="Qiwi.php" hash="acea5092f8fd1720d506d5be3714864f"/><file name="Sisal.php" hash="d6f97559eb485a8d6d66e5a7abc0e077"/><file name="SisalApi.php" hash="0c63400b243855790f987e8dd2b85402"/><file name="Sofort.php" hash="fa6cb68aff431c2dc91e7b3c62a29aaa"/><file name="SofortApi.php" hash="51111ee0872f93829833a01e36b51abf"/><file name="Webmoney.php" hash="5705818f9288d1c0acc49882c42c195f"/><file name="WebmoneyApi.php" hash="d24a31e40cba1af6e4e8fd20f3ac7dd6"/><file name="Yandex.php" hash="1edad262a001d96ede94c9406e680f46"/><file name="YandexApi.php" hash="831b63ffbe3b859cff790fb34ea63663"/></dir><file name="Observer.php" hash="b2ebcb8df2049539befb893370d8c615"/><file name="PaymentProfile.php" hash="002417022b9afb132e771bbb2eb09d1c"/><dir name="Resource"><dir name="Card"><file name="Collection.php" hash="4a9ca5d5124dcaa5fe9a01c7e864bf6e"/></dir><file name="Card.php" hash="5550c1486504972e6423fce49e3e8d93"/><dir name="PaymentProfile"><file name="Collection.php" hash="b1d5980904dbc3669cc6ee904c7620a3"/></dir><file name="PaymentProfile.php" hash="fb397fd11c35b19986d4688d207b55cb"/><dir name="Rule"><file name="Collection.php" hash="b4dd0d851cda670c6aafad0cf588b106"/></dir><file name="Rule.php" hash="115bccaa9e4d37ed03e179147ab3788d"/><dir name="SplitPayment"><file name="Collection.php" hash="c44859bdf1e4de9551bc31cd57e7ef88"/></dir><file name="SplitPayment.php" hash="133f41e753dfbb150cb61c6edf5745c9"/></dir><dir name="Rule"><dir name="Condition"><file name="Address.php" hash="4180131479d72272c7b2c67534341dbc"/><file name="Combine.php" hash="e57da0bfd13c85721ef06d9f5c1d5a45"/><file name="Customer.php" hash="b847ff261e77565af4f64761d378de59"/><dir name="Product"><file name="Combine.php" hash="b99adc27124c3c6f56d04f0bcb5a42be"/><file name="Found.php" hash="bc266762458faaba326b7d7245b688a8"/><file name="Subselect.php" hash="5c0d482cddd69d82350bc5fec15c40b7"/></dir><file name="Product.php" hash="5186cb9be313c7a772a11613ff4d1406"/></dir><file name="Config.php" hash="4034bf549bc274c836930a43d0ef8646"/></dir><file name="Rule.php" hash="4cddad3f6cb38af59dc2726d80148f51"/><dir name="Source"><file name="3ds.php" hash="e7b97e8a1c886b11951051a212c965ba"/><file name="CcType.php" hash="088d0e8c51f594092a0c6cd0f9bf6545"/><file name="CcTypeHosted.php" hash="f119a5901ac3a9056df56f9cb35b5e02"/><dir name="Order"><file name="HipayStatusValidate.php" hash="63414f71ce035909310f27842bc1b511"/><dir name="Status"><file name="Accepted.php" hash="20cfc4b9ec26a2b458f8ffc43f6195aa"/><file name="Canceled.php" hash="49a6f0b6033e698fbefe01967b81b21d"/><file name="New.php" hash="226d2f1a5d441dbd6404ea342555e893"/><file name="Refused.php" hash="dbf1ed822488bb0d03f71461c872154d"/></dir><file name="Status.php" hash="395ac5e1567ee6095769abc6ce64fec0"/></dir><file name="PaymentAction.php" hash="10638f85360e7693819cbbfd156bed72"/><file name="PaymentProfile.php" hash="9e8c5e4bea5c50b1a63c71cfd9416ff1"/><file name="Pendingredirect.php" hash="f0c3125415535637c159c97fc2627740"/><file name="Template.php" hash="2aa16f597398af7ec73e4c7b0f126fd4"/></dir><file name="SplitPayment.php" hash="38ccc9e82079d15a25e8d90710aa2b20"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="CcTypes.php" hash="916ab83c9e5e1ee18d488f42a090c524"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CardController.php" hash="1e5cba078cef7987df9314c467dd640e"/><file name="PaymentController.php" hash="d212b4ede76d1632a0554ee53285ec23"/><file name="PaymentProfileController.php" hash="887808a799db4e95d76bb9a014f80f29"/><file name="RuleController.php" hash="55291c15c7de616237b14dfad1bc5e80"/><file name="SplitPaymentController.php" hash="642960a1002c316efc04d3af4e6d2a57"/></dir><file name="CardController.php" hash="bb0bf974d25bf4d4c40e99904ba1dd35"/><file name="CbcController.php" hash="11a793cfef50322482b4d1e44f7fb427"/><file name="CcController.php" hash="2e45012894cac90a24c2017a427258b5"/><file name="CheckoutController.php" hash="8d565df4627074dd62c59e6d5b301ce0"/><file name="DexiaController.php" hash="abafa7205262125aef603f0d51445ebd"/><file name="GiropayController.php" hash="93ebe6d63e60627ee86815a7cc23006b"/><file name="HostedController.php" hash="f0bd2d41f36b0453e42063531b88d4a3"/><file name="IdealController.php" hash="49bc5c1a52c98cef934b45ce27da574a"/><file name="IngController.php" hash="43b8ae9e752d5268a51a164abc98df9f"/><file name="KbcController.php" hash="fad29361513cc354dcf200fde25265da"/><file name="NotifyController.php" hash="a05ff382d55531e2ff2c2db4f7011c75"/><file name="PaypalapiController.php" hash="6163a491b9e7b43593983da5735d29e6"/><file name="Przelewy24Controller.php" hash="d6923f98e8a53d8b8becd1d5ef99e0d0"/><file name="Przelewy24apiController.php" hash="bc488ef00a5a063d05aa12c545d8e8fe"/><file name="QiwiController.php" hash="6b3e05b2910dae0b919c50cb06363c57"/><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="40f3410aab48dfeb17b62a9f13577420"/></dir></dir><file name="SisalController.php" hash="32bdb5bf400fa1c6ee5bfb2c79b889f9"/><file name="SisalapiController.php" hash="23a04c3fe9470ef98ce84fcf5c1dd9fe"/><file name="SofortController.php" hash="5479f2e8c3043ad0dd51167bd9bcf623"/><file name="SofortapiController.php" hash="74aa59c7c7795f9f61c6b4bfeae193e3"/><file name="WebmoneyController.php" hash="b52fdbc662da23f839750c9919aad809"/><file name="WebmoneyapiController.php" hash="f34dc66aca5218930be548c88e7e9004"/><file name="YandexController.php" hash="629ec07271f8a11d7c88824154b637f0"/><file name="YandexapiController.php" hash="9741c2a9427866895907629af1e9ed98"/></dir><dir name="etc"><file name="config.xml" hash="f232999266bb5e357e714e75b4a6701a"/><file name="system.xml" hash="d7e57b4927882fb81b281c0027bbf60b"/></dir><dir name="sql"><dir name="allopass_hipay_setup"><file name="mysql4-install-0.1.0.php" hash="f26c1b504004395dff2ec07d57bc5439"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="af83b289e454c2d2ab91d2a6800d079a"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="1aa9291c5ac40a03ccbf3bcb6ce0c47e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="17ddfaae63edc655fec04dcd5f96136a"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="5dfaafe02016ff47dfd80c89effaaabb"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="abec801a24e8515ad80dfe3563fd1492"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="c4e2c53d2b62d8829731449b881dd171"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="b3080317af653951030d7d2a1b116e75"/><file name="mysql4-upgrade-1.0.9-1.1.0.php" hash="81abd6cd95c846d67abc78d2a96a0f15"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hipay.xml" hash="457415436810b9a57b0c5228ac4ae4b0"/></dir><dir name="template"><dir name="hipay"><dir name="card"><file name="account.phtml" hash="8e4ec26a1ccfb13bf8c4706d74990aad"/><dir name="form"><file name="edit.phtml" hash="befde62b0368c1afb8daa70d46796865"/></dir></dir><dir name="checkout"><file name="pending.phtml" hash="34e6bba88ea5fdd6b4ea71595de638d6"/></dir><dir name="form"><file name="cc.phtml" hash="14cf953e5a2ff9f445694be21b59a9db"/><file name="hosted.phtml" hash="9272af0be34cff74a3c0a3642171b413"/></dir><dir name="info"><file name="cc.phtml" hash="96e92e2b6564392e7294b8f96469940f"/><file name="hosted.phtml" hash="96e92e2b6564392e7294b8f96469940f"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="hipay.xml" hash="478e41f2896fd595f4d264149059c737"/></dir><dir name="template"><dir name="hipay"><dir name="form"><file name="cc.phtml" hash="558753da13affeb289d9d4725eb92871"/><file name="hosted.phtml" hash="1dc8481e0b754e12eaeb065da8a6e41f"/></dir><dir name="info"><file name="cc.phtml" hash="96e92e2b6564392e7294b8f96469940f"/><file name="hosted.phtml" hash="96e92e2b6564392e7294b8f96469940f"/></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="rules.phtml" hash="b25ca0397baffa2306ab70776b2febac"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Allopass_Hipay.xml" hash="fd0ac2e9080c0a432a3a7b6d969171c0"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Allopass_Hipay.csv" hash="210189d6078821aa0928950143020264"/><dir name="template"><dir name="email"><file name="hipay_fraud_payment.html" hash="099f8760397b9c9ccaf24bee1bdfdadc"/><file name="hipay_fraud_payment_accept.html" hash="e577cb25ea4a4ad2cd764545de86a794"/><file name="hipay_fraud_payment_deny.html" hash="9011d7215936745d781f922015bc5b9a"/></dir></dir></dir><dir name="fr_FR"><file name="Allopass_Hipay.csv" hash="f677586dd351c5dd41feee01929bc145"/><dir name="template"><dir name="email"><file name="hipay_fraud_payment.html" hash="9ec2e3fc5610a60ce86dd24d0f83ff5d"/><file name="hipay_fraud_payment_accept.html" hash="5f2538c69555f414f7c8e8767ac505f7"/><file name="hipay_fraud_payment_deny.html" hash="035b655eac80930d6ebe4e5bf2c3e50c"/></dir></dir></dir><dir name="it_IT"><file name="Allopass_Hipay.csv" hash="92ab8e910907eb6ed33283e4f8567b9b"/><dir name="template"><dir name="email"><file name="hipay_fraud_payment.html" hash="099f8760397b9c9ccaf24bee1bdfdadc"/><file name="hipay_fraud_payment_accept.html" hash="e577cb25ea4a4ad2cd764545de86a794"/><file name="hipay_fraud_payment_deny.html" hash="9011d7215936745d781f922015bc5b9a"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="hipay"><dir name="js"><file name="rules.js" hash="c9f87ded0b3a8505e78ab2584c2f098f"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>5.5.99</max></php></required></dependencies>
18
  </package>