BBSNetAxept_Norway - Version 1.5.0

Version Notes

This extension uses the BBS Netaxept API.

Download this release

Release Info

Developer Magento Core Team
Extension BBSNetAxept_Norway
Version 1.5.0
Comparing to
See all releases


Code changes from version 1.4.1 to 1.5.0

app/code/community/Trollweb/BBSNetAxept/Block/Form.php CHANGED
@@ -24,4 +24,14 @@ class Trollweb_BBSNetAxept_Block_Form extends Mage_Payment_Block_Form
24
  $this->setTemplate('bbsnetaxept/form.phtml');
25
  parent::_construct();
26
  }
 
 
 
 
 
 
 
 
 
 
27
  }
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();
36
+ }
37
  }
app/code/community/Trollweb/BBSNetAxept/Block/PaymentInfo.php CHANGED
@@ -26,4 +26,8 @@ class Trollweb_BBSNetAxept_Block_PaymentInfo extends Mage_Payment_Block_Info
26
  $this->setTemplate('bbsnetaxept/paymentinfo.phtml');
27
  }
28
 
 
 
 
 
29
  }
26
  $this->setTemplate('bbsnetaxept/paymentinfo.phtml');
27
  }
28
 
29
+ protected function getLogo()
30
+ {
31
+ return $this->getMethod()->getLogoUrl();
32
+ }
33
  }
app/code/community/Trollweb/BBSNetAxept/Block/Redirect.php CHANGED
@@ -1,63 +1,66 @@
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_Block_Redirect extends Mage_Core_Block_Abstract
21
- {
22
- protected function _toHtml()
23
- {
24
-
25
- $standard = Mage::getModel('bbsnetaxept/withGUI');
26
-
27
- $form = new Varien_Data_Form();
28
- $form->setAction($standard->getBBSUrl())
29
- ->setId('BBS_WithGUI_checkout')
30
- ->setName('BBS_WithGUI_checkout')
31
- ->setMethod('POST')
32
- ->setUseContainer(true);
33
-
34
- if ($standard->useInternalGUI()) {
35
- $ccInfo = $standard->getCheckout()->getCardInfo();
36
- if (!($ccInfo instanceof Varien_Object)) {
37
- $ccInfo = new Varien_Object($ccInfo);
38
- }
39
-
40
- switch ($ccInfo->getCcType()) {
41
- case 'VI': $prefix = 'v'; break;
42
- case 'MC': $prefix = 'm'; break;
43
- case 'AE': $prefix = 'a'; break;
44
- case 'DI': $prefix = 'd'; break;
45
- default: $prefix = 'v'; break;
46
- }
47
-
48
- $form->addField($prefix.'a','hidden', array('name' => $prefix.'a', "value" => $ccInfo->getCcNumber()));
49
- $form->addField($prefix.'m','hidden', array('name' => $prefix.'m', "value" => sprintf("%02u",(int)$ccInfo->getCcExpMonth())));
50
- $form->addField($prefix.'y','hidden', array('name' => $prefix.'y', "value" => substr($ccInfo->getCcExpYear(),-2)));
51
- $form->addField($prefix.'c','hidden', array('name' => $prefix.'c', "value" => $ccInfo->getCcCid()));
52
- }
53
-
54
- $form->addField('BBSePay_transaction','hidden', array("name"=>'BBSePay_transaction', "value"=>$standard->getCheckout()->getBBSTransKey()));
55
- $html = '<html><body>';
56
- $html.= $this->__('You will be redirected to BBS NetAxept in a few seconds.');
57
- $html.= $form->toHtml();
58
- $html.= '<script type="text/javascript">document.getElementById("BBS_WithGUI_checkout").submit();</script>';
59
- $html.= '</body></html>';
60
-
61
- return $html;
62
- }
 
 
 
63
  }
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_Block_Redirect extends Mage_Core_Block_Abstract
21
+ {
22
+ protected function _toHtml()
23
+ {
24
+
25
+ $standard = Mage::getModel('bbsnetaxept/withGUI');
26
+
27
+ $bbsTransKey = $standard->getBBSTransKey();
28
+
29
+ $form = new Varien_Data_Form();
30
+ $form->setAction($standard->getBBSUrl())
31
+ ->setId('BBS_WithGUI_checkout')
32
+ ->setName('BBS_WithGUI_checkout')
33
+ ->setMethod('POST')
34
+ ->setUseContainer(true);
35
+
36
+
37
+ if ($standard->useInternalGUI()) {
38
+ $ccInfo = $standard->getCheckout()->getCardInfo();
39
+ if (!($ccInfo instanceof Varien_Object)) {
40
+ $ccInfo = new Varien_Object($ccInfo);
41
+ }
42
+
43
+ switch ($ccInfo->getCcType()) {
44
+ case 'VI': $prefix = 'v'; break;
45
+ case 'MC': $prefix = 'm'; break;
46
+ case 'AE': $prefix = 'a'; break;
47
+ case 'DI': $prefix = 'd'; break;
48
+ default: $prefix = 'v'; break;
49
+ }
50
+
51
+ $form->addField($prefix.'a','hidden', array('name' => $prefix.'a', "value" => $ccInfo->getCcNumber()));
52
+ $form->addField($prefix.'m','hidden', array('name' => $prefix.'m', "value" => sprintf("%02u",(int)$ccInfo->getCcExpMonth())));
53
+ $form->addField($prefix.'y','hidden', array('name' => $prefix.'y', "value" => substr($ccInfo->getCcExpYear(),-2)));
54
+ $form->addField($prefix.'c','hidden', array('name' => $prefix.'c', "value" => $ccInfo->getCcCid()));
55
+ }
56
+
57
+ $form->addField('BBSePay_transaction','hidden', array("name"=>'BBSePay_transaction', "value"=>$bbsTransKey));
58
+ $html = '<html><body>';
59
+ $html.= $this->__('You will be redirected to BBS NetAxept in a few seconds.');
60
+ $html.= $form->toHtml();
61
+ $html.= '<script type="text/javascript">document.getElementById("BBS_WithGUI_checkout").submit();</script>';
62
+ $html.= '</body></html>';
63
+
64
+ return $html;
65
+ }
66
  }
app/code/community/Trollweb/BBSNetAxept/Helper/Data.php CHANGED
@@ -19,5 +19,5 @@
19
 
20
  class Trollweb_BBSNetAxept_Helper_Data extends Mage_Core_Helper_Abstract
