Version Notes
v1.3.0:
Adding localization support
Download this release
Release Info
Developer | Fer Buy |
Extension | Ferratum_Ferbuy |
Version | 1.3.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.3.0
- app/code/local/Ferratum/Ferbuy/Block/Redirect.php +43 -0
- app/code/local/Ferratum/Ferbuy/Helper/Data.php +266 -0
- app/code/local/Ferratum/Ferbuy/Model/Adminhtml/System/Config/Source/Modes.php +33 -0
- app/code/local/Ferratum/Ferbuy/Model/Base.php +321 -0
- app/code/local/Ferratum/Ferbuy/Model/Ferbuy.php +214 -0
- app/code/local/Ferratum/Ferbuy/controllers/PaymentController.php +146 -0
- app/code/local/Ferratum/Ferbuy/etc/adminhtml.xml +40 -0
- app/code/local/Ferratum/Ferbuy/etc/config.xml +137 -0
- app/code/local/Ferratum/Ferbuy/etc/system.xml +229 -0
- app/design/adminhtml/default/default/layout/ferbuy.xml +26 -0
- app/design/frontend/base/default/template/ferbuy/redirect.phtml +3 -0
- app/etc/modules/Ferratum_Ferbuy.xml +30 -0
- app/locale/en_US/Ferratum_Ferbuy.csv +41 -0
- package.xml +11 -11
- skin/adminhtml/default/default/ferbuy.css +44 -0
- skin/adminhtml/default/default/images/ferbuy.png +0 -0
app/code/local/Ferratum/Ferbuy/Block/Redirect.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_Block_Redirect extends Mage_Core_Block_Template
|
20 |
+
{
|
21 |
+
protected function _construct()
|
22 |
+
{
|
23 |
+
$this->setTemplate('ferbuy/redirect.phtml');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getForm()
|
27 |
+
{
|
28 |
+
$model = Mage::getModel('ferbuy/ferbuy');
|
29 |
+
|
30 |
+
$form = new Varien_Data_Form();
|
31 |
+
$form->setAction($model->getGatewayUrl())
|
32 |
+
->setId('ferbuy_checkout')
|
33 |
+
->setName('ferbuy_checkout')
|
34 |
+
->setMethod('POST')
|
35 |
+
->setUseContainer(true);
|
36 |
+
|
37 |
+
foreach ($model->getCheckoutFormFields() as $field => $value) {
|
38 |
+
$form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
|
39 |
+
}
|
40 |
+
|
41 |
+
return $form->getHtml();
|
42 |
+
}
|
43 |
+
}
|
app/code/local/Ferratum/Ferbuy/Helper/Data.php
ADDED
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_Helper_Data extends Mage_Core_Helper_Abstract
|
20 |
+
{
|
21 |
+
const XML_PATH_LIVE_MODE = 'ferbuy/settings/live_mode';
|
22 |
+
const XML_PATH_SITE_ID = 'ferbuy/settings/site_id';
|
23 |
+
const XML_PATH_HASH_KEY = 'ferbuy/settings/hash_key';
|
24 |
+
const XML_PATH_AUTOCREATE_INVOICE = 'ferbuy/settings/autocreate_invoice';
|
25 |
+
const XML_PATH_MAIL_INVOICE = 'ferbuy/settings/mail_invoice';
|
26 |
+
const XML_PATH_INVOICING_FAILED = 'ferbuy/settings/invoicing_failed';
|
27 |
+
const XML_PATH_NOTIFICATION_EMAIL = 'ferbuy/settings/notification_email';
|
28 |
+
const XML_PATH_INITIALIZED_STATUS = 'ferbuy/settings/initialized_status';
|
29 |
+
const XML_PATH_COMPLETE_STATUS = 'ferbuy/settings/complete_status';
|
30 |
+
const XML_PATH_FAILED_STATUS = 'ferbuy/settings/failed_status';
|
31 |
+
const XML_PATH_DEBUG = 'ferbuy/settings/debug';
|
32 |
+
|
33 |
+
const XML_PATH_ACTIVE = 'ferbuy/ferbuy/active';
|
34 |
+
const XML_PATH_GATEWAY = 'ferbuy/ferbuy/gateway';
|
35 |
+
const XML_PATH_TITLE = 'ferbuy/ferbuy/title';
|
36 |
+
const XML_PATH_MIN_ORDER_TOTAL = 'ferbuy/ferbuy/min_order_total';
|
37 |
+
const XML_PATH_MAX_ORDER_TOTAL = 'ferbuy/ferbuy/max_order_total';
|
38 |
+
const XML_PATH_ALLOWSPECIFIC = 'ferbuy/ferbuy/allowspecific';
|
39 |
+
const XML_PATH_SPECIFICCOUNTRY = 'ferbuy/ferbuy/specificcountry';
|
40 |
+
const XML_PATH_SORT_ORDER = 'ferbuy/ferbuy/sort_order';
|
41 |
+
|
42 |
+
protected $_logFileName = "ferbuy.log";
|
43 |
+
|
44 |
+
/**
|
45 |
+
* getLiveMode
|
46 |
+
*
|
47 |
+
* @return int
|
48 |
+
*/
|
49 |
+
public function getLiveMode()
|
50 |
+
{
|
51 |
+
return Mage::getStoreConfig(self::XML_PATH_LIVE_MODE);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* getSiteId
|
56 |
+
*
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getSiteId()
|
60 |
+
{
|
61 |
+
return Mage::getStoreConfig(self::XML_PATH_SITE_ID);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* getHashKey
|
66 |
+
*
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function getHashKey()
|
70 |
+
{
|
71 |
+
return Mage::getStoreConfig(self::XML_PATH_HASH_KEY);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* getAutocreateInvoice
|
76 |
+
*
|
77 |
+
* @return int
|
78 |
+
*/
|
79 |
+
public function getAutocreateInvoice()
|
80 |
+
{
|
81 |
+
return Mage::getStoreConfig(self::XML_PATH_AUTOCREATE_INVOICE);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* getEmailInvoice
|
86 |
+
*
|
87 |
+
* @return int
|
88 |
+
*/
|
89 |
+
public function getEmailInvoice()
|
90 |
+
{
|
91 |
+
return Mage::getStoreConfig(self::XML_PATH_MAIL_INVOICE);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* getInvoicingFailed
|
96 |
+
*
|
97 |
+
* @return int
|
98 |
+
*/
|
99 |
+
public function getInvoicingFailed()
|
100 |
+
{
|
101 |
+
return Mage::getStoreConfig(self::XML_PATH_INVOICING_FAILED);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* getNotificationEmail
|
106 |
+
*
|
107 |
+
* @return int
|
108 |
+
*/
|
109 |
+
public function getNotificationEmail()
|
110 |
+
{
|
111 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFICATION_EMAIL);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* getInitializedStatus
|
116 |
+
*
|
117 |
+
* @return int
|
118 |
+
*/
|
119 |
+
public function getInitializedStatus()
|
120 |
+
{
|
121 |
+
return Mage::getStoreConfig(self::XML_PATH_INITIALIZED_STATUS);
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* getCompleteStatus
|
126 |
+
*
|
127 |
+
* @return int
|
128 |
+
*/
|
129 |
+
public function getCompleteStatus()
|
130 |
+
{
|
131 |
+
return Mage::getStoreConfig(self::XML_PATH_COMPLETE_STATUS);
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* getFailedStatus
|
136 |
+
*
|
137 |
+
* @return int
|
138 |
+
*/
|
139 |
+
public function getFailedStatus()
|
140 |
+
{
|
141 |
+
return Mage::getStoreConfig(self::XML_PATH_FAILED_STATUS);
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* getIsDebug
|
146 |
+
*
|
147 |
+
* @return int
|
148 |
+
*/
|
149 |
+
public function getIsDebug()
|
150 |
+
{
|
151 |
+
return Mage::getStoreConfig(self::XML_PATH_DEBUG);
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* getActive
|
156 |
+
*
|
157 |
+
* @return int
|
158 |
+
*/
|
159 |
+
public function getActive()
|
160 |
+
{
|
161 |
+
return Mage::getStoreConfig(self::XML_PATH_ACTIVE);
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* getTitle
|
166 |
+
*
|
167 |
+
* @return string
|
168 |
+
*/
|
169 |
+
public function getTitle()
|
170 |
+
{
|
171 |
+
return Mage::getStoreConfig(self::XML_PATH_TITLE);
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* getGateway
|
176 |
+
*
|
177 |
+
* @return string
|
178 |
+
*/
|
179 |
+
public function getGateway()
|
180 |
+
{
|
181 |
+
return Mage::getStoreConfig(self::XML_PATH_GATEWAY);
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* getMinOrderTotal
|
186 |
+
*
|
187 |
+
* @return string
|
188 |
+
*/
|
189 |
+
public function getMinOrderTotal()
|
190 |
+
{
|
191 |
+
return Mage::getStoreConfig(self::XML_PATH_MIN_ORDER_TOTAL);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* getMaxOrderTotal
|
196 |
+
*
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
public function getMaxOrderTotal()
|
200 |
+
{
|
201 |
+
return Mage::getStoreConfig(self::XML_PATH_MAX_ORDER_TOTAL);
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* getAllowspecific
|
206 |
+
*
|
207 |
+
* @return string
|
208 |
+
*/
|
209 |
+
public function getAllowspecific()
|
210 |
+
{
|
211 |
+
return Mage::getStoreConfig(self::XML_PATH_ALLOWSPECIFIC);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* getSpecificcountry
|
216 |
+
*
|
217 |
+
* @return array
|
218 |
+
*/
|
219 |
+
public function getSpecificcountry()
|
220 |
+
{
|
221 |
+
return Mage::getStoreConfig(self::XML_PATH_SPECIFICCOUNTRY);
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* getSortOrder
|
226 |
+
*
|
227 |
+
* @return string
|
228 |
+
*/
|
229 |
+
public function getSortOrder()
|
230 |
+
{
|
231 |
+
return Mage::getStoreConfig(self::XML_PATH_SORT_ORDER);
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* If the live mode is enabled
|
236 |
+
*
|
237 |
+
* @return bool
|
238 |
+
*/
|
239 |
+
public function isLive()
|
240 |
+
{
|
241 |
+
return ($this->getLiveMode() == 'live');
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Log data into the logfile
|
246 |
+
*
|
247 |
+
* @param string $msg
|
248 |
+
* @return void
|
249 |
+
*/
|
250 |
+
public function log($msg)
|
251 |
+
{
|
252 |
+
if ($this->getIsDebug()) {
|
253 |
+
Mage::log($msg, null, $this->_logFileName);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Get plugin version to send to gateway (debugging purposes)
|
259 |
+
*
|
260 |
+
* @return string
|
261 |
+
*/
|
262 |
+
public function getPluginVersion()
|
263 |
+
{
|
264 |
+
return (string) Mage::getConfig()->getNode('modules/Ferratum_Ferbuy/version');
|
265 |
+
}
|
266 |
+
}
|
app/code/local/Ferratum/Ferbuy/Model/Adminhtml/System/Config/Source/Modes.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_Model_Adminhtml_System_Config_Source_Modes
|
20 |
+
{
|
21 |
+
public function toOptionArray() {
|
22 |
+
return array(
|
23 |
+
array(
|
24 |
+
"value" => "demo",
|
25 |
+
"label" => Mage::helper("ferbuy")->__("Demo Mode")
|
26 |
+
),
|
27 |
+
array(
|
28 |
+
"value" => "live",
|
29 |
+
"label" => Mage::helper("ferbuy")->__("Live Mode")
|
30 |
+
),
|
31 |
+
);
|
32 |
+
}
|
33 |
+
}
|
app/code/local/Ferratum/Ferbuy/Model/Base.php
ADDED
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_Model_Base extends Varien_Object
|
20 |
+
{
|
21 |
+
protected $_callback;
|
22 |
+
protected $_isLocked = false;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Set callback data
|
26 |
+
*
|
27 |
+
* @param array $data
|
28 |
+
* @return Ferratum_Ferbuy_Model_Base
|
29 |
+
*/
|
30 |
+
public function setCallbackData($data)
|
31 |
+
{
|
32 |
+
$this->_callback = $data;
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get callback data
|
38 |
+
*
|
39 |
+
* @param string $field
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
public function getCallbackData($field = null)
|
43 |
+
{
|
44 |
+
if ($field === null) {
|
45 |
+
return $this->_callback;
|
46 |
+
} else {
|
47 |
+
return (in_array($field, $this->_callback)) ? $this->_callback[$field] : '';
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* If the debug mode is enabled
|
53 |
+
*
|
54 |
+
* @return bool
|
55 |
+
*/
|
56 |
+
public function isDebug()
|
57 |
+
{
|
58 |
+
return Mage::helper('ferbuy')->getIsDebug();
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Create lock file
|
63 |
+
*
|
64 |
+
* @return Ferratum_Ferbuy_Model_Base
|
65 |
+
*/
|
66 |
+
public function lock()
|
67 |
+
{
|
68 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
69 |
+
$lockFilename = $varDir . DS . $this->getCallbackData('reference') . '.lock';
|
70 |
+
$fp = @fopen($lockFilename, 'x');
|
71 |
+
|
72 |
+
if ($fp) {
|
73 |
+
$this->_isLocked = true;
|
74 |
+
$pid = getmypid();
|
75 |
+
$now = date('Y-m-d H:i:s');
|
76 |
+
fwrite($fp, "Locked by $pid at $now\n");
|
77 |
+
}
|
78 |
+
|
79 |
+
return $this;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Unlock file
|
84 |
+
*
|
85 |
+
* @return Ferratum_Ferbuy_Model_Base
|
86 |
+
*/
|
87 |
+
public function unlock()
|
88 |
+
{
|
89 |
+
$this->_isLocked = false;
|
90 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
91 |
+
$lockFilename = $varDir . DS . $this->getCallbackData('reference') . '.lock';
|
92 |
+
unlink($lockFilename);
|
93 |
+
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Create and mail invoice
|
99 |
+
*
|
100 |
+
* @param Mage_Sales_Model_Order $order
|
101 |
+
* @return boolean
|
102 |
+
*/
|
103 |
+
protected function createInvoice(Mage_Sales_Model_Order $order)
|
104 |
+
{
|
105 |
+
if ($order->canInvoice() && !$order->hasInvoices()) {
|
106 |
+
$invoice = $order->prepareInvoice();
|
107 |
+
$invoice->register();
|
108 |
+
if ($invoice->canCapture()) {
|
109 |
+
$invoice->capture();
|
110 |
+
}
|
111 |
+
$invoice->save();
|
112 |
+
|
113 |
+
Mage::getModel("core/resource_transaction")
|
114 |
+
->addObject($invoice)
|
115 |
+
->addObject($invoice->getOrder())
|
116 |
+
->save();
|
117 |
+
|
118 |
+
$mail_invoice = Mage::helper('ferbuy')->getEmailInvoice();
|
119 |
+
if ($mail_invoice) {
|
120 |
+
$invoice->setEmailSent(true);
|
121 |
+
$invoice->save();
|
122 |
+
$invoice->sendEmail();
|
123 |
+
}
|
124 |
+
|
125 |
+
$statusMessage = $mail_invoice ? "Invoice # %s created and send to customer." : "Invoice # %s created.";
|
126 |
+
$order->addStatusToHistory(
|
127 |
+
$order->getStatus(),
|
128 |
+
Mage::helper("ferbuy")->__($statusMessage, $invoice->getIncrementId(),
|
129 |
+
$mail_invoice)
|
130 |
+
);
|
131 |
+
|
132 |
+
return true;
|
133 |
+
}
|
134 |
+
|
135 |
+
return false;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Notify shop owners on failed invoice creation
|
140 |
+
*
|
141 |
+
* @param Mage_Sales_Model_Order $order
|
142 |
+
* @return void
|
143 |
+
*/
|
144 |
+
protected function onFailedInvoicing($order) {
|
145 |
+
$storeId = $order->getStore()->getId();
|
146 |
+
|
147 |
+
$ident = Mage::helper('ferbuy')->getNotificationEmail();
|
148 |
+
$sender_email = Mage::getStoreConfig('trans_email/ident_general/email', $storeId);
|
149 |
+
$sender_name = Mage::getStoreConfig('trans_email/ident_general/name', $storeId);
|
150 |
+
$recipient_email = Mage::getStoreConfig('trans_email/ident_'.$ident.'/email', $storeId);
|
151 |
+
$recipient_name = Mage::getStoreConfig('trans_email/ident_'.$ident.'/name', $storeId);
|
152 |
+
|
153 |
+
$mail = new Zend_Mail();
|
154 |
+
$mail->setFrom($sender_email, $sender_name);
|
155 |
+
$mail->addTo($recipient_email, $recipient_name);
|
156 |
+
$mail->setSubject(Mage::helper("ferbuy")->__('Automatic invoice creation failed'));
|
157 |
+
$mail->setBodyText(Mage::helper("ferbuy")->__('Magento was unable to create an invoice for Order # %s after a successful payment via FerBuy (transaction # %s)', $order->getIncrementId(), $this->getCallbackData('transaction_id')));
|
158 |
+
$mail->setBodyHtml(Mage::helper("ferbuy")->__('Magento was unable to create an invoice for <b>Order # %s</b> after a successful payment via FerBuy <b>(transaction # %s)</b>', $order->getIncrementId(), $this->getCallbackData('transaction_id')));
|
159 |
+
$mail->send();
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Returns true if the amounts match
|
164 |
+
*
|
165 |
+
* @param Mage_Sales_Model_Order $order
|
166 |
+
* @return boolean
|
167 |
+
*/
|
168 |
+
protected function validateAmount(Mage_Sales_Model_Order $order)
|
169 |
+
{
|
170 |
+
$amountInCents = (int) sprintf('%.0f', $order->getGrandTotal()*100);
|
171 |
+
$callbackAmount = (int) $this->getCallbackData('amount');
|
172 |
+
|
173 |
+
if (($amountInCents != $callbackAmount) && (abs($callbackAmount - $amountInCents) > 1)) {
|
174 |
+
Mage::helper('ferbuy')->log("OrderID: {$order->getId()} do not match amounts. Sent $amountInCents, Received: $callbackAmount");
|
175 |
+
$statusMessage = Mage::helper("ferbuy")->__("Hacker attempt: Order total amount does not match FerBuy's gross total amount!");
|
176 |
+
$order->addStatusToHistory($order->getStatus(), $statusMessage);
|
177 |
+
$order->save();
|
178 |
+
return false;
|
179 |
+
}
|
180 |
+
|
181 |
+
return true;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Process callback for all transactions
|
186 |
+
*
|
187 |
+
* @return void
|
188 |
+
*/
|
189 |
+
public function processCallback()
|
190 |
+
{
|
191 |
+
$id = $this->getCallbackData('reference');
|
192 |
+
$order = Mage::getModel('sales/order');
|
193 |
+
$order->loadByIncrementId($id);
|
194 |
+
|
195 |
+
// Log callback data
|
196 |
+
Mage::helper('ferbuy')->log('Receiving callback data:');
|
197 |
+
Mage::helper('ferbuy')->log($this->getCallbackData());
|
198 |
+
|
199 |
+
// Validate amount
|
200 |
+
if (!$this->validateAmount($order)) {
|
201 |
+
Mage::helper('ferbuy')->log('Amount validation failed!');
|
202 |
+
exit();
|
203 |
+
}
|
204 |
+
|
205 |
+
$statusComplete = Mage::helper('ferbuy')->getCompleteStatus();
|
206 |
+
$statusFailed = Mage::helper('ferbuy')->getFailedStatus();
|
207 |
+
$statusFraud = $this->getConfigData("fraud_status");
|
208 |
+
$autocreateInvoice = Mage::helper('ferbuy')->getAutocreateInvoice();
|
209 |
+
$evInvoicingFailed = $this->getConfigData("event_invoicing_failed");
|
210 |
+
|
211 |
+
$complete = false;
|
212 |
+
$canceled = false;
|
213 |
+
$newState = null;
|
214 |
+
$newStatus = true;
|
215 |
+
$statusMessage = '';
|
216 |
+
|
217 |
+
switch ($this->getCallbackData('status')) {
|
218 |
+
case "200":
|
219 |
+
$complete = true;
|
220 |
+
$newState = Mage_Sales_Model_Order::STATE_PROCESSING;
|
221 |
+
$newStatus = $statusComplete;
|
222 |
+
$statusMessage = Mage::helper("ferbuy")->__("Transaction complete.");
|
223 |
+
break;
|
224 |
+
case "400":
|
225 |
+
$canceled = true;
|
226 |
+
$newState = Mage_Sales_Model_Order::STATE_CANCELED;
|
227 |
+
$newStatus = $statusFailed;
|
228 |
+
$statusMessage = Mage::helper("ferbuy")->__("Transaction failed.");
|
229 |
+
break;
|
230 |
+
case "408":
|
231 |
+
$canceled = true;
|
232 |
+
$newState = Mage_Sales_Model_Order::STATE_CANCELED;
|
233 |
+
$newStatus = $statusFraud;
|
234 |
+
$statusMessage = Mage::helper("ferbuy")->__("Transaction timed out.");
|
235 |
+
break;
|
236 |
+
case "410":
|
237 |
+
$canceled = true;
|
238 |
+
$newState = Mage_Sales_Model_Order::STATE_CANCELED;
|
239 |
+
$newStatus = $statusFailed;
|
240 |
+
$statusMessage = Mage::helper("ferbuy")->__("Transaction canceled by user.");
|
241 |
+
break;
|
242 |
+
}
|
243 |
+
|
244 |
+
// Update only certain states
|
245 |
+
$canUpdate = false;
|
246 |
+
$undoCancel = false;
|
247 |
+
if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW ||
|
248 |
+
$order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT ||
|
249 |
+
$order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING ||
|
250 |
+
$order->getState() == Mage_Sales_Model_Order::STATE_CANCELED) {
|
251 |
+
$canUpdate = true;
|
252 |
+
}
|
253 |
+
|
254 |
+
foreach ($order->getStatusHistoryCollection(true) as $_item) {
|
255 |
+
// Don't update order status if the payment is complete
|
256 |
+
if ($_item->getStatusLabel() == ucfirst($statusComplete)) {
|
257 |
+
$canUpdate = false;
|
258 |
+
// Uncancel an order if the payment is considered complete
|
259 |
+
} elseif (($_item->getStatusLabel() == ucfirst($statusFailed)) ||
|
260 |
+
($_item->getStatusLabel() == ucfirst($statusFraud))) {
|
261 |
+
$undoCancel = true;
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
// Lock
|
266 |
+
$this->lock();
|
267 |
+
|
268 |
+
// Uncancel order if necessary
|
269 |
+
if ($undoCancel) {
|
270 |
+
foreach($order->getAllItems() as $_item) {
|
271 |
+
if ($_item->getQtyCanceled() > 0) $_item->setQtyCanceled(0)->save();
|
272 |
+
if ($_item->getQtyInvoiced() > 0) $_item->setQtyInvoiced(0)->save();
|
273 |
+
}
|
274 |
+
|
275 |
+
$order->setBaseDiscountCanceled(0)
|
276 |
+
->setBaseShippingCanceled(0)
|
277 |
+
->setBaseSubtotalCanceled(0)
|
278 |
+
->setBaseTaxCanceled(0)
|
279 |
+
->setBaseTotalCanceled(0)
|
280 |
+
->setDiscountCanceled(0)
|
281 |
+
->setShippingCanceled(0)
|
282 |
+
->setSubtotalCanceled(0)
|
283 |
+
->setTaxCanceled(0)
|
284 |
+
->setTotalCanceled(0);
|
285 |
+
}
|
286 |
+
|
287 |
+
// Update the status if changed
|
288 |
+
if ($canUpdate && (($newState != $order->getState()) || ($newStatus != $order->getStatus()))) {
|
289 |
+
// Set order state and status
|
290 |
+
$order->setState($newState, $newStatus, $statusMessage);
|
291 |
+
Mage::helper('ferbuy')->log("Changing state to '$newState' with message '$statusMessage' for order ID: $id.");
|
292 |
+
|
293 |
+
// Send new order e-mail
|
294 |
+
if ($complete && !$canceled && !$order->getEmailSent()) {
|
295 |
+
$order->setEmailSent(true);
|
296 |
+
$order->sendNewOrderEmail();
|
297 |
+
}
|
298 |
+
|
299 |
+
// Save order status changes
|
300 |
+
$order->save();
|
301 |
+
|
302 |
+
// Create an invoice when the payment is completed
|
303 |
+
if ($complete && !$canceled && $autocreateInvoice) {
|
304 |
+
$invoiceCreated = $this->createInvoice($order);
|
305 |
+
if ($invoiceCreated) {
|
306 |
+
Mage::helper('ferbuy')->log("Creating invoice for order ID: $id.");
|
307 |
+
} else {
|
308 |
+
Mage::helper('ferbuy')->log("Unable to create invoice for order ID: $id.");
|
309 |
+
}
|
310 |
+
|
311 |
+
// Send notification
|
312 |
+
if (!$invoiceCreated && $evInvoicingFailed) {
|
313 |
+
$this->eventInvoicingFailed($order);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
// Unlock
|
319 |
+
$this->unlock();
|
320 |
+
}
|
321 |
+
}
|
app/code/local/Ferratum/Ferbuy/Model/Ferbuy.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_Model_Ferbuy extends Mage_Payment_Model_Method_Abstract
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Payment Method features
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
protected $_code = 'ferbuy';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* FerBuy settings
|
30 |
+
*
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
|
34 |
+
protected $_supportedCurrencies = array('SGD', 'PLN', 'CZK', 'EUR');
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Mage_Payment_Model settings
|
38 |
+
*
|
39 |
+
* @var bool
|
40 |
+
*/
|
41 |
+
protected $_isGateway = true;
|
42 |
+
protected $_canAuthorize = true;
|
43 |
+
protected $_canCapture = true;
|
44 |
+
protected $_canUseInternal = false;
|
45 |
+
protected $_canUseCheckout = true;
|
46 |
+
protected $_canUseForMultishipping = true;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Return Gateway Url
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getGatewayUrl()
|
54 |
+
{
|
55 |
+
$env = (Mage::helper('ferbuy')->getLiveMode()) ? 'live/' : 'demo/';
|
56 |
+
|
57 |
+
return Mage::helper('ferbuy')->getGateway() . $env;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Get checkout session namespace
|
62 |
+
*
|
63 |
+
* @return Mage_Checkout_Model_Session
|
64 |
+
*/
|
65 |
+
public function getCheckout()
|
66 |
+
{
|
67 |
+
return Mage::getSingleton('checkout/session');
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get current quote
|
72 |
+
*
|
73 |
+
* @return Mage_Sales_Model_Quote
|
74 |
+
*/
|
75 |
+
public function getQuote()
|
76 |
+
{
|
77 |
+
return $this->getCheckout()->getQuote();
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get current order
|
82 |
+
*
|
83 |
+
* @return Mage_Sales_Model_Order
|
84 |
+
*/
|
85 |
+
public function getOrder()
|
86 |
+
{
|
87 |
+
$order = Mage::getModel('sales/order');
|
88 |
+
$order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
|
89 |
+
return $order;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Magento will use this for payment redirection
|
94 |
+
*
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
public function getOrderPlaceRedirectUrl()
|
98 |
+
{
|
99 |
+
return Mage::getUrl('ferbuy/payment/redirect/', array('_secure' => true));
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Check method for processing with base currency
|
104 |
+
*
|
105 |
+
* @param string $currencyCode
|
106 |
+
* @return boolean
|
107 |
+
*/
|
108 |
+
public function canUseForCurrency($currencyCode)
|
109 |
+
{
|
110 |
+
return in_array(Mage::app()->getStore()->getCurrentCurrencyCode(), $this->_supportedCurrencies);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Change order status
|
115 |
+
*
|
116 |
+
* @param Mage_Sales_Model_Order $order
|
117 |
+
* @return void
|
118 |
+
*/
|
119 |
+
protected function initiateTransactionStatus($order)
|
120 |
+
{
|
121 |
+
// Change order status
|
122 |
+
$newState = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
123 |
+
$newStatus = Mage::helper('ferbuy')->getInitializedStatus();
|
124 |
+
$statusMessage = Mage::helper('ferbuy')->__('Transaction started, waiting for payment.');
|
125 |
+
$order->setState($newState, $newStatus, $statusMessage);
|
126 |
+
$order->save();
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Generates checkout form fields
|
131 |
+
*
|
132 |
+
* @return array
|
133 |
+
*/
|
134 |
+
public function getCheckoutFormFields()
|
135 |
+
{
|
136 |
+
$order = $this->getOrder();
|
137 |
+
$customer = $order->getBillingAddress();
|
138 |
+
|
139 |
+
//Shopping Cart
|
140 |
+
$items = array();
|
141 |
+
$subtotal = 0;
|
142 |
+
foreach ($order->getItemsCollection() as $item) {
|
143 |
+
if ($item->getQtyToShip() > 0) {
|
144 |
+
$items[] = array(
|
145 |
+
'Description' => $item->getSku() . ': ' . ($item->getDescription() ? $item->getDescription() : 'N/A'),
|
146 |
+
'Name' => $item->getName(),
|
147 |
+
'Price' => round($item->getPrice() * 100, 0),
|
148 |
+
'Quantity' => $item->getQtyToShip()
|
149 |
+
);
|
150 |
+
}
|
151 |
+
$subtotal+=round($item->getPrice() * 100, 0) * $item->getQtyToShip();
|
152 |
+
}
|
153 |
+
|
154 |
+
//shopping_cart
|
155 |
+
$shopping_cart = array();
|
156 |
+
$shopping_cart['tax'] = round($order->getTaxAmount()* 100,0) ;
|
157 |
+
$shopping_cart['discount'] = round($order->getDiscountAmount()* 100,0);
|
158 |
+
$shopping_cart['shipping'] = round($order->getShippingAmount()* 100,0);
|
159 |
+
$shopping_cart['items'] = $items;
|
160 |
+
$shopping_cart['subtotal'] = $subtotal;
|
161 |
+
$shopping_cart['total'] = round($order->getGrandTotal()* 100,0);
|
162 |
+
|
163 |
+
//Encode the shopping cart
|
164 |
+
if(function_exists('json_encode')){
|
165 |
+
$encodedShoppingCart=json_encode($shopping_cart);
|
166 |
+
}else{
|
167 |
+
$encodedShoppingCart=serialize($shopping_cart);
|
168 |
+
}
|
169 |
+
// Add initiate state
|
170 |
+
$this->initiateTransactionStatus($order);
|
171 |
+
|
172 |
+
$s_arr = array();
|
173 |
+
$s_arr['site_id'] = Mage::helper('ferbuy')->getSiteId();
|
174 |
+
$s_arr['reference'] = $order->getIncrementId();
|
175 |
+
$s_arr['amount'] = sprintf('%.0f', $order->getGrandTotal() * 100);
|
176 |
+
$s_arr['currency'] = $order->getOrderCurrencyCode();
|
177 |
+
$s_arr['first_name'] = $customer->getFirstname();
|
178 |
+
$s_arr['last_name'] = $customer->getLastname();
|
179 |
+
$s_arr['email'] = $order->getCustomerEmail();
|
180 |
+
$s_arr['address'] = $customer->getStreet(1);
|
181 |
+
$s_arr['address_line2'] = $customer->getStreet(2);
|
182 |
+
$s_arr['city'] = $customer->getCity();
|
183 |
+
$s_arr['country_iso'] = $customer->getCountry();
|
184 |
+
$s_arr['postal_code'] = $customer->getPostcode();
|
185 |
+
$s_arr['mobile_phone'] = $customer->getTelephone();
|
186 |
+
$s_arr['return_url_ok'] = Mage::getUrl('ferbuy/payment/success/', array('_secure' => true));
|
187 |
+
$s_arr['return_url_cancel'] = Mage::getUrl('ferbuy/payment/cancel/', array('_secure' => true));
|
188 |
+
$s_arr['shop_version'] = 'Magento '. Mage::getVersion();
|
189 |
+
$s_arr['plugin_name'] = 'Ferratum_Ferbuy';
|
190 |
+
$s_arr['plugin_version'] = Mage::helper('ferbuy')->getPluginVersion();
|
191 |
+
$s_arr['shopping_cart'] = $encodedShoppingCart;
|
192 |
+
//$s_arr['extra'] = $this->getCheckout()->getFerbuyQuoteId();
|
193 |
+
|
194 |
+
$env = ( Mage::helper('ferbuy')->isLive()) ? 'live' : 'demo';
|
195 |
+
$s_arr['checksum'] = sha1(join("&", array(
|
196 |
+
$env,
|
197 |
+
$s_arr['site_id'],
|
198 |
+
$s_arr['reference'],
|
199 |
+
$s_arr['currency'],
|
200 |
+
$s_arr['amount'],
|
201 |
+
$s_arr['first_name'],
|
202 |
+
$s_arr['last_name'],
|
203 |
+
Mage::helper('ferbuy')->getHashKey()
|
204 |
+
)));
|
205 |
+
|
206 |
+
// Logging
|
207 |
+
Mage::helper('ferbuy')->log('Initiating a new transaction');
|
208 |
+
Mage::helper('ferbuy')->log('Sending customer to FerBuy with values:');
|
209 |
+
Mage::helper('ferbuy')->log('URL = ' . $this->getGatewayUrl());
|
210 |
+
Mage::helper('ferbuy')->log($s_arr);
|
211 |
+
|
212 |
+
return $s_arr;
|
213 |
+
}
|
214 |
+
}
|
app/code/local/Ferratum/Ferbuy/controllers/PaymentController.php
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Ferbuy payment extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Mage
|
13 |
+
* @package Ferratum_Ferbuy
|
14 |
+
* @author FerBuy, <info@ferbuy.com>
|
15 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ferratum_Ferbuy_PaymentController extends Mage_Core_Controller_Front_Action
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Verify the callback
|
23 |
+
*
|
24 |
+
* @param array $data
|
25 |
+
* @return boolean
|
26 |
+
*/
|
27 |
+
protected function _validate($data)
|
28 |
+
{
|
29 |
+
$env = Mage::helper('ferbuy')->isLive() ? 'live' : 'demo';
|
30 |
+
|
31 |
+
$verify = join("&", array(
|
32 |
+
$env,
|
33 |
+
$data['reference'],
|
34 |
+
$data['transaction_id'],
|
35 |
+
$data['status'],
|
36 |
+
$data['currency'],
|
37 |
+
$data['amount'],
|
38 |
+
Mage::helper('ferbuy')->getHashKey()
|
39 |
+
));
|
40 |
+
|
41 |
+
if (sha1($verify) == $data['checksum']) {
|
42 |
+
return true;
|
43 |
+
}
|
44 |
+
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Reditect customer to the gateway using his prefered payment method
|
50 |
+
*/
|
51 |
+
public function redirectAction()
|
52 |
+
{
|
53 |
+
$session = Mage::getSingleton('checkout/session');
|
54 |
+
$session->setFerbuyQuoteId($session->getQuoteId());
|
55 |
+
|
56 |
+
$this->loadLayout();
|
57 |
+
$block = $this->getLayout()->createBlock(
|
58 |
+
'Ferratum_Ferbuy_Block_Redirect'
|
59 |
+
);
|
60 |
+
|
61 |
+
$this->getLayout()->getBlock('content')->append($block);
|
62 |
+
$this->renderLayout();
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* After a failed transaction a customer will be send here
|
67 |
+
*/
|
68 |
+
public function cancelAction()
|
69 |
+
{
|
70 |
+
$session = Mage::getSingleton('checkout/session');
|
71 |
+
|
72 |
+
$order_id = $session->getLastRealOrderId();
|
73 |
+
$order = Mage::getSingleton('sales/order')->loadByIncrementId($order_id);
|
74 |
+
if ($order_id) {
|
75 |
+
$order->setState(Mage::helper('ferbuy')->getFailedStatus());
|
76 |
+
$order->cancel();
|
77 |
+
$order->save();
|
78 |
+
}
|
79 |
+
|
80 |
+
$quote = Mage::getModel('sales/quote')->load($session->getFerbuyQuoteId());
|
81 |
+
if ($quote->getId()) {
|
82 |
+
$quote->setIsActive(true);
|
83 |
+
$quote->save();
|
84 |
+
}
|
85 |
+
|
86 |
+
$this->_redirect('checkout/cart');
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* After a successful transaction a customer will be send here
|
91 |
+
*/
|
92 |
+
public function successAction()
|
93 |
+
{
|
94 |
+
$session = Mage::getSingleton('checkout/session');
|
95 |
+
$quote = Mage::getModel('sales/quote')->load($session->getFerbuyQuoteId());
|
96 |
+
if ($quote->getId()) {
|
97 |
+
$quote->setIsActive(false);
|
98 |
+
$quote->delete();
|
99 |
+
}
|
100 |
+
|
101 |
+
$this->_redirect('checkout/onepage/success', array('_secure'=>true));
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Control URL called by gateway
|
106 |
+
*/
|
107 |
+
public function controlAction()
|
108 |
+
{
|
109 |
+
$base = Mage::getModel('ferbuy/base');
|
110 |
+
$data = $this->getRequest()->getPost();
|
111 |
+
|
112 |
+
// Verify callback hash
|
113 |
+
if (!$this->getRequest()->isPost() || !$this->_validate($data)) {
|
114 |
+
Mage::helper('ferbuy')->log('Callback hash validation failed!');
|
115 |
+
Mage::helper('ferbuy')->log('Received data from FerBuy:');
|
116 |
+
Mage::helper('ferbuy')->log($data);
|
117 |
+
exit();
|
118 |
+
}
|
119 |
+
|
120 |
+
// Process callback
|
121 |
+
$base->setCallbackData($data)->processCallback();
|
122 |
+
|
123 |
+
// Obtain quote and status
|
124 |
+
$status = (int) $data['status'];
|
125 |
+
$session = Mage::getSingleton('checkout/session');
|
126 |
+
$quote = Mage::getModel('sales/quote')->load($session->getFerbuyQuoteId());
|
127 |
+
|
128 |
+
// Set Mage_Sales_Model_Quote to inactive and delete
|
129 |
+
if (200 <= $status && $status <= 299) {
|
130 |
+
if ($quote->getId()) {
|
131 |
+
$quote->setIsActive(false);
|
132 |
+
$quote->delete();
|
133 |
+
}
|
134 |
+
|
135 |
+
// Set Mage_Sales_Model_Quote to active and save
|
136 |
+
} else {
|
137 |
+
if ($quote->getId()) {
|
138 |
+
$quote->setIsActive(true);
|
139 |
+
$quote->save();
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
// Display transaction_id and status
|
144 |
+
echo $data['transaction_id'].'.'.$data['status'];
|
145 |
+
}
|
146 |
+
}
|
app/code/local/Ferratum/Ferbuy/etc/adminhtml.xml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Ferbuy payment extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Ferratum_Ferbuy
|
15 |
+
* @author FerBuy, <info@ferbuy.com>
|
16 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<acl>
|
22 |
+
<resources>
|
23 |
+
<admin>
|
24 |
+
<children>
|
25 |
+
<system>
|
26 |
+
<children>
|
27 |
+
<config>
|
28 |
+
<children>
|
29 |
+
<ferbuy>
|
30 |
+
<title>Ferbuy Settings</title>
|
31 |
+
</ferbuy>
|
32 |
+
</children>
|
33 |
+
</config>
|
34 |
+
</children>
|
35 |
+
</system>
|
36 |
+
</children>
|
37 |
+
</admin>
|
38 |
+
</resources>
|
39 |
+
</acl>
|
40 |
+
</config>
|
app/code/local/Ferratum/Ferbuy/etc/config.xml
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Ferbuy payment extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Ferratum_Ferbuy
|
15 |
+
* @author FerBuy, <info@ferbuy.com>
|
16 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<modules>
|
22 |
+
<Ferratum_Ferbuy>
|
23 |
+
<version>1.1.0</version>
|
24 |
+
</Ferratum_Ferbuy>
|
25 |
+
</modules>
|
26 |
+
|
27 |
+
<global>
|
28 |
+
<blocks>
|
29 |
+
<ferbuy>
|
30 |
+
<class>Ferratum_Ferbuy_Block</class>
|
31 |
+
</ferbuy>
|
32 |
+
</blocks>
|
33 |
+
<helpers>
|
34 |
+
<ferbuy>
|
35 |
+
<class>Ferratum_Ferbuy_Helper</class>
|
36 |
+
</ferbuy>
|
37 |
+
</helpers>
|
38 |
+
<models>
|
39 |
+
<ferbuy>
|
40 |
+
<class>Ferratum_Ferbuy_Model</class>
|
41 |
+
</ferbuy>
|
42 |
+
</models>
|
43 |
+
<resources>
|
44 |
+
<ferbuy_setup>
|
45 |
+
<setup>
|
46 |
+
<module>Ferratum_Ferbuy</module>
|
47 |
+
</setup>
|
48 |
+
<connection>
|
49 |
+
<use>core_setup</use>
|
50 |
+
</connection>
|
51 |
+
</ferbuy_setup>
|
52 |
+
<ferbuy_read>
|
53 |
+
<connection>
|
54 |
+
<use>core_read</use>
|
55 |
+
</connection>
|
56 |
+
</ferbuy_read>
|
57 |
+
<ferbuy_write>
|
58 |
+
<connection>
|
59 |
+
<use>core_write</use>
|
60 |
+
</connection>
|
61 |
+
</ferbuy_write>
|
62 |
+
</resources>
|
63 |
+
</global>
|
64 |
+
|
65 |
+
<adminhtml>
|
66 |
+
<layout>
|
67 |
+
<updates>
|
68 |
+
<ferbuy>
|
69 |
+
<file>ferbuy.xml</file>
|
70 |
+
</ferbuy>
|
71 |
+
</updates>
|
72 |
+
</layout>
|
73 |
+
<acl>
|
74 |
+
<resources>
|
75 |
+
<admin>
|
76 |
+
<children>
|
77 |
+
<system>
|
78 |
+
<children>
|
79 |
+
<config>
|
80 |
+
<children>
|
81 |
+
<ferbuy>
|
82 |
+
<title>Ferbuy Settings</title>
|
83 |
+
</ferbuy>
|
84 |
+
</children>
|
85 |
+
</config>
|
86 |
+
</children>
|
87 |
+
</system>
|
88 |
+
</children>
|
89 |
+
</admin>
|
90 |
+
</resources>
|
91 |
+
</acl>
|
92 |
+
</adminhtml>
|
93 |
+
|
94 |
+
<frontend>
|
95 |
+
<routers>
|
96 |
+
<ferbuy>
|
97 |
+
<use>standard</use>
|
98 |
+
<args>
|
99 |
+
<module>Ferratum_Ferbuy</module>
|
100 |
+
<frontName>ferbuy</frontName>
|
101 |
+
</args>
|
102 |
+
</ferbuy>
|
103 |
+
</routers>
|
104 |
+
</frontend>
|
105 |
+
|
106 |
+
<default>
|
107 |
+
<payment>
|
108 |
+
<ferbuy>
|
109 |
+
<active>1</active>
|
110 |
+
<model>ferbuy/ferbuy</model>
|
111 |
+
<title>FerBuy (Buy Now, Pay Later)</title>
|
112 |
+
<allowspecific>0</allowspecific>
|
113 |
+
</ferbuy>
|
114 |
+
</payment>
|
115 |
+
|
116 |
+
<ferbuy>
|
117 |
+
<settings>
|
118 |
+
<initialized_status>pending</initialized_status>
|
119 |
+
<complete_status>processing</complete_status>
|
120 |
+
<failed_status>canceled</failed_status>
|
121 |
+
<autocreate_invoice>1</autocreate_invoice>
|
122 |
+
<mail_invoice>1</mail_invoice>
|
123 |
+
<invoicing_failed>0</invoicing_failed>
|
124 |
+
<notification_email>general</notification_email>
|
125 |
+
<live_mode>demo</live_mode>
|
126 |
+
<debug>0</debug>
|
127 |
+
</settings>
|
128 |
+
tings <ferbuy>
|
129 |
+
<active>1</active>
|
130 |
+
<gateway><![CDATA[https://gateway.ferbuy.com/]]></gateway>
|
131 |
+
<model>ferbuy/ferbuy</model>
|
132 |
+
<title>FerBuy (Buy Now, Pay Later)</title>
|
133 |
+
<allowspecific>0</allowspecific>
|
134 |
+
</ferbuy>
|
135 |
+
</ferbuy>
|
136 |
+
</default>
|
137 |
+
</config>
|
app/code/local/Ferratum/Ferbuy/etc/system.xml
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Ferbuy payment extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Ferratum_Ferbuy
|
15 |
+
* @author FerBuy, <info@ferbuy.com>
|
16 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<sections>
|
22 |
+
<ferbuy module="ferbuy">
|
23 |
+
<label>Ferbuy</label>
|
24 |
+
<class>ferbuy-section</class>
|
25 |
+
<header_css>ferbuy-header</header_css>
|
26 |
+
<tab>sales</tab>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>999</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<groups>
|
33 |
+
<settings translate="label comment">
|
34 |
+
<label>Settings</label>
|
35 |
+
<comment><![CDATA[<strong>Note:</strong> Don't forget to set-up in the <a href="https://my.ferbuy.com/" target="_blank">My Backoffice</a> a Control URL to "http://www.yourdomain.com/ferbuy/payment/control/".]]></comment>
|
36 |
+
<sort_order>100</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
<fields>
|
41 |
+
<live_mode translate="label comment">
|
42 |
+
<label>Test/Live Mode</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<comment><![CDATA[Switching between test and live mode. If you don't have an account <a href='http://www.ferbuy.com/' target='_blank'>Sign Up</a>.]]></comment>
|
45 |
+
<source_model>ferbuy/adminhtml_system_config_source_modes</source_model>
|
46 |
+
<sort_order>20</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</live_mode>
|
51 |
+
<site_id translate="label comment">
|
52 |
+
<label>Site ID</label>
|
53 |
+
<frontend_type>text</frontend_type>
|
54 |
+
<comment><![CDATA[Fill in you Site ID number. You can find your Site ID number at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>.]]></comment>
|
55 |
+
<sort_order>30</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
</site_id>
|
60 |
+
<hash_key translate="label comment">
|
61 |
+
<label>Checksum</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<comment><![CDATA[Fill in you secret checksum key for the site. You can create your hash key code at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>.]]></comment>
|
64 |
+
<sort_order>40</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</hash_key>
|
69 |
+
<autocreate_invoice translate="label comment">
|
70 |
+
<label>Create invoice after payment</label>
|
71 |
+
<frontend_type>select</frontend_type>
|
72 |
+
<comment>Automatically create invoices after payment.</comment>
|
73 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
74 |
+
<sort_order>50</sort_order>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>1</show_in_store>
|
78 |
+
</autocreate_invoice>
|
79 |
+
<mail_invoice translate="label comment">
|
80 |
+
<label>Mail invoice to customer</label>
|
81 |
+
<frontend_type>select</frontend_type>
|
82 |
+
<comment>Automatically mail invoices to a customer.</comment>
|
83 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
84 |
+
<sort_order>60</sort_order>
|
85 |
+
<show_in_default>1</show_in_default>
|
86 |
+
<show_in_website>1</show_in_website>
|
87 |
+
<show_in_store>1</show_in_store>
|
88 |
+
</mail_invoice>
|
89 |
+
<invoicing_failed translate="label">
|
90 |
+
<label>Notify on failed invoice creation</label>
|
91 |
+
<frontend_type>select</frontend_type>
|
92 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
93 |
+
<sort_order>70</sort_order>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>1</show_in_store>
|
97 |
+
</invoicing_failed>
|
98 |
+
<notification_email translate="label">
|
99 |
+
<label>Notifications recipient</label>
|
100 |
+
<frontend_type>select</frontend_type>
|
101 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
102 |
+
<sort_order>80</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
</notification_email>
|
107 |
+
<initialized_status translate="label">
|
108 |
+
<label>Transaction in progress status</label>
|
109 |
+
<frontend_type>select</frontend_type>
|
110 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
111 |
+
<sort_order>100</sort_order>
|
112 |
+
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>1</show_in_store>
|
115 |
+
</initialized_status>
|
116 |
+
<complete_status translate="label">
|
117 |
+
<label>Transaction complete status</label>
|
118 |
+
<frontend_type>select</frontend_type>
|
119 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
120 |
+
<sort_order>110</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>1</show_in_store>
|
124 |
+
</complete_status>
|
125 |
+
<failed_status translate="label">
|
126 |
+
<label>Transaction failed status</label>
|
127 |
+
<frontend_type>select</frontend_type>
|
128 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
129 |
+
<sort_order>120</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 |
+
</failed_status>
|
134 |
+
<debug translate="label comment">
|
135 |
+
<label>Debug</label>
|
136 |
+
<frontend_type>select</frontend_type>
|
137 |
+
<comment>Will log details for debugging purposes in /var/log/ferbuy.log file.</comment>
|
138 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
139 |
+
<sort_order>130</sort_order>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>1</show_in_store>
|
143 |
+
</debug>
|
144 |
+
</fields>
|
145 |
+
</settings>
|
146 |
+
|
147 |
+
<ferbuy translate="label" module="ferbuy">
|
148 |
+
<label>FerBuy (Buy Now, Pay Later)</label>
|
149 |
+
<sort_order>200</sort_order>
|
150 |
+
<show_in_default>1</show_in_default>
|
151 |
+
<show_in_website>1</show_in_website>
|
152 |
+
<show_in_store>1</show_in_store>
|
153 |
+
<fields>
|
154 |
+
<active translate="label">
|
155 |
+
<label>Enabled</label>
|
156 |
+
<frontend_type>select</frontend_type>
|
157 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
158 |
+
<sort_order>1</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>1</show_in_store>
|
162 |
+
</active>
|
163 |
+
<gateway translate="label comment">
|
164 |
+
<label>Gateway url</label>
|
165 |
+
<frontend_type>text</frontend_type>
|
166 |
+
<comment>https://gateway.ferbuy.com/</comment>
|
167 |
+
<sort_order>5</sort_order>
|
168 |
+
<show_in_default>1</show_in_default>
|
169 |
+
<show_in_website>1</show_in_website>
|
170 |
+
<show_in_store>1</show_in_store>
|
171 |
+
</gateway>
|
172 |
+
<title translate="label">
|
173 |
+
<label>Title</label>
|
174 |
+
<frontend_type>text</frontend_type>
|
175 |
+
<sort_order>10</sort_order>
|
176 |
+
<show_in_default>1</show_in_default>
|
177 |
+
<show_in_website>1</show_in_website>
|
178 |
+
<show_in_store>1</show_in_store>
|
179 |
+
</title>
|
180 |
+
<min_order_total translate="label comment">
|
181 |
+
<label>Minimum Order Total</label>
|
182 |
+
<frontend_type>text</frontend_type>
|
183 |
+
<comment>Checkout option will not be available with an order that does not meet the minimum.</comment>
|
184 |
+
<sort_order>20</sort_order>
|
185 |
+
<show_in_default>1</show_in_default>
|
186 |
+
<show_in_website>1</show_in_website>
|
187 |
+
<show_in_store>1</show_in_store>
|
188 |
+
</min_order_total>
|
189 |
+
<max_order_total translate="label comment">
|
190 |
+
<label>Maximum Order Total</label>
|
191 |
+
<frontend_type>text</frontend_type>
|
192 |
+
<comment>Checkout option will not be available with an order that does exceeds the maximum.</comment>
|
193 |
+
<sort_order>30</sort_order>
|
194 |
+
<show_in_default>1</show_in_default>
|
195 |
+
<show_in_website>1</show_in_website>
|
196 |
+
<show_in_store>1</show_in_store>
|
197 |
+
</max_order_total>
|
198 |
+
<allowspecific translate="label">
|
199 |
+
<label>Payment from applicable countries</label>
|
200 |
+
<frontend_type>allowspecific</frontend_type>
|
201 |
+
<sort_order>40</sort_order>
|
202 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
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 |
+
</allowspecific>
|
207 |
+
<specificcountry translate="label">
|
208 |
+
<label>Payment from Specific countries</label>
|
209 |
+
<frontend_type>multiselect</frontend_type>
|
210 |
+
<sort_order>50</sort_order>
|
211 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
212 |
+
<show_in_default>1</show_in_default>
|
213 |
+
<show_in_website>1</show_in_website>
|
214 |
+
<show_in_store>1</show_in_store>
|
215 |
+
</specificcountry>
|
216 |
+
<sort_order translate="label">
|
217 |
+
<label>Sort order</label>
|
218 |
+
<frontend_type>text</frontend_type>
|
219 |
+
<sort_order>100</sort_order>
|
220 |
+
<show_in_default>1</show_in_default>
|
221 |
+
<show_in_website>1</show_in_website>
|
222 |
+
<show_in_store>1</show_in_store>
|
223 |
+
</sort_order>
|
224 |
+
</fields>
|
225 |
+
</ferbuy>
|
226 |
+
</groups>
|
227 |
+
</ferbuy>
|
228 |
+
</sections>
|
229 |
+
</config>
|
app/design/adminhtml/default/default/layout/ferbuy.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Ferbuy payment extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Ferratum_Ferbuy
|
15 |
+
* @author FerBuy, <info@ferbuy.com>
|
16 |
+
* @copyright Copyright (c) 2013 (http://www.ferbuy.com)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<layout>
|
21 |
+
<adminhtml_system_config_edit>
|
22 |
+
<reference name="head">
|
23 |
+
<action method="addCss"><name>ferbuy.css</name></action>
|
24 |
+
</reference>
|
25 |
+
</adminhtml_system_config_edit>
|
26 |
+
</layout>
|
app/design/frontend/base/default/template/ferbuy/redirect.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php echo Mage::helper("ferbuy")->__("You will be redirected to FerBuy to finish your transaction."); ?>
|
2 |
+
<?php echo $this->getForm(); ?>
|
3 |
+
<script type="text/javascript">document.getElementById("ferbuy_checkout").submit();</script>
|
app/etc/modules/Ferratum_Ferbuy.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Ferbuy payment extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Ferratum_Ferbuy
|
15 |
+
* @author FerBuy, <info@ferbuy.com>
|
16 |
+
* @copyright Copyright (c) 2015 (http://www.ferbuy.com)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<modules>
|
22 |
+
<Ferratum_Ferbuy>
|
23 |
+
<active>true</active>
|
24 |
+
<codePool>local</codePool>
|
25 |
+
<depends>
|
26 |
+
<Mage_Payment />
|
27 |
+
</depends>
|
28 |
+
</Ferratum_Ferbuy>
|
29 |
+
</modules>
|
30 |
+
</config>
|
app/locale/en_US/Ferratum_Ferbuy.csv
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Settings","Settings"
|
2 |
+
"<strong>Note:</strong> Don't forget to set-up in the <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a> a Control URL to "http://www.yourdomain.com/ferbuy/payment/control/".","<strong>Note:</strong> Don't forget to set-up in the <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a> a Control URL to "http://www.yourdomain.com/ferbuy/payment/control/"."
|
3 |
+
"Test/Live Mode","Test/Live Mode"
|
4 |
+
"Switching between test and live mode. If you don't have an account <a href='http://www.ferbuy.com/' target='_blank'>Sign Up</a>.","Switching between test and live mode. If you don't have an account <a href='http://www.ferbuy.com/' target='_blank'>Sign Up</a>."
|
5 |
+
"Site ID","Site ID"
|
6 |
+
"Fill in you Site ID number. You can find your Site ID number at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>.","Fill in you Site ID number. You can find your Site ID number at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>."
|
7 |
+
"Checksum","Checksum"
|
8 |
+
"Fill in you secret checksum key for the site. You can create your hash key code at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>.",Fill in you secret checksum key for the site. You can create your hash key code at <a href="https://merchant.ferbuy.com/" target="_blank">Merchant Backoffice</a>.""
|
9 |
+
"Create invoice after payment","Create invoice after payment"
|
10 |
+
"Automatically create invoices after payment.","Automatically create invoices after payment."
|
11 |
+
"Mail invoice to customer","Mail invoice to customer"
|
12 |
+
"Automatically mail invoices to a customer.","Automatically mail invoices to a customer."
|
13 |
+
"Notify on failed invoice creation","Notify on failed invoice creation"
|
14 |
+
"Notifications recipient","Notifications recipient"
|
15 |
+
"Transaction in progress status","Transaction in progress status"
|
16 |
+
"Transaction complete status","Transaction complete status"
|
17 |
+
"Transaction failed status","Transaction failed status"
|
18 |
+
"Debug","Debug"
|
19 |
+
"Will log details for debugging purposes in /var/log/ferbuy.log file.","Will log details for debugging purposes in /var/log/ferbuy.log file."
|
20 |
+
"FerBuy (Buy Now, Pay Later)","FerBuy (Buy Now, Pay Later)"
|
21 |
+
"Enabled","Enabled"
|
22 |
+
"Title","Title"
|
23 |
+
"Minimum Order Total","Minimum Order Total"
|
24 |
+
"Checkout option will not be available with an order that does not meet the minimum.","Checkout option will not be available with an order that does not meet the minimum."
|
25 |
+
"Maximum Order Total","Maximum Order Total"
|
26 |
+
"Checkout option will not be available with an order that does exceeds the maximum.","Checkout option will not be available with an order that does exceeds the maximum."
|
27 |
+
"Payment from applicable countries","Payment from applicable countries"
|
28 |
+
"Payment from Specific countries","Payment from Specific countries"
|
29 |
+
"Sort order","Sort order"
|
30 |
+
"Invoice # %s created and send to customer.","Invoice # %s created and send to customer."
|
31 |
+
"Invoice # %s created.","Invoice # %s created."
|
32 |
+
"Automatic invoice creation failed","Automatic invoice creation failed"
|
33 |
+
"Magento was unable to create an invoice for Order # %s after a successful payment via FerBuy (transaction # %s)","Magento was unable to create an invoice for Order # %s after a successful payment via FerBuy (transaction # %s)"
|
34 |
+
"Magento was unable to create an invoice for <b>Order # %s</b> after a successful payment via FerBuy <b>(transaction # %s)</b>","Magento was unable to create an invoice for <b>Order # %s</b> after a successful payment via FerBuy <b>(transaction # %s)</b>"
|
35 |
+
"Hacker attempt: Order total amount does not match FerBuy's gross total amount!","Hacker attempt: Order total amount does not match FerBuy's gross total amount!"
|
36 |
+
"Transaction complete.","Transaction complete."
|
37 |
+
"Transaction failed.","Transaction failed."
|
38 |
+
"Transaction timed out.","Transaction timed out."
|
39 |
+
"Transaction canceled by user.","Transaction canceled by user."
|
40 |
+
"Transaction started, waiting for payment.","Transaction started, waiting for payment."
|
41 |
+
"You will be redirected to FerBuy to finish your transaction.","You will be redirected to FerBuy to finish your transaction."
|
package.xml
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ferratum_Ferbuy</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>FerBuy
|
10 |
-
<description>FerBuy is a simple and safe payment solution based on the "buy now, pay later" concept. Through FerBuy you can shop from home and pay
|
11 |
-
|
12 |
-
|
13 |
-
<authors><author><name>Fer Buy</name><user>
|
14 |
-
<date>2015-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magelocal"><dir name="."><dir name="
|
17 |
<compatible/>
|
18 |
-
<dependencies><required><php><min>5.
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ferratum_Ferbuy</name>
|
4 |
+
<version>1.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>FerBuy Payment Module</summary>
|
10 |
+
<description>FerBuy is a simple and safe payment solution based on the "buy now, pay later" concept. Through FerBuy you can shop from home and pay within 14 days. See below how simple this is.</description>
|
11 |
+
<notes>v1.3.0:
|
12 |
+
Adding localization support</notes>
|
13 |
+
<authors><author><name>Fer Buy</name><user>FerBuy</user><email>info@ferbuy.com</email></author></authors>
|
14 |
+
<date>2015-08-25</date>
|
15 |
+
<time>12:38:20</time>
|
16 |
+
<contents><target name="magelocal"><dir name="Ferratum"><dir name="Ferbuy"><dir name="Block"><file name="Redirect.php" hash="bdb59a1854ced707363d054ae1e9d4a4"/></dir><dir name="Helper"><file name="Data.php" hash="2bcbdb2fd52065d3b371f5c16fa44194"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Modes.php" hash="aa5f540849179c47ea6eed09aad77f6d"/></dir></dir></dir></dir><file name="Base.php" hash="132170d3ea2ba0d60d5a7cdb6dff6403"/><file name="Ferbuy.php" hash="b95698328a35691851d69c474b694936"/></dir><dir name="controllers"><file name="PaymentController.php" hash="4ece51713291736392cfd7c0cd61cc1a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f37221cd0943f83ee38d554c0d339619"/><file name="config.xml" hash="0875a0f413f9a8579bf661368b5d41db"/><file name="system.xml" hash="2a9eabb0c6e22eb30827f37619cd0e7b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ferratum_Ferbuy.xml" hash="eeaa05c490b6958c426577bcd3569cb6"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ferbuy.xml" hash="b5158397519eef21968f5ce26a433549"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ferbuy"><file name="redirect.phtml" hash="837f367951edbe379bc38ddd0acab8d4"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="ferbuy.css" hash="819549e60f84323f494ab42e8e52af68"/><dir name="images"><file name="ferbuy.png" hash="6f69778a6152cd21c6a6ec2fdc28d1d7"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Ferratum_Ferbuy.csv" hash="78573175d6346dd714567309352b58e4"/></dir></target></contents>
|
17 |
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
skin/adminhtml/default/default/ferbuy.css
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Magento Ferbuy payment extension
|
3 |
+
*
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Mage
|
12 |
+
* @package Ferratum_Ferbuy
|
13 |
+
* @author FerBuy, <info@ferbuy.com>
|
14 |
+
* @copyright Copyright (c) 2013 (http://www.ferbuy.com)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
h3.ferbuy-header { background:url(images/ferbuy.png) no-repeat 0 0; height:0; overflow:hidden; padding:22px 0 0; width:55px; }
|
19 |
+
|
20 |
+
ul.tabs a.ferbuy-section,
|
21 |
+
ul.tabs a.ferbuy-section:hover { background:url(images/tabs_span_bg.gif) repeat-x 0 100%; border-bottom:none; padding:0.5em 0.5em 0.5em 1.5em; }
|
22 |
+
ul.tabs a.ferbuy-section:hover { background-color:#d8e6e6; }
|
23 |
+
ul.tabs a.ferbuy-section.active, ul.tabs a.ferbuy-section.active:hover { background-color:#fff; }
|
24 |
+
ul.tabs a.ferbuy-section span,
|
25 |
+
ul.tabs a.ferbuy-section:hover span { background:url(images/ferbuy.png) no-repeat 0 0; height:0; overflow:hidden; padding:22px 0 0; width:55px; }
|
26 |
+
|
27 |
+
.ferbuy-selection { border-collapse:collapse; width:100%; }
|
28 |
+
.ferbuy-selection .ferbuy-selection-info { text-align:right; }
|
29 |
+
.ferbuy-selection th { font-size:13px; padding:5px 0; text-align:left; vertical-align:middle; }
|
30 |
+
.ferbuy-selection td { background:#f2f2f2; border-bottom:5px solid #fff; padding:5px; vertical-align:top; }
|
31 |
+
.ferbuy-selection .ferbuy-selection-simplified { background:#fff; padding-left:35px; }
|
32 |
+
.ferbuy-selection td a { color:#2997d8; }
|
33 |
+
.ferbuy-selection td strong { color:#3c616a; }
|
34 |
+
.ferbuy-selection td label { display:block; padding-left:30px; text-indent:-30px; }
|
35 |
+
.ferbuy-selection td div label { display:inline; padding:0; text-indent:0; }
|
36 |
+
.ferbuy-selection td input { height:13px; overflow:hidden; margin-right:15px; position:relative; top:-1px; width:13px; vertical-align:middle; }
|
37 |
+
|
38 |
+
.ferbuy-config .form-list { width:100%; }
|
39 |
+
.ferbuy-config tr.hover { background:#f7f7f7; }
|
40 |
+
.ferbuy-config tr.hover label { cursor:help; }
|
41 |
+
|
42 |
+
.ferbuy-credentials { border:1px solid #f2f2f2; }
|
43 |
+
.ferbuy-credentials caption { padding:5px; text-align:left; }
|
44 |
+
.ferbuy-credentials .value { color:#ccc; }
|
skin/adminhtml/default/default/images/ferbuy.png
ADDED
Binary file
|