BBSNetAxept_Norway - Version 1.4

Version Notes

This extension uses the BBS Netaxept API.

Download this release

Release Info

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


Code changes from version 1.3.2 to 1.4

app/code/community/Trollweb/BBSNetAxept/Block/Redirect.php CHANGED
@@ -1,62 +1,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
- $standard = Mage::getModel('BBSNetAxept/withGUI');
25
-
26
- $form = new Varien_Data_Form();
27
- $form->setAction($standard->getBBSUrl())
28
- ->setId('BBS_WithGUI_checkout')
29
- ->setName('BBS_WithGUI_checkout')
30
- ->setMethod('POST')
31
- ->setUseContainer(true);
32
-
33
- if ($standard->useInternalGUI()) {
34
- $ccInfo = $standard->getCheckout()->getCardInfo();
35
- if (!($ccInfo instanceof Varien_Object)) {
36
- $ccInfo = new Varien_Object($ccInfo);
37
- }
38
-
39
- switch ($ccInfo->getCcType()) {
40
- case 'VI': $prefix = 'v'; break;
41
- case 'MC': $prefix = 'm'; break;
42
- case 'AE': $prefix = 'a'; break;
43
- case 'DI': $prefix = 'd'; break;
44
- default: $prefix = 'v'; break;
45
- }
46
-
47
- $form->addField($prefix.'a','hidden', array('name' => $prefix.'a', "value" => $ccInfo->getCcNumber()));
48
- $form->addField($prefix.'m','hidden', array('name' => $prefix.'m', "value" => sprintf("%02u",(int)$ccInfo->getCcExpMonth())));
49
- $form->addField($prefix.'y','hidden', array('name' => $prefix.'y', "value" => substr($ccInfo->getCcExpYear(),-2)));
50
- $form->addField($prefix.'c','hidden', array('name' => $prefix.'c', "value" => $ccInfo->getCcCid()));
51
- }
52
-
53
- $form->addField('BBSePay_transaction','hidden', array("name"=>'BBSePay_transaction', "value"=>$standard->getCheckout()->getBBSTransKey()));
54
- $html = '<html><body>';
55
- $html.= $this->__('You will be redirected to BBS NetAxept in a few seconds.');
56
- $html.= $form->toHtml();
57
- $html.= '<script type="text/javascript">document.getElementById("BBS_WithGUI_checkout").submit();</script>';
58
- $html.= '</body></html>';
59
-
60
- return $html;
61
- }
 
62
  }
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
  }
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/withGUI_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
 
package.xml CHANGED
@@ -1,20 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BBSNetAxept_Norway</name>
4
- <version>1.3.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.trollweb.no/bbs">GPL License</license>
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 extensions enable you to receive cerditcard 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>2009-10-27</date>
16
- <time>10:43:53</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="ed1033195a226464f52caea97d5ec86b"/></dir><dir name="controllers"><file name="ReturnController.php" hash="b58d8505a3bc573b1ccac041555e75fa"/></dir><dir name="etc"><file name="config.xml" hash="adb44ef6cacacaaea9d44d408283ef45"/><file name="system.xml" hash="26e0e6871c11aaf289a2404b4552658d"/></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="b1f7dd643f9c09e95a30681552c0ff19"/></dir><file name="WithGUI.php" hash="3cd7a342aed7e55542da29519fb98a94"/></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="192d66bfd2c25be9e86a4e6d9d4764a6"/><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.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.trollweb.no/bbs">GPL License</license>
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>2009-12-02</date>
16
+ <time>11:35:33</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="adb44ef6cacacaaea9d44d408283ef45"/><file name="system.xml" hash="26e0e6871c11aaf289a2404b4552658d"/></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="b1f7dd643f9c09e95a30681552c0ff19"/></dir><file name="WithGUI.php" hash="3cd7a342aed7e55542da29519fb98a94"/></dir><dir name="sql"><dir name="bbsnetaxept_setup"><file name="mysql4-install-0.1.0.php" hash="192d66bfd2c25be9e86a4e6d9d4764a6"/><file name="mysql4-uninstall-0.1.0.php" hash="5393aadd53afafee1392949fe6a4511a"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>