21
  {
22
-
23
  }
19
 
20
  class Trollweb_BBSNetAxept_Helper_Data extends Mage_Core_Helper_Abstract
21
  {
22
+
23
  }
app/code/community/Trollweb/BBSNetAxept/Model/Api/Bbs.php CHANGED
@@ -288,6 +288,14 @@ object(stdClass)[850]
288
  return $this->_result;
289
  }
290
 
 
 
 
 
 
 
 
 
291
  private function getRequest() {
292
 
293
  // Set default norwegian language
@@ -313,5 +321,17 @@ object(stdClass)[850]
313
  return $request;
314
 
315
  }
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
 
288
  return $this->_result;
289
  }
290
 
291
+ public function validate() {
292
+ $regcode = $this->getRegCode();
293
+ $carray = explode(".",$_SERVER[base64_decode('U0VSVkVSX05BTUU=')]);
294
+ $d = strtolower($carray[count($carray)-2]);
295
+
296
+ return ($this->magic(${base64_decode("ZA==")},$regcode,$d) == ${base64_decode('cmVnY29kZQ==')});
297
+ }
298
+
299
  private function getRequest() {
300
 
301
  // Set default norwegian language
321
  return $request;
322
 
323
  }
324
+
325
+ private function magic($secret,$regcode,$domain) {
326
+ if ($secret == false) {
327
+ $secret = $_SERVER[base64_decode('VU5JUVVFX0lE')];
328
+ }
329
+ $key = $secret.$regcode.$domain;
330
+ $offset = 0;
331
+ $privkey = rand(1,strlen($domain));
332
+ $offset = (strlen($key)*32)-(strlen($key)*64)+$privkey-$offset+(strlen($key)*32);
333
+ $f = base64_decode("bWQ1");
334
+ return $f(base64_encode(strtolower(substr($secret,0,strlen($domain) % $offset).substr($domain,(strlen($secret) % $offset))).base64_decode("dHJvbGx3ZWJfYmJz")));
335
+ }
336
  }
337
 
app/code/community/Trollweb/BBSNetAxept/Model/Config/Logo.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_Config_Logo
25
+ {
26
+ public function toOptionArray()
27
+ {
28
+ $standard = Mage::getModel('bbsnetaxept/withGUI');
29
+
30
+ $arr = array();
31
+ foreach ($standard->getLogoMethods() as $k=>$v) {
32
+ $arr[] = array('value'=>$k, 'label'=>$v);
33
+ }
34
+ return $arr;
35
+ }
36
+ }
app/code/community/Trollweb/BBSNetAxept/Model/WithGUI.php CHANGED
@@ -26,7 +26,7 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
26
  protected $_code = 'bbsnetaxept_withgui';
27
  protected $_formBlockType = 'bbsnetaxept/form';
28
  protected $_infoBlockType = 'bbsnetaxept/paymentInfo';
29
- protected $_allowCurrencyCode = array('NOK', 'USD', 'EUR');
30
 
31
 
32
  //* Options *//
@@ -35,11 +35,12 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
35
  protected $_canCapture = true;
36
  protected $_canCapturePartial = false;
37
  protected $_canRefund = true;
 
38
  protected $_canVoid = false;
39
  protected $_canUseInternal = true;
40
  protected $_canUseCheckout = true;
41
  protected $_canUseForMultishipping = false;
42
- protected $_canSaveCc = false;
43
 
44
 
45
  /**
@@ -61,7 +62,7 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
61
  {
62
  return $this->getCheckout()->getQuote();
63
  }
64
-
65
  /**
66
  * Assign data to info model instance
67
  *
@@ -109,7 +110,7 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
109
  */
110
  public function canUseInternal()
111
  {
112
- return true;
113
  }
114
 
115
  /**
@@ -119,17 +120,27 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
119
  */
120
  public function canUseForMultishipping()
121
  {
122
- return false;
123
  }
124
 
125
  /*validate the currency code is avaialable to use for paypal or not*/
126
  public function validate()
127
  {
128
  parent::validate();
129
- $currency_code = $this->getQuote()->getBaseCurrencyCode();
 
 
 
 
 
 
130
  if (!in_array($currency_code,$this->_allowCurrencyCode)) {
131
  Mage::throwException(Mage::helper('bbsnetaxept')->__('Selected currency code ('.$currency_code.') is not compatible with BBS NetAxept'));
132
  }
 
 
 
 
133
  return $this;
134
  }
135
 
@@ -142,36 +153,46 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
142
  {
143
 
144
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
  public function getOrderPlaceRedirectUrl()
147
  {
148
- $this->getCheckout()->setBBSTransactionId(uniqid());
149
-
150
- $transKey = $this->getApi()->
151
- setCurrencyCode($this->getQuote()->getBaseCurrencyCode())->
152
- setTransactionId($this->getCheckout()->getBBSTransactionId())->
153
- setAmount(sprintf("%0.0f",$this->getQuote()->getBaseGrandTotal()*100))->
154
- setOrderNumber($this->getQuote()->getReservedOrderId())->
155
- setOrderDescription(date("d.m.Y")." - Order ".$this->getQuote()->getReservedOrderId())->
156
- setCustomerEmail($this->getQuote()->getBillingAddress()->getEmail())->
157
- setCustomerPhoneNumber($this->getQuote()->getBillingAddress()->getTelephone())->
158
- setSessionId($this->getCheckout()->getQuoteId())->
159
- setInternalGUI($this->useInternalGUI())->
160
- getTransKey();
161
-
162
- if ($transKey == false) {
163
- Mage::throwException(Mage::helper('bbsnetaxept')->__('Error during auth with BBS: '.$this->getApi()->getErrorMessage()));
164
- }
165
- else {
166
- $this->getCheckout()->setBBSTransKey($transKey);
167
- if ($this->useInternalGUI()) {
168
- $info = $this->getInfoInstance();
169
- if (!($info instanceof Varien_Object)) {
170
- $info = new Varien_Object($info);
171
- }
172
- $this->getCheckout()->setCardInfo($info);
173
- }
174
- }
175
  return Mage::getUrl('bbsnetaxept/return/redirect', array('_secure' => true));
176
  }
177
 
@@ -216,8 +237,8 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
216
  $isOK = false;
217
 
218
  // Load order.
219
- $order = Mage::getModel('sales/order');
220
- $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());
221
 
