Version Notes
- Direct payment for Sverige.
- Gavekoret.
- Mobil tilpasset versjon.
Download this release
Release Info
Developer | Roy Andre Tollefsen |
Extension | BBSNetAxept_Norway |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.4 to 2.2.0
- app/code/community/Trollweb/BBSNetAxept/Block/Form.php +6 -6
- app/code/community/Trollweb/BBSNetAxept/Block/PaymentInfo.php +5 -0
- app/code/community/Trollweb/BBSNetAxept/Block/Redirect.php +13 -42
- app/code/community/Trollweb/BBSNetAxept/Model/Api/Bbs.php +449 -228
- app/code/community/Trollweb/BBSNetAxept/Model/Api/BbsRequest.php +62 -35
- app/code/community/Trollweb/BBSNetAxept/Model/Api/SoapClient.php +26 -12
- app/code/community/Trollweb/BBSNetAxept/Model/Cron.php +16 -15
- app/code/community/Trollweb/BBSNetAxept/Model/Info.php +94 -69
- app/code/community/Trollweb/BBSNetAxept/Model/Observer.php +45 -0
- app/code/community/Trollweb/BBSNetAxept/Model/Updates.php +176 -0
- app/code/community/Trollweb/BBSNetAxept/Model/WithGUI.php +947 -293
- app/code/community/Trollweb/BBSNetAxept/controllers/ReturnController.php +41 -14
- app/code/community/Trollweb/BBSNetAxept/etc/config.xml +104 -56
- app/code/community/Trollweb/BBSNetAxept/etc/system.xml +203 -97
- app/code/community/Trollweb/BBSNetAxept/{Model/BBSNetterminal/Result.php → sql/bbsnetaxept_setup/mysql4-upgrade-1.9.9-2.0.0.php} +28 -23
- app/design/adminhtml/default/default/template/bbsnetaxept/form.phtml +1 -1
- app/design/adminhtml/default/default/template/bbsnetaxept/paymentinfo.phtml +3 -0
- app/design/frontend/base/default/layout/bbsnetaxept.xml +17 -0
- app/design/frontend/base/default/template/bbsnetaxept/form.phtml +18 -10
- app/design/frontend/base/default/template/bbsnetaxept/paymentinfo.phtml +4 -2
- app/locale/nb_NO/Trollweb_BBSNetaxept.csv +3 -3
- js/bbsnetaxept/modernizr_touch.js +4 -0
- package.xml +5 -19
- skin/frontend/base/default/images/bbsnetaxept/dancard.png +0 -0
- skin/frontend/base/default/images/bbsnetaxept/logo.png +0 -0
- skin/frontend/base/default/images/bbsnetaxept/nets-payment.png +0 -0
- skin/frontend/base/default/images/bbsnetaxept/technology_logo.png +0 -0
app/code/community/Trollweb/BBSNetAxept/Block/Form.php
CHANGED
@@ -3,18 +3,18 @@
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
-
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Block_Form extends Mage_Payment_Block_Form
|
@@ -24,12 +24,12 @@ class Trollweb_BBSNetAxept_Block_Form extends Mage_Payment_Block_Form
|
|
24 |
$this->setTemplate('bbsnetaxept/form.phtml');
|
25 |
parent::_construct();
|
26 |
}
|
27 |
-
|
28 |
protected function getLogo()
|
29 |
{
|
30 |
return $this->getMethod()->getLogoUrl();
|
31 |
}
|
32 |
-
|
33 |
protected function getRedirectText()
|
34 |
{
|
35 |
return $this->getMethod()->getRedirectText();
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
+
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Block_Form extends Mage_Payment_Block_Form
|
24 |
$this->setTemplate('bbsnetaxept/form.phtml');
|
25 |
parent::_construct();
|
26 |
}
|
27 |
+
|
28 |
protected function getLogo()
|
29 |
{
|
30 |
return $this->getMethod()->getLogoUrl();
|
31 |
}
|
32 |
+
|
33 |
protected function getRedirectText()
|
34 |
{
|
35 |
return $this->getMethod()->getRedirectText();
|
app/code/community/Trollweb/BBSNetAxept/Block/PaymentInfo.php
CHANGED
@@ -30,6 +30,11 @@ class Trollweb_BBSNetAxept_Block_PaymentInfo extends Mage_Payment_Block_Info
|
|
30 |
return $this->getMethod()->getLogoUrl();
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
protected function _prepareSpecificInformation($transport = null)
|
34 |
{
|
35 |
$transport = parent::_prepareSpecificInformation($transport);
|
30 |
return $this->getMethod()->getLogoUrl();
|
31 |
}
|
32 |
|
33 |
+
public function isMobileDevice()
|
34 |
+
{
|
35 |
+
return $this->getInfo()->getAdditionalInformation(Trollweb_BBSNetAxept_Model_WithGUI::MOBILE_CLIENT);
|
36 |
+
}
|
37 |
+
|
38 |
protected function _prepareSpecificInformation($transport = null)
|
39 |
{
|
40 |
$transport = parent::_prepareSpecificInformation($transport);
|
app/code/community/Trollweb/BBSNetAxept/Block/Redirect.php
CHANGED
@@ -22,49 +22,20 @@ class Trollweb_BBSNetAxept_Block_Redirect extends Mage_Core_Block_Abstract
|
|
22 |
protected function _toHtml()
|
23 |
{
|
24 |
|
25 |
-
$
|
26 |
-
|
27 |
-
$bbsTransKey = $standard->getBBSTransKey();
|
28 |
-
|
29 |
-
if (!$bbsTransKey) {
|
30 |
-
Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
|
31 |
-
return false;
|
32 |
-
}
|
33 |
-
|
34 |
-
$form = new Varien_Data_Form();
|
35 |
-
$form->setAction($standard->getBBSUrl())
|
36 |
-
->setId('BBS_WithGUI_checkout')
|
37 |
-
->setName('BBS_WithGUI_checkout')
|
38 |
-
->setMethod('POST')
|
39 |
-
->setUseContainer(true);
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
default: $prefix = 'v'; break;
|
54 |
-
}
|
55 |
-
|
56 |
-
$form->addField($prefix.'a','hidden', array('name' => $prefix.'a', "value" => $ccInfo->getCcNumber()));
|
57 |
-
$form->addField($prefix.'m','hidden', array('name' => $prefix.'m', "value" => sprintf("%02u",(int)$ccInfo->getCcExpMonth())));
|
58 |
-
$form->addField($prefix.'y','hidden', array('name' => $prefix.'y', "value" => substr($ccInfo->getCcExpYear(),-2)));
|
59 |
-
$form->addField($prefix.'c','hidden', array('name' => $prefix.'c', "value" => $ccInfo->getCcCid()));
|
60 |
-
}
|
61 |
-
|
62 |
-
$form->addField('BBSePay_transaction','hidden', array("name"=>'BBSePay_transaction', "value"=>$bbsTransKey));
|
63 |
-
$html = '<html><body>';
|
64 |
-
$html.= $this->__('You will be redirected to BBS NetAxept in a few seconds.');
|
65 |
-
$html.= $form->toHtml();
|
66 |
-
$html.= '<script type="text/javascript">document.getElementById("BBS_WithGUI_checkout").submit();</script>';
|
67 |
-
$html.= '</body></html>';
|
68 |
|
69 |
return $html;
|
70 |
}
|
22 |
protected function _toHtml()
|
23 |
{
|
24 |
|
25 |
+
$url = $this->getNetsUrl();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
$html = '<html>';
|
28 |
+
$html .= '<head>';
|
29 |
+
$html .= '<title>'.$this->getNetsMessage().'</title>';
|
30 |
+
$html .= '</head>';
|
31 |
+
$html .= '<body>';
|
32 |
+
$html .= $this->getNetsMessage().'<br />';
|
33 |
+
$html .= '<a href="'.$url.'">'.$this->__('Click here if you are not redirected within 10 seconds.').'</a>';
|
34 |
+
$html .= '<script type="text/javascript">';
|
35 |
+
$html .= ' setTimeout(function(){ window.location="'.$url.'"; },100);';
|
36 |
+
$html .= '</script>';
|
37 |
+
$html .= '</body>';
|
38 |
+
$html .= '</html>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
return $html;
|
41 |
}
|
app/code/community/Trollweb/BBSNetAxept/Model/Api/Bbs.php
CHANGED
@@ -1,228 +1,449 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
* BBS Api
|
23 |
+
*/
|
24 |
+
class Trollweb_BBSNetAxept_Model_Api_Bbs extends Varien_Object
|
25 |
+
{
|
26 |
+
|
27 |
+
protected $_result;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Auth with BBS and return the key.
|
31 |
+
*
|
32 |
+
* @param none
|
33 |
+
* @return array
|
34 |
+
*/
|
35 |
+
public function getTransKey($storeId = null) {
|
36 |
+
$result = false;
|
37 |
+
|
38 |
+
$response = $this->doClientRequest('Register',$this->getRequest($storeId));
|
39 |
+
if ($response && isset($response->TransactionId)) {
|
40 |
+
$result = (string)$response->TransactionId;
|
41 |
+
}
|
42 |
+
|
43 |
+
if ($this->getError()) {
|
44 |
+
$this->doLog('ERROR: [TransKey] '.$this->getErrorMessage());
|
45 |
+
}
|
46 |
+
|
47 |
+
return $result;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Authorize the request from BBS.
|
52 |
+
*
|
53 |
+
* @param String $TransactionId
|
54 |
+
* @return string|false
|
55 |
+
*/
|
56 |
+
public function auth($TransactionId) {
|
57 |
+
|
58 |
+
$result = false;
|
59 |
+
$params = array(
|
60 |
+
'operation' => 'AUTH',
|
61 |
+
'transactionId' => $TransactionId,
|
62 |
+
);
|
63 |
+
|
64 |
+
|
65 |
+
$response = $this->doClientRequest('Process',$params);
|
66 |
+
|
67 |
+
if ($response) {
|
68 |
+
$this->Result()->setResponseCode((string)$response->ResponseCode);
|
69 |
+
$this->Result()->setIssuerId((string)$response->IssuerId);
|
70 |
+
$this->Result()->setAuthorizationId((string)$response->AuthorizationId);
|
71 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
72 |
+
$this->Result()->setAuthenticatedWith('');
|
73 |
+
$this->Result()->setAuthenticatedStatus('');
|
74 |
+
|
75 |
+
if (isset($response->ResponseCode) && ($response->ResponseCode == "OK")) {
|
76 |
+
$this->query($TransactionId); // Fetch additional information.
|
77 |
+
|
78 |
+
$result = (string)$response->TransactionId;
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
$this->setError(true);
|
82 |
+
$this->setErrorMessage('('.(string)$response->ResponseSource.') '.(string)$response->ResponseText);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
if ($this->getError()) {
|
87 |
+
$this->doLog('ERROR: [Auth] '.$this->getErrorMessage());
|
88 |
+
}
|
89 |
+
|
90 |
+
return $result;
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Sale transaction to Nets.
|
96 |
+
*
|
97 |
+
* @param String $TransactionId, [String $description]
|
98 |
+
* @return string|false
|
99 |
+
*/
|
100 |
+
public function sale($TransactionId, $description='') {
|
101 |
+
$result = false;
|
102 |
+
$params = array(
|
103 |
+
'operation' => 'SALE',
|
104 |
+
'transactionId' => $TransactionId,
|
105 |
+
'description' => $description,
|
106 |
+
'transactionReconRef' => $description,
|
107 |
+
);
|
108 |
+
|
109 |
+
$response = $this->doClientRequest('Process',$params);
|
110 |
+
|
111 |
+
if ($response) {
|
112 |
+
$this->Result()->setResponseCode((string)$response->ResponseCode);
|
113 |
+
$this->Result()->setAuthorizationId((string)$response->AuthorizationId);
|
114 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
115 |
+
$this->Result()->setAuthenticatedWith('');
|
116 |
+
$this->Result()->setAuthenticatedStatus('');
|
117 |
+
|
118 |
+
if (isset($response->ResponseCode) && ($response->ResponseCode == "OK")) {
|
119 |
+
$this->query($TransactionId); // Fetch additional information.
|
120 |
+
|
121 |
+
$result = (string)$response->TransactionId;
|
122 |
+
}
|
123 |
+
else {
|
124 |
+
$this->setError(true);
|
125 |
+
$this->setErrorMessage('('.(string)$response->ResponseSource.') '.(string)$response->ResponseText);
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($this->getError()) {
|
130 |
+
$this->doLog('ERROR: [Sales] '.$this->getErrorMessage());
|
131 |
+
}
|
132 |
+
|
133 |
+
return $result;
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Capture from Nets.
|
139 |
+
*
|
140 |
+
* @param String $TransactionId, Integer $amount, [String $description]
|
141 |
+
* @return Trollweb_BBSNetAxept_Model_BBSNetterminal_Result
|
142 |
+
*/
|
143 |
+
public function capture($TransactionId, $amount, $description='') {
|
144 |
+
$result = false;
|
145 |
+
$params = array(
|
146 |
+
'operation' => 'CAPTURE',
|
147 |
+
'transactionId' => $TransactionId,
|
148 |
+
'transactionAmount' => $amount,
|
149 |
+
'description' => $description,
|
150 |
+
'transactionReconRef' => $description,
|
151 |
+
);
|
152 |
+
|
153 |
+
$response = $this->doClientRequest('Process',$params);
|
154 |
+
|
155 |
+
if ($response) {
|
156 |
+
$this->Result()->setResponseCode((string)$response->ResponseCode);
|
157 |
+
$this->Result()->setIssuerId((string)$response->IssuerId);
|
158 |
+
$this->Result()->setAuthorizationId((string)$response->AuthorizationId);
|
159 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
160 |
+
$this->Result()->setAuthenticatedWith('');
|
161 |
+
$this->Result()->setAuthenticatedStatus('');
|
162 |
+
|
163 |
+
if (isset($response->ResponseCode) && ($response->ResponseCode == "OK")) {
|
164 |
+
|
165 |
+
$result = true;
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
$this->setError(true);
|
169 |
+
$this->setErrorMessage('('.(string)$response->ResponseSource.') '.(string)$response->ResponseText);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
if ($this->getError()) {
|
174 |
+
$this->doLog('ERROR: [Capture] '.$this->getErrorMessage());
|
175 |
+
}
|
176 |
+
|
177 |
+
return $result;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Refund with BBS.
|
182 |
+
*
|
183 |
+
* @param String $TransactionId, Integer $amount, [String $description]
|
184 |
+
* @return Trollweb_BBSNetAxept_Model_BBSNetterminal_Result
|
185 |
+
*/
|
186 |
+
public function refund($TransactionId, $amount, $description='') {
|
187 |
+
|
188 |
+
$result = false;
|
189 |
+
$params = array(
|
190 |
+
'operation' => 'CREDIT',
|
191 |
+
'transactionId' => $TransactionId,
|
192 |
+
'transactionAmount' => $amount,
|
193 |
+
'description' => $description,
|
194 |
+
'transactionReconRef' => $description,
|
195 |
+
);
|
196 |
+
|
197 |
+
$response = $this->doClientRequest('Process',$params);
|
198 |
+
|
199 |
+
if ($response) {
|
200 |
+
$this->Result()->setResponseCode((string)$response->ResponseCode);
|
201 |
+
$this->Result()->setIssuerId((string)$response->IssuerId);
|
202 |
+
$this->Result()->setAuthorizationId((string)$response->AuthorizationId);
|
203 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
204 |
+
$this->Result()->setAuthenticatedWith('');
|
205 |
+
$this->Result()->setAuthenticatedStatus('');
|
206 |
+
|
207 |
+
if (isset($response->ResponseCode) && ($response->ResponseCode == "OK")) {
|
208 |
+
|
209 |
+
$result = (string)$response->TransactionId;
|
210 |
+
}
|
211 |
+
else {
|
212 |
+
$this->setError(true);
|
213 |
+
$this->setErrorMessage('('.(string)$response->ResponseSource.') '.(string)$response->ResponseText);
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
if ($this->getError()) {
|
218 |
+
$this->doLog('ERROR: [Refund] '.$this->getErrorMessage());
|
219 |
+
}
|
220 |
+
|
221 |
+
return $result;
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Void on BBS.
|
226 |
+
*
|
227 |
+
* @param String $TransactionId, [String $description]
|
228 |
+
* @return Trollweb_BBSNetAxept_Model_BBSNetterminal_Result
|
229 |
+
*/
|
230 |
+
public function void($TransactionId, $description='') {
|
231 |
+
|
232 |
+
$result = false;
|
233 |
+
$params = array(
|
234 |
+
'operation' => 'ANNUL',
|
235 |
+
'transactionId' => $TransactionId,
|
236 |
+
);
|
237 |
+
|
238 |
+
$response = $this->doClientRequest('Process',$params);
|
239 |
+
|
240 |
+
if ($response) {
|
241 |
+
$this->Result()->setResponseCode((string)$response->ResponseCode);
|
242 |
+
$this->Result()->setIssuerId((string)$response->IssuerId);
|
243 |
+
$this->Result()->setAuthorizationId((string)$response->AuthorizationId);
|
244 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
245 |
+
$this->Result()->setAuthenticatedWith('');
|
246 |
+
$this->Result()->setAuthenticatedStatus('');
|
247 |
+
|
248 |
+
if (isset($response->ResponseCode) && ($response->ResponseCode == "OK")) {
|
249 |
+
|
250 |
+
$result = (string)$response->TransactionId;
|
251 |
+
}
|
252 |
+
else {
|
253 |
+
$this->setError(true);
|
254 |
+
$this->setErrorMessage('('.(string)$response->ResponseSource.') '.(string)$response->ResponseText);
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
if ($this->getError()) {
|
259 |
+
$this->doLog('ERROR: [Void] '.$this->getErrorMessage());
|
260 |
+
}
|
261 |
+
|
262 |
+
return $result;
|
263 |
+
}
|
264 |
+
|
265 |
+
public function query($TransactionId)
|
266 |
+
{
|
267 |
+
$result = false;
|
268 |
+
$params = array(
|
269 |
+
'transactionId' => $TransactionId,
|
270 |
+
);
|
271 |
+
|
272 |
+
$this->Result()->setChildTransactionId('');
|
273 |
+
|
274 |
+
|
275 |
+
$response = $this->doClientRequest('Query',$params);
|
276 |
+
|
277 |
+
if ($response) {
|
278 |
+
|
279 |
+
$this->addResult('issuer',$response->CardInformation->Issuer);
|
280 |
+
|
281 |
+
$this->Result()->setIssuer((string)$response->CardInformation->Issuer);
|
282 |
+
$this->Result()->setIssuerCountry((string)$response->CardInformation->IssuerCountry);
|
283 |
+
$this->Result()->setPaymentMethod((string)$response->CardInformation->PaymentMethod);
|
284 |
+
$this->Result()->setMaskedPAN((string)$response->CardInformation->MaskedPAN);
|
285 |
+
|
286 |
+
$this->Result()->setAuthorized((((string)$response->Summary->Authorized) == "true"));
|
287 |
+
$this->Result()->setAuthorizationId((string)$response->Summary->AuthorizationId);
|
288 |
+
|
289 |
+
$this->Result()->setTransactionId((string)$response->TransactionId);
|
290 |
+
|
291 |
+
$this->Result()->setAnulled(((string)$response->Summary->Annulled) == "true");
|
292 |
+
$this->Result()->setAmountCaptured((float)$response->Summary->AmountCaptured);
|
293 |
+
$this->Result()->setChildTransactionId((string)$response->ChildTransactionId);
|
294 |
+
|
295 |
+
if (isset($response->AuthenticationInformation->AuthenticatedWith)) {
|
296 |
+
$this->Result()->setAuthenticatedWith((string)$response->AuthenticationInformation->AuthenticatedWith);
|
297 |
+
}
|
298 |
+
if (isset($response->AuthenticationInformation->AuthenticatedStatus)) {
|
299 |
+
$this->Result()->setAuthenticatedStatus((string)$response->AuthenticationInformation->AuthenticatedStatus);
|
300 |
+
}
|
301 |
+
|
302 |
+
$result = true;
|
303 |
+
}
|
304 |
+
|
305 |
+
if ($this->getError()) {
|
306 |
+
$this->doLog('ERROR: [Query] '.$this->getErrorMessage());
|
307 |
+
}
|
308 |
+
|
309 |
+
return $result;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Check BBS Transaction
|
314 |
+
*
|
315 |
+
* @param String $TransactionId
|
316 |
+
* @return Trollweb_BBSNetAxept_Model_BBSNetterminal_Result
|
317 |
+
*/
|
318 |
+
public function checkStatus($TransactionId) {
|
319 |
+
|
320 |
+
$result = false;
|
321 |
+
if ($this->query($TransactionId)) {
|
322 |
+
$result = $this->Result()->getAuthorized();
|
323 |
+
}
|
324 |
+
|
325 |
+
return $result;
|
326 |
+
}
|
327 |
+
|
328 |
+
public function Result() {
|
329 |
+
if (!is_object($this->_result)) {
|
330 |
+
$this->_result = new Varien_Object;
|
331 |
+
}
|
332 |
+
|
333 |
+
return $this->_result;
|
334 |
+
}
|
335 |
+
|
336 |
+
protected function addResult($field,$object)
|
337 |
+
{
|
338 |
+
if (isset($object)) {
|
339 |
+
$this->Result()->setData($field,(string)$object);
|
340 |
+
}
|
341 |
+
}
|
342 |
+
|
343 |
+
private function doClientRequest($function,$params)
|
344 |
+
{
|
345 |
+
|
346 |
+
$netsResult = false;
|
347 |
+
$url = 'https://'.$this->getHost().'/Netaxept/'.$function.'.aspx';
|
348 |
+
$bbsClient = new Zend_Http_Client($url);
|
349 |
+
$bbsClient->setParameterGet('merchantId',$this->getMerchantId());
|
350 |
+
$bbsClient->setParameterGet('token',$this->getMerchantToken());
|
351 |
+
|
352 |
+
foreach ($params as $key => $value)
|
353 |
+
{
|
354 |
+
$bbsClient->setParameterGet($key,$value);
|
355 |
+
}
|
356 |
+
|
357 |
+
try {
|
358 |
+
$response = $bbsClient->request();
|
359 |
+
//$this->doLog($bbsClient->getLastRequest());
|
360 |
+
}
|
361 |
+
catch (Exception $e) {
|
362 |
+
$this->setError(true);
|
363 |
+
$this->setErrorMessage($e->getMessage());
|
364 |
+
$response = false;
|
365 |
+
}
|
366 |
+
|
367 |
+
if ($response) {
|
368 |
+
$netsResult = $this->parseResult($response->getBody());
|
369 |
+
}
|
370 |
+
|
371 |
+
if ($this->getError()) {
|
372 |
+
$this->doLog('ERROR: ['.$function.'] '.$this->getErrorMessage());
|
373 |
+
}
|
374 |
+
|
375 |
+
return $netsResult;
|
376 |
+
}
|
377 |
+
|
378 |
+
private function parseResult($xml)
|
379 |
+
{
|
380 |
+
$dom = simplexml_load_string($xml);
|
381 |
+
|
382 |
+
if (isset($dom->Error)) {
|
383 |
+
$this->setErrorMessage((string)$dom->Error->Message);
|
384 |
+
$this->setError(true);
|
385 |
+
if (isset($dom->Error->Result)) {
|
386 |
+
return $dom->Error->Result;
|
387 |
+
}
|
388 |
+
else {
|
389 |
+
return false;
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
+
return $dom;
|
394 |
+
}
|
395 |
+
|
396 |
+
|
397 |
+
private function getRequest($storeId) {
|
398 |
+
|
399 |
+
// Set default norwegian language
|
400 |
+
if ($this->getLanguage() == false) {
|
401 |
+
$this->setLanguage('no_NO');
|
402 |
+
}
|
403 |
+
|
404 |
+
if (Mage::getStoreConfig('payment/bbsnetaxept_withgui/alternate_redirect', $storeId)) {
|
405 |
+
$redirectUrl = Mage::getStoreConfig('payment/bbsnetaxept_withgui/alternate_redirect', $storeId);
|
406 |
+
}
|
407 |
+
else {
|
408 |
+
$redirectUrlConfig = 'bbsnetaxept/return/check';
|
409 |
+
$redirectUrl = Mage::getUrl($redirectUrlConfig, array('_secure' => true, '_query' => false, '_nosid' => true));
|
410 |
+
}
|
411 |
+
|
412 |
+
$_singlePage = 'false';
|
413 |
+
if (Mage::getStoreConfig('payment/bbsnetaxept_withgui/singlepage', $storeId)) {
|
414 |
+
$_singlePage = 'true';
|
415 |
+
}
|
416 |
+
|
417 |
+
$request = array(
|
418 |
+
'serviceType' => ($this->getInternalGUI() ? 'M' : 'B'),
|
419 |
+
'transactionId' => $this->getTransactionId(),
|
420 |
+
'orderNumber' => $this->getOrderNumber(),
|
421 |
+
'currencyCode' => $this->getCurrencyCode(),
|
422 |
+
'amount' => $this->getAmount(),
|
423 |
+
'orderDescription' => $this->getOrderDescription(),
|
424 |
+
'language' => $this->getLanguage(),
|
425 |
+
'redirectUrl' => $redirectUrl,
|
426 |
+
'customerEmail' => $this->getCustomerEmail(),
|
427 |
+
'customerPhoneNumber' => $this->getCustomerPhoneNumber(),
|
428 |
+
'terminalSinglePage' => $_singlePage,
|
429 |
+
// 'paymentMethodList' => $this->getPaymentMethodList(), // TODO: implement this
|
430 |
+
);
|
431 |
+
|
432 |
+
|
433 |
+
return $request;
|
434 |
+
|
435 |
+
}
|
436 |
+
|
437 |
+
public function doLog($logline,$force=false) {
|
438 |
+
$logDir = Mage::getBaseDir('log');
|
439 |
+
|
440 |
+
if ($force or $this->getLogactive()) {
|
441 |
+
$fh = fopen($logDir."/trollweb_bbsnetaxept.log","a");
|
442 |
+
if ($fh) {
|
443 |
+
fwrite($fh,"[".date("d.m.Y h:i:s")."] ".$logline."\n");
|
444 |
+
fclose($fh);
|
445 |
+
}
|
446 |
+
}
|
447 |
+
}
|
448 |
+
}
|
449 |
+
|
app/code/community/Trollweb/BBSNetAxept/Model/Api/BbsRequest.php
CHANGED
@@ -1,35 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Trollweb_BBSNetAxept_Model_Api_BbsRequest {
|
21 |
+
|
22 |
+
public $Amount;
|
23 |
+
public $CurrencyCode;
|
24 |
+
public $CustomerEmail;
|
25 |
+
public $CustomerPhoneNumber;
|
26 |
+
public $Description;
|
27 |
+
public $Language;
|
28 |
+
public $OrderDescription;
|
29 |
+
public $OrderNumber;
|
30 |
+
public $PanHash;
|
31 |
+
public $RecurringExpiryDate;
|
32 |
+
public $RecurringFrequency;
|
33 |
+
public $RecurringType;
|
34 |
+
public $RedirectUrl;
|
35 |
+
public $ServiceType;
|
36 |
+
public $SessionId;
|
37 |
+
public $TransactionId;
|
38 |
+
|
39 |
+
function Trollweb_BBSNetAxept_Model_Api_BbsRequest
|
40 |
+
(
|
41 |
+
$Amount,
|
42 |
+
$CurrencyCode,
|
43 |
+
$OrderDescription,
|
44 |
+
$OrderNumber,
|
45 |
+
$RedirectUrl,
|
46 |
+
$ServiceType, /* B : BBS Hosted UI ; M : Merchant Hosted UI ; C : Call Center Solution */
|
47 |
+
$SessionId,
|
48 |
+
$TransactionId
|
49 |
+
)
|
50 |
+
{
|
51 |
+
$this->Amount = $Amount;
|
52 |
+
$this->CurrencyCode = $CurrencyCode;
|
53 |
+
$this->OrderDescription = $OrderDescription;
|
54 |
+
$this->OrderNumber = $OrderNumber;
|
55 |
+
$this->RedirectUrl = $RedirectUrl;
|
56 |
+
$this->ServiceType = $ServiceType;
|
57 |
+
$this->SessionId = $SessionId;
|
58 |
+
$this->TransactionId = $TransactionId;
|
59 |
+
}
|
60 |
+
|
61 |
+
};
|
62 |
+
|
app/code/community/Trollweb/BBSNetAxept/Model/Api/SoapClient.php
CHANGED
@@ -1,12 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
/**
|
21 |
+
* BBS Soap Client
|
22 |
+
*/
|
23 |
+
class Trollweb_BBSNetAxept_Model_Api_SoapClient extends SoapClient
|
24 |
+
{
|
25 |
+
|
26 |
+
}
|
app/code/community/Trollweb/BBSNetAxept/Model/Cron.php
CHANGED
@@ -3,54 +3,55 @@
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
-
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Model_Cron
|
21 |
{
|
22 |
-
|
23 |
public function checkOrders($schedule)
|
24 |
{
|
25 |
$collection = Mage::getResourceModel('sales/order_collection')
|
26 |
->addAttributeToSelect('*')
|
27 |
-
->addAttributeToFilter('status',
|
|
|
28 |
|
29 |
-
|
30 |
foreach ($collection as $key => $order) {
|
31 |
$bbs = Mage::getModel('bbsnetaxept/withGUI')->getApi();
|
32 |
// Cancel all orders older than X minutes. (change in admin)
|
33 |
$timeout = $order->getPayment()->getMethodInstance()->getPendingTimeout();
|
34 |
-
|
35 |
if (($timeout > 0) and (strtotime($order->getUpdatedAt())+($timeout*60) < time()))
|
36 |
{
|
37 |
$transid = $order->getPayment()->getAdditionalInformation(Trollweb_BBSNetAxept_Model_WithGUI::TRANSACTION_ID);
|
38 |
$status = $bbs->checkStatus($transid);
|
39 |
if ($status == false) {
|
40 |
$bbs->doLog('Order number '.$order->getIncrementId().' is automatic canceled due to missing payment (Timeout: '.$timeout.')',true);
|
41 |
-
$order->cancel()
|
|
|
|
|
42 |
}
|
43 |
else {
|
44 |
-
|
45 |
// If marked as captured in BBS, lets try to find the correct invoice and mark it as captured here aswell.
|
46 |
-
$captured = $bbs->getAmountCaptured();
|
47 |
if ($captured > 0) {
|
48 |
if ($order->hasInvoices()) {
|
49 |
-
|
50 |
foreach ($order->getInvoiceCollection() as $id => $invoice) {
|
51 |
-
$amount = $invoice->
|
52 |
if ($invoice->canCapture() and ($amount*100 == $captured)) {
|
53 |
-
$bbs->doLog('Invoice number '.$invoice->getIncrementId().' was marked as captured on
|
54 |
$invoice->setIsPaid(true);
|
55 |
$invoice->pay()->save();
|
56 |
$message = Mage::helper('bbsnetaxept')->__('Registered notification about captured amount of %s.', $amount);
|
@@ -63,6 +64,6 @@ class Trollweb_BBSNetAxept_Model_Cron
|
|
63 |
}
|
64 |
}
|
65 |
}
|
66 |
-
|
67 |
}
|
68 |
}
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
+
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Model_Cron
|
21 |
{
|
22 |
+
|
23 |
public function checkOrders($schedule)
|
24 |
{
|
25 |
$collection = Mage::getResourceModel('sales/order_collection')
|
26 |
->addAttributeToSelect('*')
|
27 |
+
->addAttributeToFilter('status',Trollweb_BBSNetAxept_Model_WithGUI::ORDER_STATUS);
|
28 |
+
|
29 |
|
|
|
30 |
foreach ($collection as $key => $order) {
|
31 |
$bbs = Mage::getModel('bbsnetaxept/withGUI')->getApi();
|
32 |
// Cancel all orders older than X minutes. (change in admin)
|
33 |
$timeout = $order->getPayment()->getMethodInstance()->getPendingTimeout();
|
34 |
+
|
35 |
if (($timeout > 0) and (strtotime($order->getUpdatedAt())+($timeout*60) < time()))
|
36 |
{
|
37 |
$transid = $order->getPayment()->getAdditionalInformation(Trollweb_BBSNetAxept_Model_WithGUI::TRANSACTION_ID);
|
38 |
$status = $bbs->checkStatus($transid);
|
39 |
if ($status == false) {
|
40 |
$bbs->doLog('Order number '.$order->getIncrementId().' is automatic canceled due to missing payment (Timeout: '.$timeout.')',true);
|
41 |
+
$order->cancel();
|
42 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Automatic canceled due to missing authorization (Timeout: '.$timeout.')'),false);
|
43 |
+
$order->save();
|
44 |
}
|
45 |
else {
|
|
|
46 |
// If marked as captured in BBS, lets try to find the correct invoice and mark it as captured here aswell.
|
47 |
+
$captured = $bbs->Result()->getAmountCaptured();
|
48 |
if ($captured > 0) {
|
49 |
if ($order->hasInvoices()) {
|
50 |
+
|
51 |
foreach ($order->getInvoiceCollection() as $id => $invoice) {
|
52 |
+
$amount = $invoice->getBaseGrandTotal();
|
53 |
if ($invoice->canCapture() and ($amount*100 == $captured)) {
|
54 |
+
$bbs->doLog('Invoice number '.$invoice->getIncrementId().' was marked as captured on Nets and is automaticly marked as paied in magento. (Amount: '.$amount.')',true);
|
55 |
$invoice->setIsPaid(true);
|
56 |
$invoice->pay()->save();
|
57 |
$message = Mage::helper('bbsnetaxept')->__('Registered notification about captured amount of %s.', $amount);
|
64 |
}
|
65 |
}
|
66 |
}
|
67 |
+
|
68 |
}
|
69 |
}
|
app/code/community/Trollweb/BBSNetAxept/Model/Info.php
CHANGED
@@ -3,96 +3,121 @@
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
-
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Model_Info
|
21 |
{
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
-
protected $_secureMap = array('transaction_id',
|
25 |
-
'authorization_id',
|
26 |
-
'authenticated_status',
|
27 |
-
'authenticated_with',
|
28 |
-
'issuer_id',
|
29 |
-
'issuer_country'
|
30 |
-
);
|
31 |
-
|
32 |
public function getPublicPaymentInfo($payment) {
|
33 |
-
|
34 |
-
}
|
35 |
|
36 |
public function getPaymentInfo($payment) {
|
37 |
return $this->_makeMap($this->_secureMap,$payment);
|
38 |
-
}
|
39 |
-
|
40 |
protected function _makeMap($map,$payment) {
|
41 |
$result = array();
|
42 |
foreach ($map as $key) {
|
43 |
-
|
|
|
|
|
|
|
44 |
}
|
45 |
-
|
46 |
return $result;
|
47 |
}
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
+
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_Model_Info
|
21 |
{
|
22 |
+
protected $_publicMap = array();
|
23 |
+
|
24 |
+
protected $_secureMap = array('transaction_id',
|
25 |
+
'authorization_id',
|
26 |
+
'authenticated_status',
|
27 |
+
'authenticated_with',
|
28 |
+
'issuer_id',
|
29 |
+
'issuer_country',
|
30 |
+
'giftcard_amount',
|
31 |
+
);
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
public function getPublicPaymentInfo($payment) {
|
34 |
+
return $this->_makeMap($this->_publicMap,$payment);
|
35 |
+
}
|
36 |
|
37 |
public function getPaymentInfo($payment) {
|
38 |
return $this->_makeMap($this->_secureMap,$payment);
|
39 |
+
}
|
40 |
+
|
41 |
protected function _makeMap($map,$payment) {
|
42 |
$result = array();
|
43 |
foreach ($map as $key) {
|
44 |
+
$value = $this->_getValue($key,$payment);
|
45 |
+
if ($value !== false) {
|
46 |
+
$result[$this->_getLabel($key)] = $this->_getValue($key,$payment);
|
47 |
+
}
|
48 |
}
|
49 |
+
|
50 |
return $result;
|
51 |
}
|
52 |
+
|
53 |
+
protected function _getLabel($key) {
|
54 |
+
switch ($key) {
|
55 |
+
case 'transaction_id':
|
56 |
+
return Mage::helper('bbsnetaxept')->__('Transaction id');
|
57 |
+
case 'authorization_id':
|
58 |
+
return Mage::helper('bbsnetaxept')->__('Authorization id');
|
59 |
+
case 'authenticated_status':
|
60 |
+
return Mage::helper('bbsnetaxept')->__('Authenticated status');
|
61 |
+
case 'authenticated_with':
|
62 |
+
return Mage::helper('bbsnetaxept')->__('Authenticated with');
|
63 |
+
case 'issuer_id':
|
64 |
+
return Mage::helper('bbsnetaxept')->__('Issuer');
|
65 |
+
case 'issuer_country':
|
66 |
+
return Mage::helper('bbsnetaxept')->__('Issuer country');
|
67 |
+
case 'payment_method':
|
68 |
+
return Mage::helper('bbsnetaxept')->__('Payment method');
|
69 |
+
case 'giftcard_amount':
|
70 |
+
return Mage::helper('bbsnetaxept')->__('Giftcard amount');
|
71 |
+
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function _getValue($key,$payment) {
|
76 |
+
$value = $payment->getAdditionalInformation('bbs_'.$key);
|
77 |
+
if ($value == null) {
|
78 |
+
switch ($key) {
|
79 |
+
case 'transaction_id':
|
80 |
+
$value = $payment->getBbsTransactionId();
|
81 |
+
break;
|
82 |
+
case 'authorization_id':
|
83 |
+
$value = $payment->getBbsAuthorizationId();
|
84 |
+
break;
|
85 |
+
case 'authenticated_status':
|
86 |
+
$value = $payment->getBbsAuthenticatedStatus();
|
87 |
+
break;
|
88 |
+
case 'authenticated_with':
|
89 |
+
$value = $payment->getBbsAuthenticatedWith();
|
90 |
+
break;
|
91 |
+
case 'issuer_id':
|
92 |
+
$value = $payment->getBbsIssuerId();
|
93 |
+
break;
|
94 |
+
case 'issuer_country':
|
95 |
+
$value = $payment->getBbsIssuerCountry();
|
96 |
+
break;
|
97 |
+
}
|
98 |
+
|
99 |
+
if ($key == "issuer_id") {
|
100 |
+
$additional = $this->_getValue('issuer', $payment);
|
101 |
+
if ($additional) {
|
102 |
+
$value .= ' '.$additional;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
if (!$value) {
|
107 |
+
$value = '';
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
if ($key == "giftcard_amount") {
|
112 |
+
if ($payment->getAdditionalInformation(Trollweb_BBSNetAxept_Model_WithGUI::IS_GIFTCARD)) {
|
113 |
+
$value = number_format($value/100,2);
|
114 |
+
}
|
115 |
+
else {
|
116 |
+
$value = false;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
return $value;
|
121 |
+
}
|
122 |
+
|
123 |
}
|
app/code/community/Trollweb/BBSNetAxept/Model/Observer.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Trollweb_BBSNetAxept_Model_Observer
|
4 |
+
{
|
5 |
+
|
6 |
+
public function voidPayment($observer)
|
7 |
+
{
|
8 |
+
|
9 |
+
$payment = $observer->getEvent()->getPayment();
|
10 |
+
if ($payment->getMethod() == "bbsnetaxept_withgui") {
|
11 |
+
$methodInstance = $payment->getMethodInstance();
|
12 |
+
$methodInstance->void($payment);
|
13 |
+
}
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
public function core_config_data_save_after($observer) {
|
18 |
+
$configData = $observer->getEvent()->getConfigData();
|
19 |
+
|
20 |
+
if ($configData && $configData->getPath() == 'payment/bbsnetaxept_withgui/active' && $configData->getValue() == 1) {
|
21 |
+
Mage::register('bbsnetaxept_licens_status', true);
|
22 |
+
}
|
23 |
+
|
24 |
+
if ($configData && $configData->getPath() == 'payment/bbsnetaxept_withgui/test_mode' && $configData->getValue() == 0) {
|
25 |
+
Mage::register('bbsnetaxept_licens_mode', true);
|
26 |
+
}
|
27 |
+
|
28 |
+
if ($configData && $configData->getPath() == 'payment/bbsnetaxept_withgui/merchant_id' && $configData->getValue() != '') {
|
29 |
+
Mage::register('bbsnetaxept_licens_merchant', true);
|
30 |
+
}
|
31 |
+
|
32 |
+
if (Mage::registry('bbsnetaxept_licens_status') AND Mage::registry('bbsnetaxept_licens_mode') AND Mage::registry('bbsnetaxept_licens_merchant')) {
|
33 |
+
if (Mage::registry('bbsnetaxept_licens_updated')) {
|
34 |
+
return $this;
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
Mage::register('bbsnetaxept_licens_updated', true);
|
38 |
+
}
|
39 |
+
Mage::getModel('bbsnetaxept/withGUI')->saveConfigData();
|
40 |
+
}
|
41 |
+
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
app/code/community/Trollweb/BBSNetAxept/Model/Updates.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
class Trollweb_BBSNetAxept_Model_Updates
|
21 |
+
{
|
22 |
+
// Config paths
|
23 |
+
const FEED_URL_PATH = 'trollweb/updates/url';
|
24 |
+
const FEED_ENABLED = 'trollweb/updates/enabled';
|
25 |
+
const FEED_CHECK_FREQUENCY = 'trollweb/updates/check_frequencey';
|
26 |
+
|
27 |
+
const CACHE_PREFIX = 'trollweb_notification';
|
28 |
+
|
29 |
+
protected $_feedUrl;
|
30 |
+
protected $_module;
|
31 |
+
|
32 |
+
function check(Varien_Event_Observer $observer) {
|
33 |
+
if (Mage::getSingleton('admin/session')->isLoggedIn()) {
|
34 |
+
$this->getModule();
|
35 |
+
$this->checkUpdate();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
function checkUpdate()
|
41 |
+
{
|
42 |
+
if (($this->getFrequency() + $this->getLastUpdate()) > time()) {
|
43 |
+
// return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
$feedData = array();
|
47 |
+
|
48 |
+
$feedXml = $this->getFeedData();
|
49 |
+
if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
|
50 |
+
|
51 |
+
foreach ($feedXml->channel->item as $item) {
|
52 |
+
$feedData[] = array(
|
53 |
+
'severity' => (int)$item->severity,
|
54 |
+
'date_added' => $this->getDate((string)$item->pubDate),
|
55 |
+
'title' => (string)$item->title,
|
56 |
+
'description' => (string)$item->description,
|
57 |
+
'url' => (string)$item->link,
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
if ($feedData) {
|
62 |
+
Mage::getModel('adminnotification/inbox')->parse(array_reverse($feedData));
|
63 |
+
}
|
64 |
+
|
65 |
+
}
|
66 |
+
$this->setLastUpdate();
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
public function getModule()
|
71 |
+
{
|
72 |
+
if (!isset($this->_module)) {
|
73 |
+
$tags = explode("_",get_class($this));
|
74 |
+
// Check if this is a trollweb module.
|
75 |
+
if (strtolower($tags[0]) == "trollweb") {
|
76 |
+
$this->_module = strtolower($tags[1]);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
return $this->_module;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Retrieve DB date from RSS date
|
84 |
+
*
|
85 |
+
* @param string $rssDate
|
86 |
+
* @return string YYYY-MM-DD YY:HH:SS
|
87 |
+
*/
|
88 |
+
public function getDate($rssDate)
|
89 |
+
{
|
90 |
+
return gmdate('Y-m-d H:i:s', strtotime($rssDate));
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Retrieve Update Frequency
|
95 |
+
*
|
96 |
+
* @return int
|
97 |
+
*/
|
98 |
+
public function getFrequency()
|
99 |
+
{
|
100 |
+
return Mage::getStoreConfig(self::FEED_CHECK_FREQUENCY);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Retrieve Last update time
|
105 |
+
*
|
106 |
+
* @return int
|
107 |
+
*/
|
108 |
+
public function getLastUpdate()
|
109 |
+
{
|
110 |
+
return Mage::app()->loadCache(self::CACHE_PREFIX."_".$this->getModule().'_lastcheck');
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Retrieve Last update time
|
115 |
+
*
|
116 |
+
* @return int
|
117 |
+
*/
|
118 |
+
public function setLastUpdate()
|
119 |
+
{
|
120 |
+
Mage::app()->saveCache(time(), self::CACHE_PREFIX."_".$this->getModule().'_lastcheck');
|
121 |
+
}
|
122 |
+
|
123 |
+
public function getVersion()
|
124 |
+
{
|
125 |
+
$v = (array)Mage::getConfig()->getNode('modules')->children();
|
126 |
+
$module = implode("_",array_slice(explode("_",get_class($this)),0,2));
|
127 |
+
$ver = (string)$v[$module]->version;
|
128 |
+
|
129 |
+
return ($ver ? $ver : '0.0.1');
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Retrieve feed url
|
135 |
+
*
|
136 |
+
* @return string
|
137 |
+
*/
|
138 |
+
public function getFeedUrl()
|
139 |
+
{
|
140 |
+
if (is_null($this->_feedUrl)) {
|
141 |
+
$this->_feedUrl = 'http://' . Mage::getStoreConfig(self::FEED_URL_PATH).'?module='.$this->getModule().'&ver='.$this->getVersion();
|
142 |
+
}
|
143 |
+
return $this->_feedUrl;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Retrieve feed data as XML element
|
148 |
+
*
|
149 |
+
* @return SimpleXMLElement
|
150 |
+
*/
|
151 |
+
public function getFeedData()
|
152 |
+
{
|
153 |
+
$curl = new Varien_Http_Adapter_Curl();
|
154 |
+
$curl->setConfig(array(
|
155 |
+
'timeout' => 2
|
156 |
+
));
|
157 |
+
$curl->write(Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
|
158 |
+
$data = $curl->read();
|
159 |
+
if ($data === false) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
$data = preg_split('/^\r?$/m', $data, 2);
|
163 |
+
$data = trim($data[1]);
|
164 |
+
$curl->close();
|
165 |
+
|
166 |
+
try {
|
167 |
+
$xml = new SimpleXMLElement($data);
|
168 |
+
}
|
169 |
+
catch (Exception $e) {
|
170 |
+
return false;
|
171 |
+
}
|
172 |
+
|
173 |
+
return $xml;
|
174 |
+
}
|
175 |
+
|
176 |
+
}
|
app/code/community/Trollweb/BBSNetAxept/Model/WithGUI.php
CHANGED
@@ -1,293 +1,947 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Our test CC module adapter
|
23 |
+
*/
|
24 |
+
class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstract
|
25 |
+
{
|
26 |
+
protected $_code = 'bbsnetaxept_withgui';
|
27 |
+
protected $_formBlockType = 'bbsnetaxept/form';
|
28 |
+
protected $_infoBlockType = 'bbsnetaxept/paymentInfo';
|
29 |
+
|
30 |
+
|
31 |
+
//* Options *//
|
32 |
+
protected $_isGateway = true;
|
33 |
+
protected $_canAuthorize = true;
|
34 |
+
protected $_canCapture = true;
|
35 |
+
protected $_canCapturePartial = true;
|
36 |
+
protected $_canRefund = true;
|
37 |
+
protected $_canRefundInvoicePartial = true;
|
38 |
+
protected $_canVoid = false;
|
39 |
+
protected $_canUseInternal = true;
|
40 |
+
protected $_canUseCheckout = true;
|
41 |
+
protected $_canUseForMultishipping = false;
|
42 |
+
protected $_canSaveCc = false;
|
43 |
+
protected $_isInitializeNeeded = true;
|
44 |
+
|
45 |
+
// Direct payment methods
|
46 |
+
protected $_directPaymentMethods = array(
|
47 |
+
'SwedishBankHandelsbanken',
|
48 |
+
'SwedishBankNordea',
|
49 |
+
'SwedishBankSwedbank',
|
50 |
+
'SwedishBankSEB',
|
51 |
+
);
|
52 |
+
|
53 |
+
// Gift card methods
|
54 |
+
protected $_giftCardMethods = array(
|
55 |
+
'GiftCard',
|
56 |
+
'GiftCardCenter'
|
57 |
+
);
|
58 |
+
|
59 |
+
// Internal Flags
|
60 |
+
protected $_useMobile;
|
61 |
+
|
62 |
+
// TEST HOST
|
63 |
+
const TEST_HOST = 'epayment-test.bbs.no';
|
64 |
+
const PROD_HOST = 'epayment.bbs.no';
|
65 |
+
|
66 |
+
// Attributes
|
67 |
+
const TRANSACTION_ID = 'bbs_transaction_id';
|
68 |
+
const AUTHENTICATED_STATUS = 'bbs_authenticated_status';
|
69 |
+
const AUTHENTICATED_WITH = 'bbs_authenticated_with';
|
70 |
+
const ISSUER_COUNTRY = 'bbs_issuer_country';
|
71 |
+
const ISSUER = 'bbs_issuer';
|
72 |
+
const ISSUER_ID = 'bbs_issuer_id';
|
73 |
+
const AUTHORIZATION_ID = 'bbs_authorization_id';
|
74 |
+
const SESSION_NUMBER = 'bbs_session_number';
|
75 |
+
const PAYMENTMETHOD = 'bbs_payment_method';
|
76 |
+
const MOBILE_CLIENT = 'bbs_mobile_client';
|
77 |
+
const IS_GIFTCARD = 'bbs_is_giftcard';
|
78 |
+
const GIFTCARD_AMOUNT = 'bbs_giftcard_amount';
|
79 |
+
const CHILD_TRANSACTION = 'bbs_child_transaction';
|
80 |
+
|
81 |
+
const ORDER_STATUS = 'pending_nets';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Get checkout session namespace
|
85 |
+
*
|
86 |
+
* @return Mage_Checkout_Model_Session
|
87 |
+
*/
|
88 |
+
public function getCheckout()
|
89 |
+
{
|
90 |
+
return Mage::getSingleton('checkout/session');
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Get current quote
|
95 |
+
*
|
96 |
+
* @return Mage_Sales_Model_Quote
|
97 |
+
*/
|
98 |
+
public function getQuote()
|
99 |
+
{
|
100 |
+
return $this->getCheckout()->getQuote();
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Assign data to info model instance
|
105 |
+
*
|
106 |
+
* @param mixed $data
|
107 |
+
* @return Mage_Payment_Model_Info
|
108 |
+
*/
|
109 |
+
public function assignData($data)
|
110 |
+
{
|
111 |
+
if (!($data instanceof Varien_Object)) {
|
112 |
+
$data = new Varien_Object($data);
|
113 |
+
}
|
114 |
+
|
115 |
+
$info = $this->getInfoInstance();
|
116 |
+
$info->setCcType($data->getCcType())
|
117 |
+
->setCcOwner($data->getCcOwner())
|
118 |
+
->setCcLast4(substr($data->getCcNumber(), -4))
|
119 |
+
->setCcNumber($data->getCcNumber())
|
120 |
+
->setCcCid($data->getCcCid())
|
121 |
+
->setCcExpMonth($data->getCcExpMonth())
|
122 |
+
->setCcExpYear($data->getCcExpYear());
|
123 |
+
|
124 |
+
if ($this->getConfigData('mobile_active') && $data->getNetsMobile()) {
|
125 |
+
$this->getCheckout()->setNetsMobile(true);
|
126 |
+
}
|
127 |
+
else {
|
128 |
+
$this->getCheckout()->setNetsMobile(false);
|
129 |
+
}
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Checks if the user's cart is under the limit set in
|
135 |
+
* the admin config, the option isn't set or the value
|
136 |
+
* of the option is set to ' ' or '0'.
|
137 |
+
*
|
138 |
+
* @param Mage_Sales_Model_Quote $quote Shopping cart quote
|
139 |
+
*/
|
140 |
+
protected function cartOverLimit($quote) {
|
141 |
+
$_maxAmountSet = $this->getConfigData('max_amount');
|
142 |
+
$_maxAmountValue = $this->getConfigData('max_amount_value');
|
143 |
+
|
144 |
+
// If setting disabled:
|
145 |
+
if($_maxAmountSet == 0) {
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
// If setting enabled and no value:
|
149 |
+
else if($_maxAmountSet == 1 && empty($_maxAmountValue)) { // empty() is equivalent to !isset(var) || var == false
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
// If setting enabled and value > cart value
|
153 |
+
else if($quote->getBaseGrandTotal() < $_maxAmountValue) {
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
|
157 |
+
return true; // Option enabled and cart over limit
|
158 |
+
|
159 |
+
}
|
160 |
+
|
161 |
+
public function isAvailable($quote=null)
|
162 |
+
{
|
163 |
+
if ($this->getConfigData('use_gui') == 1) {
|
164 |
+
$this->_formBlockType = 'bbsnetaxept/form';
|
165 |
+
$this->_infoBlockType = 'bbsnetaxept/paymentInfo';
|
166 |
+
|
167 |
+
}
|
168 |
+
else {
|
169 |
+
$this->_formBlockType = 'payment/form_cc';
|
170 |
+
$this->_infoBlockType = 'payment/info_cc';
|
171 |
+
|
172 |
+
}
|
173 |
+
|
174 |
+
if($this->cartOverLimit($quote)) {
|
175 |
+
return false;
|
176 |
+
}
|
177 |
+
return $this->getConfigData('active');
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Retrieve payment method title
|
182 |
+
*
|
183 |
+
* @return string
|
184 |
+
*/
|
185 |
+
public function getTitle()
|
186 |
+
{
|
187 |
+
return $this->getConfigData('title');
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Method that will be executed instead of authorize or capture
|
192 |
+
* if flag isInitilizeNeeded set to true
|
193 |
+
*
|
194 |
+
* @param string $paymentAction
|
195 |
+
* @param Varien_Object $stateObject
|
196 |
+
* @return Mage_Payment_Model_Abstract
|
197 |
+
*/
|
198 |
+
public function initialize($paymentAction, $stateObject)
|
199 |
+
{
|
200 |
+
$state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
201 |
+
$stateObject->setState($state);
|
202 |
+
$stateObject->setStatus(self::ORDER_STATUS);
|
203 |
+
$stateObject->setIsNotified(false);
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Using internal pages for input payment data
|
208 |
+
*
|
209 |
+
* @return bool
|
210 |
+
*/
|
211 |
+
public function canUseInternal()
|
212 |
+
{
|
213 |
+
|
214 |
+
return $this->_canUseInternal;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Using for multiple shipping address
|
219 |
+
*
|
220 |
+
* @return bool
|
221 |
+
*/
|
222 |
+
public function canUseForMultishipping()
|
223 |
+
{
|
224 |
+
return $this->_canUseForMultishipping;
|
225 |
+
}
|
226 |
+
|
227 |
+
public function onOrderValidate(Mage_Sales_Model_Order_Payment $payment)
|
228 |
+
{
|
229 |
+
return $this;
|
230 |
+
}
|
231 |
+
|
232 |
+
public function onInvoiceCreate(Mage_Sales_Model_Invoice_Payment $payment)
|
233 |
+
{
|
234 |
+
|
235 |
+
}
|
236 |
+
|
237 |
+
public function getBBSTransKey()
|
238 |
+
{
|
239 |
+
$order = Mage::getModel('sales/order');
|
240 |
+
$_oid = $this->getCheckout()->getLastOrderId();
|
241 |
+
$order->load($_oid);
|
242 |
+
if ($order->getStatus() == self::ORDER_STATUS) {
|
243 |
+
|
244 |
+
$this->getCheckout()->setBBSTransactionId(uniqid());
|
245 |
+
$order->getPayment()->setAdditionalInformation(self::TRANSACTION_ID,$this->getCheckout()->getBBSTransactionId());
|
246 |
+
|
247 |
+
$transKey = $this->getApi()->
|
248 |
+
setCurrencyCode($order->getBaseCurrencyCode())->
|
249 |
+
setTransactionId($this->getCheckout()->getBBSTransactionId())->
|
250 |
+
setAmount(sprintf("%0.0f",$order->getBaseGrandTotal()*100))->
|
251 |
+
setOrderNumber($this->getCheckout()->getLastRealOrderId())->
|
252 |
+
setOrderDescription($this->getProductLines($order))->
|
253 |
+
setCustomerEmail($order->getCustomerEmail())->
|
254 |
+
setCustomerPhoneNumber($order->getBillingAddress()->getTelephone())->
|
255 |
+
setSessionId($this->getCheckout()->getQuoteId())->
|
256 |
+
setInternalGUI($this->useInternalGUI())->
|
257 |
+
getTransKey($this->getCheckout()->getStoreId());
|
258 |
+
|
259 |
+
if ($transKey == false) {
|
260 |
+
$this->getApi()->doLog('ERROR: [NetsTransKey] Error receiving key - '.$this->getApi()->getErrorMessage(),true);
|
261 |
+
$this->getCheckout()->addError(Mage::helper('bbsnetaxept')->__('Unable to receive transaction key from Nets: '.$this->getApi()->getErrorMessage()));
|
262 |
+
return false;
|
263 |
+
}
|
264 |
+
else {
|
265 |
+
$this->getCheckout()->setBBSTransKey($transKey);
|
266 |
+
if ($this->useInternalGUI()) {
|
267 |
+
$info = $this->getInfoInstance();
|
268 |
+
if (!($info instanceof Varien_Object)) {
|
269 |
+
$info = new Varien_Object($info);
|
270 |
+
}
|
271 |
+
$this->getCheckout()->setCardInfo($info);
|
272 |
+
}
|
273 |
+
$order->addStatusToHistory(self::ORDER_STATUS,Mage::helper('bbsnetaxept')->__('Redirected to Nets Payment for authorisation').' ('.$order->getBaseGrandTotal().' '.$order->getBaseCurrencyCode().')',false);
|
274 |
+
$order->save();
|
275 |
+
}
|
276 |
+
return $this->getCheckout()->getBBSTransKey();
|
277 |
+
}
|
278 |
+
else {
|
279 |
+
$this->getApi()->doLog('ERROR: [NetsTransKey] Order ('.$_oid.' - '.$order->getIncrementId().') has not correct status - '.$order->getStatus(),true);
|
280 |
+
return false;
|
281 |
+
}
|
282 |
+
|
283 |
+
// Should never end up here.
|
284 |
+
return false;
|
285 |
+
}
|
286 |
+
|
287 |
+
public function getOrderPlaceRedirectUrl()
|
288 |
+
{
|
289 |
+
$this->getCheckout()->setNetsAllowRedirect(true);
|
290 |
+
return Mage::getUrl('bbsnetaxept/return/redirect', array('_secure' => true));
|
291 |
+
}
|
292 |
+
|
293 |
+
public function getBBSUrl()
|
294 |
+
{
|
295 |
+
$url = 'https://';
|
296 |
+
if ($this->getConfigData('test_mode')) {
|
297 |
+
$url .= Trollweb_BBSNetAxept_Model_WithGUI::TEST_HOST;
|
298 |
+
}
|
299 |
+
else {
|
300 |
+
$url .= Trollweb_BBSNetAxept_Model_WithGUI::PROD_HOST;
|
301 |
+
}
|
302 |
+
if ($this->useMobile()) {
|
303 |
+
$url .= '/terminal/mobile/default.aspx';
|
304 |
+
}
|
305 |
+
else {
|
306 |
+
$url .= '/terminal/default.aspx';
|
307 |
+
}
|
308 |
+
return $url;
|
309 |
+
}
|
310 |
+
|
311 |
+
public function getMerchantId()
|
312 |
+
{
|
313 |
+
$_merchantId = ($this->useMobile() ? 'mobile_' : '').'merchant_id';
|
314 |
+
|
315 |
+
return $this->getConfigData($_merchantId);
|
316 |
+
}
|
317 |
+
|
318 |
+
public function getPendingTimeout()
|
319 |
+
{
|
320 |
+
return $this->getConfigData('pending_minutes');
|
321 |
+
}
|
322 |
+
|
323 |
+
public function useInternalGUI()
|
324 |
+
{
|
325 |
+
return ($this->getConfigData('use_gui') ? false : true);
|
326 |
+
}
|
327 |
+
|
328 |
+
public function getCCDate()
|
329 |
+
{
|
330 |
+
$info = $this->getInfoInstance();
|
331 |
+
return $info;
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Get BBS API Model
|
336 |
+
*
|
337 |
+
* @return Trollweb_BBSNetAxept_Model_Api_Bbs
|
338 |
+
*/
|
339 |
+
public function getApi()
|
340 |
+
{
|
341 |
+
$bbsClient = Mage::getSingleton('bbsnetaxept/api_bbs');
|
342 |
+
|
343 |
+
$_merchantToken = ($this->useMobile() ? 'mobile_' : '').'merchant_token';
|
344 |
+
$_merchantTestToken = ($this->useMobile() ? 'mobile_test_token' : 'merchant_test_token');
|
345 |
+
|
346 |
+
|
347 |
+
// Merchant ID
|
348 |
+
$bbsClient->setMerchantId($this->getMerchantId())
|
349 |
+
->setLanguage($this->getConfigData('gui_language'))
|
350 |
+
->setLogactive($this->getConfigData('enable_log'));
|
351 |
+
|
352 |
+
if ($this->getConfigData('test_mode')) {
|
353 |
+
$bbsClient->setHost(Trollweb_BBSNetAxept_Model_WithGUI::TEST_HOST)
|
354 |
+
->setMerchantToken($this->getConfigData($_merchantTestToken));
|
355 |
+
}
|
356 |
+
else {
|
357 |
+
$bbsClient->setHost(Trollweb_BBSNetAxept_Model_WithGUI::PROD_HOST)
|
358 |
+
->setMerchantToken($this->getConfigData($_merchantToken));
|
359 |
+
|
360 |
+
}
|
361 |
+
return $bbsClient;
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Check the result from the BBS NetAxept
|
366 |
+
*
|
367 |
+
* @param none
|
368 |
+
* @return bool
|
369 |
+
*/
|
370 |
+
public function checkResult($bbskey) {
|
371 |
+
$isOK = false;
|
372 |
+
|
373 |
+
// Load order.
|
374 |
+
$order = Mage::getModel('sales/order');
|
375 |
+
$order->load($this->getCheckout()->getLastOrderId());
|
376 |
+
|
377 |
+
if ($order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
378 |
+
|
379 |
+
if ($this->getApi()->query($bbskey)) {
|
380 |
+
$_paymentMethod = $this->getApi()->Result()->getPaymentMethod();
|
381 |
+
if (in_array($_paymentMethod,$this->_directPaymentMethods)) {
|
382 |
+
// Direct payment
|
383 |
+
$isOK = $this->processDirectPayment($order,$bbskey);
|
384 |
+
}
|
385 |
+
elseif (in_array($_paymentMethod,$this->_giftCardMethods)) {
|
386 |
+
// Gift cards - handle with care.
|
387 |
+
if ($this->getApi()->Result()->getChildTransactionId()) {
|
388 |
+
// This is a split transaction. Partly paid with giftcard
|
389 |
+
// and partly with a regular card.
|
390 |
+
// Run this a regular Auth
|
391 |
+
$isOK = $this->processCardTransaction($order,$bbskey,true);
|
392 |
+
}
|
393 |
+
else {
|
394 |
+
// Fully paid with gift card.
|
395 |
+
// Handle special
|
396 |
+
$isOK = $this->processGiftCardTransaction($order,$bbskey);
|
397 |
+
}
|
398 |
+
}
|
399 |
+
else {
|
400 |
+
$isOK = $this->processCardTransaction($order,$bbskey,false);
|
401 |
+
}
|
402 |
+
}
|
403 |
+
else {
|
404 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Unable to get info about payment. Please contact the store.'),true)->save();
|
405 |
+
$this->getApi()->doLog('ERROR: Unable to get info about payment. Please contact the store.',false);
|
406 |
+
$this->getCheckout()->addError($this->getErrorMessage(-99));
|
407 |
+
}
|
408 |
+
}
|
409 |
+
else {
|
410 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Wrong order state %s',$order->getState()),true)->save();
|
411 |
+
$this->getApi()->doLog('ERROR: Wrong order state ('.$order->getState().') on #'.$order->getIncrementId().'.',false);
|
412 |
+
$this->getCheckout()->addError($this->getErrorMessage(-99));
|
413 |
+
}
|
414 |
+
|
415 |
+
if (!$isOK) {
|
416 |
+
$this->activateQuote();
|
417 |
+
}
|
418 |
+
|
419 |
+
return $isOK;
|
420 |
+
}
|
421 |
+
|
422 |
+
public function cancelledByUser()
|
423 |
+
{
|
424 |
+
$_canceled = false;
|
425 |
+
$order = Mage::getModel('sales/order');
|
426 |
+
$order->load($this->getCheckout()->getLastOrderId());
|
427 |
+
if ($order->getId() && ($order->getStatus() == self::ORDER_STATUS)) {
|
428 |
+
Mage::dispatchEvent('payment_cancel_action', array('order' => $order, 'quote' => $this->getCheckout()->setLoadInactive(true)->getQuote()));
|
429 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Payment cancelled by user'),false);
|
430 |
+
$order->cancel()->save();
|
431 |
+
$_canceled = true;
|
432 |
+
}
|
433 |
+
|
434 |
+
if ($_canceled) {
|
435 |
+
$this->getCheckout()->addError(Mage::helper('bbsnetaxept')->__('Payment cancelled by user'));
|
436 |
+
$this->activateQuote();
|
437 |
+
}
|
438 |
+
|
439 |
+
return $_canceled;
|
440 |
+
}
|
441 |
+
|
442 |
+
public function activateQuote()
|
443 |
+
{
|
444 |
+
$this->getCheckout()->setLoadInactive(true)->getQuote()->setIsActive(true)->save();
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
public function capture(Varien_Object $payment, $amount) {
|
449 |
+
$error = false;
|
450 |
+
|
451 |
+
if (in_array($payment->getAdditionalInformation(self::PAYMENTMETHOD),$this->_directPaymentMethods)) {
|
452 |
+
// Do not run financial transactions on directpayment.
|
453 |
+
return $this;
|
454 |
+
}
|
455 |
+
|
456 |
+
$bbs_amount = sprintf("%0.0f",$amount*100);
|
457 |
+
$order = $payment->getOrder();
|
458 |
+
|
459 |
+
if ($payment->getAdditionalInformation(self::IS_GIFTCARD)) {
|
460 |
+
// Special checks for giftcards.
|
461 |
+
$invoiced = sprintf("%0.0f",$order->getBaseTotalInvoiced()*100);
|
462 |
+
$giftcardAmount = $payment->getAdditionalInformation(self::GIFTCARD_AMOUNT);
|
463 |
+
|
464 |
+
if ($invoiced <= $giftcardAmount) {
|
465 |
+
// The whole giftcard amount is not invoiced
|
466 |
+
if ($bbs_amount <= ($giftcardAmount-$invoiced)) {
|
467 |
+
// The amount that is invoiced is exactly the same
|
468 |
+
// or less than the remaining giftcard amount
|
469 |
+
// Don't do any capture to Nets. Just approve the amount.
|
470 |
+
$payment->setTransactionId($payment->getTransactionId().'-giftcard');
|
471 |
+
return $this;
|
472 |
+
}
|
473 |
+
else {
|
474 |
+
// Substract the giftcard amount from
|
475 |
+
// the amount that is going to be captured.
|
476 |
+
$bbs_amount = $bbs_amount - ($giftcardAmount-$invoiced);
|
477 |
+
}
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
if (!$payment->getAdditionalInformation(self::TRANSACTION_ID)) {
|
482 |
+
if (!$payment->getBbsTransactionId()) {
|
483 |
+
Mage::throwException(Mage::helper('bbsnetaxept')->__('Could not find transaction id.'));
|
484 |
+
}
|
485 |
+
else {
|
486 |
+
$bbsTransId = $payment->getBbsTransactionId(); // Make it compatible with old fashion BBSNetterminal.
|
487 |
+
}
|
488 |
+
}
|
489 |
+
else {
|
490 |
+
$bbsTransId = $payment->getAdditionalInformation(self::TRANSACTION_ID);
|
491 |
+
}
|
492 |
+
|
493 |
+
|
494 |
+
|
495 |
+
$this->_useMobile = ($payment->getAdditionalInformation(self::MOBILE_CLIENT) === true);
|
496 |
+
|
497 |
+
$InvoiceId = ($order->getIncrementId() ? $order->getIncrementId() : 'Unknown');
|
498 |
+
|
499 |
+
$this->getApi()->doLog('Sending request to capture '.$bbs_amount.' on '.$invoiceId);
|
500 |
+
|
501 |
+
if ($this->getApi()->capture($bbsTransId,$bbs_amount,$InvoiceId) === true) {
|
502 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED);
|
503 |
+
$inc = (int)$order->hasInvoices();
|
504 |
+
$transId = $this->getApi()->Result()->getTransactionId();
|
505 |
+
$payment->setTransactionId($transId.'-'.$inc);
|
506 |
+
}
|
507 |
+
else {
|
508 |
+
$error = Mage::helper('bbsnetaxept')->__('Error capturing the payment: %s', $this->getApi()->getErrorMessage());
|
509 |
+
}
|
510 |
+
|
511 |
+
if ($error !== false) {
|
512 |
+
Mage::throwException($error);
|
513 |
+
}
|
514 |
+
|
515 |
+
return $this;
|
516 |
+
}
|
517 |
+
|
518 |
+
/**
|
519 |
+
* refund the amount with transaction id
|
520 |
+
*
|
521 |
+
* @access public
|
522 |
+
* @param string $payment Varien_Object object
|
523 |
+
* @return Mage_Payment_Model_Abstract
|
524 |
+
*/
|
525 |
+
public function refund(Varien_Object $payment, $amount)
|
526 |
+
{
|
527 |
+
$error = false;
|
528 |
+
|
529 |
+
if (!$payment->getAdditionalInformation(self::TRANSACTION_ID)) {
|
530 |
+
if (!$payment->getBbsTransactionId()) {
|
531 |
+
Mage::throwException(Mage::helper('bbsnetaxept')->__('Could not find transaction id.'));
|
532 |
+
}
|
533 |
+
else {
|
534 |
+
$bbsTransId = $payment->getBbsTransactionId(); // Make it compatible with old fashion BBSNetterminal.
|
535 |
+
}
|
536 |
+
}
|
537 |
+
else {
|
538 |
+
$bbsTransId = $payment->getAdditionalInformation(self::TRANSACTION_ID);
|
539 |
+
}
|
540 |
+
|
541 |
+
$order = $payment->getOrder();
|
542 |
+
$this->_useMobile = ($payment->getAdditionalInformation(self::MOBILE_CLIENT) === true);
|
543 |
+
$InvoiceId = ($order->getIncrementId() ? $order->getIncrementId() : 'Unknown');
|
544 |
+
|
545 |
+
$bbs_amount = sprintf("%0.0f",$amount*100);
|
546 |
+
if ($this->getApi()->refund($bbsTransId,$bbs_amount, $InvoiceId) == $bbsTransId) {
|
547 |
+
$payment->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_SUCCESS);
|
548 |
+
$inc = $order->hasCreditmemos();
|
549 |
+
$payment->setTransactionId($bbsTransId.'-CM'.$inc);
|
550 |
+
|
551 |
+
}
|
552 |
+
else {
|
553 |
+
$error = Mage::helper('bbsnetaxept')->__('Error refunding the payment: %s', $this->getApi()->getErrorMessage());
|
554 |
+
}
|
555 |
+
|
556 |
+
if ($error !== false) {
|
557 |
+
Mage::throwException($error);
|
558 |
+
}
|
559 |
+
|
560 |
+
return $this;
|
561 |
+
}
|
562 |
+
|
563 |
+
/**
|
564 |
+
* Void payment
|
565 |
+
*
|
566 |
+
* @param Varien_Object $invoicePayment
|
567 |
+
* @return Mage_Payment_Model_Abstract
|
568 |
+
*/
|
569 |
+
public function void(Varien_Object $payment)
|
570 |
+
{
|
571 |
+
$error = false;
|
572 |
+
|
573 |
+
// Void is not enabled.
|
574 |
+
if (!$this->getConfigData('enable_void')) {
|
575 |
+
return $this;
|
576 |
+
}
|
577 |
+
|
578 |
+
if (in_array($payment->getAdditionalInformation(self::PAYMENTMETHOD),$this->_directPaymentMethods)) {
|
579 |
+
// Do not run financial transactions on directpayment.
|
580 |
+
return $this;
|
581 |
+
}
|
582 |
+
|
583 |
+
if (!$payment->getAdditionalInformation(self::TRANSACTION_ID)) {
|
584 |
+
if (!$payment->getBbsTransactionId()) {
|
585 |
+
$this->getApi()->doLog(Mage::helper('bbsnetaxept')->__('Could not find transaction id.'));
|
586 |
+
return $this;
|
587 |
+
}
|
588 |
+
else {
|
589 |
+
$bbsTransId = $payment->getBbsTransactionId(); // Make it compatible with old fashion BBSNetterminal.
|
590 |
+
}
|
591 |
+
}
|
592 |
+
else {
|
593 |
+
$bbsTransId = $payment->getAdditionalInformation(self::TRANSACTION_ID);
|
594 |
+
}
|
595 |
+
|
596 |
+
$order = $payment->getOrder();
|
597 |
+
$this->_useMobile = ($payment->getAdditionalInformation(self::MOBILE_CLIENT) === true);
|
598 |
+
if ($order->getInvoiceCollection()->count() > 0) {
|
599 |
+
// Do no try to annul orders that have invoices.
|
600 |
+
return $this;
|
601 |
+
}
|
602 |
+
|
603 |
+
$InvoiceId = ($order->getIncrementId() ? $order->getIncrementId() : 'Unknown');
|
604 |
+
|
605 |
+
if ($this->getApi()->void($bbsTransId, $InvoiceId) == $bbsTransId) {
|
606 |
+
$payment->setStatus(self::STATUS_SUCCESS);
|
607 |
+
}
|
608 |
+
else {
|
609 |
+
$error = Mage::helper('bbsnetaxept')->__('Error void the payment: %s', $this->getApi()->getErrorMessage());
|
610 |
+
}
|
611 |
+
|
612 |
+
if ($error !== false) {
|
613 |
+
$this->getApi()->doLog($error);
|
614 |
+
// Mage::throwException($error);
|
615 |
+
|
616 |
+
}
|
617 |
+
|
618 |
+
return $this;
|
619 |
+
}
|
620 |
+
|
621 |
+
|
622 |
+
public function getLogoMethods() {
|
623 |
+
$codes = array(0 => Mage::helper('bbsnetaxept')->__('Ingen logo'),
|
624 |
+
// 1 => Mage::helper('bbsnetaxept')->__('BBS logo'),
|
625 |
+
2 => Mage::helper('bbsnetaxept')->__('Nets logo'),
|
626 |
+
3 => Mage::helper('bbsnetaxept')->__('Dankort logo')
|
627 |
+
);
|
628 |
+
return $codes;
|
629 |
+
}
|
630 |
+
|
631 |
+
public function getLogoUrl() {
|
632 |
+
$logotypes = explode(",",$this->getConfigData('logo'));
|
633 |
+
|
634 |
+
$logos = array();
|
635 |
+
|
636 |
+
foreach ($logotypes as $logotype) {
|
637 |
+
|
638 |
+
switch($logotype) {
|
639 |
+
case 1:
|
640 |
+
$url = 'images/bbsnetaxept/logo.png';
|
641 |
+
break;
|
642 |
+
case 2:
|
643 |
+
$url = 'images/bbsnetaxept/nets-payment.png';
|
644 |
+
break;
|
645 |
+
case 3:
|
646 |
+
$url = 'images/bbsnetaxept/dancard.png';
|
647 |
+
break;
|
648 |
+
|
649 |
+
case 0:
|
650 |
+
default:
|
651 |
+
$url = '';
|
652 |
+
break;
|
653 |
+
}
|
654 |
+
|
655 |
+
if ($url) {
|
656 |
+
$logos[] = $url;
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
return $logos;
|
661 |
+
}
|
662 |
+
|
663 |
+
public function getRedirectText() {
|
664 |
+
return $this->getConfigData('redirect_text');
|
665 |
+
}
|
666 |
+
|
667 |
+
public function getProductLines($order) {
|
668 |
+
$html = '<br />';
|
669 |
+
foreach ($order->getAllItems() as $product) {
|
670 |
+
if (!$product->getParentItemId()) {
|
671 |
+
$html .= (int)$product->getQtyOrdered().' x '.$product->getName().'<br />';
|
672 |
+
}
|
673 |
+
}
|
674 |
+
return $html;
|
675 |
+
}
|
676 |
+
|
677 |
+
protected function processCardTransaction($order,$bbskey,$_giftCard)
|
678 |
+
{
|
679 |
+
$isOK = false;
|
680 |
+
if ($this->getApi()->auth($bbskey) == $this->getCheckout()->getBBSTransactionId()) {
|
681 |
+
$order->getPayment()->setAdditionalInformation(self::TRANSACTION_ID,$this->getCheckout()->getBBSTransactionId())->
|
682 |
+
setAdditionalInformation(self::AUTHENTICATED_STATUS,$this->getApi()->Result()->getAuthenticatedStatus())->
|
683 |
+
setAdditionalInformation(self::AUTHENTICATED_WITH,$this->getApi()->Result()->getAuthenticatedWith())->
|
684 |
+
setAdditionalInformation(self::ISSUER_COUNTRY,$this->getApi()->Result()->getIssuerCountry())->
|
685 |
+
setAdditionalInformation(self::ISSUER,$this->getApi()->Result()->getIssuer())->
|
686 |
+
setAdditionalInformation(self::ISSUER_ID,$this->getApi()->Result()->getIssuerId())->
|
687 |
+
setAdditionalInformation(self::AUTHORIZATION_ID,$this->getApi()->Result()->getAuthorizationId())->
|
688 |
+
setAdditionalInformation(self::PAYMENTMETHOD,$this->getApi()->Result()->getPaymentMethod())->
|
689 |
+
setAdditionalInformation(self::IS_GIFTCARD,$_giftCard)->
|
690 |
+
setAdditionalInformation(self::GIFTCARD_AMOUNT,($_giftCard ? $this->getApi()->Result()->getAmountCaptured() : 0))->
|
691 |
+
setAdditionalInformation(self::CHILD_TRANSACTION,$this->getApi()->Result()->getChildTransactionId())->
|
692 |
+
setAdditionalInformation(self::MOBILE_CLIENT,$this->useMobile())->
|
693 |
+
save();
|
694 |
+
|
695 |
+
$this->getCheckout()->getQuote()->setIsActive(false)->save();
|
696 |
+
$this->getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
697 |
+
$order->getPayment()->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED);
|
698 |
+
|
699 |
+
$order->getPayment()->setTransactionId($this->getApi()->Result()->getAuthorizationId());
|
700 |
+
$order->getPayment()->setIsTransactionClosed(0);
|
701 |
+
$transaction = $order->getPayment()->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
702 |
+
|
703 |
+
//Set new orderstatus
|
704 |
+
$newOrderStatus = $this->getConfigData('auth_order_status');
|
705 |
+
if (empty($newOrderStatus)) {
|
706 |
+
$newOrderStatus = $order->getStatus();
|
707 |
+
}
|
708 |
+
$order->addStatusToHistory($newOrderStatus,Mage::helper('bbsnetaxept')->__('Nets Authorization successful'),true);
|
709 |
+
|
710 |
+
/**
|
711 |
+
* send confirmation email to customer
|
712 |
+
*/
|
713 |
+
if($order->getId()){
|
714 |
+
$order->sendNewOrderEmail();
|
715 |
+
}
|
716 |
+
|
717 |
+
$transaction->save();
|
718 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING)->save();
|
719 |
+
if ($this->getConfigData('payment_action') == 'sale') {
|
720 |
+
$invoice = $order->prepareInvoice();
|
721 |
+
$invoice->register()->capture();
|
722 |
+
Mage::getModel('core/resource_transaction')
|
723 |
+
->addObject($invoice)
|
724 |
+
->addObject($invoice->getOrder())
|
725 |
+
->save();
|
726 |
+
}
|
727 |
+
$isOK = true;
|
728 |
+
}
|
729 |
+
else {
|
730 |
+
if ($order->getPayment()) {
|
731 |
+
$order->getPayment()->setAdditionalInformation(self::AUTHENTICATED_STATUS,'Error')->setAdditionalInformation(self::AUTHENTICATED_WITH,$this->getApi()->getErrorMessage());
|
732 |
+
}
|
733 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Error during auth.'),false);
|
734 |
+
$this->getApi()->doLog('ERROR: Error during auth - '.$this->getApi()->getErrorMessage().' ('.$this->getApi()->getErrorCode().')');
|
735 |
+
$order->cancel()->save();
|
736 |
+
$this->getCheckout()->addError($this->getErrorMessage($this->getApi()->getErrorCode()).' ('.$this->getApi()->getErrorCode().') (auth)');
|
737 |
+
}
|
738 |
+
|
739 |
+
return $isOK;
|
740 |
+
}
|
741 |
+
|
742 |
+
protected function processGiftCardTransaction($order,$bbskey)
|
743 |
+
{
|
744 |
+
$isOK = false;
|
745 |
+
if ($this->getApi()->sale($bbskey,$order->getIncrementId()) == $this->getCheckout()->getBBSTransactionId()) {
|
746 |
+
$order->getPayment()->setAdditionalInformation(self::TRANSACTION_ID,$this->getCheckout()->getBBSTransactionId())->
|
747 |
+
setAdditionalInformation(self::AUTHENTICATED_STATUS,$this->getApi()->Result()->getAuthenticatedStatus())->
|
748 |
+
setAdditionalInformation(self::AUTHENTICATED_WITH,$this->getApi()->Result()->getAuthenticatedWith())->
|
749 |
+
setAdditionalInformation(self::ISSUER_COUNTRY,$this->getApi()->Result()->getIssuerCountry())->
|
750 |
+
setAdditionalInformation(self::ISSUER,$this->getApi()->Result()->getIssuer())->
|
751 |
+
setAdditionalInformation(self::ISSUER_ID,$this->getApi()->Result()->getIssuerId())->
|
752 |
+
setAdditionalInformation(self::AUTHORIZATION_ID,$this->getApi()->Result()->getAuthorizationId())->
|
753 |
+
setAdditionalInformation(self::PAYMENTMETHOD,$this->getApi()->Result()->getPaymentMethod())->
|
754 |
+
setAdditionalInformation(self::GIFTCARD_AMOUNT,$this->getApi()->Result()->getAmountCaptured())->
|
755 |
+
setAdditionalInformation(self::IS_GIFTCARD,true)->
|
756 |
+
setAdditionalInformation(self::CHILD_TRANSACTION,$this->getApi()->Result()->getChildTransactionId())->
|
757 |
+
setAdditionalInformation(self::MOBILE_CLIENT,$this->useMobile())->
|
758 |
+
save();
|
759 |
+
|
760 |
+
$this->getCheckout()->getQuote()->setIsActive(false)->save();
|
761 |
+
$this->getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
762 |
+
$order->getPayment()->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED);
|
763 |
+
|
764 |
+
$order->getPayment()->setTransactionId($this->getApi()->Result()->getAuthorizationId());
|
765 |
+
$order->getPayment()->setIsTransactionClosed(0);
|
766 |
+
$transaction = $order->getPayment()->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
767 |
+
|
768 |
+
//Set new orderstatus
|
769 |
+
$newOrderStatus = $this->getConfigData('auth_order_status');
|
770 |
+
if (empty($newOrderStatus)) {
|
771 |
+
$newOrderStatus = $order->getStatus();
|
772 |
+
}
|
773 |
+
$order->addStatusToHistory($newOrderStatus,Mage::helper('bbsnetaxept')->__('Nets Authorization successful'),true);
|
774 |
+
|
775 |
+
/**
|
776 |
+
* send confirmation email to customer
|
777 |
+
*/
|
778 |
+
if($order->getId()){
|
779 |
+
$order->sendNewOrderEmail();
|
780 |
+
}
|
781 |
+
|
782 |
+
$transaction->save();
|
783 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING)->save();
|
784 |
+
if ($this->getConfigData('payment_action') == 'sale') {
|
785 |
+
$invoice = $order->prepareInvoice();
|
786 |
+
$invoice->register()->capture();
|
787 |
+
Mage::getModel('core/resource_transaction')
|
788 |
+
->addObject($invoice)
|
789 |
+
->addObject($invoice->getOrder())
|
790 |
+
->save();
|
791 |
+
}
|
792 |
+
$isOK = true;
|
793 |
+
}
|
794 |
+
else {
|
795 |
+
if ($order->getPayment()) {
|
796 |
+
$order->getPayment()->setAdditionalInformation(self::AUTHENTICATED_STATUS,'Error')->setAdditionalInformation(self::AUTHENTICATED_WITH,$this->getApi()->getErrorMessage());
|
797 |
+
}
|
798 |
+
$order->addStatusToHistory($order->getStatus(),Mage::helper('bbsnetaxept')->__('Error during sale of giftcard.'),false);
|
799 |
+
$this->getApi()->doLog('ERROR: Error during auth - '.$this->getApi()->getErrorMessage().' ('.$this->getApi()->getErrorCode().')');
|
800 |
+
$order->cancel()->save();
|
801 |
+
$this->getCheckout()->addError($this->getErrorMessage($this->getApi()->getErrorCode()).' ('.$this->getApi()->getErrorCode().') (auth)');
|
802 |
+
}
|
803 |
+
|
804 |
+
return $isOK;
|
805 |
+
}
|
806 |
+
|
807 |
+
// This function processes DirectPayment transactions.
|
808 |
+
protected function processDirectPayment($order,$bbskey)
|
809 |
+
{
|
810 |
+
$isOK = false;
|
811 |
+
try {
|
812 |
+
$order->getPayment()->
|
813 |
+
setAdditionalInformation(self::TRANSACTION_ID,$this->getCheckout()->getBBSTransactionId())->
|
814 |
+
setAdditionalInformation(self::AUTHENTICATED_STATUS,$this->getApi()->Result()->getAuthenticatedStatus())->
|
815 |
+
setAdditionalInformation(self::AUTHENTICATED_WITH,$this->getApi()->Result()->getAuthenticatedWith())->
|
816 |
+
setAdditionalInformation(self::ISSUER_COUNTRY,$this->getApi()->Result()->getIssuerCountry())->
|
817 |
+
setAdditionalInformation(self::ISSUER,$this->getApi()->Result()->getIssuer())->
|
818 |
+
setAdditionalInformation(self::ISSUER_ID,$this->getApi()->Result()->getIssuerId())->
|
819 |
+
setAdditionalInformation(self::AUTHORIZATION_ID,$this->getApi()->Result()->getAuthorizationId())->
|
820 |
+
setAdditionalInformation(self::PAYMENTMETHOD,$this->getApi()->Result()->getPaymentMethod())->
|
821 |
+
setAdditionalInformation(self::MOBILE_CLIENT,$this->useMobile())->
|
822 |
+
save();
|
823 |
+
|
824 |
+
$this->getCheckout()->getQuote()->setIsActive(false)->save();
|
825 |
+
$this->getCheckout()->setLastSuccessQuoteId($order->getQuoteId());
|
826 |
+
$order->getPayment()->setStatus(Mage_Payment_Model_Method_Abstract::STATUS_APPROVED);
|
827 |
+
|
828 |
+
$order->getPayment()->setTransactionId($this->getApi()->Result()->getAuthorizationId());
|
829 |
+
$order->getPayment()->setIsTransactionClosed(0);
|
830 |
+
$transaction = $order->getPayment()->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
|
831 |
+
|
832 |
+
//Set new orderstatus
|
833 |
+
$newOrderStatus = $this->getConfigData('auth_order_status');
|
834 |
+
if (empty($newOrderStatus)) {
|
835 |
+
$newOrderStatus = $order->getStatus();
|
836 |
+
}
|
837 |
+
$order->addStatusToHistory($newOrderStatus,Mage::helper('bbsnetaxept')->__('Directpayment successful'),true);
|
838 |
+
|
839 |
+
/**
|
840 |
+
* send confirmation email to customer
|
841 |
+
*/
|
842 |
+
if($order->getId()){
|
843 |
+
$order->sendNewOrderEmail();
|
844 |
+
}
|
845 |
+
|
846 |
+
$transaction->save();
|
847 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
|
848 |
+
|
849 |
+
// Directpayment does not have auth. Create an invoice.
|
850 |
+
$invoice = $order->prepareInvoice();
|
851 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE)->register();
|
852 |
+
Mage::getModel('core/resource_transaction')
|
853 |
+
->addObject($invoice)
|
854 |
+
->addObject($invoice->getOrder())
|
855 |
+
->save();
|
856 |
+
|
857 |
+
$isOK = true;
|
858 |
+
} catch (Exception $e) {
|
859 |
+
$this->getApi()->doLog('ERROR: Error processing directpayment - '.$e->getMessage());
|
860 |
+
}
|
861 |
+
|
862 |
+
return $isOK;
|
863 |
+
}
|
864 |
+
|
865 |
+
private function getErrorMessage($errorcode=99) {
|
866 |
+
switch ($errorcode) {
|
867 |
+
case '-99':
|
868 |
+
$message = Mage::helper('bbsnetaxept')->__('Unable to find correct orderstatus and payment is cancelled. Please try again.');
|
869 |
+
break;
|
870 |
+
case '00':
|
871 |
+
$message = '';
|
872 |
+
break;
|
873 |
+
case '17':
|
874 |
+
$message = Mage::helper('bbsnetaxept')->__('Payment cancelled by user.');
|
875 |
+
break;
|
876 |
+
case '99':
|
877 |
+
default:
|
878 |
+
$message = Mage::helper('bbsnetaxept')->__('Unable to process transaction from Nets. Try again or contact your bank');
|
879 |
+
break;
|
880 |
+
}
|
881 |
+
|
882 |
+
return $message;
|
883 |
+
}
|
884 |
+
|
885 |
+
protected function useMobile()
|
886 |
+
{
|
887 |
+
|
888 |
+
if (!isset($this->_useMobile)) {
|
889 |
+
$this->_useMobile = false;
|
890 |
+
|
891 |
+
if ($this->getCheckout()) {
|
892 |
+
if ($this->getCheckout()->getNetsMobile()) {
|
893 |
+
$this->_useMobile = true;
|
894 |
+
}
|
895 |
+
}
|
896 |
+
}
|
897 |
+
|
898 |
+
return $this->_useMobile;
|
899 |
+
}
|
900 |
+
|
901 |
+
public function saveConfigData() {
|
902 |
+
$client = new Zend_Http_Client();
|
903 |
+
$client->setUri('http://serial.trollweb.no/nets.php');
|
904 |
+
|
905 |
+
$client->setConfig(array(
|
906 |
+
'adapter' => 'Zend_Http_Client_Adapter_Curl',
|
907 |
+
'curloptions' => array(
|
908 |
+
CURLOPT_USERAGENT => 'Zend_Curl_Adapter',
|
909 |
+
CURLOPT_HEADER => 0,
|
910 |
+
CURLOPT_VERBOSE => 0,
|
911 |
+
CURLOPT_RETURNTRANSFER => 1,
|
912 |
+
CURLOPT_TIMEOUT => 10,
|
913 |
+
CURLOPT_SSL_VERIFYPEER => false,
|
914 |
+
CURLOPT_SSLVERSION => 3,
|
915 |
+
),
|
916 |
+
));
|
917 |
+
|
918 |
+
$client->setMethod(Zend_Http_Client::POST);
|
919 |
+
|
920 |
+
$url = Mage::app()->getWebsite()->getConfig('web/unsecure/base_url');
|
921 |
+
$domain = trim(preg_replace('/^.*?\\/\\/(.*)?\\//', '$1', $url));
|
922 |
+
|
923 |
+
$storeName = Mage::app()->getStore()->getFrontendName();
|
924 |
+
|
925 |
+
$client->setParameterPost('domain', $domain);
|
926 |
+
$client->setParameterPost('ip', Mage::helper('core/http')->getRemoteAddr());
|
927 |
+
$client->setParameterPost('merchant', $this->getConfigData('merchant_id'));
|
928 |
+
$client->setParameterPost('customer', $storeName);
|
929 |
+
|
930 |
+
$errorMessage = 'Unable to save NETS configuration, please try again or contact support@trollweb.no';
|
931 |
+
|
932 |
+
try {
|
933 |
+
$response = $client->request();
|
934 |
+
|
935 |
+
if ($response->getBody() != 'OK') {
|
936 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bbsnetaxept')->__($errorMessage));
|
937 |
+
}
|
938 |
+
}
|
939 |
+
catch (Exception $e) {
|
940 |
+
$this->getApi()->doLog($e->getMessage());
|
941 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bbsnetaxept')->__($errorMessage));
|
942 |
+
}
|
943 |
+
|
944 |
+
return $this;
|
945 |
+
}
|
946 |
+
|
947 |
+
}
|
app/code/community/Trollweb/BBSNetAxept/controllers/ReturnController.php
CHANGED
@@ -3,18 +3,18 @@
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
-
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_ReturnController extends Mage_Core_Controller_Front_Action
|
@@ -33,7 +33,7 @@ class Trollweb_BBSNetAxept_ReturnController extends Mage_Core_Controller_Front_A
|
|
33 |
*
|
34 |
* @return Trollweb_BBSNetAxept_Model_WithGUI
|
35 |
*/
|
36 |
-
|
37 |
{
|
38 |
return Mage::getSingleton('bbsnetaxept/withGUI');
|
39 |
}
|
@@ -44,9 +44,32 @@ class Trollweb_BBSNetAxept_ReturnController extends Mage_Core_Controller_Front_A
|
|
44 |
*/
|
45 |
public function redirectAction()
|
46 |
{
|
47 |
-
$
|
48 |
-
$
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
/**
|
@@ -55,14 +78,18 @@ class Trollweb_BBSNetAxept_ReturnController extends Mage_Core_Controller_Front_A
|
|
55 |
public function checkAction()
|
56 |
{
|
57 |
$redirect = 'checkout/cart';
|
58 |
-
|
59 |
-
|
60 |
-
$session->setQuoteId($session->getBBSNetterminalStandardQuoteId(true));
|
61 |
|
62 |
-
if ($this->
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
$this->_redirect($redirect, array('_secure'=>true));
|
66 |
}
|
67 |
}
|
68 |
-
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
+
*
|
18 |
*/
|
19 |
|
20 |
class Trollweb_BBSNetAxept_ReturnController extends Mage_Core_Controller_Front_Action
|
33 |
*
|
34 |
* @return Trollweb_BBSNetAxept_Model_WithGUI
|
35 |
*/
|
36 |
+
protected function getNets()
|
37 |
{
|
38 |
return Mage::getSingleton('bbsnetaxept/withGUI');
|
39 |
}
|
44 |
*/
|
45 |
public function redirectAction()
|
46 |
{
|
47 |
+
$nets = $this->getNets();
|
48 |
+
$nets->getCheckout()->setNetsQuoteId($nets->getCheckout()->getQuoteId());
|
49 |
+
|
50 |
+
$htmlBlock = $this->
|
51 |
+
getLayout()->
|
52 |
+
createBlock('bbsnetaxept/redirect')->
|
53 |
+
setNetsUrl(Mage::getUrl('checkout/cart', array('_secure'=>true)))->
|
54 |
+
setNetsMessage($this->__('We are bringing you back to you cart.'));
|
55 |
+
|
56 |
+
if ($nets->getCheckout()->getNetsAllowRedirect()) {
|
57 |
+
$nets->getCheckout()->setNetsAllowRedirect(false);
|
58 |
+
|
59 |
+
$_transKey = $nets->getBBSTransKey();
|
60 |
+
|
61 |
+
if ($_transKey) {
|
62 |
+
$htmlBlock->setNetsUrl($nets->getBBSUrl().'?merchantId='.$nets->getMerchantId().'&transactionId='.$_transKey);
|
63 |
+
$htmlBlock->setNetsMessage($this->__('You will be redirected to Nets NetAxept in a few seconds.'));
|
64 |
+
}
|
65 |
+
}
|
66 |
+
else {
|
67 |
+
$nets->cancelledByUser();
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
$this->getResponse()->setBody($htmlBlock->toHtml());
|
72 |
+
return $this;
|
73 |
}
|
74 |
|
75 |
/**
|
78 |
public function checkAction()
|
79 |
{
|
80 |
$redirect = 'checkout/cart';
|
81 |
+
$this->getNets()->getCheckout()->setQuoteId($this->getNets()->getCheckout()->getNetsQuoteId(true));
|
82 |
+
|
|
|
83 |
|
84 |
+
if ($this->getRequest()->getQuery('responseCode','Fail') == 'OK')
|
85 |
+
{
|
86 |
+
if ($this->getNets()->checkResult($this->getRequest()->getQuery('transactionId')))
|
87 |
+
{
|
88 |
+
$redirect = 'checkout/onepage/success';
|
89 |
+
}
|
90 |
+
} else {
|
91 |
+
$this->getNets()->cancelledByUser();
|
92 |
}
|
93 |
$this->_redirect($redirect, array('_secure'=>true));
|
94 |
}
|
95 |
}
|
|
app/code/community/Trollweb/BBSNetAxept/etc/config.xml
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
<global>
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
</bbsnetaxept>
|
17 |
</models>
|
18 |
|
19 |
<helpers>
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
<resources>
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
</setup>
|
31 |
<connection>
|
32 |
-
|
33 |
</connection>
|
34 |
</bbsnetaxept_setup>
|
35 |
<bbsnetaxept_write>
|
36 |
-
|
37 |
</bbsnetaxept_write>
|
38 |
<bbsnetaxept_read>
|
39 |
-
|
40 |
</bbsnetaxept_read>
|
41 |
</resources>
|
42 |
|
@@ -45,24 +45,54 @@
|
|
45 |
</blocks>
|
46 |
|
47 |
<payment>
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
</payment>
|
55 |
|
56 |
<sales>
|
57 |
<order>
|
58 |
<statuses>
|
59 |
-
<
|
60 |
-
<label>Pending
|
61 |
-
</
|
62 |
</statuses>
|
63 |
</order>
|
64 |
-
</sales>
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
<frontend>
|
68 |
<secure_url>
|
@@ -77,41 +107,59 @@
|
|
77 |
</args>
|
78 |
</bbsnetaxept>
|
79 |
</routers>
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
</frontend>
|
90 |
|
91 |
|
92 |
|
93 |
<default>
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
<title>Kredittkort</title>
|
98 |
-
<cctypes>
|
99 |
<merchant_id backend_model="adminhtml/system_config_backend_encrypted" />
|
100 |
<merchant_token backend_model="adminhtml/system_config_backend_encrypted" />
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
103 |
<use_gui>1</use_gui>
|
104 |
<gui_language>no_NO</gui_language>
|
105 |
-
<order_status>
|
106 |
-
<auth_order_status>
|
107 |
<allowspecific>0</allowspecific>
|
108 |
-
<sort_order>
|
109 |
<payment_action>auth</payment_action>
|
110 |
<regcode backend_model="adminhtml/system_config_backend_encrypted" />
|
111 |
-
<logo>
|
112 |
-
<redirect_text>Du vil bli sendt til en sikker side hos
|
113 |
-
|
114 |
-
|
|
|
115 |
|
116 |
<model>bbsnetaxept/withGUI</model>
|
117 |
</bbsnetaxept_withgui>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<modules>
|
4 |
+
<Trollweb_BBSNetAxept>
|
5 |
+
<version>2.2.0</version>
|
6 |
+
<depends>
|
7 |
+
<Mage_Payment />
|
8 |
+
</depends>
|
9 |
+
</Trollweb_BBSNetAxept>
|
10 |
+
</modules>
|
11 |
+
|
12 |
<global>
|
13 |
+
<models>
|
14 |
+
<bbsnetaxept>
|
15 |
+
<class>Trollweb_BBSNetAxept_Model</class>
|
16 |
</bbsnetaxept>
|
17 |
</models>
|
18 |
|
19 |
<helpers>
|
20 |
+
<bbsnetaxept>
|
21 |
+
<class>Trollweb_BBSNetAxept_Helper</class>
|
22 |
+
</bbsnetaxept>
|
23 |
+
</helpers>
|
24 |
|
25 |
<resources>
|
26 |
+
<bbsnetaxept_setup>
|
27 |
+
<setup>
|
28 |
+
<module>Trollweb_BBSNetAxept</module>
|
29 |
+
<class>Trollweb_BBSNetAxept_Model_Entity_Setup</class>
|
30 |
</setup>
|
31 |
<connection>
|
32 |
+
<use>core_setup</use>
|
33 |
</connection>
|
34 |
</bbsnetaxept_setup>
|
35 |
<bbsnetaxept_write>
|
36 |
+
<use>core_write</use>
|
37 |
</bbsnetaxept_write>
|
38 |
<bbsnetaxept_read>
|
39 |
+
<use>core_read</use>
|
40 |
</bbsnetaxept_read>
|
41 |
</resources>
|
42 |
|
45 |
</blocks>
|
46 |
|
47 |
<payment>
|
48 |
+
<bbsnetaxept>
|
49 |
+
<authcode>
|
50 |
+
<code>authcode</code>
|
51 |
+
<name>Auth Code</name>
|
52 |
+
</authcode>
|
53 |
+
</bbsnetaxept>
|
54 |
</payment>
|
55 |
|
56 |
<sales>
|
57 |
<order>
|
58 |
<statuses>
|
59 |
+
<pending_nets translate="label" type="label">
|
60 |
+
<label>Pending Nets</label>
|
61 |
+
</pending_nets>
|
62 |
</statuses>
|
63 |
</order>
|
64 |
+
</sales>
|
65 |
+
<!--
|
66 |
+
<events>
|
67 |
+
<controller_action_predispatch>
|
68 |
+
<observers>
|
69 |
+
<bbsnetaxept>
|
70 |
+
<class>bbsnetaxept/updates</class>
|
71 |
+
<method>check</method>
|
72 |
+
</bbsnetaxept>
|
73 |
+
</observers>
|
74 |
+
</controller_action_predispatch>
|
75 |
+
</events>
|
76 |
+
-->
|
77 |
+
<events>
|
78 |
+
<sales_order_payment_cancel>
|
79 |
+
<observers>
|
80 |
+
<bbsnetaxept_cancel>
|
81 |
+
<class>bbsnetaxept/observer</class>
|
82 |
+
<method>voidPayment</method>
|
83 |
+
</bbsnetaxept_cancel>
|
84 |
+
</observers>
|
85 |
+
</sales_order_payment_cancel>
|
86 |
+
<core_config_data_save_after>
|
87 |
+
<observers>
|
88 |
+
<bbsnetaxept_save_config>
|
89 |
+
<class>bbsnetaxept/observer</class>
|
90 |
+
<method>core_config_data_save_after</method>
|
91 |
+
</bbsnetaxept_save_config>
|
92 |
+
</observers>
|
93 |
+
</core_config_data_save_after>
|
94 |
+
</events>
|
95 |
+
</global>
|
96 |
|
97 |
<frontend>
|
98 |
<secure_url>
|
107 |
</args>
|
108 |
</bbsnetaxept>
|
109 |
</routers>
|
110 |
+
<translate>
|
111 |
+
<modules>
|
112 |
+
<Trollweb_BBSNetAxept>
|
113 |
+
<files>
|
114 |
+
<default>Trollweb_BBSNetaxept.csv</default>
|
115 |
+
</files>
|
116 |
+
</Trollweb_BBSNetAxept>
|
117 |
+
</modules>
|
118 |
+
</translate>
|
119 |
+
<layout>
|
120 |
+
<updates>
|
121 |
+
<bbsnetaxept>
|
122 |
+
<file>bbsnetaxept.xml</file>
|
123 |
+
</bbsnetaxept>
|
124 |
+
</updates>
|
125 |
+
</layout>
|
126 |
</frontend>
|
127 |
|
128 |
|
129 |
|
130 |
<default>
|
131 |
+
<trollweb>
|
132 |
+
<updates>
|
133 |
+
<url>updates.trollweb.no/</url>
|
134 |
+
<check_frequencey>86400</check_frequencey>
|
135 |
+
<enabled>0</enabled>
|
136 |
+
</updates>
|
137 |
+
</trollweb>
|
138 |
+
<payment>
|
139 |
+
<bbsnetaxept_withgui>
|
140 |
+
<active>0</active>
|
141 |
<title>Kredittkort</title>
|
142 |
+
<cctypes>VI,MC</cctypes>
|
143 |
<merchant_id backend_model="adminhtml/system_config_backend_encrypted" />
|
144 |
<merchant_token backend_model="adminhtml/system_config_backend_encrypted" />
|
145 |
+
<merchant_test_token backend_model="adminhtml/system_config_backend_encrypted" />
|
146 |
+
<mobile_merchant_id backend_model="adminhtml/system_config_backend_encrypted" />
|
147 |
+
<mobile_merchant_token backend_model="adminhtml/system_config_backend_encrypted" />
|
148 |
+
<mobile_test_token backend_model="adminhtml/system_config_backend_encrypted" />
|
149 |
+
<test_mode>1</test_mode>
|
150 |
<use_gui>1</use_gui>
|
151 |
<gui_language>no_NO</gui_language>
|
152 |
+
<order_status>pending_nets</order_status>
|
153 |
+
<auth_order_status>processing</auth_order_status>
|
154 |
<allowspecific>0</allowspecific>
|
155 |
+
<sort_order>10</sort_order>
|
156 |
<payment_action>auth</payment_action>
|
157 |
<regcode backend_model="adminhtml/system_config_backend_encrypted" />
|
158 |
+
<logo>2</logo>
|
159 |
+
<redirect_text>Du vil bli sendt til en sikker side hos Nets for inntasting av kredittkort-detaljene dine når du har fullført bestillingen.</redirect_text>
|
160 |
+
<pending_minutes>120</pending_minutes>
|
161 |
+
<enable_log>0</enable_log>
|
162 |
+
<singlepage>0</singlepage>
|
163 |
|
164 |
<model>bbsnetaxept/withGUI</model>
|
165 |
</bbsnetaxept_withgui>
|
app/code/community/Trollweb/BBSNetAxept/etc/system.xml
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<payment>
|
5 |
<groups>
|
6 |
<bbsnetaxept_withgui translate="label" module="bbsnetaxept">
|
7 |
-
<label>
|
8 |
<sort_order>670</sort_order>
|
9 |
<show_in_default>1</show_in_default>
|
10 |
<show_in_website>1</show_in_website>
|
@@ -13,21 +13,20 @@
|
|
13 |
<div class="custom-options">
|
14 |
<div class="box">
|
15 |
<br />
|
16 |
-
<p class="grand-total">Opprett avtale med
|
17 |
|
18 |
-
For å ta i bruk
|
19 |
-
Klikk på linkene nedenfor for å hente opp søknadsskjemaene til
|
20 |
-
Disse må fylles ut så godt det lar seg gjøre og returneres til
|
21 |
<br />
|
22 |
-
<a href="http://
|
23 |
-
<a href="http://
|
24 |
-
<a href="http://www.trollweb.no/bbs/getregcode"><b>Steg 3) Klik her for å gratis generer registeringskode for ditt domene</b></a><br />
|
25 |
<br />
|
26 |
Kontakt oss helt gratis om du har spørsmål til søknadsskjemaene eller kostnadene rundt løsningen.<br />
|
27 |
<label>Epost <a href="mailto:support@trollweb.no"><b>support@trollweb.no</b></a></label><br />
|
28 |
-
Telefon <b>+47
|
29 |
<br />
|
30 |
-
<font size=1>
|
31 |
<br />
|
32 |
</div>
|
33 |
</div>
|
@@ -50,29 +49,76 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
|
|
50 |
<show_in_default>1</show_in_default>
|
51 |
<show_in_website>1</show_in_website>
|
52 |
<show_in_store>1</show_in_store>
|
53 |
-
<comment><![CDATA[Tekst som vises på
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
<
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
<test_mode translate="label">
|
78 |
<label>Test modus</label>
|
@@ -82,109 +128,146 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
|
|
82 |
<show_in_default>1</show_in_default>
|
83 |
<show_in_website>1</show_in_website>
|
84 |
<show_in_store>1</show_in_store>
|
85 |
-
<comment><![CDATA[Sett denne til ja for å kjøre mot
|
86 |
</test_mode>
|
87 |
|
88 |
-
<payment_action translate="label">
|
89 |
-
<label>Betalingshandling</label>
|
90 |
-
<frontend_type>select</frontend_type>
|
91 |
-
<source_model>bbsnetaxept/BBSNetterminal_paymentAction</source_model>
|
92 |
-
<sort_order>11</sort_order>
|
93 |
-
<show_in_default>1</show_in_default>
|
94 |
-
<show_in_website>1</show_in_website>
|
95 |
-
<show_in_store>1</show_in_store>
|
96 |
-
<comment><![CDATA[Authorize Only (standard) reserverer først beløpet på kundens kort. Man må deretter kjøre Capture (trekke beløpet) i ordrebehandlingen i Magento når ordren sendes. Det er ikke lov å trekke penger fra kortet før varene sendes. Kunder som selger for eksempel digitale produkter som kunden mottar umiddelbart kan bruke Authorize + Capture.]]></comment>
|
97 |
-
</payment_action>
|
98 |
-
|
99 |
-
|
100 |
-
<merchant_id translate="label">
|
101 |
-
<label>Merchant ID</label>
|
102 |
-
<frontend_type>text</frontend_type>
|
103 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
104 |
-
<sort_order>12</sort_order>
|
105 |
-
<show_in_default>1</show_in_default>
|
106 |
-
<show_in_website>1</show_in_website>
|
107 |
-
<show_in_store>1</show_in_store>
|
108 |
-
<comment><![CDATA[Din unike kunde-ID fra BBS. Fås på epost av BBS.]]></comment>
|
109 |
-
</merchant_id>
|
110 |
-
|
111 |
-
<merchant_token translate="label">
|
112 |
-
<label>Merchant Token</label>
|
113 |
-
<frontend_type>text</frontend_type>
|
114 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
115 |
-
<sort_order>13</sort_order>
|
116 |
-
<show_in_default>1</show_in_default>
|
117 |
-
<show_in_website>1</show_in_website>
|
118 |
-
<show_in_store>1</show_in_store>
|
119 |
-
<comment><![CDATA[Ditt unike kunde-passord fra BBS. Fås på SMS fra BBS. Merk at BBS normalt sender både TEST og PROD passord på SMS. Her skal skrive inn PROD passordet.]]></comment>
|
120 |
-
</merchant_token>
|
121 |
-
|
122 |
<merchant_test_token translate="label">
|
123 |
<label>Merchant Test Token</label>
|
124 |
<frontend_type>text</frontend_type>
|
125 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
126 |
-
<sort_order>
|
127 |
<show_in_default>1</show_in_default>
|
128 |
<show_in_website>1</show_in_website>
|
129 |
<show_in_store>1</show_in_store>
|
130 |
-
<comment><![CDATA[Ditt unike test-passord fra
|
|
|
131 |
</merchant_test_token>
|
132 |
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<use_gui translate="label">
|
135 |
-
<label>Bruke
|
136 |
<frontend_type>select</frontend_type>
|
137 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
138 |
-
<sort_order>
|
139 |
<show_in_default>1</show_in_default>
|
140 |
<show_in_website>1</show_in_website>
|
141 |
<show_in_store>1</show_in_store>
|
142 |
-
<
|
143 |
</use_gui>
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
<gui_language translate="label">
|
147 |
-
<label>Språk på
|
148 |
<frontend_type>select</frontend_type>
|
149 |
<source_model>bbsnetaxept/BBSNetterminal_language</source_model>
|
150 |
-
<sort_order>
|
151 |
<show_in_default>1</show_in_default>
|
152 |
<show_in_website>1</show_in_website>
|
153 |
<show_in_store>1</show_in_store>
|
154 |
-
<comment><![CDATA[Velg språket du ønsker at
|
155 |
</gui_language>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
<redirect_text translate="label">
|
158 |
<label>Utvidet infotekst</label>
|
159 |
<frontend_type>textarea</frontend_type>
|
160 |
-
<sort_order>
|
161 |
<show_in_default>1</show_in_default>
|
162 |
<show_in_website>1</show_in_website>
|
163 |
<show_in_store>1</show_in_store>
|
164 |
-
<comment><![CDATA[Meldingstekst som kunden ser når han eller hun velger betalingsalternativet
|
165 |
</redirect_text>
|
166 |
|
167 |
<pending_minutes translate="label">
|
168 |
<label>Betalings avbrudd</label>
|
169 |
<frontend_type>text</frontend_type>
|
170 |
-
<sort_order>
|
171 |
<show_in_default>1</show_in_default>
|
172 |
<show_in_website>0</show_in_website>
|
173 |
<show_in_store>0</show_in_store>
|
174 |
-
<comment><![CDATA[Antall minutter før en ordre automatisk blir merket som avbrutt dersom kunden ikke har kommet tilbake fra
|
175 |
</pending_minutes>
|
176 |
|
177 |
-
<regcode translate="label">
|
178 |
-
<label>Registreringskode</label>
|
179 |
-
<frontend_type>text</frontend_type>
|
180 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
181 |
-
<sort_order>30</sort_order>
|
182 |
-
<show_in_default>1</show_in_default>
|
183 |
-
<show_in_website>1</show_in_website>
|
184 |
-
<show_in_store>1</show_in_store>
|
185 |
-
<comment><![CDATA[Din registreringskode fra Trollweb. <a href="http://www.trollweb.no/bbs/getregcode">Klikk her for å generere din registreringskode helt gartis</a>.]]></comment>
|
186 |
-
</regcode>
|
187 |
-
|
188 |
<!--
|
189 |
<order_status translate="label">
|
190 |
<label>New order status</label>
|
@@ -205,13 +288,24 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
|
|
205 |
<show_in_default>1</show_in_default>
|
206 |
<show_in_website>1</show_in_website>
|
207 |
<show_in_store>1</show_in_store>
|
208 |
-
<comment><![CDATA[Velg ønsket ordrestatus på ordrer som har blitt authentisert og godkjent hos
|
209 |
</auth_order_status>
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
<allowspecific translate="label">
|
212 |
-
<label>Tillatt enkelt-land som kan bruke
|
213 |
<frontend_type>allowspecific</frontend_type>
|
214 |
-
<sort_order>
|
215 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
216 |
<show_in_default>1</show_in_default>
|
217 |
<show_in_website>1</show_in_website>
|
@@ -219,14 +313,15 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
|
|
219 |
</allowspecific>
|
220 |
|
221 |
<specificcountry translate="label">
|
222 |
-
<label>Spesifiser hvilke land som
|
223 |
<frontend_type>multiselect</frontend_type>
|
224 |
-
<sort_order>
|
225 |
<source_model>adminhtml/system_config_source_country</source_model>
|
226 |
<show_in_default>1</show_in_default>
|
227 |
<show_in_website>1</show_in_website>
|
228 |
<show_in_store>1</show_in_store>
|
229 |
<comment><![CDATA[Velg utvalgte land som får lov å velge denne betalingsmetoden. Standard er alle land.]]></comment>
|
|
|
230 |
</specificcountry>
|
231 |
|
232 |
<enable_log translate="label">
|
@@ -248,6 +343,17 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
|
|
248 |
<show_in_store>1</show_in_store>
|
249 |
<comment><![CDATA[Ønsket sortering i Betalingsmetoder-feltet på utsjekkingssiden i nettbutikken. Aktuelt dersom du tilbyr flere betalingsalternativer og ønsker å plassere BBS betalingsvalget i en angitt rekkefølge.]]></comment>
|
250 |
</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
</fields>
|
252 |
</bbsnetaxept_withgui>
|
253 |
</groups>
|
4 |
<payment>
|
5 |
<groups>
|
6 |
<bbsnetaxept_withgui translate="label" module="bbsnetaxept">
|
7 |
+
<label>Nets Netaxept, versjon 2.2.0</label>
|
8 |
<sort_order>670</sort_order>
|
9 |
<show_in_default>1</show_in_default>
|
10 |
<show_in_website>1</show_in_website>
|
13 |
<div class="custom-options">
|
14 |
<div class="box">
|
15 |
<br />
|
16 |
+
<p class="grand-total">Opprett avtale med Nets og Teller<br /><b></b></p>
|
17 |
|
18 |
+
For å ta i bruk Nets NetAxept må du ha en avtale med Nets og en kredittkort-innløser som Teller.
|
19 |
+
Klikk på linkene nedenfor for å hente opp søknadsskjemaene til Nets og Teller.
|
20 |
+
Disse må fylles ut så godt det lar seg gjøre og returneres til Nets og Teller. <br />
|
21 |
<br />
|
22 |
+
<a href="http://goto.trollweb.no/bbs"><b>Steg 1) Klikk her for å laste ned og fylle ut avtale med Nets</b></a><br />
|
23 |
+
<a href="http://goto.trollweb.no/teller"><b>Steg 2) Klikk her for å laste ned og fylle ut avtale med Teller</b></a><br />
|
|
|
24 |
<br />
|
25 |
Kontakt oss helt gratis om du har spørsmål til søknadsskjemaene eller kostnadene rundt løsningen.<br />
|
26 |
<label>Epost <a href="mailto:support@trollweb.no"><b>support@trollweb.no</b></a></label><br />
|
27 |
+
Telefon <b>+47 51215300</b> (0800-1600, man-fre)<br />
|
28 |
<br />
|
29 |
+
<font size=1>Nets NetAxept modulen er utviklet av <a href="http://www.trollweb.no">Trollweb Solutions AS</a> i Norge og er sertifisert og godkjent av Nets. Videredistribusjon av noe slag er ikke tillatt uten etter avtale med Trollweb.</font><br />
|
30 |
<br />
|
31 |
</div>
|
32 |
</div>
|
49 |
<show_in_default>1</show_in_default>
|
50 |
<show_in_website>1</show_in_website>
|
51 |
<show_in_store>1</show_in_store>
|
52 |
+
<comment><![CDATA[Tekst som vises på Nets betalingsvalget i nettbutikken.]]></comment>
|
53 |
+
</title>
|
54 |
+
<!--
|
55 |
+
<regcode translate="label">
|
56 |
+
<label>Registreringskode</label>
|
57 |
+
<frontend_type>text</frontend_type>
|
58 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
59 |
+
<sort_order>3</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
<comment><![CDATA[Din registreringskode fra Trollweb. <a href="http://serial.trollweb.no/bbs">Klikk her for å generere din registreringskode helt gartis</a>.]]></comment>
|
64 |
+
</regcode>
|
65 |
+
-->
|
66 |
|
67 |
+
<merchant_id translate="label">
|
68 |
+
<label>Merchant ID</label>
|
69 |
+
<frontend_type>text</frontend_type>
|
70 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
71 |
+
<sort_order>5</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>1</show_in_store>
|
75 |
+
<comment><![CDATA[Din unike kunde-ID fra Nets. Fås på epost av Nets.]]></comment>
|
76 |
+
</merchant_id>
|
77 |
+
|
78 |
+
<merchant_token translate="label">
|
79 |
+
<label>Merchant Token</label>
|
80 |
+
<frontend_type>text</frontend_type>
|
81 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
82 |
+
<sort_order>6</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
<comment><![CDATA[Ditt unike kunde-passord fra Nets. Fås på SMS fra Nets. Merk at Nets normalt sender både TEST og PROD passord på SMS. Her skriver du PROD passordet.]]></comment>
|
87 |
+
</merchant_token>
|
88 |
+
|
89 |
+
<mobile_active translate="label">
|
90 |
+
<label>Aktiver Nets Mobile</label>
|
91 |
+
<frontend_type>select</frontend_type>
|
92 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
93 |
+
<sort_order>7</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 |
+
</mobile_active>
|
98 |
+
|
99 |
+
<mobile_merchant_id translate="label">
|
100 |
+
<label>Merchant ID</label>
|
101 |
+
<frontend_type>text</frontend_type>
|
102 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
103 |
+
<sort_order>8</sort_order>
|
104 |
+
<show_in_default>1</show_in_default>
|
105 |
+
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>1</show_in_store>
|
107 |
+
<comment><![CDATA[Din unike kunde-ID for Nets Mobile. Fås på epost av Nets.]]></comment>
|
108 |
+
<depends><mobile_active>1</mobile_active></depends>
|
109 |
+
</mobile_merchant_id>
|
110 |
+
|
111 |
+
<mobile_merchant_token translate="label">
|
112 |
+
<label>Merchant Token</label>
|
113 |
+
<frontend_type>text</frontend_type>
|
114 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
115 |
+
<sort_order>9</sort_order>
|
116 |
+
<show_in_default>1</show_in_default>
|
117 |
+
<show_in_website>1</show_in_website>
|
118 |
+
<show_in_store>1</show_in_store>
|
119 |
+
<comment><![CDATA[Ditt unike kunde-passord for Nets Mobile. Fås på SMS fra Nets.]]></comment>
|
120 |
+
<depends><mobile_active>1</mobile_active></depends>
|
121 |
+
</mobile_merchant_token>
|
122 |
|
123 |
<test_mode translate="label">
|
124 |
<label>Test modus</label>
|
128 |
<show_in_default>1</show_in_default>
|
129 |
<show_in_website>1</show_in_website>
|
130 |
<show_in_store>1</show_in_store>
|
131 |
+
<comment><![CDATA[Sett denne til ja for å kjøre mot Nets sitt test system.]]></comment>
|
132 |
</test_mode>
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<merchant_test_token translate="label">
|
135 |
<label>Merchant Test Token</label>
|
136 |
<frontend_type>text</frontend_type>
|
137 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
138 |
+
<sort_order>11</sort_order>
|
139 |
<show_in_default>1</show_in_default>
|
140 |
<show_in_website>1</show_in_website>
|
141 |
<show_in_store>1</show_in_store>
|
142 |
+
<comment><![CDATA[Ditt unike test-passord fra Nets. Fås på SMS fra Nets. Merk at Nets normalt sender både TEST og PROD passord på SMS. Her skriver du TEST passordet.]]></comment>
|
143 |
+
<depends><test_mode>1</test_mode></depends>
|
144 |
</merchant_test_token>
|
145 |
|
146 |
+
<mobile_test_token translate="label">
|
147 |
+
<label>Mobile Test Token</label>
|
148 |
+
<frontend_type>text</frontend_type>
|
149 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
150 |
+
<sort_order>12</sort_order>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>1</show_in_store>
|
154 |
+
<comment><![CDATA[Ditt unike test-passord for Nets Mobile.]]></comment>
|
155 |
+
<depends><test_mode>1</test_mode><mobile_active>1</mobile_active></depends>
|
156 |
+
</mobile_test_token>
|
157 |
+
|
158 |
+
<max_amount translate="label">
|
159 |
+
<label>Min amount</label>
|
160 |
+
<frontend_type>select</frontend_type>
|
161 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
162 |
+
<sort_order>14</sort_order>
|
163 |
+
<show_in_default>1</show_in_default>
|
164 |
+
<show_in_website>1</show_in_website>
|
165 |
+
<show_in_store>1</show_in_store>
|
166 |
+
<comment><![CDATA[]]></comment>
|
167 |
+
</max_amount>
|
168 |
+
|
169 |
+
<max_amount_value translate="label">
|
170 |
+
<label>Min amount limit</label>
|
171 |
+
<frontend_type>text</frontend_type>
|
172 |
+
<sort_order>15</sort_order>
|
173 |
+
<show_in_default>1</show_in_default>
|
174 |
+
<show_in_website>1</show_in_website>
|
175 |
+
<show_in_store>1</show_in_store>
|
176 |
+
<comment><![CDATA[Alla ordrar över detta värde kommer ej visa NETS-modulen i checkout]]></comment>
|
177 |
+
<depends>
|
178 |
+
<max_amount>1</max_amount>
|
179 |
+
</depends>
|
180 |
+
</max_amount_value>
|
181 |
+
|
182 |
+
<logo translate="label">
|
183 |
+
<label>Logo</label>
|
184 |
+
<frontend_type>multiselect</frontend_type>
|
185 |
+
<source_model>bbsnetaxept/config_logo</source_model>
|
186 |
+
<sort_order>16</sort_order>
|
187 |
+
<show_in_default>1</show_in_default>
|
188 |
+
<show_in_website>1</show_in_website>
|
189 |
+
<show_in_store>1</show_in_store>
|
190 |
+
<comment><![CDATA[Logo som vises på Nets betalingsvalget i nettbutikken.]]></comment>
|
191 |
+
</logo>
|
192 |
+
|
193 |
+
<payment_action translate="label">
|
194 |
+
<label>Betalingshandling</label>
|
195 |
+
<frontend_type>select</frontend_type>
|
196 |
+
<source_model>bbsnetaxept/BBSNetterminal_paymentAction</source_model>
|
197 |
+
<sort_order>20</sort_order>
|
198 |
+
<show_in_default>1</show_in_default>
|
199 |
+
<show_in_website>1</show_in_website>
|
200 |
+
<show_in_store>1</show_in_store>
|
201 |
+
<tooltip><![CDATA[Authorize Only (standard) reserverer først beløpet på kundens kort. Man må deretter kjøre Capture (trekke beløpet) i ordrebehandlingen i Magento når ordren sendes. Det er ikke lov å trekke penger fra kortet før varene sendes. Kunder som selger for eksempel digitale produkter som kunden mottar umiddelbart kan bruke Authorize + Capture.]]></tooltip>
|
202 |
+
</payment_action>
|
203 |
+
|
204 |
+
<!--
|
205 |
<use_gui translate="label">
|
206 |
+
<label>Bruke Nets sin betalingsside</label>
|
207 |
<frontend_type>select</frontend_type>
|
208 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
209 |
+
<sort_order>21</sort_order>
|
210 |
<show_in_default>1</show_in_default>
|
211 |
<show_in_website>1</show_in_website>
|
212 |
<show_in_store>1</show_in_store>
|
213 |
+
<tooltip><![CDATA[Skal normalt ikke endres. Husk at du kan laste opp egen logo på betalingssiden gjennom kontrollpanelet til Nets (https://epayment.bbs.no/). Dersom du velger å ikke bruke Nets GUI så krever dette en PCI sertifisering av nettbutikken din.]]></tooltip>
|
214 |
</use_gui>
|
215 |
+
-->
|
216 |
+
<cctypes translate="label">
|
217 |
+
<label>Aktive kredittkort-typer</label>
|
218 |
+
<frontend_type>multiselect</frontend_type>
|
219 |
+
<source_model>adminhtml/system_config_source_payment_cctype</source_model>
|
220 |
+
<sort_order>22</sort_order>
|
221 |
+
<show_in_default>1</show_in_default>
|
222 |
+
<show_in_website>1</show_in_website>
|
223 |
+
<show_in_store>1</show_in_store>
|
224 |
+
<comment><![CDATA[Tilgjengelige korttyper på din konto. Husk at hver korttype krever avtale med Nets og kredittkortinnløser. VISA og MasterCard er vanlig for de fleste.]]></comment>
|
225 |
+
<depends><use_gui>0</use_gui></depends>
|
226 |
+
</cctypes>
|
227 |
|
228 |
<gui_language translate="label">
|
229 |
+
<label>Språk på Nets betalingssiden</label>
|
230 |
<frontend_type>select</frontend_type>
|
231 |
<source_model>bbsnetaxept/BBSNetterminal_language</source_model>
|
232 |
+
<sort_order>23</sort_order>
|
233 |
<show_in_default>1</show_in_default>
|
234 |
<show_in_website>1</show_in_website>
|
235 |
<show_in_store>1</show_in_store>
|
236 |
+
<comment><![CDATA[Velg språket du ønsker at Nets skal vise på selve betalingssiden.]]></comment>
|
237 |
</gui_language>
|
238 |
+
|
239 |
+
<singlepage>
|
240 |
+
<label>Bruk "Singlepage"</label>
|
241 |
+
<frontend_type>select</frontend_type>
|
242 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
243 |
+
<sort_order>24</sort_order>
|
244 |
+
<show_in_default>1</show_in_default>
|
245 |
+
<show_in_website>1</show_in_website>
|
246 |
+
<show_in_store>1</show_in_store>
|
247 |
+
<comment><![CDATA[Bruk en enkel side på Nets.]]></comment>
|
248 |
+
</singlepage>
|
249 |
+
|
250 |
|
251 |
<redirect_text translate="label">
|
252 |
<label>Utvidet infotekst</label>
|
253 |
<frontend_type>textarea</frontend_type>
|
254 |
+
<sort_order>30</sort_order>
|
255 |
<show_in_default>1</show_in_default>
|
256 |
<show_in_website>1</show_in_website>
|
257 |
<show_in_store>1</show_in_store>
|
258 |
+
<comment><![CDATA[Meldingstekst som kunden ser når han eller hun velger betalingsalternativet Nets.]]></comment>
|
259 |
</redirect_text>
|
260 |
|
261 |
<pending_minutes translate="label">
|
262 |
<label>Betalings avbrudd</label>
|
263 |
<frontend_type>text</frontend_type>
|
264 |
+
<sort_order>31</sort_order>
|
265 |
<show_in_default>1</show_in_default>
|
266 |
<show_in_website>0</show_in_website>
|
267 |
<show_in_store>0</show_in_store>
|
268 |
+
<comment><![CDATA[Antall minutter før en ordre automatisk blir merket som avbrutt dersom kunden ikke har kommet tilbake fra Nets betalings siden. Skriv 0 for aldri å automatisk avbryte en ordre.]]></comment>
|
269 |
</pending_minutes>
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
<!--
|
272 |
<order_status translate="label">
|
273 |
<label>New order status</label>
|
288 |
<show_in_default>1</show_in_default>
|
289 |
<show_in_website>1</show_in_website>
|
290 |
<show_in_store>1</show_in_store>
|
291 |
+
<comment><![CDATA[Velg ønsket ordrestatus på ordrer som har blitt authentisert og godkjent hos Nets. Ordrer får normalt Venter/Pending før de er betalt. Ordrestatus som settes her er den de får når betalingen er bekreftet.]]></comment>
|
292 |
</auth_order_status>
|
293 |
|
294 |
+
<enable_void translate="label">
|
295 |
+
<label>Fjern autorisasjon når ordre avbrytes</label>
|
296 |
+
<frontend_type>select</frontend_type>
|
297 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
298 |
+
<sort_order>45</sort_order>
|
299 |
+
<show_in_default>1</show_in_default>
|
300 |
+
<show_in_website>1</show_in_website>
|
301 |
+
<show_in_store>1</show_in_store>
|
302 |
+
<comment><![CDATA[OBS! Dersom dette blir aktivert vil autorisasjonen bli fjernet dersom du endrer ordrer.]]></comment>
|
303 |
+
</enable_void>
|
304 |
+
|
305 |
<allowspecific translate="label">
|
306 |
+
<label>Tillatt enkelt-land som kan bruke Nets</label>
|
307 |
<frontend_type>allowspecific</frontend_type>
|
308 |
+
<sort_order>80</sort_order>
|
309 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
310 |
<show_in_default>1</show_in_default>
|
311 |
<show_in_website>1</show_in_website>
|
313 |
</allowspecific>
|
314 |
|
315 |
<specificcountry translate="label">
|
316 |
+
<label>Spesifiser hvilke land som kan bruke Nets</label>
|
317 |
<frontend_type>multiselect</frontend_type>
|
318 |
+
<sort_order>81</sort_order>
|
319 |
<source_model>adminhtml/system_config_source_country</source_model>
|
320 |
<show_in_default>1</show_in_default>
|
321 |
<show_in_website>1</show_in_website>
|
322 |
<show_in_store>1</show_in_store>
|
323 |
<comment><![CDATA[Velg utvalgte land som får lov å velge denne betalingsmetoden. Standard er alle land.]]></comment>
|
324 |
+
<depends><allowspecific>1</allowspecific></depends>
|
325 |
</specificcountry>
|
326 |
|
327 |
<enable_log translate="label">
|
343 |
<show_in_store>1</show_in_store>
|
344 |
<comment><![CDATA[Ønsket sortering i Betalingsmetoder-feltet på utsjekkingssiden i nettbutikken. Aktuelt dersom du tilbyr flere betalingsalternativer og ønsker å plassere BBS betalingsvalget i en angitt rekkefølge.]]></comment>
|
345 |
</sort_order>
|
346 |
+
|
347 |
+
<alternate_redirect>
|
348 |
+
<label>Alternativ retur URL</label>
|
349 |
+
<frontend_type>text</frontend_type>
|
350 |
+
<sort_order>101</sort_order>
|
351 |
+
<show_in_default>1</show_in_default>
|
352 |
+
<show_in_website>1</show_in_website>
|
353 |
+
<show_in_store>1</show_in_store>
|
354 |
+
<comment><![CDATA[OBS!! Ikke gjør endringer i dette feltet uten at du er 100% sikker på hva du gjør]]></comment>
|
355 |
+
</alternate_redirect>
|
356 |
+
|
357 |
</fields>
|
358 |
</bbsnetaxept_withgui>
|
359 |
</groups>
|
app/code/community/Trollweb/BBSNetAxept/{Model/BBSNetterminal/Result.php → sql/bbsnetaxept_setup/mysql4-upgrade-1.9.9-2.0.0.php}
RENAMED
@@ -1,23 +1,28 @@
|
|
1 |
-
<?
|
2 |
-
/**
|
3 |
-
* BBS NetAxept, Norge
|
4 |
-
*
|
5 |
-
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
-
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
-
* Trollweb is not responsible for any problems caused by this file.
|
10 |
-
*
|
11 |
-
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
-
* @category Trollweb
|
14 |
-
* @package Trollweb_BBSNetAxept
|
15 |
-
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
-
* @license Single-site License
|
17 |
-
*
|
18 |
-
*/
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
<?
|
2 |
+
/**
|
3 |
+
* BBS NetAxept, Norge
|
4 |
+
*
|
5 |
+
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
+
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
+
* Trollweb is not responsible for any problems caused by this file.
|
10 |
+
*
|
11 |
+
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
+
* @category Trollweb
|
14 |
+
* @package Trollweb_BBSNetAxept
|
15 |
+
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
+
* @license Single-site License
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
|
20 |
+
$installer = $this;
|
21 |
+
|
22 |
+
$installer->startSetup();
|
23 |
+
|
24 |
+
$statusTable = $installer->getTable('sales/order_status');
|
25 |
+
$data = array(array('status' => 'pending_nets', 'label' => 'Venter på kort'));
|
26 |
+
$installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
|
27 |
+
|
28 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/bbsnetaxept/form.phtml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
<?php $_code=$this->getMethodCode() ?>
|
22 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
23 |
<li>
|
24 |
-
<?php echo $this->__('You will be redirected to
|
25 |
</li>
|
26 |
</ul>
|
27 |
</fieldset>
|
21 |
<?php $_code=$this->getMethodCode() ?>
|
22 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
23 |
<li>
|
24 |
+
<?php echo $this->__('You will be redirected to Nets website when you place an order.') ?>
|
25 |
</li>
|
26 |
</ul>
|
27 |
</fieldset>
|
app/design/adminhtml/default/default/template/bbsnetaxept/paymentinfo.phtml
CHANGED
@@ -32,5 +32,8 @@
|
|
32 |
</tbody>
|
33 |
</table>
|
34 |
<?php endif;?>
|
|
|
|
|
|
|
35 |
|
36 |
<?php echo $this->getChildHtml()?>
|
32 |
</tbody>
|
33 |
</table>
|
34 |
<?php endif;?>
|
35 |
+
<?php if ($this->isMobileDevice()): ?>
|
36 |
+
<?php echo $this->__('Order was placed with a mobile device'); ?>
|
37 |
+
<?php endif; ?>
|
38 |
|
39 |
<?php echo $this->getChildHtml()?>
|
app/design/frontend/base/default/layout/bbsnetaxept.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<layout>
|
4 |
+
|
5 |
+
<checkout_onepage_index>
|
6 |
+
<reference name="head">
|
7 |
+
<action method="addJs"><script>bbsnetaxept/modernizr_touch.js</script></action>
|
8 |
+
</reference>
|
9 |
+
</checkout_onepage_index>
|
10 |
+
|
11 |
+
<gomage_checkout_onepage_index>
|
12 |
+
<reference name="head">
|
13 |
+
<action method="addJs"><script>bbsnetaxept/modernizr_touch.js</script></action>
|
14 |
+
</reference>
|
15 |
+
</gomage_checkout_onepage_index>
|
16 |
+
|
17 |
+
</layout>
|
app/design/frontend/base/default/template/bbsnetaxept/form.phtml
CHANGED
@@ -3,31 +3,39 @@
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
-
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
-
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
-
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
-
*
|
18 |
*/
|
19 |
|
20 |
$logoUrl = $this->getLogo();
|
|
|
21 |
?>
|
22 |
<fieldset class="form-list">
|
23 |
-
<?php $
|
|
|
|
|
|
|
|
|
24 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
|
|
25 |
<li>
|
26 |
-
<?php if (!empty($logoUrl)): ?>
|
27 |
-
<img id="bbs_logo_<?php echo $_code; ?>" src="<?php echo $this->getSkinUrl($logoUrl); ?>" />
|
28 |
-
<br />
|
29 |
-
<?php endif;?>
|
30 |
<?php echo $this->getRedirectText(); ?>
|
31 |
</li>
|
32 |
</ul>
|
33 |
-
</fieldset>
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* BBS NetAxept, Norge
|
4 |
*
|
5 |
* LICENSE AND USAGE INFORMATION
|
6 |
+
* It is NOT allowed to modify, copy or re-sell this file or any
|
7 |
+
* part of it. Please contact us by email at post@trollweb.no or
|
8 |
* visit us at www.trollweb.no/bbs if you have any questions about this.
|
9 |
* Trollweb is not responsible for any problems caused by this file.
|
10 |
*
|
11 |
* Visit us at http://www.trollweb.no today!
|
12 |
+
*
|
13 |
* @category Trollweb
|
14 |
* @package Trollweb_BBSNetAxept
|
15 |
* @copyright Copyright (c) 2009 Trollweb (http://www.trollweb.no)
|
16 |
* @license Single-site License
|
17 |
+
*
|
18 |
*/
|
19 |
|
20 |
$logoUrl = $this->getLogo();
|
21 |
+
$_code=$this->getMethodCode();
|
22 |
?>
|
23 |
<fieldset class="form-list">
|
24 |
+
<?php if (!empty($logoUrl)): ?>
|
25 |
+
<?php foreach ($logoUrl as $_url): ?>
|
26 |
+
<img id="bbs_logo_<?php echo $_code; ?>" src="<?php echo $this->getSkinUrl($_url); ?>" />
|
27 |
+
<?php endforeach; ?>
|
28 |
+
<?php endif;?>
|
29 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
30 |
+
<input type="hidden" name="payment[nets_mobile]" value="0" id="nets_mobile">
|
31 |
<li>
|
|
|
|
|
|
|
|
|
32 |
<?php echo $this->getRedirectText(); ?>
|
33 |
</li>
|
34 |
</ul>
|
35 |
+
</fieldset>
|
36 |
+
|
37 |
+
<script type="text/javascript">
|
38 |
+
if (Modernizr.touch) {
|
39 |
+
$('nets_mobile').value = 1
|
40 |
+
}
|
41 |
+
</script>
|
app/design/frontend/base/default/template/bbsnetaxept/paymentinfo.phtml
CHANGED
@@ -22,6 +22,8 @@ $logoUrl = $this->getLogo();
|
|
22 |
<?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
|
23 |
<?php if (!empty($logoUrl)): ?>
|
24 |
<br />
|
25 |
-
|
|
|
|
|
26 |
<?php endif;?>
|
27 |
-
</p>
|
22 |
<?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
|
23 |
<?php if (!empty($logoUrl)): ?>
|
24 |
<br />
|
25 |
+
<?php foreach($logoUrl as $_url): ?>
|
26 |
+
<img alt="logo" src="<?php echo $this->getSkinUrl($_url); ?>" />
|
27 |
+
<?php endforeach; ?>
|
28 |
<?php endif;?>
|
29 |
+
</p>
|
app/locale/nb_NO/Trollweb_BBSNetaxept.csv
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
"Pending
|
2 |
-
"Redirected to
|
3 |
-
"
|
4 |
"Payment status: %s","Betalings status: %s"
|
1 |
+
"Pending Nets","Det er ikke registert noe betaling på denne ordren"
|
2 |
+
"Redirected to Nets Payment for authorisation","Videresendt til Nets sin betalingsløsning"
|
3 |
+
"Nets Authorization successful","Ordrebeløpet er reservert av Nets"
|
4 |
"Payment status: %s","Betalings status: %s"
|
js/bbsnetaxept/modernizr_touch.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
2 |
+
* Build: http://modernizr.com/download/#-touch-shiv-cssclasses-teststyles-prefixes-load
|
3 |
+
*/
|
4 |
+
;window.Modernizr=function(a,b,c){function w(a){j.cssText=a}function x(a,b){return w(m.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var B in n)v(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},w(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
|
package.xml
CHANGED
@@ -1,20 +1,6 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
<channel>community</channel>
|
8 |
-
<extends/>
|
9 |
-
<summary>Payment gateway for BBS Netaxept. Let your customers pay safely by creditcard and BankAxess/BankID. Module certified by BBS.</summary>
|
10 |
-
<description>This Magento extension enables you to receive creditcard payments through BBS Netaxept. BBS supports all major creditcards and also the Norwegian BankAxess so that your customers can pay directly from their bank account if they have a valid BankID.
|
11 |
-
|
12 |
-
Please remember that you need to sign up with both BBS and Teller. Sign up forms are available directly in the Magento Admin and Payment Gateways, under the BBS Netaxept Settings.</description>
|
13 |
-
<notes>This extension uses the BBS Netaxept API.</notes>
|
14 |
-
<authors><author><name>Trollweb Solutions AS</name><user>auto-converted</user><email>post@trollweb.no</email></author></authors>
|
15 |
-
<date>2010-10-19</date>
|
16 |
-
<time>12:04:07</time>
|
17 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="d61295f247bccb512608c1f9dec45876"/><file name="paymentinfo.phtml" hash="06807ed36bc240dec7b72a45bde8bc99"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="f2c6bb87bb25ddd68a3dddde8ed64f12"/><file name="paymentinfo.phtml" hash="6ec9c7243fdb7c67a9d3de210a56908c"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Trollweb_BBSNetaxept.csv" hash="000d3c77466ee3fb34b0f746a98d8ce8"/></dir><dir name="nb_NO"><file name="Trollweb_BBSNetaxept.csv" hash="79492eece606a21d90b5b18956a03b04"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="bbsnetaxept"><file name="logo.png" hash="17dcefecee14a0231c58dd87b2e0dc5e"/><file name="technology_logo.png" hash="e0b62fb37da9fb8c1ef69390762f066b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Trollweb_BBSNetAxept.xml" hash="f3b2219f86e88ada812f5bde8ae6859c"/></dir></target><target name="magecommunity"><dir name="Trollweb"><dir name="BBSNetAxept"><dir name="Block"><file name="Form.php" hash="2e843f8b372cf86b901604676223e9ff"/><file name="PaymentInfo.php" hash="fa9a17d60fe0c8927bed84ec7cfbbb98"/><file name="Redirect.php" hash="fd14f6a2f2ac7b36daa4884b74e33f6d"/></dir><dir name="controllers"><file name="ReturnController.php" hash="0261e731bc6f842e9e6206ac8649f6ae"/></dir><dir name="etc"><file name="config.xml" hash="aebd38a752f6e292394c20d943a1ef55"/><file name="system.xml" hash="208e2eda8b2ccae42e338d27e1785edb"/></dir><dir name="Helper"><file name="Data.php" hash="06e6b25c35fa45f014c51163ccec2e44"/></dir><dir name="Model"><dir name="Api"><file name="Bbs.php" hash="71bf1369b78b750087a1e456e5dcbe06"/><file name="BbsRequest.php" hash="cb1e4dbcbaf323f629b5312151d886d1"/><file name="SoapClient.php" hash="bec9fac81508b4596f309c9dfd735514"/></dir><dir name="BBSNetterminal"><file name="Debug.php" hash="4c938bc2a079719a111478c9d24adf77"/><file name="Language.php" hash="8bafa1d208ee1571920eebfdf98a6745"/><file name="PaymentAction.php" hash="60efa6278b77fcd56d28d81e19617ccc"/><file name="Request.php" hash="b9353f6c6ca06349928aa418cf943744"/><file name="Result.php" hash="2faf0b6cc4fb00b00cbec7a48f4dca07"/></dir><dir name="Config"><file name="Logo.php" hash="7a6d09c42821270b85d32a6f9509395b"/></dir><dir name="Entity"><file name="Setup.php" hash="6d17490981f2d9efa48ac7a0f9318a83"/></dir><file name="Cron.php" hash="b8ad260d5df4987fd205865a19c8dd19"/><file name="Info.php" hash="6da79bb08aaad83e5d41f6680bae25e0"/><file name="WithGUI.php" hash="a43cd736ddc0597b7c1377eed1666b99"/></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="f4fca44c4f8acc3a4c57510ea5b79087"/><file name="mysql4-uninstall-0.1.0.php" hash="8aeaa58e2ce89edb82be3a4e7f3bd68b"/></dir></dir></dir></dir></target></contents>
|
18 |
-
<compatible/>
|
19 |
-
<dependencies/>
|
20 |
-
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>BBSNetAxept_Norway</name><version>2.2.0</version><stability>stable</stability><license>MIT</license><channel>community</channel><extends></extends><summary>Nets Netaxept modul for Magento. Sertifisert og godkjent av Nets.</summary><description></description><notes><ul>
|
3 |
+
<li>Direct payment for Sverige.</li>
|
4 |
+
<li>Gavekoret.</li>
|
5 |
+
<li>Mobil tilpasset versjon.</li>
|
6 |
+
</ul></notes><authors><author><name>Roy Andre Tollefsen</name><user>royandre</user><email>royandre@trollweb.no</email></author></authors><date>2013-12-09</date><time>3:50:58</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="js"><dir name="bbsnetaxept"><file name="modernizr_touch.js" hash="69aeeea1add903dc60601b04f3e5bc22"/></dir></dir><dir name="app"><dir name="locale"><dir name="nb_NO"><file name="Trollweb_BBSNetaxept.csv" hash="0466e2771116fc61d1cd53866092e064"/></dir><dir name="en_US"><file name="Trollweb_BBSNetaxept.csv" hash="000d3c77466ee3fb34b0f746a98d8ce8"/></dir></dir><dir name="code"><dir name="community"><dir name="Trollweb"><dir name="BBSNetAxept"><dir name="Model"><file name="Cron.php" hash="5fd7db4fd5e604789c688de5251cbccd"/><file name="Info.php" hash="ddc6e5a3e1131939b16f0530fb3a7688"/><file name="Observer.php" hash="f55d9c83a049de97e5a574938ce52bbe"/><file name="Updates.php" hash="3cac26dfde3b4106a02f4b4f0a073223"/><file name="WithGUI.php" hash="0e62ce4b604b56c646366526535079d6"/><dir name="Config"><file name="Logo.php" hash="7a6d09c42821270b85d32a6f9509395b"/></dir><dir name="BBSNetterminal"><file name="Debug.php" hash="4c938bc2a079719a111478c9d24adf77"/><file name="Language.php" hash="8bafa1d208ee1571920eebfdf98a6745"/><file name="PaymentAction.php" hash="60efa6278b77fcd56d28d81e19617ccc"/><file name="Request.php" hash="b9353f6c6ca06349928aa418cf943744"/></dir><dir name="Api"><file name="Bbs.php" hash="49001a2f7a9e8c1a25e3cf625996dc48"/><file name="BbsRequest.php" hash="1d89c8369032ba4ba79c89828770da56"/><file name="SoapClient.php" hash="0bea5c38b2402fe854c092389aae9a21"/></dir><dir name="Entity"><file name="Setup.php" hash="6d17490981f2d9efa48ac7a0f9318a83"/></dir></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="f4fca44c4f8acc3a4c57510ea5b79087"/><file name="mysql4-uninstall-0.1.0.php" hash="8aeaa58e2ce89edb82be3a4e7f3bd68b"/><file name="mysql4-upgrade-1.9.9-2.0.0.php" hash="9c279b664a88152b26b37ec0c43bdf20"/></dir></dir><dir name="controllers"><file name="ReturnController.php" hash="ea6af48c462e41bbd13cc62603cc1acb"/></dir><dir name="Helper"><file name="Data.php" hash="06e6b25c35fa45f014c51163ccec2e44"/></dir><dir name="Block"><file name="Form.php" hash="70a9e93d6683a2eeeef47c0f14e83eff"/><file name="PaymentInfo.php" hash="82ee25e87c4a45ca9a6387dcfe49532f"/><file name="Redirect.php" hash="2f87d101827078305286c1a8b792fa36"/></dir><dir name="etc"><file name="config.xml" hash="812717acdd6e0e8cadbbc56238bd69f2"/><file name="system.xml" hash="3fdd59230edf75f2568be9c44a6de5d2"/></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bbsnetaxept.xml" hash="c2129c35e8d445f3f9f31f7b3e203f25"/></dir><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="e1422af5aab2b66f8eb22bfe9c33c90c"/><file name="paymentinfo.phtml" hash="9691a3becc63875ff85fa4e7f0e9327b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="80e1505773287d1e3711d7b5e4594d71"/><file name="paymentinfo.phtml" hash="f4128bf1029de032f55e8c6d6a71bf4f"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Trollweb_BBSNetAxept.xml" hash="f3b2219f86e88ada812f5bde8ae6859c"/></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="bbsnetaxept"><file name="dancard.png" hash="6d430b5bec1f550e4185e16a906b81de"/><file name="nets-payment.png" hash="6f43693b3e2af61626f10d6e041ebfeb"/></dir></dir></dir></dir></dir></dir></target></contents></package>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/base/default/images/bbsnetaxept/dancard.png
ADDED
Binary file
|
skin/frontend/base/default/images/bbsnetaxept/logo.png
DELETED
Binary file
|
skin/frontend/base/default/images/bbsnetaxept/nets-payment.png
ADDED
Binary file
|
skin/frontend/base/default/images/bbsnetaxept/technology_logo.png
DELETED
Binary file
|