Sirateck_Lemonway4ec - Version 1.0.1

Version Notes

- Add ecommerce route by default

Download this release

Release Info

Developer Thomas Roche
Extension Sirateck_Lemonway4ec
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

Files changed (54) hide show
  1. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Moneyout.php +106 -0
  2. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet.php +43 -0
  3. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit.php +82 -0
  4. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Form.php +52 -0
  5. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Tab/Form.php +424 -0
  6. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Tabs.php +74 -0
  7. app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Grid.php +636 -0
  8. app/code/community/Sirateck/Lemonway4ec/Block/Form/Webkit.php +97 -0
  9. app/code/community/Sirateck/Lemonway4ec/Block/Info/Webkit.php +52 -0
  10. app/code/community/Sirateck/Lemonway4ec/Controller/Adminhtml/Lemonway.php +60 -0
  11. app/code/community/Sirateck/Lemonway4ec/Helper/Data.php +86 -0
  12. app/code/community/Sirateck/Lemonway4ec/Model/Adminhtml/Search/Wallet.php +60 -0
  13. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/Iban.php +26 -0
  14. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/KycDoc.php +36 -0
  15. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/LwError.php +19 -0
  16. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/LwModel.php +5 -0
  17. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/Operation.php +93 -0
  18. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/SddMandate.php +42 -0
  19. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/Wallet.php +44 -0
  20. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apiresponse.php +55 -0
  21. app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Kit.php +300 -0
  22. app/code/community/Sirateck/Lemonway4ec/Model/Attribute/Source/Country.php +47 -0
  23. app/code/community/Sirateck/Lemonway4ec/Model/Config.php +157 -0
  24. app/code/community/Sirateck/Lemonway4ec/Model/Iban.php +106 -0
  25. app/code/community/Sirateck/Lemonway4ec/Model/Method/Webkit.php +274 -0
  26. app/code/community/Sirateck/Lemonway4ec/Model/Moneyout.php +90 -0
  27. app/code/community/Sirateck/Lemonway4ec/Model/Observer.php +53 -0
  28. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Iban.php +37 -0
  29. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Iban/Collection.php +84 -0
  30. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Moneyout.php +37 -0
  31. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Moneyout/Collection.php +84 -0
  32. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Setup.php +26 -0
  33. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Wallet.php +37 -0
  34. app/code/community/Sirateck/Lemonway4ec/Model/Resource/Wallet/Collection.php +84 -0
  35. app/code/community/Sirateck/Lemonway4ec/Model/Wallet.php +129 -0
  36. app/code/community/Sirateck/Lemonway4ec/Model/Wallet/Attribute/Source/Payerorbeneficiary.php +97 -0
  37. app/code/community/Sirateck/Lemonway4ec/controllers/Adminhtml/Lemonway/MoneyoutController.php +134 -0
  38. app/code/community/Sirateck/Lemonway4ec/controllers/Adminhtml/Lemonway/WalletController.php +662 -0
  39. app/code/community/Sirateck/Lemonway4ec/controllers/PaymentController.php +308 -0
  40. app/code/community/Sirateck/Lemonway4ec/etc/adminhtml.xml +69 -0
  41. app/code/community/Sirateck/Lemonway4ec/etc/config.xml +157 -0
  42. app/code/community/Sirateck/Lemonway4ec/etc/system.xml +201 -0
  43. app/code/community/Sirateck/Lemonway4ec/sql/sirateck_lemonway4ec_setup/install-0.1.0.php +246 -0
  44. app/code/community/Sirateck/Lemonway4ec/sql/sirateck_lemonway4ec_setup/mysql4-upgrade-0.1.0-0.1.1.php +59 -0
  45. app/code/community/Sirateck/Lemonway4ec/sql/sirateck_lemonway4ec_setup/mysql4-upgrade-0.1.1-0.1.2.php +115 -0
  46. app/code/community/Sirateck/Lemonway4ec/sql/sirateck_lemonway4ec_setup/mysql4-upgrade-0.1.4-0.1.5.php +63 -0
  47. app/design/adminhtml/default/default/layout/sirateck_lemonway4ec.xml +64 -0
  48. app/design/adminhtml/default/default/template/lemonway4ec/moneyout.phtml +191 -0
  49. app/design/frontend/base/default/template/lemonway4ec/form/webkit.phtml +81 -0
  50. app/design/frontend/base/default/template/lemonway4ec/info/webkit.phtml +19 -0
  51. app/etc/modules/Sirateck_Lemonway4ec.xml +29 -0
  52. app/locale/en_US/Sirateck_Lemonway4ec.csv +153 -0
  53. app/locale/fr_FR/Sirateck_Lemonway4ec.csv +153 -0
  54. package.xml +2 -0
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Moneyout.php ADDED
@@ -0,0 +1,106 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet admin block
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Moneyout extends Mage_Adminhtml_Block_Template
25
+ {
26
+ protected $_walletDetails = null;
27
+
28
+
29
+ protected function _prepareLayout(){
30
+ $this->setChild(
31
+ 'submit_button',
32
+ $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
33
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Pay'),
34
+ 'class' => 'save submit-button',
35
+ 'onclick' => 'moneyoutForm.submit()',
36
+ ))
37
+ );
38
+ }
39
+
40
+ /**
41
+ * Get page header text
42
+ *
43
+ * @return string
44
+ */
45
+ protected function getHeader()
46
+ {
47
+ return $this->__("Money out");
48
+ }
49
+
50
+ /**
51
+ * Get html code of pay button
52
+ *
53
+ * @return string
54
+ */
55
+ protected function getPayButtonHtml()
56
+ {
57
+ return $this->getChildHtml('pay_button');
58
+ }
59
+
60
+ /**
61
+ * Get process pay url
62
+ *
63
+ * @return string
64
+ */
65
+ public function getPayFormAction()
66
+ {
67
+ return $this->getUrl('*/*/payPost');
68
+ }
69
+
70
+ /**
71
+ * Check if main wallet is configured and if Iban is present
72
+ * @TODO check validation (wallet exist and have a positive balance,iban exist and status is ok)
73
+ * @return bool
74
+ */
75
+ public function canPayMoneyOut()
76
+ {
77
+ return !$this->getWalletDetails()->lwError && count($this->getWalletDetails()->wallet->getIbans());
78
+ }
79
+
80
+ public function formatPrice($price){
81
+
82
+ return Mage::helper('core')->formatPrice($price);
83
+ }
84
+
85
+
86
+ /**
87
+ * @return Sirateck_Lemonway4ec_Model_Apikit_Apiresponse
88
+ */
89
+ public function getWalletDetails(){
90
+ if(is_null($this->_walletDetails))
91
+ {
92
+ /* @var $_helper Sirateck_Lemonway4ec_Helper_Data */
93
+ $_helper = $this->helper('sirateck_lemonway4ec');
94
+ $params = array("wallet"=>$_helper->getConfig()->getWalletMerchantId()
95
+ );
96
+
97
+ $this->_walletDetails = Mage::getSingleton('sirateck_lemonway4ec/apikit_kit')->GetWalletDetails($params);
98
+
99
+ }
100
+
101
+ return $this->_walletDetails;
102
+
103
+ }
104
+
105
+
106
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet.php ADDED
@@ -0,0 +1,43 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet admin block
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet extends Mage_Adminhtml_Block_Widget_Grid_Container
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @return void
31
+ * @author Kassim Belghait kassim@sirateck.com
32
+ */
33
+ public function __construct()
34
+ {
35
+ $this->_controller = 'adminhtml_wallet';
36
+ $this->_blockGroup = 'sirateck_lemonway4ec';
37
+ parent::__construct();
38
+ $this->_headerText = Mage::helper('sirateck_lemonway4ec')->__('Wallet');
39
+ $this->_removeButton('add');
40
+ //$this->_updateButton('add', 'label', Mage::helper('sirateck_lemonway4ec')->__('Add Wallet'));
41
+
42
+ }
43
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit.php ADDED
@@ -0,0 +1,82 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet admin edit form
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @return void
31
+ * @author Kassim Belghait kassim@sirateck.com
32
+ */
33
+ public function __construct()
34
+ {
35
+ parent::__construct();
36
+ $this->_blockGroup = 'sirateck_lemonway4ec';
37
+ $this->_controller = 'adminhtml_wallet';
38
+ $this->_updateButton(
39
+ 'save',
40
+ 'label',
41
+ Mage::helper('sirateck_lemonway4ec')->__('Save Wallet')
42
+ );
43
+ $this->_updateButton(
44
+ 'delete',
45
+ 'label',
46
+ Mage::helper('sirateck_lemonway4ec')->__('Delete Wallet')
47
+ );
48
+ $this->_addButton(
49
+ 'saveandcontinue',
50
+ array(
51
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Save And Continue Edit'),
52
+ 'onclick' => 'saveAndContinueEdit()',
53
+ 'class' => 'save',
54
+ ),
55
+ -100
56
+ );
57
+ $this->_formScripts[] = "
58
+ function saveAndContinueEdit() {
59
+ editForm.submit($('edit_form').action+'back/edit/');
60
+ }
61
+ ";
62
+ }
63
+
64
+ /**
65
+ * get the edit form header
66
+ *
67
+ * @access public
68
+ * @return string
69
+ * @author Kassim Belghait kassim@sirateck.com
70
+ */
71
+ public function getHeaderText()
72
+ {
73
+ if (Mage::registry('current_wallet') && Mage::registry('current_wallet')->getId()) {
74
+ return Mage::helper('sirateck_lemonway4ec')->__(
75
+ "Edit Wallet '%s'",
76
+ $this->escapeHtml(Mage::registry('current_wallet')->getWalletId())
77
+ );
78
+ } else {
79
+ return Mage::helper('sirateck_lemonway4ec')->__('Add Wallet');
80
+ }
81
+ }
82
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Form.php ADDED
@@ -0,0 +1,52 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet edit form
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
25
+ {
26
+ /**
27
+ * prepare form
28
+ *
29
+ * @access protected
30
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Form
31
+ * @author Kassim Belghait kassim@sirateck.com
32
+ */
33
+ protected function _prepareForm()
34
+ {
35
+ $form = new Varien_Data_Form(
36
+ array(
37
+ 'id' => 'edit_form',
38
+ 'action' => $this->getUrl(
39
+ '*/*/save',
40
+ array(
41
+ 'id' => $this->getRequest()->getParam('id')
42
+ )
43
+ ),
44
+ 'method' => 'post',
45
+ 'enctype' => 'multipart/form-data'
46
+ )
47
+ );
48
+ $form->setUseContainer(true);
49
+ $this->setForm($form);
50
+ return parent::_prepareForm();
51
+ }
52
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Tab/Form.php ADDED
@@ -0,0 +1,424 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet edit form tab
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
25
+ {
26
+ /**
27
+ * prepare the form
28
+ *
29
+ * @access protected
30
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Tab_Form
31
+ * @author Kassim Belghait kassim@sirateck.com
32
+ */
33
+ protected function _prepareForm()
34
+ {
35
+ $form = new Varien_Data_Form();
36
+ $form->setHtmlIdPrefix('wallet_');
37
+ $form->setFieldNameSuffix('wallet');
38
+ $this->setForm($form);
39
+ $fieldset = $form->addFieldset(
40
+ 'wallet_form',
41
+ array('legend' => Mage::helper('sirateck_lemonway4ec')->__('Wallet'))
42
+ );
43
+
44
+ $fieldset->addField(
45
+ 'lw_id',
46
+ 'text',
47
+ array(
48
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Lemonway ID'),
49
+ 'name' => 'lw_id',
50
+ 'required' => true,
51
+ 'class' => 'required-entry',
52
+
53
+ )
54
+ );
55
+
56
+ $fieldset->addField(
57
+ 'customer_id',
58
+ 'text',
59
+ array(
60
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Customer ID'),
61
+ 'name' => 'customer_id',
62
+ 'required' => true,
63
+ 'class' => 'required-entry',
64
+
65
+ )
66
+ );
67
+
68
+ $fieldset->addField(
69
+ 'wallet_id',
70
+ 'text',
71
+ array(
72
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Wallet ID'),
73
+ 'name' => 'wallet_id',
74
+ 'required' => true,
75
+ 'class' => 'required-entry',
76
+
77
+ )
78
+ );
79
+
80
+ $fieldset->addField(
81
+ 'is_admin',
82
+ 'select',
83
+ array(
84
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is Admin'),
85
+ 'name' => 'is_admin',
86
+ 'required' => true,
87
+ 'class' => 'required-entry',
88
+
89
+ 'values'=> array(
90
+ array(
91
+ 'value' => 1,
92
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
93
+ ),
94
+ array(
95
+ 'value' => 0,
96
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('No'),
97
+ ),
98
+ ),
99
+ )
100
+ );
101
+
102
+ $fieldset->addField(
103
+ 'customer_email',
104
+ 'text',
105
+ array(
106
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Email'),
107
+ 'name' => 'customer_email',
108
+ 'required' => true,
109
+ 'class' => 'required-entry',
110
+
111
+ )
112
+ );
113
+
114
+ $fieldset->addField(
115
+ 'customer_prefix',
116
+ 'text',
117
+ array(
118
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Prefix'),
119
+ 'name' => 'customer_prefix',
120
+ 'required' => true,
121
+ 'class' => 'required-entry',
122
+
123
+ )
124
+ );
125
+
126
+ $fieldset->addField(
127
+ 'customer_firstname',
128
+ 'text',
129
+ array(
130
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Firstname'),
131
+ 'name' => 'customer_firstname',
132
+ 'required' => true,
133
+ 'class' => 'required-entry',
134
+
135
+ )
136
+ );
137
+
138
+ $fieldset->addField(
139
+ 'customer_lastname',
140
+ 'text',
141
+ array(
142
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Lastname'),
143
+ 'name' => 'customer_lastname',
144
+ 'required' => true,
145
+ 'class' => 'required-entry',
146
+
147
+ )
148
+ );
149
+
150
+ $fieldset->addField(
151
+ 'billing_address_street',
152
+ 'text',
153
+ array(
154
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Street'),
155
+ 'name' => 'billing_address_street',
156
+
157
+ )
158
+ );
159
+
160
+ $fieldset->addField(
161
+ 'billing_address_postcode',
162
+ 'text',
163
+ array(
164
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Postcode'),
165
+ 'name' => 'billing_address_postcode',
166
+
167
+ )
168
+ );
169
+
170
+ $fieldset->addField(
171
+ 'billing_address_city',
172
+ 'text',
173
+ array(
174
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('City'),
175
+ 'name' => 'billing_address_city',
176
+
177
+ )
178
+ );
179
+
180
+ $fieldset->addField(
181
+ 'billing_address_country',
182
+ 'select',
183
+ array(
184
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Country'),
185
+ 'name' => 'billing_address_country',
186
+
187
+ 'values'=> Mage::getResourceModel('directory/country_collection')->toOptionArray(),
188
+ )
189
+ );
190
+
191
+ $fieldset->addField(
192
+ 'billing_address_phone',
193
+ 'text',
194
+ array(
195
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Phone Number'),
196
+ 'name' => 'billing_address_phone',
197
+
198
+ )
199
+ );
200
+
201
+ $fieldset->addField(
202
+ 'billing_address_mobile',
203
+ 'text',
204
+ array(
205
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Mobile Number'),
206
+ 'name' => 'billing_address_mobile',
207
+
208
+ )
209
+ );
210
+
211
+ $fieldset->addField(
212
+ 'customer_dob',
213
+ 'date',
214
+ array(
215
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Dob'),
216
+ 'name' => 'customer_dob',
217
+
218
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
219
+ 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
220
+ )
221
+ );
222
+
223
+ $fieldset->addField(
224
+ 'is_company',
225
+ 'select',
226
+ array(
227
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is company'),
228
+ 'name' => 'is_company',
229
+
230
+ 'values'=> array(
231
+ array(
232
+ 'value' => 1,
233
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
234
+ ),
235
+ array(
236
+ 'value' => 0,
237
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('No'),
238
+ ),
239
+ ),
240
+ )
241
+ );
242
+
243
+ $fieldset->addField(
244
+ 'company_name',
245
+ 'text',
246
+ array(
247
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Company name'),
248
+ 'name' => 'company_name',
249
+ 'required' => true,
250
+ 'class' => 'required-entry',
251
+
252
+ )
253
+ );
254
+
255
+ $fieldset->addField(
256
+ 'company_website',
257
+ 'text',
258
+ array(
259
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Company website'),
260
+ 'name' => 'company_website',
261
+ 'required' => true,
262
+ 'class' => 'required-entry',
263
+
264
+ )
265
+ );
266
+
267
+ $fieldset->addField(
268
+ 'company_description',
269
+ 'textarea',
270
+ array(
271
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Company description'),
272
+ 'name' => 'company_description',
273
+
274
+ )
275
+ );
276
+
277
+ $fieldset->addField(
278
+ 'company_id_number',
279
+ 'text',
280
+ array(
281
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Company ID number'),
282
+ 'name' => 'company_id_number',
283
+
284
+ )
285
+ );
286
+
287
+ $fieldset->addField(
288
+ 'is_debtor',
289
+ 'select',
290
+ array(
291
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is debtor'),
292
+ 'name' => 'is_debtor',
293
+
294
+ 'values'=> array(
295
+ array(
296
+ 'value' => 1,
297
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
298
+ ),
299
+ array(
300
+ 'value' => 0,
301
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('No'),
302
+ ),
303
+ ),
304
+ )
305
+ );
306
+
307
+ $fieldset->addField(
308
+ 'customer_nationality',
309
+ 'select',
310
+ array(
311
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Nationality'),
312
+ 'name' => 'customer_nationality',
313
+
314
+ 'values'=> Mage::getResourceModel('directory/country_collection')->toOptionArray(),
315
+ )
316
+ );
317
+
318
+ $fieldset->addField(
319
+ 'customer_birth_city',
320
+ 'text',
321
+ array(
322
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('City of Birth'),
323
+ 'name' => 'customer_birth_city',
324
+
325
+ )
326
+ );
327
+
328
+ $fieldset->addField(
329
+ 'customer_birth_country',
330
+ 'select',
331
+ array(
332
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Birth country'),
333
+ 'name' => 'customer_birth_country',
334
+
335
+ 'values'=> Mage::getResourceModel('directory/country_collection')->toOptionArray(),
336
+ )
337
+ );
338
+
339
+ $fieldset->addField(
340
+ 'payer_or_beneficiary',
341
+ 'select',
342
+ array(
343
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Payer or beneficiary'),
344
+ 'name' => 'payer_or_beneficiary',
345
+
346
+ 'values'=> Mage::getModel('sirateck_lemonway4ec/wallet_attribute_source_payerorbeneficiary')->getAllOptions(true),
347
+ )
348
+ );
349
+
350
+ $fieldset->addField(
351
+ 'is_onetime_customer',
352
+ 'select',
353
+ array(
354
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is One time customer'),
355
+ 'name' => 'is_onetime_customer',
356
+ 'required' => true,
357
+ 'class' => 'required-entry',
358
+
359
+ 'values'=> array(
360
+ array(
361
+ 'value' => 1,
362
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
363
+ ),
364
+ array(
365
+ 'value' => 0,
366
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('No'),
367
+ ),
368
+ ),
369
+ )
370
+ );
371
+
372
+ $fieldset->addField(
373
+ 'is_default',
374
+ 'select',
375
+ array(
376
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is default'),
377
+ 'name' => 'is_default',
378
+ 'required' => true,
379
+ 'class' => 'required-entry',
380
+
381
+ 'values'=> array(
382
+ array(
383
+ 'value' => 1,
384
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
385
+ ),
386
+ array(
387
+ 'value' => 0,
388
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('No'),
389
+ ),
390
+ ),
391
+ )
392
+ );
393
+ $fieldset->addField(
394
+ 'status',
395
+ 'select',
396
+ array(
397
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Status'),
398
+ 'name' => 'status',
399
+ 'values' => array(
400
+ array(
401
+ 'value' => 1,
402
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Enabled'),
403
+ ),
404
+ array(
405
+ 'value' => 0,
406
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Disabled'),
407
+ ),
408
+ ),
409
+ )
410
+ );
411
+ $formValues = Mage::registry('current_wallet')->getDefaultValues();
412
+ if (!is_array($formValues)) {
413
+ $formValues = array();
414
+ }
415
+ if (Mage::getSingleton('adminhtml/session')->getWalletData()) {
416
+ $formValues = array_merge($formValues, Mage::getSingleton('adminhtml/session')->getWalletData());
417
+ Mage::getSingleton('adminhtml/session')->setWalletData(null);
418
+ } elseif (Mage::registry('current_wallet')) {
419
+ $formValues = array_merge($formValues, Mage::registry('current_wallet')->getData());
420
+ }
421
+ $form->setValues($formValues);
422
+ return parent::_prepareForm();
423
+ }
424
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Edit/Tabs.php ADDED
@@ -0,0 +1,74 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet admin edit tabs
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
25
+ {
26
+ /**
27
+ * Initialize Tabs
28
+ *
29
+ * @access public
30
+ * @author Kassim Belghait kassim@sirateck.com
31
+ */
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('wallet_tabs');
36
+ $this->setDestElementId('edit_form');
37
+ $this->setTitle(Mage::helper('sirateck_lemonway4ec')->__('Wallet'));
38
+ }
39
+
40
+ /**
41
+ * before render html
42
+ *
43
+ * @access protected
44
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Edit_Tabs
45
+ * @author Kassim Belghait kassim@sirateck.com
46
+ */
47
+ protected function _beforeToHtml()
48
+ {
49
+ $this->addTab(
50
+ 'form_wallet',
51
+ array(
52
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Wallet'),
53
+ 'title' => Mage::helper('sirateck_lemonway4ec')->__('Wallet'),
54
+ 'content' => $this->getLayout()->createBlock(
55
+ 'sirateck_lemonway4ec/adminhtml_wallet_edit_tab_form'
56
+ )
57
+ ->toHtml(),
58
+ )
59
+ );
60
+ return parent::_beforeToHtml();
61
+ }
62
+
63
+ /**
64
+ * Retrieve wallet entity
65
+ *
66
+ * @access public
67
+ * @return Sirateck_Lemonway4ec_Model_Wallet
68
+ * @author Kassim Belghait kassim@sirateck.com
69
+ */
70
+ public function getWallet()
71
+ {
72
+ return Mage::registry('current_wallet');
73
+ }
74
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Adminhtml/Wallet/Grid.php ADDED
@@ -0,0 +1,636 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Wallet admin grid block
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Grid extends Mage_Adminhtml_Block_Widget_Grid
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @author Kassim Belghait kassim@sirateck.com
31
+ */
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('walletGrid');
36
+ $this->setDefaultSort('entity_id');
37
+ $this->setDefaultDir('ASC');
38
+ $this->setSaveParametersInSession(true);
39
+ $this->setUseAjax(true);
40
+ }
41
+
42
+ /**
43
+ * prepare collection
44
+ *
45
+ * @access protected
46
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Grid
47
+ * @author Kassim Belghait kassim@sirateck.com
48
+ */
49
+ protected function _prepareCollection()
50
+ {
51
+ $collection = Mage::getModel('sirateck_lemonway4ec/wallet')
52
+ ->getCollection();
53
+
54
+ $this->setCollection($collection);
55
+ return parent::_prepareCollection();
56
+ }
57
+
58
+ /**
59
+ * prepare grid collection
60
+ *
61
+ * @access protected
62
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Grid
63
+ * @author Kassim Belghait kassim@sirateck.com
64
+ */
65
+ protected function _prepareColumns()
66
+ {
67
+ $this->addColumn(
68
+ 'entity_id',
69
+ array(
70
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Id'),
71
+ 'index' => 'entity_id',
72
+ 'type' => 'number'
73
+ )
74
+ );
75
+ $this->addColumn(
76
+ 'wallet_id',
77
+ array(
78
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Wallet ID'),
79
+ 'align' => 'left',
80
+ 'index' => 'wallet_id',
81
+ )
82
+ );
83
+
84
+ /* $options = array();
85
+ foreach (Sirateck_Lemonway4ec_Model_Wallet::$statuesLabel as $key=>$label){
86
+ $options[$key] = Mage::helper('sirateck_lemonway4ec')->__($label);
87
+ }
88
+
89
+ $this->addColumn(
90
+ 'status',
91
+ array(
92
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Status'),
93
+ 'index' => 'status',
94
+ 'type' => 'options',
95
+ 'options' => $options
96
+ )
97
+ );
98
+ $this->addColumn(
99
+ 'lw_id',
100
+ array(
101
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Lemonway ID'),
102
+ 'index' => 'lw_id',
103
+ 'type'=> 'text',
104
+
105
+ )
106
+ );*/
107
+ $this->addColumn(
108
+ 'customer_id',
109
+ array(
110
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Customer ID'),
111
+ 'index' => 'customer_id',
112
+ 'type'=> 'number',
113
+
114
+ )
115
+ );
116
+ $this->addColumn(
117
+ 'is_admin',
118
+ array(
119
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Is Admin'),
120
+ 'index' => 'is_admin',
121
+ 'type' => 'options',
122
+ 'options' => array(
123
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
124
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
125
+ )
126
+
127
+ )
128
+ );
129
+ $this->addColumn(
130
+ 'customer_email',
131
+ array(
132
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Email'),
133
+ 'index' => 'customer_email',
134
+ 'type'=> 'text',
135
+
136
+ )
137
+ );
138
+ /* $this->addColumn(
139
+ 'customer_prefix',
140
+ array(
141
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Prefix'),
142
+ 'index' => 'customer_prefix',
143
+ 'type'=> 'text',
144
+
145
+ )
146
+ );
147
+ $this->addColumn(
148
+ 'customer_firstname',
149
+ array(
150
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Firstname'),
151
+ 'index' => 'customer_firstname',
152
+ 'type'=> 'text',
153
+
154
+ )
155
+ );
156
+ $this->addColumn(
157
+ 'customer_lastname',
158
+ array(
159
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Lastname'),
160
+ 'index' => 'customer_lastname',
161
+ 'type'=> 'text',
162
+
163
+ )
164
+ );
165
+ $this->addColumn(
166
+ 'billing_address_street',
167
+ array(
168
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Street'),
169
+ 'index' => 'billing_address_street',
170
+ 'type'=> 'text',
171
+
172
+ )
173
+ );
174
+ $this->addColumn(
175
+ 'billing_address_postcode',
176
+ array(
177
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Postcode'),
178
+ 'index' => 'billing_address_postcode',
179
+ 'type'=> 'text',
180
+
181
+ )
182
+ );
183
+ $this->addColumn(
184
+ 'billing_address_city',
185
+ array(
186
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('City'),
187
+ 'index' => 'billing_address_city',
188
+ 'type'=> 'text',
189
+
190
+ )
191
+ );
192
+ $this->addColumn(
193
+ 'billing_address_country',
194
+ array(
195
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Country'),
196
+ 'index' => 'billing_address_country',
197
+ 'type'=> 'country',
198
+
199
+ )
200
+ );
201
+ $this->addColumn(
202
+ 'billing_address_phone',
203
+ array(
204
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Phone Number'),
205
+ 'index' => 'billing_address_phone',
206
+ 'type'=> 'text',
207
+
208
+ )
209
+ );
210
+ $this->addColumn(
211
+ 'billing_address_mobile',
212
+ array(
213
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Mobile Number'),
214
+ 'index' => 'billing_address_mobile',
215
+ 'type'=> 'text',
216
+
217
+ )
218
+ );
219
+ $this->addColumn(
220
+ 'customer_dob',
221
+ array(
222
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Dob'),
223
+ 'index' => 'customer_dob',
224
+ 'type'=> 'date',
225
+
226
+ )
227
+ );
228
+ $this->addColumn(
229
+ 'is_company',
230
+ array(
231
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Is company'),
232
+ 'index' => 'is_company',
233
+ 'type' => 'options',
234
+ 'options' => array(
235
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
236
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
237
+ )
238
+
239
+ )
240
+ );
241
+ $this->addColumn(
242
+ 'company_name',
243
+ array(
244
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Company name'),
245
+ 'index' => 'company_name',
246
+ 'type'=> 'text',
247
+
248
+ )
249
+ );
250
+ $this->addColumn(
251
+ 'company_website',
252
+ array(
253
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Company website'),
254
+ 'index' => 'company_website',
255
+ 'type'=> 'text',
256
+
257
+ )
258
+ );
259
+ $this->addColumn(
260
+ 'company_id_number',
261
+ array(
262
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Company ID number'),
263
+ 'index' => 'company_id_number',
264
+ 'type'=> 'text',
265
+
266
+ )
267
+ );
268
+ $this->addColumn(
269
+ 'is_debtor',
270
+ array(
271
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Is debtor'),
272
+ 'index' => 'is_debtor',
273
+ 'type' => 'options',
274
+ 'options' => array(
275
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
276
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
277
+ )
278
+
279
+ )
280
+ );
281
+ $this->addColumn(
282
+ 'customer_nationality',
283
+ array(
284
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Nationality'),
285
+ 'index' => 'customer_nationality',
286
+ 'type'=> 'country',
287
+
288
+ )
289
+ );
290
+ $this->addColumn(
291
+ 'customer_birth_city',
292
+ array(
293
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('City of Birth'),
294
+ 'index' => 'customer_birth_city',
295
+ 'type'=> 'text',
296
+
297
+ )
298
+ );
299
+ $this->addColumn(
300
+ 'customer_birth_country',
301
+ array(
302
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Birth country'),
303
+ 'index' => 'customer_birth_country',
304
+ 'type'=> 'country',
305
+
306
+ )
307
+ );
308
+ $this->addColumn(
309
+ 'payer_or_beneficiary',
310
+ array(
311
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Payer or beneficiary'),
312
+ 'index' => 'payer_or_beneficiary',
313
+ 'type' => 'options',
314
+ 'options' => Mage::helper('sirateck_lemonway4ec')->convertOptions(
315
+ Mage::getModel('sirateck_lemonway4ec/wallet_attribute_source_payerorbeneficiary')->getAllOptions(false)
316
+ )
317
+
318
+ )
319
+ );
320
+ $this->addColumn(
321
+ 'is_onetime_customer',
322
+ array(
323
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Is One time customer'),
324
+ 'index' => 'is_onetime_customer',
325
+ 'type' => 'options',
326
+ 'options' => array(
327
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
328
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
329
+ )
330
+
331
+ )
332
+ );
333
+ $this->addColumn(
334
+ 'is_default',
335
+ array(
336
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Is default'),
337
+ 'index' => 'is_default',
338
+ 'type' => 'options',
339
+ 'options' => array(
340
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
341
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
342
+ )
343
+
344
+ )
345
+ ); */
346
+ $this->addColumn(
347
+ 'created_at',
348
+ array(
349
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Created at'),
350
+ 'index' => 'created_at',
351
+ 'width' => '120px',
352
+ 'type' => 'datetime',
353
+ )
354
+ );
355
+ $this->addColumn(
356
+ 'updated_at',
357
+ array(
358
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Updated at'),
359
+ 'index' => 'updated_at',
360
+ 'width' => '120px',
361
+ 'type' => 'datetime',
362
+ )
363
+ );
364
+ $this->addColumn(
365
+ 'action',
366
+ array(
367
+ 'header' => Mage::helper('sirateck_lemonway4ec')->__('Action'),
368
+ 'width' => '100',
369
+ 'type' => 'action',
370
+ 'getter' => 'getId',
371
+ 'actions' => array(
372
+ array(
373
+ 'caption' => Mage::helper('sirateck_lemonway4ec')->__('Edit'),
374
+ 'url' => array('base'=> '*/*/edit'),
375
+ 'field' => 'id'
376
+ )
377
+ ),
378
+ 'filter' => false,
379
+ 'is_system' => true,
380
+ 'sortable' => false,
381
+ )
382
+ );
383
+ $this->addExportType('*/*/exportCsv', Mage::helper('sirateck_lemonway4ec')->__('CSV'));
384
+ $this->addExportType('*/*/exportExcel', Mage::helper('sirateck_lemonway4ec')->__('Excel'));
385
+ $this->addExportType('*/*/exportXml', Mage::helper('sirateck_lemonway4ec')->__('XML'));
386
+ return parent::_prepareColumns();
387
+ }
388
+
389
+ /**
390
+ * prepare mass action
391
+ *
392
+ * @access protected
393
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Grid
394
+ * @author Kassim Belghait kassim@sirateck.com
395
+ */
396
+ protected function _prepareMassaction()
397
+ {
398
+ $this->setMassactionIdField('entity_id');
399
+ $this->getMassactionBlock()->setFormFieldName('wallet');
400
+ $this->getMassactionBlock()->addItem(
401
+ 'delete',
402
+ array(
403
+ 'label'=> Mage::helper('sirateck_lemonway4ec')->__('Delete'),
404
+ 'url' => $this->getUrl('*/*/massDelete'),
405
+ 'confirm' => Mage::helper('sirateck_lemonway4ec')->__('Are you sure?')
406
+ )
407
+ );
408
+ $this->getMassactionBlock()->addItem(
409
+ 'status',
410
+ array(
411
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change status'),
412
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
413
+ 'additional' => array(
414
+ 'status' => array(
415
+ 'name' => 'status',
416
+ 'type' => 'select',
417
+ 'class' => 'required-entry',
418
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Status'),
419
+ 'values' => array(
420
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Enabled'),
421
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('Disabled'),
422
+ )
423
+ )
424
+ )
425
+ )
426
+ );
427
+ $this->getMassactionBlock()->addItem(
428
+ 'is_admin',
429
+ array(
430
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Is Admin'),
431
+ 'url' => $this->getUrl('*/*/massIsAdmin', array('_current'=>true)),
432
+ 'additional' => array(
433
+ 'flag_is_admin' => array(
434
+ 'name' => 'flag_is_admin',
435
+ 'type' => 'select',
436
+ 'class' => 'required-entry',
437
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is Admin'),
438
+ 'values' => array(
439
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
440
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
441
+ )
442
+
443
+ )
444
+ )
445
+ )
446
+ );
447
+ $this->getMassactionBlock()->addItem(
448
+ 'billing_address_country',
449
+ array(
450
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Country'),
451
+ 'url' => $this->getUrl('*/*/massBillingAddressCountry', array('_current'=>true)),
452
+ 'additional' => array(
453
+ 'flag_billing_address_country' => array(
454
+ 'name' => 'flag_billing_address_country',
455
+ 'type' => 'select',
456
+ 'class' => 'required-entry',
457
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Country'),
458
+ 'values' => Mage::getResourceModel('directory/country_collection')->toOptionArray()
459
+
460
+ )
461
+ )
462
+ )
463
+ );
464
+ $this->getMassactionBlock()->addItem(
465
+ 'is_company',
466
+ array(
467
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Is company'),
468
+ 'url' => $this->getUrl('*/*/massIsCompany', array('_current'=>true)),
469
+ 'additional' => array(
470
+ 'flag_is_company' => array(
471
+ 'name' => 'flag_is_company',
472
+ 'type' => 'select',
473
+ 'class' => 'required-entry',
474
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is company'),
475
+ 'values' => array(
476
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
477
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
478
+ )
479
+
480
+ )
481
+ )
482
+ )
483
+ );
484
+ $this->getMassactionBlock()->addItem(
485
+ 'is_debtor',
486
+ array(
487
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Is debtor'),
488
+ 'url' => $this->getUrl('*/*/massIsDebtor', array('_current'=>true)),
489
+ 'additional' => array(
490
+ 'flag_is_debtor' => array(
491
+ 'name' => 'flag_is_debtor',
492
+ 'type' => 'select',
493
+ 'class' => 'required-entry',
494
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is debtor'),
495
+ 'values' => array(
496
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
497
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
498
+ )
499
+
500
+ )
501
+ )
502
+ )
503
+ );
504
+ $this->getMassactionBlock()->addItem(
505
+ 'customer_nationality',
506
+ array(
507
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Nationality'),
508
+ 'url' => $this->getUrl('*/*/massCustomerNationality', array('_current'=>true)),
509
+ 'additional' => array(
510
+ 'flag_customer_nationality' => array(
511
+ 'name' => 'flag_customer_nationality',
512
+ 'type' => 'select',
513
+ 'class' => 'required-entry',
514
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Nationality'),
515
+ 'values' => Mage::getResourceModel('directory/country_collection')->toOptionArray()
516
+
517
+ )
518
+ )
519
+ )
520
+ );
521
+ $this->getMassactionBlock()->addItem(
522
+ 'customer_birth_country',
523
+ array(
524
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Birth country'),
525
+ 'url' => $this->getUrl('*/*/massCustomerBirthCountry', array('_current'=>true)),
526
+ 'additional' => array(
527
+ 'flag_customer_birth_country' => array(
528
+ 'name' => 'flag_customer_birth_country',
529
+ 'type' => 'select',
530
+ 'class' => 'required-entry',
531
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Birth country'),
532
+ 'values' => Mage::getResourceModel('directory/country_collection')->toOptionArray()
533
+
534
+ )
535
+ )
536
+ )
537
+ );
538
+ $this->getMassactionBlock()->addItem(
539
+ 'payer_or_beneficiary',
540
+ array(
541
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Payer or beneficiary'),
542
+ 'url' => $this->getUrl('*/*/massPayerOrBeneficiary', array('_current'=>true)),
543
+ 'additional' => array(
544
+ 'flag_payer_or_beneficiary' => array(
545
+ 'name' => 'flag_payer_or_beneficiary',
546
+ 'type' => 'select',
547
+ 'class' => 'required-entry',
548
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Payer or beneficiary'),
549
+ 'values' => Mage::getModel('sirateck_lemonway4ec/wallet_attribute_source_payerorbeneficiary')
550
+ ->getAllOptions(true),
551
+
552
+ )
553
+ )
554
+ )
555
+ );
556
+ $this->getMassactionBlock()->addItem(
557
+ 'is_onetime_customer',
558
+ array(
559
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Is One time customer'),
560
+ 'url' => $this->getUrl('*/*/massIsOnetimeCustomer', array('_current'=>true)),
561
+ 'additional' => array(
562
+ 'flag_is_onetime_customer' => array(
563
+ 'name' => 'flag_is_onetime_customer',
564
+ 'type' => 'select',
565
+ 'class' => 'required-entry',
566
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is One time customer'),
567
+ 'values' => array(
568
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
569
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
570
+ )
571
+
572
+ )
573
+ )
574
+ )
575
+ );
576
+ $this->getMassactionBlock()->addItem(
577
+ 'is_default',
578
+ array(
579
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Change Is default'),
580
+ 'url' => $this->getUrl('*/*/massIsDefault', array('_current'=>true)),
581
+ 'additional' => array(
582
+ 'flag_is_default' => array(
583
+ 'name' => 'flag_is_default',
584
+ 'type' => 'select',
585
+ 'class' => 'required-entry',
586
+ 'label' => Mage::helper('sirateck_lemonway4ec')->__('Is default'),
587
+ 'values' => array(
588
+ '1' => Mage::helper('sirateck_lemonway4ec')->__('Yes'),
589
+ '0' => Mage::helper('sirateck_lemonway4ec')->__('No'),
590
+ )
591
+
592
+ )
593
+ )
594
+ )
595
+ );
596
+ return $this;
597
+ }
598
+
599
+ /**
600
+ * get the row url
601
+ *
602
+ * @access public
603
+ * @param Sirateck_Lemonway4ec_Model_Wallet
604
+ * @return string
605
+ * @author Kassim Belghait kassim@sirateck.com
606
+ */
607
+ public function getRowUrl($row)
608
+ {
609
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
610
+ }
611
+
612
+ /**
613
+ * get the grid url
614
+ *
615
+ * @access public
616
+ * @return string
617
+ * @author Kassim Belghait kassim@sirateck.com
618
+ */
619
+ public function getGridUrl()
620
+ {
621
+ return $this->getUrl('*/*/grid', array('_current'=>true));
622
+ }
623
+
624
+ /**
625
+ * after collection load
626
+ *
627
+ * @access protected
628
+ * @return Sirateck_Lemonway4ec_Block_Adminhtml_Wallet_Grid
629
+ * @author Kassim Belghait kassim@sirateck.com
630
+ */
631
+ protected function _afterLoadCollection()
632
+ {
633
+ $this->getCollection()->walk('afterLoad');
634
+ parent::_afterLoadCollection();
635
+ }
636
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Form/Webkit.php ADDED
@@ -0,0 +1,97 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Block for select payment method FORM
20
+ *
21
+ * @author Kassim Belghait <kassim@sirateck.com>
22
+ */
23
+ class Sirateck_Lemonway4ec_Block_Form_Webkit extends Mage_Payment_Block_Form
24
+ {
25
+
26
+ protected function _construct()
27
+ {
28
+ parent::_construct();
29
+ $this->setTemplate('lemonway4ec/form/webkit.phtml');
30
+ }
31
+
32
+ /**
33
+ *
34
+ * @return Mage_Checkout_Model_Session
35
+ */
36
+ public function getCheckout()
37
+ {
38
+ return Mage::getSingleton('checkout/session');
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @return Mage_Sales_Model_Quote
44
+ */
45
+ public function getQuote()
46
+ {
47
+ return $this->getCheckout()->getQuote();
48
+ }
49
+
50
+ /**
51
+ * @return Mage_Customer_Model_Customer
52
+ */
53
+ public function getCustomer(){
54
+ return Mage::getSingleton('customer/session')->getCustomer();
55
+ }
56
+
57
+ public function oneClicAllowed()
58
+ {
59
+ $checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
60
+
61
+ if($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST || !$this->getMethod()->getConfigData('allow_oneclic'))
62
+ return false;
63
+
64
+ return true;
65
+
66
+ }
67
+
68
+ public function customerHasCardId()
69
+ {
70
+ return $this->getCardId() != "";
71
+ }
72
+
73
+ public function getCardId()
74
+ {
75
+ return $this->getCustomer()->getLwCardId();
76
+ }
77
+
78
+ public function getCardNum(){
79
+ return $this->getCustomer()->getLwCardNum();
80
+ }
81
+
82
+ public function customerHasCardNum()
83
+ {
84
+ return $this->getCardNum() != "";
85
+ }
86
+
87
+ public function getCardType(){
88
+ return $this->getCustomer()->getLwCardType();
89
+ }
90
+
91
+ public function getCardExp(){
92
+ return $this->getCustomer()->getLwCardExp();
93
+ }
94
+
95
+
96
+
97
+ }
app/code/community/Sirateck/Lemonway4ec/Block/Info/Webkit.php ADDED
@@ -0,0 +1,52 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Block INFO
20
+ *
21
+ * @author Kassim Belghait <kassim@sirateck.com>
22
+ */
23
+ class Sirateck_Lemonway4ec_Block_Info_Webkit extends Mage_Payment_Block_Info
24
+ {
25
+
26
+
27
+ protected function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->setTemplate('lemonway4ec/info/webkit.phtml');
31
+ }
32
+
33
+
34
+ /**
35
+ *
36
+ * @return Mage_Checkout_Model_Session
37
+ */
38
+ public function getCheckout()
39
+ {
40
+ return Mage::getSingleton('checkout/session');
41
+ }
42
+
43
+ /**
44
+ *
45
+ * @return Mage_Sales_Model_Quote
46
+ */
47
+ public function getQuote()
48
+ {
49
+ return $this->getCheckout()->getQuote();
50
+ }
51
+
52
+ }
app/code/community/Sirateck/Lemonway4ec/Controller/Adminhtml/Lemonway.php ADDED
@@ -0,0 +1,60 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * module base admin controller
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Controller_Adminhtml_Lemonway extends Mage_Adminhtml_Controller_Action
25
+ {
26
+ /**
27
+ * upload file and get the uploaded name
28
+ *
29
+ * @access public
30
+ * @param string $input
31
+ * @param string $destinationFolder
32
+ * @param array $data
33
+ * @return string
34
+ * @author Kassim Belghait kassim@sirateck.com
35
+ */
36
+ protected function _uploadAndGetName($input, $destinationFolder, $data)
37
+ {
38
+ try {
39
+ if (isset($data[$input]['delete'])) {
40
+ return '';
41
+ } else {
42
+ $uploader = new Varien_File_Uploader($input);
43
+ $uploader->setAllowRenameFiles(true);
44
+ $uploader->setFilesDispersion(true);
45
+ $uploader->setAllowCreateFolders(true);
46
+ $result = $uploader->save($destinationFolder);
47
+ return $result['file'];
48
+ }
49
+ } catch (Exception $e) {
50
+ if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY) {
51
+ throw $e;
52
+ } else {
53
+ if (isset($data[$input]['value'])) {
54
+ return $data[$input]['value'];
55
+ }
56
+ }
57
+ }
58
+ return '';
59
+ }
60
+ }
app/code/community/Sirateck/Lemonway4ec/Helper/Data.php ADDED
@@ -0,0 +1,86 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Lemonway default helper
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Helper_Data extends Mage_Core_Helper_Abstract
25
+ {
26
+ /**
27
+ * convert array to options
28
+ *
29
+ * @access public
30
+ * @param $options
31
+ * @return array
32
+ * @author Kassim Belghait kassim@sirateck.com
33
+ */
34
+ public function convertOptions($options)
35
+ {
36
+ $converted = array();
37
+ foreach ($options as $option) {
38
+ if (isset($option['value']) && !is_array($option['value']) &&
39
+ isset($option['label']) && !is_array($option['label'])) {
40
+ $converted[$option['value']] = $option['label'];
41
+ }
42
+ }
43
+ return $converted;
44
+ }
45
+
46
+ public function reAddToCart($incrementId) {
47
+
48
+ $cart = Mage::getSingleton('checkout/cart');
49
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
50
+
51
+ if ($order->getId()) {
52
+ $items = $order->getItemsCollection();
53
+ foreach ($items as $item) {
54
+ try {
55
+ $cart->addOrderItem($item);
56
+ } catch (Mage_Core_Exception $e) {
57
+ if (Mage::getSingleton('checkout/session')->getUseNotice(true)) {
58
+ Mage::getSingleton('checkout/session')->addNotice($e->getMessage());
59
+ } else {
60
+ Mage::getSingleton('checkout/session')->addError($e->getMessage());
61
+ }
62
+ } catch (Exception $e) {
63
+ Mage::getSingleton('checkout/session')->addException($e, Mage::helper('checkout')->__('Cannot add the item to shopping cart.')
64
+ );
65
+ }
66
+ }
67
+ }
68
+
69
+ $cart->save();
70
+ }
71
+
72
+ /**
73
+ * @return Sirateck_Lemonway4ec_Model_Config
74
+ */
75
+ public function getConfig(){
76
+ return Mage::getSingleton('sirateck_lemonway4ec/config');
77
+ }
78
+
79
+ /**
80
+ *
81
+ * @return boolean
82
+ */
83
+ public function oneStepCheckoutInstalled(){
84
+ return Mage::getStoreConfigFlag('onestepcheckout/general/enabled');
85
+ }
86
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Adminhtml/Search/Wallet.php ADDED
@@ -0,0 +1,60 @@
1
+ <?php
2
+ /**
3
+ * Sirateck_Lemonway4ec extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Sirateck
13
+ * @package Sirateck_Lemonway4ec
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Admin search model
19
+ *
20
+ * @category Sirateck
21
+ * @package Sirateck_Lemonway4ec
22
+ * @author Kassim Belghait kassim@sirateck.com
23
+ */
24
+ class Sirateck_Lemonway4ec_Model_Adminhtml_Search_Wallet extends Varien_Object
25
+ {
26
+ /**
27
+ * Load search results
28
+ *
29
+ * @access public
30
+ * @return Sirateck_Lemonway4ec_Model_Adminhtml_Search_Wallet
31
+ * @author Kassim Belghait kassim@sirateck.com
32
+ */
33
+ public function load()
34
+ {
35
+ $arr = array();
36
+ if (!$this->hasStart() || !$this->hasLimit() || !$this->hasQuery()) {
37
+ $this->setResults($arr);
38
+ return $this;
39
+ }
40
+ $collection = Mage::getResourceModel('sirateck_lemonway4ec/wallet_collection')
41
+ ->addFieldToFilter('wallet_id', array('like' => $this->getQuery().'%'))
42
+ ->setCurPage($this->getStart())
43
+ ->setPageSize($this->getLimit())
44
+ ->load();
45
+ foreach ($collection->getItems() as $wallet) {
46
+ $arr[] = array(
47
+ 'id' => 'wallet/1/'.$wallet->getId(),
48
+ 'type' => Mage::helper('sirateck_lemonway4ec')->__('Wallet'),
49
+ 'name' => $wallet->getWalletId(),
50
+ 'description' => $wallet->getWalletId(),
51
+ 'url' => Mage::helper('adminhtml')->getUrl(
52
+ '*/lemonway_wallet/edit',
53
+ array('id'=>$wallet->getId())
54
+ ),
55
+ );
56
+ }
57
+ $this->setResults($arr);
58
+ return $this;
59
+ }
60
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/Iban.php ADDED
@@ -0,0 +1,26 @@
1
+ <?php
2
+ /**
3
+ * @method int getIbanId() ID as defined by merchant
4
+ * @method int getStatus() {0,5,6,8,9}
5
+ * @method string getIban() iban number
6
+ * @method string getSwift() BIC or swift code
7
+ */
8
+ class Sirateck_Lemonway4ec_Model_Apikit_Apimodels_Iban extends Varien_Object{
9
+
10
+ function __construct($nodeArr=array()) {
11
+ if(count($nodeArr))
12
+ {
13
+ $node = $nodeArr[0];
14
+ $this->_data['iban_id'] = $node->ID;
15
+ if (isset($node->STATUS))
16
+ $this->_data['status'] = $node->STATUS;
17
+ if (isset($node->S))
18
+ $this->_data['status'] = $node->S;
19
+ if (isset($node->DATA))
20
+ $this->_data['iban'] = $node->DATA;
21
+ if (isset($node->SWIFT))
22
+ $this->_data['swift'] = $node->SWIFT;
23
+ }
24
+ }
25
+
26
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/KycDoc.php ADDED
@@ -0,0 +1,36 @@
1
+ <?php
2
+
3
+ class Sirateck_Lemonway4ec_Model_Apikit_Apimodels_KycDoc {
4
+
5
+ /**
6
+ * ID as defined by Lemon Way
7
+ * @var string
8
+ */
9
+ public $ID;
10
+
11
+ /**
12
+ * STATUS {1,2,3,4,5}
13
+ * @var string
14
+ */
15
+ public $STATUS;
16
+
17
+ /**
18
+ * TYPE {0,1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20}
19
+ * @var string
20
+ */
21
+ public $TYPE;
22
+
23
+ /**
24
+ * VD validity date
25
+ * @var string
26
+ */
27
+ public $VD;
28
+
29
+ function __construct($nodeArr) {
30
+ $node = $nodeArr[0];
31
+ $this->ID = $node->ID;
32
+ $this->STATUS = $node->S;
33
+ $this->TYPE = $node->TYPE;
34
+ $this->VD = $node->VD;
35
+ }
36
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/LwError.php ADDED
@@ -0,0 +1,19 @@
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * @method string getMessage()
6
+ * @method int getCode()
7
+ *
8
+ */
9
+ class Sirateck_Lemonway4ec_Model_Apikit_Apimodels_LwError Extends Varien_Object{
10
+
11
+
12
+ function __construct($arr = array()) {
13
+ if(count($arr) > 0)
14
+ {
15
+ $this->_data['code'] = $arr[0];
16
+ $this->_data['message'] = $arr[1];
17
+ }
18
+ }
19
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/LwModel.php ADDED
@@ -0,0 +1,5 @@
1
+ <?php
2
+
3
+ class Sirateck_Lemonway4ec_Model_Apikit_Apimodels_LwModel {
4
+
5
+ }
app/code/community/Sirateck/Lemonway4ec/Model/Apikit/Apimodels/Operation.php ADDED
@@ -0,0 +1,93 @@
1
+ <?php
2
+ /**
3
+ * @method string getType() {p2p, moneyin, moneyout}
4
+ * @method int getHpayId() id lemonway
5
+ * @method string getLabelCode() IBAN or Card number
6
+ * @method string getSenderWallet() sender wallet id
7
+ * @method string getReceiverWallet() receiver wallet id
8
+ * @method float getDebitAmount() amount debited from sender wallet
9
+ * @method float getCreditAmount() amount credited to receiver wallet or external bank account
10
+ * @method float getFees() fees automatically sent to merchant wallet
11
+ * @method string getMessage() comment
12
+ * @method int getStatus() {0,3,4}
13
+ * @method string getErrorMessage() internal error message with codes
14
+ * @method EXTRA getExtra() Detailed information regarding Card payment
15