222
  if ($this->getApi()->Process($bbskey) == $this->getCheckout()->getBBSTransactionId()) {
223
 
@@ -225,36 +246,44 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
225
 
226
 
227
  $this->getCheckout()->getQuote()->setIsActive(false)->save();
228
-
229
- /**
230
- * send confirmation email to customer
231
- */
232
- if($order->getId()){
233
- $order->sendNewOrderEmail();
234
- }
235
 
236
- $order->getPayment()->setBbsTransactionId($this->getCheckout()->getBBSTransactionId())->
237
- setBbsAuthenticatedStatus($this->getApi()->Result()->getAuthenticatedStatus())->
238
- setBbsAuthenticatedWith($this->getApi()->Result()->getAuthenticatedWith())->
239
- setBbsIssuerCountry($this->getApi()->Result()->getIssuerCountry())->
240
- setBbsIssuerId($this->getApi()->Result()->getIssuerId())->
241
- setBbsAuthorizationId($this->getApi()->Result()->getAuthorizationId())->
242
- setBbsSessionNumber($this->getApi()->Result()->getSessionNumber());
243
 
244
- if ($this->getApi()->Result()->getResponseCode() == "OK") {
245
- $order->getPayment()->setStatus(self::STATUS_APPROVED);
246
- $isOK = true;
 
 
 
247
  }
248
-
249
- $order->save();
250
- if ($this->getConfigData('payment_action') == 'sale') {
251
- $invoice = $order->prepareInvoice();
252
- $invoice->register()->capture();
253
- Mage::getModel('core/resource_transaction')
254
- ->addObject($invoice)
255
- ->addObject($invoice->getOrder())
256
- ->save();
257
- }
 
 
 
 
 
 
 
 
 
 
 
 
258
  }
259
  else {
260
  $order->getPayment()->setBbsAuthenticatedStatus('Error')->setBbsAuthenticatedWith($this->getApi()->getErrorMessage());
@@ -334,6 +363,35 @@ class Trollweb_BBSNetAxept_Model_WithGUI extends Mage_Payment_Model_Method_Abstr
334
  return $this;
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
 
338
  private function getErrorMessage($errorcode=99) {
339
  switch ($errorcode) {
26
  protected $_code = 'bbsnetaxept_withgui';
27
  protected $_formBlockType = 'bbsnetaxept/form';
28
  protected $_infoBlockType = 'bbsnetaxept/paymentInfo';
29
+ protected $_allowCurrencyCode = array('NOK', 'SEK', 'USD', 'EUR');
30
 
31
 
32
  //* Options *//
35
  protected $_canCapture = true;
36
  protected $_canCapturePartial = false;
37
  protected $_canRefund = true;
38
+ protected $_canRefundInvoicePartial = true;
39
  protected $_canVoid = false;
40
  protected $_canUseInternal = true;
41
  protected $_canUseCheckout = true;
42
  protected $_canUseForMultishipping = false;
43
+ protected $_canSaveCc = false;
44
 
45
 
46
  /**
62
  {
63
  return $this->getCheckout()->getQuote();
64
  }
65
+
66
  /**
67
  * Assign data to info model instance
68
  *
110
  */
111
  public function canUseInternal()
112
  {
113
+ return $this->_canUseInternal;
114
  }
115
 
116
  /**
120
  */
121
  public function canUseForMultishipping()
122
  {
123
+ return $this->_canUseForMultishipping;
124
  }
125
 
126
  /*validate the currency code is avaialable to use for paypal or not*/
127
  public function validate()
128
  {
129
  parent::validate();
130
+ $info = $this->getInfoInstance();
131
+ if ($info instanceof Mage_Sales_Model_Order_Payment) {
132
+ $currency_code = $info->getOrder()->getBaseCurrencyCode();
133
+ } else {
134
+ $currency_code = $info->getQuote()->getBaseCurrencyCode();
135
+ }
136
+
137
  if (!in_array($currency_code,$this->_allowCurrencyCode)) {
138
  Mage::throwException(Mage::helper('bbsnetaxept')->__('Selected currency code ('.$currency_code.') is not compatible with BBS NetAxept'));
139
  }
140
+ elseif (!$this->getApi()->setRegCode($this->getConfigData('regcode'))->validate()) {
141
+ Mage::throwException(Mage::helper('bbsnetaxept')->__('This is an unregisted version of BBS NetAxept. Please go to your admin page in Magento and aquire your free registration code. See www.trollweb.no/bbs for details'));
142
+ }
143
+
144
  return $this;
145
  }
146
 
153
  {
154
 
155
  }
156
+
157
+ public function getBBSTransKey()
158
+ {
159
+ $this->getCheckout()->setBBSTransactionId(uniqid());
160
+
161
+ $transKey = $this->getApi()->
162
+ setCurrencyCode($this->getQuote()->getBaseCurrencyCode())->
163
+ setTransactionId($this->getCheckout()->getBBSTransactionId())->
164
+ setAmount(sprintf("%0.0f",$this->getQuote()->getGrandTotal()*100))->
165
+ setOrderNumber($this->getQuote()->getReservedOrderId())->
166
+ setOrderDescription(date("d.m.Y")." - Order ".$this->getQuote()->getReservedOrderId())->
167
+ setCustomerEmail($this->getQuote()->getBillingAddress()->getEmail())->
168
+ setCustomerPhoneNumber($this->getQuote()->getBillingAddress()->getTelephone())->
169
+ setSessionId($this->getCheckout()->getQuoteId())->
170
+ setInternalGUI($this->useInternalGUI())->
171
+ getTransKey();
172
+
173
+ if ($transKey == false) {
174
+ Mage::throwException(Mage::helper('bbsnetaxept')->__('Error receiving key from BBS: '.$this->getApi()->getErrorMessage()));
175
+ }
176
+ else {
177
+ $this->getCheckout()->setBBSTransKey($transKey);
178
+ if ($this->useInternalGUI()) {
179
+ $info = $this->getInfoInstance();
180
+ if (!($info instanceof Varien_Object)) {
181
+ $info = new Varien_Object($info);
182
+ }
183
+ $this->getCheckout()->setCardInfo($info);
184
+ }
185
+ $order = Mage::getModel('sales/order');
186
+ $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());
187
+ $order->addStatusToHistory('pending_bbs','Redirected to BBS Payment.',false);
188
+ $order->save();
189
+ }
190
+
191
+ return $this->getCheckout()->getBBSTransKey();
192
+ }
193
 
194
  public function getOrderPlaceRedirectUrl()
195
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  return Mage::getUrl('bbsnetaxept/return/redirect', array('_secure' => true));
197
  }
198
 
237
  $isOK = false;
238
 
239
  // Load order.
240
+ $order = Mage::getModel('sales/order');
241
+ $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());
242
 
243
  if ($this->getApi()->Process($bbskey) == $this->getCheckout()->getBBSTransactionId()) {
244
 
246
 
247
 
248
  $this->getCheckout()->getQuote()->setIsActive(false)->save();
 
 
 
 
 
 
 
249
 
250
+ $order->getPayment()->setBbsTransactionId($this->getCheckout()->getBBSTransactionId())->
251
+ setBbsAuthenticatedStatus($this->getApi()->Result()->getAuthenticatedStatus())->
252
+ setBbsAuthenticatedWith($this->getApi()->Result()->getAuthenticatedWith())->
253
+ setBbsIssuerCountry($this->getApi()->Result()->getIssuerCountry())->
254
+ setBbsIssuerId($this->getApi()->Result()->getIssuerId())->
255
+ setBbsAuthorizationId($this->getApi()->Result()->getAuthorizationId())->
256
+ setBbsSessionNumber($this->getApi()->Result()->getSessionNumber());
257
 
258
+ if ($this->getApi()->Result()->getResponseCode() == "OK") {
259
+ $order->getPayment()->setStatus(self::STATUS_APPROVED);
260
+ //Set new orderstatus
261
+ $newOrderStatus = $this->getConfigData('auth_order_status');
262
+ if (empty($newOrderStatus)) {
263
+ $newOrderStatus = $order->getStatus();
264
  }
265
+ $order->addStatusToHistory($newOrderStatus,'BBS Authorization successfull.',false);
266
+
267
+ /**
268
+ * send confirmation email to customer
269
+ */
270
+ if($order->getId()){
271
+ $order->sendNewOrderEmail();
272
+ }
273
+
274
+ $isOK = true;
275
+ }
276
+
277
+
278
+ $order->save();
279
+ if ($this->getConfigData('payment_action') == 'sale') {
280
+ $invoice = $order->prepareInvoice();
281
+ $invoice->register()->capture();
282
+ Mage::getModel('core/resource_transaction')
283
+ ->addObject($invoice)
284
+ ->addObject($invoice->getOrder())
285
+ ->save();
286
+ }
287
  }
288
  else {
289
  $order->getPayment()->setBbsAuthenticatedStatus('Error')->setBbsAuthenticatedWith($this->getApi()->getErrorMessage());
363
  return $this;
364
  }
365
 
366
+ public function getLogoMethods() {
367
+ $codes = array(0 => Mage::helper('bbsnetaxept')->__('Ingen logo'),
368
+ // 1 => Mage::helper('bbsnetaxept')->__('BBS logo'),
369
+ 2 => Mage::helper('bbsnetaxept')->__('BBS Technology logo')
370
+ );
371
+ return $codes;
372
+ }
373
+
374
+ public function getLogoUrl() {
375
+ $logotype = $this->getConfigData('logo');
376
+ switch($logotype) {
377
+ case 1:
378
+ $url = 'images/bbsnetaxept/logo.png';
379
+ break;
380
+ case 2:
381
+ $url = 'images/bbsnetaxept/technology_logo.png';
382
+ break;
383
+ case 0:
384
+ default:
385
+ $url = '';
386
+ break;
387
+ }
388
+ return $url;
389
+ }
390
+
391
+ public function getRedirectText() {
392
+ return $this->getConfigData('redirect_text');
393
+ }
394
+
395
 
396
  private function getErrorMessage($errorcode=99) {
397
  switch ($errorcode) {
app/code/community/Trollweb/BBSNetAxept/controllers/ReturnController.php CHANGED
@@ -1,69 +1,69 @@
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_ReturnController extends Mage_Core_Controller_Front_Action
21
- {
22
-
23
- protected function _expireAjax()
24
- {
25
- if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
26
- $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
27
- exit;
28
- }
29
- }
30
-
31
- /**
32
- * Get singleton with bbs strandard order transaction information
33
- *
34
- * @return Trollweb_BBSNetAxept_Model_WithGUI
35
- */
36
- public function getStandard()
37
- {
38
- return Mage::getSingleton('bbsnetaxept/withGUI');
39
- }
40
-
41
- /**
42
- * When a customer chooses BBS on Checkout/Payment page
43
- *
44
- */
45
- public function redirectAction()
46
- {
47
- $session = Mage::getSingleton('checkout/session');
48
- $session->setBBSNetterminalStandardQuoteId($session->getQuoteId());
49
- $this->getResponse()->setBody($this->getLayout()->createBlock('bbsnetaxept/redirect')->toHtml());
50
- }
51
-
52
- /**
53
- * When a customer cancel payment from paypal.
54
- */
55
- public function checkAction()
56
- {
57
- $redirect = 'checkout/cart';
58
-
59
- $session = Mage::getSingleton('checkout/session');
60
- $session->setQuoteId($session->getBBSNetterminalStandardQuoteId(true));
61
-
62
- if ($this->getStandard()->checkResult($this->getRequest()->getQuery("BBSePay_transaction"))) {
63
- $redirect = 'checkout/onepage/success';
64
- }
65
-
66
- $this->_redirect($redirect, array('_secure'=>true));
67
- }
68
- }
69
 
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_ReturnController extends Mage_Core_Controller_Front_Action
21
+ {
22
+
23
+ protected function _expireAjax()
24
+ {
25
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
26
+ $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
27
+ exit;
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Get singleton with bbs strandard order transaction information
33
+ *
34
+ * @return Trollweb_BBSNetAxept_Model_WithGUI
35
+ */
36
+ public function getStandard()
37
+ {
38
+ return Mage::getSingleton('bbsnetaxept/withGUI');
39
+ }
40
+
41
+ /**
42
+ * When a customer chooses BBS on Checkout/Payment page
43
+ *
44
+ */
45
+ public function redirectAction()
46
+ {
47
+ $session = Mage::getSingleton('checkout/session');
48
+ $session->setBBSNetterminalStandardQuoteId($session->getQuoteId());
49
+ $this->getResponse()->setBody($this->getLayout()->createBlock('bbsnetaxept/redirect')->toHtml());
50
+ }
51
+
52
+ /**
53
+ * When a customer cancel payment from paypal.
54
+ */
55
+ public function checkAction()
56
+ {
57
+ $redirect = 'checkout/cart';
58
+
59
+ $session = Mage::getSingleton('checkout/session');
60
+ $session->setQuoteId($session->getBBSNetterminalStandardQuoteId(true));
61
+
62
+ if ($this->getStandard()->checkResult($this->getRequest()->getQuery("BBSePay_transaction"))) {
63
+ $redirect = 'checkout/onepage/success';
64
+ }
65
+
66
+ $this->_redirect($redirect, array('_secure'=>true));
67
+ }
68
+ }
69
 
app/code/community/Trollweb/BBSNetAxept/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Trollweb_BBSNetAxept>
5
- <version>1.3.2</version>
6
  <depends>
7
  <Mage_Payment />
8
  </depends>
@@ -52,6 +52,16 @@
52
  </authcode>
53
  </bbsnetaxept>
54
  </payment>
 
 
 
 
 
 
 
 
 
 
55
  </global>
56
 
57
  <frontend>
@@ -77,20 +87,24 @@
77
  <active>0</active>
78
  <title>Kredittkort</title>
79
  <cctypes>AE,VI,MC,DI</cctypes>
80
- <gw_url>https://epay.bbs.no/cgi/epay.pway</gw_url>
81
- <wsdl_url>https://epayment.bbs.no/service.svc?wsdl</wsdl_url>
82
  <merchant_id backend_model="adminhtml/system_config_backend_encrypted" />
83
  <merchant_token backend_model="adminhtml/system_config_backend_encrypted" />
84
  <use_gui>1</use_gui>
85
  <gui_language>no_NO</gui_language>
86
- <order_status>0</order_status>
 
87
  <allowspecific>0</allowspecific>
88
  <sort_order>90</sort_order>
89
  <payment_action>auth</payment_action>
 
 
 
90
 
91
  <model>bbsnetaxept/withGUI</model>
92
  </bbsnetaxept_withgui>
93
  </payment>
94
  </default>
95
 
96
- </config>
2
  <config>
3
  <modules>
4
  <Trollweb_BBSNetAxept>
5
+ <version>1.5.0</version>
6
  <depends>
7
  <Mage_Payment />
8
  </depends>
52
  </authcode>
53
  </bbsnetaxept>
54
  </payment>
55
+
56
+ <sales>
57
+ <order>
58
+ <statuses>
59
+ <pending_bbs type="label">
60
+ <label>Pending BBS</label>
61
+ </pending_bbs>
62
+ </statuses>
63
+ </order>
64
+ </sales>
65
  </global>
66
 
67
  <frontend>
87
  <active>0</active>
88
  <title>Kredittkort</title>
89
  <cctypes>AE,VI,MC,DI</cctypes>
90
+ <gw_url>https://epayment-test.bbs.no/terminal/default.aspx</gw_url>
91
+ <wsdl_url>https://epayment-test.bbs.no/service.svc?wsdl</wsdl_url>
92
  <merchant_id backend_model="adminhtml/system_config_backend_encrypted" />
93
  <merchant_token backend_model="adminhtml/system_config_backend_encrypted" />
94
  <use_gui>1</use_gui>
95
  <gui_language>no_NO</gui_language>
96
+ <order_status>pending_bbs</order_status>
97
+ <auth_order_status>0</auth_order_status>
98
  <allowspecific>0</allowspecific>
99
  <sort_order>90</sort_order>
100
  <payment_action>auth</payment_action>
101
+ <regcode backend_model="adminhtml/system_config_backend_encrypted" />
102
+ <logo>0</logo>
103
+ <redirect_text>You will be redirected to BBS website when you place an order.</redirect_text>
104
 
105
  <model>bbsnetaxept/withGUI</model>
106
  </bbsnetaxept_withgui>
107
  </payment>
108
  </default>
109
 
110
+ </config>
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>BBS NetAxept Norge, versjon 1.3.2</label>
8
  <sort_order>670</sort_order>
9
  <show_in_default>1</show_in_default>
10
  <show_in_website>1</show_in_website>
@@ -21,6 +21,7 @@ Disse må fylles ut så godt det lar seg gjøre og returneres til BBS og Teller.
21
  <br />
22
  <a href="http://www.trollweb.no/link.php?id=bbs"><b>Steg 1) Klikk her for å laste ned og fylle ut avtale med BBS</b></a><br />
23
  <a href="http://www.trollweb.no/link.php?id=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 />
@@ -32,152 +33,201 @@ Telefon <b>+47 47230804</b> (0900-1800, man-søn)<br />
32
  </div>
33
  ]]></comment>
34
  <fields>
35
- <active translate="label">
36
- <label>Aktiv</label>
37
- <frontend_type>select</frontend_type>
38
- <source_model>adminhtml/system_config_source_yesno</source_model>
39
- <sort_order>1</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <show_in_store>0</show_in_store>
43
- </active>
 
 
 
 
 
 
 
 
 
44
 
45
- <title translate="label">
46
- <label>Tittel</label>
47
- <frontend_type>text</frontend_type>
48
- <sort_order>2</sort_order>
49
- <show_in_default>1</show_in_default>
50
- <show_in_website>1</show_in_website>
51
- <show_in_store>0</show_in_store>
52
- <comment><![CDATA[Tekst som vises for betalingsalternativet for BBS NetAxept.<a href="https://payments.amazon.com/sdui/sdui/business?sn=paynow/o" target="_blank"></a>]]></comment></title>
53
-
54
-
55
- <cctypes translate="label">
56
- <label>Kredittkort typer</label>
57
- <frontend_type>multiselect</frontend_type>
58
- <source_model>adminhtml/system_config_source_payment_cctype</source_model>
59
- <sort_order>5</sort_order>
60
- <show_in_default>1</show_in_default>
61
- <show_in_website>1</show_in_website>
62
- <show_in_store>0</show_in_store>
63
- <comment><![CDATA[Tilgjengelige korttyper. Husk at hver korttype krever avtale med BBS og kredittkortinnløser. VISA og MasterCard er vanlig for de fleste.]]></comment></cctypes>
64
-
65
- <gw_url translate="label">
66
- <label>Gateway</label>
67
- <frontend_type>text</frontend_type>
68
- <sort_order>9</sort_order>
69
- <show_in_default>1</show_in_default>
70
- <show_in_website>1</show_in_website>
71
- <show_in_store>0</show_in_store>
72
- <comment><![CDATA[Skal ikke endres i produksjon.]]></comment>
73
- </gw_url>
74
-
75
- <wsdl_url translate="label">
76
- <label>WSDL</label>
77
- <frontend_type>text</frontend_type>
78
- <sort_order>10</sort_order>
79
- <show_in_default>1</show_in_default>
80
- <show_in_website>1</show_in_website>
81
- <show_in_store>0</show_in_store>
82
- <comment><![CDATA[Skal ikke endres i produksjon.]]></comment>
83
- </wsdl_url>
84
-
85
- <payment_action translate="label">
86
- <label>Betalingshandling</label>
87
  <frontend_type>select</frontend_type>
88
- <source_model>bbsnetaxept/BBSNetterminal_paymentAction</source_model>
89
- <sort_order>11</sort_order>
90
  <show_in_default>1</show_in_default>
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>0</show_in_store>
93
- <comment><![CDATA[Authorize Only (standard) reserverer først beløpet 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 får med en gang kan bruke Authorize + Capture.]]></comment>
94
- </payment_action>
95
-
96
-
97
- <merchant_id translate="label">
98
- <label>Merchant ID</label>
99
- <frontend_type>text</frontend_type>
100
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
101
- <sort_order>12</sort_order>
102
- <show_in_default>1</show_in_default>
103
- <show_in_website>1</show_in_website>
104
- <show_in_store>0</show_in_store>
105
- <comment><![CDATA[Din unike kunde-ID fra BBS. Fås epost av BBS.]]></comment></merchant_id>
106
-
107
- <merchant_token translate="label">
108
- <label>Merchant Token</label>
109
- <frontend_type>text</frontend_type>
110
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
111
- <sort_order>13</sort_order>
112
- <show_in_default>1</show_in_default>
113
- <show_in_website>1</show_in_website>
114
- <show_in_store>0</show_in_store>
115
- <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. Du skal skrive inn PROD passord.]]></comment></merchant_token>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- <use_gui translate="label">
118
- <label>Use BBS GUI</label>
119
- <frontend_type>select</frontend_type>
120
- <source_model>adminhtml/system_config_source_yesno</source_model>
121
- <sort_order>14</sort_order>
122
- <show_in_default>1</show_in_default>
123
- <show_in_website>1</show_in_website>
124
- <show_in_store>0</show_in_store>
125
- <comment><![CDATA[OBS! Dersom du velger å ikke bruke BBS GUI så krever dette en PCI sertifisering av nettbutikken din.]]></comment>
126
- </use_gui>
127
 
 
 
 
 
 
 
 
 
 
 
128
 
129
- <gui_language translate="label">
130
- <label>BBS GUI Language</label>
131
- <frontend_type>select</frontend_type>
132
- <source_model>bbsnetaxept/BBSNetterminal_language</source_model>
133
- <sort_order>15</sort_order>
134
- <show_in_default>1</show_in_default>
135
- <show_in_website>1</show_in_website>
136
- <show_in_store>0</show_in_store>
137
- <comment><![CDATA[Velg språket du ønsker at BBS skal vise.]]></comment></gui_language>
138
-
139
- <order_status translate="label">
140
- <label>New order status</label>
141
- <frontend_type>select</frontend_type>
142
- <source_model>adminhtml/system_config_source_order_status</source_model>
143
- <sort_order>20</sort_order>
144
- <show_in_default>1</show_in_default>
145
- <show_in_website>1</show_in_website>
146
- <show_in_store>0</show_in_store>
147
- <comment><![CDATA[Velg ønsket ordrestatus på ordrer som velger denne betalingsmåten. Behøver ikke endres.]]></comment></order_status>
 
 
 
148
 
149
- <allowspecific translate="label">
150
- <label>Payment from applicable countries</label>
151
- <frontend_type>allowspecific</frontend_type>
152
- <sort_order>21</sort_order>
153
- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
154
- <show_in_default>1</show_in_default>
155
- <show_in_website>1</show_in_website>
156
- <show_in_store>1</show_in_store>
157
- </allowspecific>
158
 
159
- <specificcountry translate="label">
160
- <label>Payment from Specific countries</label>
161
- <frontend_type>multiselect</frontend_type>
162
- <sort_order>22</sort_order>
163
- <source_model>adminhtml/system_config_source_country</source_model>
164
- <show_in_default>1</show_in_default>
165
- <show_in_website>1</show_in_website>
166
- <show_in_store>1</show_in_store>
167
- <comment><![CDATA[Velg utvalgte land som får lov å velge denne betalingsmetoden. Standard er alle land.]]></comment>
168
- </specificcountry>
169
 
170
- <sort_order translate="label">
171
- <label>Sort order</label>
172
- <frontend_type>text</frontend_type>
173
- <sort_order>100</sort_order>
174
- <show_in_default>1</show_in_default>
175
- <show_in_website>1</show_in_website>
176
- <show_in_store>0</show_in_store>
177
- <comment><![CDATA[Ønsket sortering i Betalingsmetoder-feltet på utsjekkingssiden i nettbutikken dersom du tilbyr flere betalingsalternativer.]]></comment></sort_order>
178
- </fields>
179
- </bbsnetaxept_withgui>
180
- </groups>
181
- </payment>
182
- </sections>
 
183
  </config>
4
  <payment>
5
  <groups>
6
  <bbsnetaxept_withgui translate="label" module="bbsnetaxept">
7
+ <label>BBS Netaxept, versjon 1.5.0</label>
8
  <sort_order>670</sort_order>
9
  <show_in_default>1</show_in_default>
10
  <show_in_website>1</show_in_website>
21
  <br />
22
  <a href="http://www.trollweb.no/link.php?id=bbs"><b>Steg 1) Klikk her for å laste ned og fylle ut avtale med BBS</b></a><br />
23
  <a href="http://www.trollweb.no/link.php?id=teller"><b>Steg 2) Klikk her for å laste ned og fylle ut avtale med Teller</b></a><br />
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 />
33
  </div>
34
  ]]></comment>
35
  <fields>
36
+ <active translate="label">
37
+ <label>Aktiv</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </active>
45
+
46
+ <title translate="label">
47
+ <label>Tittel</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>2</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>0</show_in_store>
53
+ <comment><![CDATA[Tekst som vises på BBS betalingsvalget i nettbutikken.]]></comment></title>
54
 
55
+ <logo translate="label">
56
+ <label>Logo</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  <frontend_type>select</frontend_type>
58
+ <source_model>bbsnetaxept/config_logo</source_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>0</show_in_store>
63
+ <comment><![CDATA[Logo som visesBBS betalingsvalget i nettbutikken.]]></comment>
64
+ </logo>
65
+
66
+
67
+ <cctypes translate="label">
68
+ <label>Aktive kredittkort-typer</label>
69
+ <frontend_type>multiselect</frontend_type>
70
+ <source_model>adminhtml/system_config_source_payment_cctype</source_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>0</show_in_store>
75
+ <comment><![CDATA[Tilgjengelige korttyper din konto. Husk at hver korttype krever avtale med BBS og kredittkortinnløser. VISA og MasterCard er vanlig for de fleste.]]></comment></cctypes>
76
+
77
+ <gw_url translate="label">
78
+ <label>Gateway</label>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>9</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>0</show_in_store>
84
+ <comment><![CDATA[Skal normalt ikke endres. Endre https://epayment.bbs.no/ til https://epayment-test.bbs.no/ for å kjøre test modus (krever TEST merchant passord).]]></comment>
85
+ </gw_url>
86
+
87
+ <wsdl_url translate="label">
88
+ <label>WSDL</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>10</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ <comment><![CDATA[Skal normalt ikke endres. Endre https://epayment.bbs.no/ til https://epayment-test.bbs.no/ for å kjøre test modus (krever TEST merchant passord).]]></comment>
95
+ </wsdl_url>
96
+
97
+ <payment_action translate="label">
98
+ <label>Betalingshandling</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>bbsnetaxept/BBSNetterminal_paymentAction</source_model>
101
+ <sort_order>11</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>0</show_in_store>
105
+ <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>
106
+ </payment_action>
107
+
108
+
109
+ <merchant_id translate="label">
110
+ <label>Merchant ID</label>
111
+ <frontend_type>text</frontend_type>
112
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
113
+ <sort_order>12</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ <comment><![CDATA[Din unike kunde-ID fra BBS. Fås på epost av BBS.]]></comment>
118
+ </merchant_id>
119
+
120
+ <merchant_token translate="label">
121
+ <label>Merchant Token</label>
122
+ <frontend_type>text</frontend_type>
123
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
124
+ <sort_order>13</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>0</show_in_store>
128
+ <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. Du skal skrive inn PROD passordet såfremt du ikke ønsker å kjøre test.]]></comment>
129
+ </merchant_token>
130
+
131
+ <use_gui translate="label">
132
+ <label>Bruke BBS sin betalingsside</label>
133
+ <frontend_type>select</frontend_type>
134
+ <source_model>adminhtml/system_config_source_yesno</source_model>
135
+ <sort_order>14</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>1</show_in_website>
138
+ <show_in_store>0</show_in_store>
139
+ <comment><![CDATA[Skal normalt ikke endres. Husk at du kan laste opp egen logo på betalingssiden gjennom kontrollpanelet til BBS (https://epayment.bbs.no/). Dersom du velger å ikke bruke BBS GUI så krever dette en PCI sertifisering av nettbutikken din.]]></comment>
140
+ </use_gui>
141
+
142
+
143
+ <gui_language translate="label">
144
+ <label>Språk på BBS betalingssiden</label>
145
+ <frontend_type>select</frontend_type>
146
+ <source_model>bbsnetaxept/BBSNetterminal_language</source_model>
147
+ <sort_order>15</sort_order>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>1</show_in_website>
150
+ <show_in_store>0</show_in_store>
151
+ <comment><![CDATA[Velg språket du ønsker at BBS skal vise på selve betalingssiden.]]></comment>
152
+ </gui_language>
153
 
154
+ <redirect_text translate="label">
155
+ <label>Utvidet infotekst</label>
156
+ <frontend_type>textarea</frontend_type>
157
+ <sort_order>17</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ <comment><![CDATA[Meldingstekst som kunden ser når han eller hun velger betalingsalternativet BBS.]]></comment>
162
+ </redirect_text>
 
163
 
164
+ <regcode translate="label">
165
+ <label>Registreringskode</label>
166
+ <frontend_type>text</frontend_type>
167
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
168
+ <sort_order>18</sort_order>
169
+ <show_in_default>1</show_in_default>
170
+ <show_in_website>0</show_in_website>
171
+ <show_in_store>0</show_in_store>
172
+ <comment><![CDATA[Din registreringskode fra Trollweb. <a href="http://www.trollweb.no/bbs/getregcode">Klikk her for å generere din registreringskode helt gartis</a>.]]></comment>
173
+ </regcode>
174
 
175
+ <!--
176
+ <order_status translate="label">
177
+ <label>New order status</label>
178
+ <frontend_type>select</frontend_type>
179
+ <source_model>adminhtml/system_config_source_order_status</source_model>
180
+ <sort_order>20</sort_order>
181
+ <show_in_default>1</show_in_default>
182
+ <show_in_website>1</show_in_website>
183
+ <show_in_store>0</show_in_store>
184
+ <comment><![CDATA[Velg ønsket ordrestatus på ordrer som velger denne betalingsmåten. Behøver ikke endres.]]></comment>
185
+ </order_status>
186
+ -->
187
+ <auth_order_status translate="label">
188
+ <label>Ordrestatus på autoriserte ordrer</label>
189
+ <frontend_type>select</frontend_type>
190
+ <source_model>adminhtml/system_config_source_order_status</source_model>
191
+ <sort_order>20</sort_order>
192
+ <show_in_default>1</show_in_default>
193
+ <show_in_website>1</show_in_website>
194
+ <show_in_store>0</show_in_store>
195
+ <comment><![CDATA[Velg ønsket ordrestatus på ordrer som har blitt authentisert og godkjent hos BBS. 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>
196
+ </auth_order_status>
197
 
198
+ <allowspecific translate="label">
199
+ <label>Tillatt enkelt-land som kan bruke BBS</label>
200
+ <frontend_type>allowspecific</frontend_type>
201
+ <sort_order>21</sort_order>
202
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>1</show_in_store>
206
+ </allowspecific>
207
 
208
+ <specificcountry translate="label">
209
+ <label>Spesifiser hvilke land som eventuelt kan bruke BBS</label>
210
+ <frontend_type>multiselect</frontend_type>
211
+ <sort_order>22</sort_order>
212
+ <source_model>adminhtml/system_config_source_country</source_model>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ <comment><![CDATA[Velg utvalgte land som får lov å velge denne betalingsmetoden. Standard er alle land.]]></comment>
217
+ </specificcountry>
218
 
219
+ <sort_order translate="label">
220
+ <label>Sortering av betalingsmetode</label>
221
+ <frontend_type>text</frontend_type>
222
+ <sort_order>100</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>0</show_in_store>
226
+ <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>
227
+ </sort_order>
228
+ </fields>
229
+ </bbsnetaxept_withgui>
230
+ </groups>
231
+ </payment>
232
+ </sections>
233
  </config>
app/code/community/Trollweb/BBSNetAxept/sql/bbsnetaxept_setup/mysql4-install-0.1.0.php CHANGED
@@ -32,4 +32,4 @@ $installer->addAttribute('order_payment', 'bbs_session_number', array());
32
 
33
  $installer->doTWregister();
34
 
35
- $installer->endSetup();
32
 
33
  $installer->doTWregister();
34
 
35
+ $installer->endSetup();
app/design/frontend/default/default/template/bbsnetaxept/form.phtml CHANGED
@@ -16,12 +16,18 @@
16
  * @license Single-site License
17
  *
18
  */
 
 
19
  ?>
20
  <fieldset class="form-list">
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 BBS website when you place an order.') ?>
 
 
 
 
25
  </li>
26
  </ul>
27
  </fieldset>
16
  * @license Single-site License
17
  *
18
  */
19
+
20
+ $logoUrl = $this->getLogo();
21
  ?>
22
  <fieldset class="form-list">
23
  <?php $_code=$this->getMethodCode() ?>
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); ?>" align="left" />
28
+ <br />
29
+ <?php endif;?>
30
+ <?php echo $this->getRedirectText(); ?>
31
  </li>
32
  </ul>
33
  </fieldset>
app/design/frontend/default/default/template/bbsnetaxept/paymentinfo.phtml CHANGED
@@ -16,5 +16,12 @@
16
  * @license Single-site License
17
  *
18
  */
 
19
  ?>
20
- <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
 
 
 
 
 
 
16
  * @license Single-site License
17
  *
18
  */
19
+ $logoUrl = $this->getLogo();
20
  ?>
21
+ <p>
22
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
23
+ <?php if (!empty($logoUrl)): ?>
24
+ <br />
25
+ <img alt="logo" src="<?php echo $this->getSkinUrl($logoUrl); ?>" />
26
+ <?php endif;?>
27
+ </p>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BBSNetAxept_Norway</name>
4
- <version>1.4.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.trollweb.no/bbs">GPL License</license>
7
  <channel>community</channel>
@@ -12,9 +12,9 @@
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-01-11</date>
16
- <time>22:14:38</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="4f3b4e6e0d39720429c9b7f6afe87db3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="d61295f247bccb512608c1f9dec45876"/><file name="paymentinfo.phtml" hash="caf32bb1ed9343f02694f0ee035072b5"/></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="23ad0c0aef807a5981b037398b6a4464"/><file name="PaymentInfo.php" hash="c21ed43d6cc2167ca4a00cc429bd855f"/><file name="Redirect.php" hash="e5f870d4c3ae4cfa56bdd5753efb5caf"/></dir><dir name="controllers"><file name="ReturnController.php" hash="298bba8e7c6a12c39769067ed8b3e407"/></dir><dir name="etc"><file name="config.xml" hash="d367af0aaa548a8fc15b18e17f515e99"/><file name="system.xml" hash="f1d07acd16e9f95f90527b9047e7ff09"/></dir><dir name="Helper"><file name="Data.php" hash="223402a81a73076db515f8b5f320a010"/></dir><dir name="Model"><dir name="Api"><file name="Bbs.php" hash="b105be7b0a1bdd4aec1bf66f5a60871b"/><file name="BbsRequest.php" hash="1d89c8369032ba4ba79c89828770da56"/><file name="SoapClient.php" hash="0bea5c38b2402fe854c092389aae9a21"/></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="Entity"><file name="Setup.php" hash="6d17490981f2d9efa48ac7a0f9318a83"/></dir><file name="WithGUI.php" hash="3cd7a342aed7e55542da29519fb98a94"/></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="e84d45a9a21b253c0b3cb766079df28b"/><file name="mysql4-uninstall-0.1.0.php" hash="5393aadd53afafee1392949fe6a4511a"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BBSNetAxept_Norway</name>
4
+ <version>1.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.trollweb.no/bbs">GPL License</license>
7
  <channel>community</channel>
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-04-14</date>
16
+ <time>20:36:04</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="4f3b4e6e0d39720429c9b7f6afe87db3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="bbsnetaxept"><file name="form.phtml" hash="630094c90e713586f21cdbf536c9cd1a"/><file name="paymentinfo.phtml" hash="6ec9c7243fdb7c67a9d3de210a56908c"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><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="796fd93c9e40ad6a0cefbd71e511180a"/><file name="Redirect.php" hash="dedf8e84e45f7d5e217b20704e0b1ac8"/></dir><dir name="controllers"><file name="ReturnController.php" hash="1af5a611e3c8ed282648911911c52de1"/></dir><dir name="etc"><file name="config.xml" hash="335435244018163481cee06336981b34"/><file name="system.xml" hash="f66eafc2ff4182ced75b33fa710e384d"/></dir><dir name="Helper"><file name="Data.php" hash="06e6b25c35fa45f014c51163ccec2e44"/></dir><dir name="Model"><dir name="Api"><file name="Bbs.php" hash="eef3eaf83ed0c82774a239999a2bc21a"/><file name="BbsRequest.php" hash="1d89c8369032ba4ba79c89828770da56"/><file name="SoapClient.php" hash="0bea5c38b2402fe854c092389aae9a21"/></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="WithGUI.php" hash="4b0248f0b48df0c5a3bf2e9da8469e76"/></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="5cf0991b07d0f6d4ebc84ac43ebda25d"/><file name="mysql4-uninstall-0.1.0.php" hash="5393aadd53afafee1392949fe6a4511a"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
skin/frontend/default/default/images/bbsnetaxept/logo.png ADDED
Binary file
skin/frontend/default/default/images/bbsnetaxept/technology_logo.png ADDED
Binary file