Dibspw - Version 4.1.0

Version Notes

4.1.0:
- New module for DIBS Payment Window and Mobile Payment Window integration methods.

Download this release

Release Info

Developer DIBS AS
Extension Dibspw
Version 4.1.0
Comparing to
See all releases


Version 4.1.0

Files changed (103) hide show
  1. app/code/community/Dibspw/Adminhtml/Block/Sales/Order/View/Tab/Info.php +132 -0
  2. app/code/community/Dibspw/Adminhtml/etc/config.xml +34 -0
  3. app/code/community/Dibspw/Dibspw/Block/Failure.php +34 -0
  4. app/code/community/Dibspw/Dibspw/Block/Form.php +41 -0
  5. app/code/community/Dibspw/Dibspw/Block/Redirect.php +41 -0
  6. app/code/community/Dibspw/Dibspw/Helper/Data.php +36 -0
  7. app/code/community/Dibspw/Dibspw/Model/Dibspw.php +137 -0
  8. app/code/community/Dibspw/Dibspw/Model/Mysql4/Setup.php +36 -0
  9. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibslogos.php +62 -0
  10. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibspaytypes.php +58 -0
  11. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibsyesno.php +34 -0
  12. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Lang.php +36 -0
  13. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Orderstatusafter.php +58 -0
  14. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Orderstatusbefore.php +58 -0
  15. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/PBBdistribution.php +34 -0
  16. app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Paymentwindow.php +36 -0
  17. app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_api.php +616 -0
  18. app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers.php +198 -0
  19. app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers_cms.php +74 -0
  20. app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers_interface.php +16 -0
  21. app/code/community/Dibspw/Dibspw/controllers/DibspwController.php +155 -0
  22. app/code/community/Dibspw/Dibspw/etc/config.xml +137 -0
  23. app/code/community/Dibspw/Dibspw/etc/system.xml +207 -0
  24. app/code/community/Dibspw/Dibspw/sql/dibspw_setup/mysql4-install-4.1.0.php +63 -0
  25. app/code/community/Dibspw/Dibspw/sql/dibspw_setup/mysql4-upgrade-4.0.1-4.1.0.php +63 -0
  26. app/code/community/Dibspw/Sales/Block/Order/Info.php +151 -0
  27. app/code/community/Dibspw/Sales/Block/Order/Print.php +111 -0
  28. app/code/community/Dibspw/Sales/etc/config.xml +35 -0
  29. app/design/frontend/base/default/template/Dibspw/Dibspw/redirect.phtml +49 -0
  30. app/design/frontend/default/default/template/Dibspw/Dibspw/form.phtml +47 -0
  31. app/etc/modules/Dibspw_Adminhtml.xml +32 -0
  32. app/etc/modules/Dibspw_Dibspw.xml +32 -0
  33. app/etc/modules/Dibspw_Sales.xml +32 -0
  34. app/locale/da_DK/Mage_Dibspw.csv +32 -0
  35. app/locale/en_US/Mage_Dibspw.csv +32 -0
  36. app/locale/nb_NO/Mage_Dibspw.csv +32 -0
  37. app/locale/nn_NO/Mage_Dibspw.csv +32 -0
  38. app/locale/sv_SE/Mage_Dibspw.csv +32 -0
  39. package.xml +43 -0
  40. skin/adminhtml/base/default/images/Dibspw/Dibspw/aktia.gif +0 -0
  41. skin/adminhtml/base/default/images/Dibspw/Dibspw/amex.gif +0 -0
  42. skin/adminhtml/base/default/images/Dibspw/Dibspw/bax.gif +0 -0
  43. skin/adminhtml/base/default/images/Dibspw/Dibspw/dibs.gif +0 -0
  44. skin/adminhtml/base/default/images/Dibspw/Dibspw/din.gif +0 -0
  45. skin/adminhtml/base/default/images/Dibspw/Dibspw/dk.gif +0 -0
  46. skin/adminhtml/base/default/images/Dibspw/Dibspw/dnb.gif +0 -0
  47. skin/adminhtml/base/default/images/Dibspw/Dibspw/edk.gif +0 -0
  48. skin/adminhtml/base/default/images/Dibspw/Dibspw/elec.gif +0 -0
  49. skin/adminhtml/base/default/images/Dibspw/Dibspw/elv.gif +0 -0
  50. skin/adminhtml/base/default/images/Dibspw/Dibspw/ew.gif +0 -0
  51. skin/adminhtml/base/default/images/Dibspw/Dibspw/ffk.gif +0 -0
  52. skin/adminhtml/base/default/images/Dibspw/Dibspw/fsb.gif +0 -0
  53. skin/adminhtml/base/default/images/Dibspw/Dibspw/git.gif +0 -0
  54. skin/adminhtml/base/default/images/Dibspw/Dibspw/ing.gif +0 -0
  55. skin/adminhtml/base/default/images/Dibspw/Dibspw/jcb.gif +0 -0
  56. skin/adminhtml/base/default/images/Dibspw/Dibspw/jcbsecure.gif +0 -0
  57. skin/adminhtml/base/default/images/Dibspw/Dibspw/loading.gif +0 -0
  58. skin/adminhtml/base/default/images/Dibspw/Dibspw/mc.gif +0 -0
  59. skin/adminhtml/base/default/images/Dibspw/Dibspw/mcsecure.gif +0 -0
  60. skin/adminhtml/base/default/images/Dibspw/Dibspw/moca.gif +0 -0
  61. skin/adminhtml/base/default/images/Dibspw/Dibspw/mtro.gif +0 -0
  62. skin/adminhtml/base/default/images/Dibspw/Dibspw/oko.gif +0 -0
  63. skin/adminhtml/base/default/images/Dibspw/Dibspw/pbb.gif +0 -0
  64. skin/adminhtml/base/default/images/Dibspw/Dibspw/pbbtest.gif +0 -0
  65. skin/adminhtml/base/default/images/Dibspw/Dibspw/pci.gif +0 -0
  66. skin/adminhtml/base/default/images/Dibspw/Dibspw/seb.gif +0 -0
  67. skin/adminhtml/base/default/images/Dibspw/Dibspw/shb.gif +0 -0
  68. skin/adminhtml/base/default/images/Dibspw/Dibspw/solo.gif +0 -0
  69. skin/adminhtml/base/default/images/Dibspw/Dibspw/val.gif +0 -0
  70. skin/adminhtml/base/default/images/Dibspw/Dibspw/visa.gif +0 -0
  71. skin/adminhtml/base/default/images/Dibspw/Dibspw/visasecure.gif +0 -0
  72. skin/frontend/base/default/images/Dibspw/Dibspw/aktia.gif +0 -0
  73. skin/frontend/base/default/images/Dibspw/Dibspw/amex.gif +0 -0
  74. skin/frontend/base/default/images/Dibspw/Dibspw/bax.gif +0 -0
  75. skin/frontend/base/default/images/Dibspw/Dibspw/dibs.gif +0 -0
  76. skin/frontend/base/default/images/Dibspw/Dibspw/din.gif +0 -0
  77. skin/frontend/base/default/images/Dibspw/Dibspw/dk.gif +0 -0
  78. skin/frontend/base/default/images/Dibspw/Dibspw/dnb.gif +0 -0
  79. skin/frontend/base/default/images/Dibspw/Dibspw/edk.gif +0 -0
  80. skin/frontend/base/default/images/Dibspw/Dibspw/elec.gif +0 -0
  81. skin/frontend/base/default/images/Dibspw/Dibspw/elv.gif +0 -0
  82. skin/frontend/base/default/images/Dibspw/Dibspw/ew.gif +0 -0
  83. skin/frontend/base/default/images/Dibspw/Dibspw/ffk.gif +0 -0
  84. skin/frontend/base/default/images/Dibspw/Dibspw/fsb.gif +0 -0
  85. skin/frontend/base/default/images/Dibspw/Dibspw/git.gif +0 -0
  86. skin/frontend/base/default/images/Dibspw/Dibspw/ing.gif +0 -0
  87. skin/frontend/base/default/images/Dibspw/Dibspw/jcb.gif +0 -0
  88. skin/frontend/base/default/images/Dibspw/Dibspw/jcbsecure.gif +0 -0
  89. skin/frontend/base/default/images/Dibspw/Dibspw/loading.gif +0 -0
  90. skin/frontend/base/default/images/Dibspw/Dibspw/mc.gif +0 -0
  91. skin/frontend/base/default/images/Dibspw/Dibspw/mcsecure.gif +0 -0
  92. skin/frontend/base/default/images/Dibspw/Dibspw/moca.gif +0 -0
  93. skin/frontend/base/default/images/Dibspw/Dibspw/mtro.gif +0 -0
  94. skin/frontend/base/default/images/Dibspw/Dibspw/oko.gif +0 -0
  95. skin/frontend/base/default/images/Dibspw/Dibspw/pbb.gif +0 -0
  96. skin/frontend/base/default/images/Dibspw/Dibspw/pbbtest.gif +0 -0
  97. skin/frontend/base/default/images/Dibspw/Dibspw/pci.gif +0 -0
  98. skin/frontend/base/default/images/Dibspw/Dibspw/seb.gif +0 -0
  99. skin/frontend/base/default/images/Dibspw/Dibspw/shb.gif +0 -0
  100. skin/frontend/base/default/images/Dibspw/Dibspw/solo.gif +0 -0
  101. skin/frontend/base/default/images/Dibspw/Dibspw/val.gif +0 -0
  102. skin/frontend/base/default/images/Dibspw/Dibspw/visa.gif +0 -0
  103. skin/frontend/base/default/images/Dibspw/Dibspw/visasecure.gif +0 -0
app/code/community/Dibspw/Adminhtml/Block/Sales/Order/View/Tab/Info.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order information tab
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Dibspw_Adminhtml_Block_Sales_Order_View_Tab_Info extends Mage_Adminhtml_Block_Sales_Order_View_Tab_Info {
36
+
37
+ protected function PaymentPart($paymentstr) {
38
+ $PaymentPartStr = explode(',',$paymentstr,2);
39
+ return $PaymentPartStr[0];
40
+ }
41
+
42
+ public function getPaymentHtml() {
43
+ $res = parent::getPaymentHtml();
44
+
45
+ $sButtons = '';
46
+ $oOrder = $this->getSource();
47
+ $standard = Mage::getModel('dibspw/Dibspw');
48
+ $oPaymentObj = $oOrder->getPayment()->getMethodInstance();
49
+ $sPaymentClass = get_class($oPaymentObj);
50
+ if(strpos($sPaymentClass, "DibsFlex") !== FALSE) {
51
+ $oOrderInfo = $oPaymentObj->dibsflex_helper_getOrderObj($oOrder);
52
+ $sButtons = $oPaymentObj->dibsflex_api_cgibuttons($oOrderInfo->order_id);
53
+ }
54
+
55
+ // Read info directly from the database
56
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
57
+ $sTablePrefix = Mage::getConfig()->getTablePrefix();
58
+ $row = $read->fetchRow("SELECT `status`, `transaction`, `amount`, `currency`, `fee`, `paytype`, `ext_info`
59
+ FROM " . $sTablePrefix . dibs_pw_api::api_dibs_get_tableName() . "
60
+ WHERE orderid = " . $this->getOrder()->getIncrementId());
61
+
62
+ if (count($row) > 0) {
63
+ if ($row['status'] == 'ACCEPTED') {
64
+ $row['ext'] = array();
65
+ if(isset($row['ext_info']) && $row['ext_info'] != NULL) {
66
+ $row['ext'] = unserialize($row['ext_info']);
67
+ }
68
+ // Payment has been made to this order
69
+ $res .= "<br><br>" . "<table border='0' width='100%'>";
70
+ $res .= "<tr><td colspan='2'><b>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_7') . "</b></td></tr>";
71
+
72
+ if ($row['transaction'] != '0') {
73
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_8') . "</td>";
74
+ $res .= "<td>" . $row['transaction'] . "</td></tr>";
75
+ }
76
+
77
+ if ($row['amount'] != '0') {
78
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_9') . "</td>";
79
+ $res .= "<td>" . $this->getOrder()->getOrderCurrencyCode() . "&nbsp;" . number_format(((int)$row['amount']) / 100, 2, ',', ' ') . "</td></tr>";
80
+ }
81
+
82
+ if ($row['currency'] != '0') {
83
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_10') . "</td>";
84
+ $res .= "<td>" . $row['currency'] . "</td></tr>";
85
+ }
86
+
87
+ if ($row['fee'] != '0') {
88
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_11') . "</td>";
89
+ $res .= "<td>" . $this->getOrder()->getOrderCurrencyCode() . "&nbsp;" . number_format(((int)$row['fee']) / 100, 2, ',', ' ') . "</td></tr>";
90
+ }
91
+
92
+ if ($row['paytype'] != '0') {
93
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_12') . "</td>";
94
+ $res .= "<td>" . $this->printLogo($row['paytype']) . "</td></tr>";
95
+ }
96
+
97
+ if ($row['ext']['acquirer'] != '0') {
98
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_16') . "</td>";
99
+ $res .= "<td>" . $row['ext']['acquirer'] . "</td></tr>";
100
+ }
101
+
102
+ if ($row['ext']['enrolled'] != '0') {
103
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_17') . "</td>";
104
+ $res .= "<td>" . $row['ext']['enrolled'] . "</td></tr>";
105
+ }
106
+
107
+ $res .= '<tr><td colspan="2">' . $sButtons . '</td></tr>';
108
+
109
+ $res .= "</table><br>";
110
+ $res .= "<a href='https://payment.architrade.com/admin/' target='_blank'>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_18') . "</a>";
111
+ $res .= "<br><br>";
112
+ }
113
+ else {
114
+ $res .= "<br>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_19') . "<br>";
115
+ }
116
+ }
117
+
118
+ return $res;
119
+ }
120
+
121
+ public function printLogo($paytype) {
122
+ if(preg_match("/[a-z\(\)]+/is", $this->PaymentPart($paytype))) {
123
+ $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/' .
124
+ preg_replace("/\(\)_/s", "", strtolower($this->PaymentPart($paytype))) . '.gif') .
125
+ '" border="0" />';
126
+ }
127
+ else $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/dibs.gif') .
128
+ '" border="0" />';
129
+
130
+ return $res;
131
+ }
132
+ }
app/code/community/Dibspw/Adminhtml/etc/config.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <global>
26
+ <blocks>
27
+ <adminhtml>
28
+ <rewrite>
29
+ <sales_order_view_tab_info>Dibspw_Adminhtml_Block_Sales_Order_View_Tab_Info</sales_order_view_tab_info>
30
+ </rewrite>
31
+ </adminhtml>
32
+ </blocks>
33
+ </global>
34
+ </config>
app/code/community/Dibspw/Dibspw/Block/Failure.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Core
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Payment Block
30
+ **/
31
+
32
+ class Dibspw_Dibspw_Block_Failure extends Mage_Core_Block_Template
33
+ {
34
+ }
app/code/community/Dibspw/Dibspw/Block/Form.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Core
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
26
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
27
+ */
28
+
29
+ /**
30
+ * Payment Block
31
+ **/
32
+
33
+ class Dibspw_Dibspw_Block_Form extends Mage_Payment_Block_Form
34
+ {
35
+ protected function _construct()
36
+ {
37
+
38
+ $this->setTemplate('Dibspw/Dibspw/form.phtml');
39
+ parent::_construct();
40
+ }
41
+ }
app/code/community/Dibspw/Dibspw/Block/Redirect.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Core
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
26
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
27
+ */
28
+
29
+ class Dibspw_Dibspw_Block_Redirect extends Mage_Core_Block_Template
30
+ {
31
+ /**
32
+ * Constructor. Set template.
33
+ */
34
+
35
+ protected function _construct()
36
+ {
37
+ parent::_construct();
38
+ $this->setTemplate('Dibspw/Dibspw/redirect.phtml');
39
+ }
40
+
41
+ }
app/code/community/Dibspw/Dibspw/Helper/Data.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Adminhtml
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
26
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
27
+ */
28
+
29
+ /**
30
+ * Payment Helper
31
+ **/
32
+
33
+ class Dibspw_Dibspw_Helper_Data extends Mage_Payment_Helper_Data
34
+ {
35
+
36
+ }
app/code/community/Dibspw/Dibspw/Model/Dibspw.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dibs A/S
4
+ * Dibs Payment Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payments & Gateways Extensions
17
+ * @package Dibspw_Dibspw
18
+ * @author Dibs A/S
19
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Payment Model
25
+ **/
26
+ require_once dirname(__FILE__) . '/dibs_api/pw/dibs_pw_api.php';
27
+
28
+ class Dibspw_Dibspw_Model_Dibspw extends dibs_pw_api {
29
+
30
+ protected $_code = 'Dibspw';
31
+ protected $_formBlockType = 'Dibspw_Dibspw_block_form';
32
+
33
+ /**
34
+ * Get Dibs session namespace
35
+ *
36
+ * @return Dibspw_Dibspw_Model_Session
37
+ */
38
+ public function getSession() {
39
+ return Mage::getSingleton('Dibspw/session');
40
+ }
41
+
42
+ /**
43
+ * Get checkout session namespace
44
+ *
45
+ * @return Mage_Checkout_Model_Session
46
+ */
47
+ public function getCheckout() {
48
+ return Mage::getSingleton('checkout/session');
49
+ }
50
+
51
+ /**
52
+ * Get current quote
53
+ *
54
+ * @return Mage_Sales_Model_Quote
55
+ */
56
+ public function getQuote() {
57
+ return $this->getCheckout()->getQuote();
58
+ }
59
+
60
+ /*
61
+ * Validate the currency code is avaialable to use for dibs or not
62
+ */
63
+ public function validate() {
64
+ parent::validate();
65
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
66
+ if (!array_key_exists($currency_code, dibs_pw_api::api_dibs_get_currencyArray())) {
67
+ Mage::throwException(Mage::helper('Dibspw')->__('Selected currency code (' .
68
+ $currency_code.') is not compatabile with Dibs'));
69
+ }
70
+ return $this;
71
+ }
72
+
73
+ public function getCheckoutFormFields() {
74
+ $order = Mage::getModel('sales/order');
75
+ $order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
76
+ $aFields = $this->api_dibs_get_requestFields($order);
77
+
78
+ return $aFields;
79
+ }
80
+
81
+
82
+ /**
83
+ * Using internal pages for input payment data
84
+ *
85
+ * @return bool
86
+ */
87
+ public function canUseInternal() {
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Using for multiple shipping address
93
+ *
94
+ * @return bool
95
+ */
96
+ public function canUseForMultishipping() {
97
+ return false;
98
+ }
99
+
100
+ public function getOrderPlaceRedirectUrl() {
101
+ return Mage::getUrl('Dibspw/Dibspw/redirect');
102
+ }
103
+
104
+ /**
105
+ * Calculates if any of the trusted logos are to be shown - in that case return true
106
+ */
107
+ public function showTrustedList() {
108
+ $logoArray = explode(',', $this->getConfigData('dibslogos'));
109
+ foreach($logoArray as $item) {
110
+ if ($item == 'DIBS' || $item == 'VISA_SECURE' || $item == 'MC_SECURE' ||
111
+ $item == 'JCB_SECURE' || $item == 'PCI') {
112
+
113
+ return true;
114
+ }
115
+ }
116
+ return false;
117
+ }
118
+
119
+ /**
120
+ * Calculates if any of the card logos are to be shown - in that case return true
121
+ */
122
+ public function showCardsList() {
123
+ $logoArray = explode(',', $this->getConfigData('dibslogos'));
124
+ foreach($logoArray as $item) {
125
+ if ($item == 'AMEX' || $item == 'BAX' || $item == 'DIN' || $item == 'DK' ||
126
+ $item == 'FFK' || $item == 'JCB' || $item == 'MC' || $item == 'MTRO' ||
127
+ $item == 'MOCA' || $item == 'VISA' || $item == 'ELEC' || $item == 'AKTIA' ||
128
+ $item == 'DNB' || $item == 'EDK' || $item == 'ELV' || $item == 'EW' ||
129
+ $item == 'FSB' || $item == 'GIT' || $item == 'ING' || $item == 'SEB' ||
130
+ $item == 'SHB' || $item == 'SOLO' || $item == 'VAL') {
131
+
132
+ return true;
133
+ }
134
+ }
135
+ return false;
136
+ }
137
+ }
app/code/community/Dibspw/Dibspw/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
25
+ {
26
+ /**
27
+ * delete cache.cfg from Magento Connect directory after/during module install
28
+ * to fix bug with module invisible in module list
29
+
30
+ $sMageRoot = Mage::getBaseDir();
31
+ if(strpos($sMageRoot, '/') !== FALSE) $sDS = '/';
32
+ else $sDS = '\\';
33
+ $sCacheCfgFile = $sMageRoot . $sDS . 'downloader'. $sDS . 'cache.cfg';
34
+ unlink($sCacheCfgFile);*/
35
+ }
36
+ ?>
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibslogos.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Dibslogos
25
+ {
26
+
27
+ public function toOptionArray()
28
+ {
29
+ return array(
30
+ array('value'=>'DIBS', 'label'=>Mage::helper('adminhtml')->__('DIBS Standard Logo')),
31
+ array('value'=>'PBB', 'label'=>Mage::helper('adminhtml')->__('DIBS PayByBill Logo')),
32
+ array('value'=>'VISA_SECURE', 'label'=>Mage::helper('adminhtml')->__('Verified by VISA')),
33
+ array('value'=>'MC_SECURE', 'label'=>Mage::helper('adminhtml')->__('MasterCard SecureCode')),
34
+ array('value'=>'JCB_SECURE', 'label'=>Mage::helper('adminhtml')->__('JCB J/Secure')),
35
+ array('value'=>'PCI', 'label'=>Mage::helper('adminhtml')->__('PCI')),
36
+ array('value'=>'MC', 'label'=>Mage::helper('adminhtml')->__('MasterCard')),
37
+ array('value'=>'MTRO', 'label'=>Mage::helper('adminhtml')->__('Maestro')),
38
+ array('value'=>'VISA', 'label'=>Mage::helper('adminhtml')->__('Visa')),
39
+ array('value'=>'ELEC', 'label'=>Mage::helper('adminhtml')->__('Visa Electron')),
40
+ array('value'=>'DIN', 'label'=>Mage::helper('adminhtml')->__('Diners Club')),
41
+ array('value'=>'AMEX', 'label'=>Mage::helper('adminhtml')->__('American Express')),
42
+ array('value'=>'DK', 'label'=>Mage::helper('adminhtml')->__('Dankort')),
43
+ array('value'=>'EDK', 'label'=>Mage::helper('adminhtml')->__('eDankort')),
44
+ array('value'=>'SEB', 'label'=>Mage::helper('adminhtml')->__('SEB Direktbetalning')),
45
+ array('value'=>'SHB', 'label'=>Mage::helper('adminhtml')->__('SHB Direktbetalning')),
46
+ array('value'=>'FSB', 'label'=>Mage::helper('adminhtml')->__('Swedbank Direktbetalning')),
47
+ array('value'=>'SOLO', 'label'=>Mage::helper('adminhtml')->__('Nordea Solo-E betalning')),
48
+ array('value'=>'DNB', 'label'=>Mage::helper('adminhtml')->__('Danske Netbetaling (Danske Bank)')),
49
+ array('value'=>'MOCA', 'label'=>Mage::helper('adminhtml')->__('Mobilcash')),
50
+ array('value'=>'BAX', 'label'=>Mage::helper('adminhtml')->__('BankAxess')),
51
+ array('value'=>'FFK', 'label'=>Mage::helper('adminhtml')->__('Forbrugsforeningen Card')),
52
+ array('value'=>'JCB', 'label'=>Mage::helper('adminhtml')->__('JCB (Japan Credit Bureau)')),
53
+ array('value'=>'AKTIA', 'label'=>Mage::helper('adminhtml')->__('Aktia Web Payment')),
54
+ array('value'=>'ELV', 'label'=>Mage::helper('adminhtml')->__('Bank Einzug (eOLV)')),
55
+ array('value'=>'EW', 'label'=>Mage::helper('adminhtml')->__('eWire')),
56
+ array('value'=>'GIT', 'label'=>Mage::helper('adminhtml')->__('Getitcard')),
57
+ array('value'=>'VAL', 'label'=>Mage::helper('adminhtml')->__('Valus')),
58
+ array('value'=>'ING', 'label'=>Mage::helper('adminhtml')->__('ING iDeal Payment'))
59
+ );
60
+ }
61
+
62
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibspaytypes.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Dibspaytypes
25
+ {
26
+
27
+ public function toOptionArray()
28
+ {
29
+ return array(
30
+ array('value'=>'DIBS', 'label'=>Mage::helper('adminhtml')->__('DIBS Contracted Paytypes')),
31
+ array('value'=>'PBB', 'label'=>Mage::helper('adminhtml')->__('DIBS PayByBill')),
32
+ array('value'=>'MC', 'label'=>Mage::helper('adminhtml')->__('MasterCard')),
33
+ array('value'=>'MTRO', 'label'=>Mage::helper('adminhtml')->__('Maestro')),
34
+ array('value'=>'VISA', 'label'=>Mage::helper('adminhtml')->__('Visa')),
35
+ array('value'=>'ELEC', 'label'=>Mage::helper('adminhtml')->__('Visa Electron')),
36
+ array('value'=>'DIN', 'label'=>Mage::helper('adminhtml')->__('Diners Club')),
37
+ array('value'=>'AMEX', 'label'=>Mage::helper('adminhtml')->__('American Express')),
38
+ array('value'=>'DK', 'label'=>Mage::helper('adminhtml')->__('Dankort')),
39
+ array('value'=>'EDK', 'label'=>Mage::helper('adminhtml')->__('eDankort')),
40
+ array('value'=>'SEB', 'label'=>Mage::helper('adminhtml')->__('SEB Direktbetalning')),
41
+ array('value'=>'SHB', 'label'=>Mage::helper('adminhtml')->__('SHB Direktbetalning')),
42
+ array('value'=>'FSB', 'label'=>Mage::helper('adminhtml')->__('Swedbank Direktbetalning')),
43
+ array('value'=>'SOLO', 'label'=>Mage::helper('adminhtml')->__('Nordea Solo-E betalning')),
44
+ array('value'=>'DNB', 'label'=>Mage::helper('adminhtml')->__('Danske Netbetaling (Danske Bank)')),
45
+ array('value'=>'MOCA', 'label'=>Mage::helper('adminhtml')->__('Mobilcash')),
46
+ array('value'=>'BAX', 'label'=>Mage::helper('adminhtml')->__('BankAxess')),
47
+ array('value'=>'FFK', 'label'=>Mage::helper('adminhtml')->__('Forbrugsforeningen Card')),
48
+ array('value'=>'JCB', 'label'=>Mage::helper('adminhtml')->__('JCB (Japan Credit Bureau)')),
49
+ array('value'=>'AKTIA', 'label'=>Mage::helper('adminhtml')->__('Aktia Web Payment')),
50
+ array('value'=>'ELV', 'label'=>Mage::helper('adminhtml')->__('Bank Einzug (eOLV)')),
51
+ array('value'=>'EW', 'label'=>Mage::helper('adminhtml')->__('eWire')),
52
+ array('value'=>'GIT', 'label'=>Mage::helper('adminhtml')->__('Getitcard')),
53
+ array('value'=>'VAL', 'label'=>Mage::helper('adminhtml')->__('Valus')),
54
+ array('value'=>'ING', 'label'=>Mage::helper('adminhtml')->__('ING iDeal Payment'))
55
+ );
56
+ }
57
+
58
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Dibsyesno.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Dibsyesno
25
+ {
26
+
27
+ public function toOptionArray()
28
+ {
29
+ return array(
30
+ array('value'=>'yes', 'label'=>Mage::helper('adminhtml')->__('Yes')),
31
+ array('value'=>'no', 'label'=>Mage::helper('adminhtml')->__('No')),
32
+ );
33
+ }
34
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Lang.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Lang
25
+ {
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ array('value'=>'da_DK', 'label'=>Mage::helper('adminhtml')->__('Danish')),
30
+ array('value'=>'en_UK', 'label'=>Mage::helper('adminhtml')->__('English')),
31
+ array('value'=>'fi_FIN', 'label'=>Mage::helper('adminhtml')->__('Finnish')),
32
+ array('value'=>'nb_NO', 'label'=>Mage::helper('adminhtml')->__('Norwegian')),
33
+ array('value'=>'sv_SE', 'label'=>Mage::helper('adminhtml')->__('Swedish')),
34
+ );
35
+ }
36
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Orderstatusafter.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Orderstatusafter
25
+ {
26
+ // set null to enable all possible
27
+ protected $_stateStatuses = array(
28
+ // Mage_Sales_Model_Order::STATE_NEW,
29
+ // Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
30
+ Mage_Sales_Model_Order::STATE_PROCESSING,
31
+ // Mage_Sales_Model_Order::STATE_COMPLETE,
32
+ // Mage_Sales_Model_Order::STATE_CLOSED,
33
+ // Mage_Sales_Model_Order::STATE_CANCELED,
34
+ Mage_Sales_Model_Order::STATE_HOLDED,
35
+ );
36
+
37
+ public function toOptionArray()
38
+ {
39
+ if ($this->_stateStatuses) {
40
+ $statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($this->_stateStatuses);
41
+ }
42
+ else {
43
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
44
+ }
45
+ $options = array();
46
+ $options[] = array(
47
+ 'value' => '',
48
+ 'label' => Mage::helper('adminhtml')->__('-- Please Select --')
49
+ );
50
+ foreach ($statuses as $code=>$label) {
51
+ $options[] = array(
52
+ 'value' => $code,
53
+ 'label' => $label
54
+ );
55
+ }
56
+ return $options;
57
+ }
58
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Orderstatusbefore.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Orderstatusbefore
25
+ {
26
+ // set null to enable all possible
27
+ protected $_stateStatuses = array(
28
+ Mage_Sales_Model_Order::STATE_NEW,
29
+ // Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
30
+ Mage_Sales_Model_Order::STATE_PROCESSING,
31
+ // Mage_Sales_Model_Order::STATE_COMPLETE,
32
+ // Mage_Sales_Model_Order::STATE_CLOSED,
33
+ // Mage_Sales_Model_Order::STATE_CANCELED,
34
+ // Mage_Sales_Model_Order::STATE_HOLDED,
35
+ );
36
+
37
+ public function toOptionArray()
38
+ {
39
+ if ($this->_stateStatuses) {
40
+ $statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($this->_stateStatuses);
41
+ }
42
+ else {
43
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
44
+ }
45
+ $options = array();
46
+ $options[] = array(
47
+ 'value' => '',
48
+ 'label' => Mage::helper('adminhtml')->__('-- Please Select --')
49
+ );
50
+ foreach ($statuses as $code=>$label) {
51
+ $options[] = array(
52
+ 'value' => $code,
53
+ 'label' => $label
54
+ );
55
+ }
56
+ return $options;
57
+ }
58
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/PBBdistribution.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_PBBdistribution
25
+ {
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ array('value'=>'empty', 'label'=>Mage::helper('adminhtml')->__('-')),
30
+ array('value'=>'paper', 'label'=>Mage::helper('adminhtml')->__('Paper')),
31
+ array('value'=>'email', 'label'=>Mage::helper('adminhtml')->__('Email')),
32
+ );
33
+ }
34
+ }
app/code/community/Dibspw/Dibspw/Model/System/Config/Source/Paymentwindow.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ class Dibspw_Dibspw_Model_System_Config_Source_Paymentwindow
25
+ {
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ array('value'=>1, 'label'=>Mage::helper('adminhtml')->__('Auto')),
30
+ array('value'=>2, 'label'=>Mage::helper('adminhtml')->__('DIBS Payment Window')),
31
+ array('value'=>3, 'label'=>Mage::helper('adminhtml')->__('Mobile Payment Window'))
32
+ );
33
+ }
34
+
35
+
36
+ }
app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_api.php ADDED
@@ -0,0 +1,616 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once dirname(__FILE__) . '/dibs_pw_helpers_interface.php';
3
+ require_once dirname(__FILE__) . '/dibs_pw_helpers_cms.php';
4
+ require_once dirname(__FILE__) . '/dibs_pw_helpers.php';
5
+
6
+ class dibs_pw_api extends dibs_pw_helpers {
7
+
8
+ private static $sDibsTable = 'dibspw_results';
9
+
10
+ private static $sDefaultCurr = array(0 => 'EUR', 1 => '978');
11
+
12
+ private static $aFormActions = array(2 => 'https://sat1.dibspayment.com/dibspaymentwindow/entrypoint',
13
+ 3 => 'https://mopay.dibspayment.com/');
14
+
15
+ private static $aRespFields = array('orderid' => 'orderid', 'status' => 'status',
16
+ 'testmode' => 'test', 'transaction' => 'transaction',
17
+ 'amount' => 'amount','currency' => 'currency',
18
+ 'fee' => 'fee', 'voucheramount' => 'voucherAmount',
19
+ 'paytype' => array(2 => 'cardTypeName', 3 => 'payTypeName'),
20
+ 'amountoriginal'=>'amountOriginal',
21
+ 'validationerrors'=>'validationErrors',
22
+ 'capturestatus' => 'captureStatus',
23
+ 'actioncode' => array(2 => 'actionCode', 3 => 'approvalCode'),
24
+ 'sysmod' => 's_sysmod');
25
+
26
+ private static $aCurrency = array('ADP' => '020','AED' => '784','AFA' => '004','ALL' => '008',
27
+ 'AMD' => '051','ANG' => '532','AOA' => '973','ARS' => '032',
28
+ 'AUD' => '036','AWG' => '533','AZM' => '031','BAM' => '977',
29
+ 'BBD' => '052','BDT' => '050','BGL' => '100','BGN' => '975',
30
+ 'BHD' => '048','BIF' => '108','BMD' => '060','BND' => '096',
31
+ 'BOB' => '068','BOV' => '984','BRL' => '986','BSD' => '044',
32
+ 'BTN' => '064','BWP' => '072','BYR' => '974','BZD' => '084',
33
+ 'CAD' => '124','CDF' => '976','CHF' => '756','CLF' => '990',
34
+ 'CLP' => '152','CNY' => '156','COP' => '170','CRC' => '188',
35
+ 'CUP' => '192','CVE' => '132','CYP' => '196','CZK' => '203',
36
+ 'DJF' => '262','DKK' => '208','DOP' => '214','DZD' => '012',
37
+ 'ECS' => '218','ECV' => '983','EEK' => '233','EGP' => '818',
38
+ 'ERN' => '232','ETB' => '230','EUR' => '978','FJD' => '242',
39
+ 'FKP' => '238','GBP' => '826','GEL' => '981','GHC' => '288',
40
+ 'GIP' => '292','GMD' => '270','GNF' => '324','GTQ' => '320',
41
+ 'GWP' => '624','GYD' => '328','HKD' => '344','HNL' => '340',
42
+ 'HRK' => '191','HTG' => '332','HUF' => '348','IDR' => '360',
43
+ 'ILS' => '376','INR' => '356','IQD' => '368','IRR' => '364',
44
+ 'ISK' => '352','JMD' => '388','JOD' => '400','JPY' => '392',
45
+ 'KES' => '404','KGS' => '417','KHR' => '116','KMF' => '174',
46
+ 'KPW' => '408','KRW' => '410','KWD' => '414','KYD' => '136',
47
+ 'KZT' => '398','LAK' => '418','LBP' => '422','LKR' => '144',
48
+ 'LRD' => '430','LSL' => '426','LTL' => '440','LVL' => '428',
49
+ 'LYD' => '434','MAD' => '504','MDL' => '498','MGF' => '450',
50
+ 'MKD' => '807','MMK' => '104','MNT' => '496','MOP' => '446',
51
+ 'MRO' => '478','MTL' => '470','MUR' => '480','MVR' => '462',
52
+ 'MWK' => '454','MXN' => '484','MXV' => '979','MYR' => '458',
53
+ 'MZM' => '508','NAD' => '516','NGN' => '566','NIO' => '558',
54
+ 'NOK' => '578','NPR' => '524','NZD' => '554','OMR' => '512',
55
+ 'PAB' => '590','PEN' => '604','PGK' => '598','PHP' => '608',
56
+ 'PKR' => '586','PLN' => '985','PYG' => '600','QAR' => '634',
57
+ 'ROL' => '642','RUB' => '643','RUR' => '810','RWF' => '646',
58
+ 'SAR' => '682','SBD' => '090','SCR' => '690','SDD' => '736',
59
+ 'SEK' => '752','SGD' => '702','SHP' => '654','SIT' => '705',
60
+ 'SKK' => '703','SLL' => '694','SOS' => '706','SRG' => '740',
61
+ 'STD' => '678','SVC' => '222','SYP' => '760','SZL' => '748',
62
+ 'THB' => '764','TJS' => '972','TMM' => '795','TND' => '788',
63
+ 'TOP' => '776','TPE' => '626','TRL' => '792','TRY' => '949',
64
+ 'TTD' => '780','TWD' => '901','TZS' => '834','UAH' => '980',
65
+ 'UGX' => '800','USD' => '840','UYU' => '858','UZS' => '860',
66
+ 'VEB' => '862','VND' => '704','VUV' => '548','XAF' => '950',
67
+ 'XCD' => '951','XOF' => '952','XPF' => '953','YER' => '886',
68
+ 'YUM' => '891','ZAR' => '710','ZMK' => '894','ZWD' => '716');
69
+
70
+ /**
71
+ * Returns CMS order common information converted to standardized order information objects.
72
+ *
73
+ * @param mixed $mOrderInfo
74
+ * @return object
75
+ */
76
+ private function api_dibs_commonOrderObject($mOrderInfo) {
77
+ return (object)array(
78
+ 'order' => $this->helper_dibs_obj_order($mOrderInfo),
79
+ 'urls' => $this->helper_dibs_obj_urls($mOrderInfo),
80
+ 'etc' => $this->helper_dibs_obj_etc($mOrderInfo)
81
+ );
82
+ }
83
+
84
+ /**
85
+ * Returns CMS order invoice information converted to standardized order information objects.
86
+ *
87
+ * @param mixed $mOrderInfo
88
+ * @return object
89
+ */
90
+ private function api_dibs_invoiceOrderObject($mOrderInfo) {
91
+ return (object)array(
92
+ 'items' => $this->helper_dibs_obj_items($mOrderInfo),
93
+ 'ship' => $this->helper_dibs_obj_ship($mOrderInfo),
94
+ 'addr' => $this->helper_dibs_obj_addr($mOrderInfo)
95
+ );
96
+ }
97
+
98
+
99
+ /**
100
+ * Returns form action URL of gateway.
101
+ *
102
+ * @param bool $bResponse
103
+ * @return string
104
+ */
105
+ final public function api_dibs_get_formAction($bResponse = FALSE) {
106
+ return self::$aFormActions[$this->api_dibs_get_method($bResponse)];
107
+ }
108
+
109
+ /**
110
+ * Collects API parameters to send in dependence of checkout type. API entry point.
111
+ *
112
+ * @param mixed $mOrderInfo
113
+ * @return array
114
+ */
115
+ final public function api_dibs_get_requestFields($mOrderInfo) {
116
+ $oOrder = $this->api_dibs_commonOrderObject($mOrderInfo);
117
+ $this->api_dibs_prepareDB($oOrder->order->orderid);
118
+ $aData = array('s_pw' => $this->api_dibs_get_method());
119
+ $this->api_dibs_commonFields($aData, $oOrder);
120
+ if($aData['s_pw'] == 2) $this->api_dibs_invoiceFields($aData, $mOrderInfo);
121
+ else $this->api_dibs_mobileFields($aData);
122
+ if(count($oOrder->etc) > 0) {
123
+ foreach($oOrder->etc as $sKey => $sVal) $aData['s_' . $sKey] = $sVal;
124
+ }
125
+ array_walk($aData, create_function('&$val', '$val = trim($val);'));
126
+ $sMAC = $this->api_dibs_calcMAC($aData, $this->helper_dibs_tools_conf('hmac'));
127
+ if(!empty($sMAC)) $aData['MAC'] = $sMAC;
128
+
129
+ return $aData;
130
+ }
131
+
132
+ /**
133
+ * Adds to $aData common DIBS integration parameters.
134
+ *
135
+ * @param array $aData
136
+ * @param object $oOrder
137
+ */
138
+ private function api_dibs_commonFields(&$aData, $oOrder) {
139
+ $aData['orderid'] = $oOrder->order->orderid;
140
+ $aData['merchant'] = $this->helper_dibs_tools_conf('mid');
141
+ $aData['amount'] = self::api_dibs_round($oOrder->order->amount);
142
+ $aData['currency'] = $oOrder->order->currency;
143
+ $aData['language'] = $this->helper_dibs_tools_conf('lang');
144
+ if((string)$this->helper_dibs_tools_conf('fee') == 'yes') $aData['addfee'] = 1;
145
+ if((string)$this->helper_dibs_tools_conf('testmode') == 'yes') $aData['test'] = 1;
146
+ $sPaytype = $this->helper_dibs_tools_conf('paytype');
147
+ if(!empty($sPaytype)) $aData['paytype'] = $sPaytype;
148
+ $sAccount = $this->helper_dibs_tools_conf('account');
149
+ if(!empty($sAccount)) $aData['account'] = $sAccount;
150
+ $aData['acceptreturnurl'] = $this->helper_dibs_tools_url($oOrder->urls->acceptreturnurl);
151
+ $aData['cancelreturnurl'] = $this->helper_dibs_tools_url($oOrder->urls->cancelreturnurl);
152
+ $aData['callbackurl'] = $oOrder->urls->callbackurl;
153
+ if(strpos($aData['callbackurl'], '/5c65f1600b8_dcbf.php') === FALSE) {
154
+ $aData['callbackurl'] = $this->helper_dibs_tools_url($aData['callbackurl']);
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Adds to $aData parameters specific for Mobile PW integration.
160
+ *
161
+ * @param array $aData
162
+ */
163
+ private function api_dibs_mobileFields(&$aData) {
164
+ if((string)$this->helper_dibs_tools_conf('voucher') == 'yes') $aData['voucher'] = 1;
165
+ if((string)$this->helper_dibs_tools_conf('uniq') == 'yes') {
166
+ $aData['uniqueid'] = $aData['orderid'];
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Adds Invoice API parameters specific for SAT PW.
172
+ *
173
+ * @param array $aData
174
+ * @param object $oOrder
175
+ */
176
+ private function api_dibs_invoiceFields(&$aData, $mOrderInfo) {
177
+ $oOrder = $this->api_dibs_invoiceOrderObject($mOrderInfo);
178
+ foreach($oOrder->addr as $sKey => $sVal) {
179
+ $sVal = trim($sVal);
180
+ if(!empty($sVal)) {
181
+ $aData[$sKey] = self::api_dibs_utf8Fix($sVal);
182
+ }
183
+ }
184
+ if(isset($oOrder->ship->rate) && $oOrder->ship->rate > 0) {
185
+ $aData['shippingFee'] = self::api_dibs_round($oOrder->ship->rate);
186
+ $aData['shippingFeeVAT'] = self::api_dibs_round($oOrder->ship->tax);
187
+ }
188
+ if(isset($oOrder->items) && count($oOrder->items) > 0) {
189
+ $aData['oitypes'] = 'QUANTITY;UNITCODE;DESCRIPTION;AMOUNT;ITEMID;VATPERCENT';
190
+ $aData['oinames'] = 'Qty;UnitCode;Description;Amount;ItemId;VatPercent';
191
+
192
+ $i = 1;
193
+ foreach($oOrder->items as $oItem) {
194
+ $iTmpPrice = self::api_dibs_round($oItem->price);
195
+ if(!empty($iTmpPrice)) {
196
+ $sTmpName = !empty($oItem->name) ? $oItem->name : $oItem->sku;
197
+ if(empty($sTmpName)) $sTmpName = $oItem->id;
198
+
199
+ $aData['oiRow' . $i++] =
200
+ self::api_dibs_round($oItem->qty, 3) / 1000 . ";" .
201
+ "pcs" . ";" .
202
+ self::api_dibs_utf8Fix(str_replace(";","\;",$sTmpName)) . ";" .
203
+ $iTmpPrice . ";" .
204
+ self::api_dibs_utf8Fix(str_replace(";","\;",$oItem->id)) . ";" .
205
+ self::api_dibs_round($oItem->tax);
206
+ }
207
+ unset($iTmpPrice, $sTmpName);
208
+ }
209
+ }
210
+ if(!empty($aData['orderid'])) $aData['yourRef'] = $aData['orderid'];
211
+ if((string)$this->helper_dibs_tools_conf('capturenow') == 'yes') $aData['capturenow'] = 1;
212
+ $sDistributionType = $this->helper_dibs_tools_conf('distr');
213
+ if((string)$sDistributionType != 'empty') {
214
+ $aData['distributiontype'] = strtoupper($sDistributionType);
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Returns integration method ID (2 or 3), specific for currenct transaction.
220
+ *
221
+ * @param bool $bResp
222
+ * @return int
223
+ */
224
+ final public function api_dibs_get_method($bResp = FALSE) {
225
+ if($bResp === TRUE && ($_POST['s_pw'] == 2 || $_POST['s_pw'] == 3)) return $_POST['s_pw'];
226
+
227
+ $iPayMethod = $this->helper_dibs_tools_conf("method");
228
+ if($iPayMethod != 2 && $iPayMethod != 3) {
229
+ return (self::api_dibs_detectMobile() === TRUE) ? 3 : 2;
230
+ }
231
+ else return $iPayMethod;
232
+ }
233
+
234
+ /**
235
+ * Process DB preparations and adds empty transaction record before payment.
236
+ *
237
+ * @param int $iOrderId
238
+ */
239
+ private function api_dibs_prepareDB($iOrderId) {
240
+ $this->api_dibs_checkTable();
241
+ $sQuery = "SELECT COUNT(`orderid`) AS order_exists
242
+ FROM `" . $this->helper_dibs_tools_prefix() . self::api_dibs_get_tableName() . "`
243
+ WHERE `orderid` = '" . $iOrderId . "'
244
+ LIMIT 1;";
245
+ if($this->helper_dibs_db_read_single($sQuery, 'order_exists') <= 0) {
246
+ $this->helper_dibs_db_write(
247
+ "INSERT INTO `" . $this->helper_dibs_tools_prefix() .
248
+ self::api_dibs_get_tableName() . "`(`orderid`)
249
+ VALUES('" . $iOrderId."')"
250
+ );
251
+ }
252
+ }
253
+
254
+ /**
255
+ * Creates dibs_results DB if not exists.
256
+ */
257
+ private function api_dibs_checkTable() {
258
+ $this->helper_dibs_db_write(
259
+ "CREATE TABLE IF NOT EXISTS `" . $this->helper_dibs_tools_prefix() .
260
+ self::api_dibs_get_tableName() . "` (
261
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
262
+ `orderid` varchar(100) NOT NULL DEFAULT '',
263
+ `status` varchar(10) NOT NULL DEFAULT '0',
264
+ `testmode` tinyint(1) unsigned NOT NULL DEFAULT '0',
265
+ `transaction` varchar(100) NOT NULL DEFAULT '',
266
+ `amount` int(10) unsigned NOT NULL DEFAULT '0',
267
+ `currency` smallint(3) unsigned NOT NULL DEFAULT '0',
268
+ `fee` int(10) unsigned NOT NULL DEFAULT '0',
269
+ `paytype` varchar(32) NOT NULL DEFAULT '',
270
+ `voucheramount` int(10) unsigned NOT NULL DEFAULT '0',
271
+ `amountoriginal` int(10) unsigned NOT NULL DEFAULT '0',
272
+ `ext_info` text,
273
+ `validationerrors` text,
274
+ `capturestatus` varchar(10) NOT NULL DEFAULT '0',
275
+ `actioncode` varchar(20) NOT NULL DEFAULT '',
276
+ `success_action` tinyint(1) unsigned NOT NULL DEFAULT '0'
277
+ COMMENT '0 = NotPerformed, 1 = Performed',
278
+ `cancel_action` tinyint(1) unsigned NOT NULL DEFAULT '0'
279
+ COMMENT '0 = NotPerformed, 1 = Performed',
280
+ `callback_action` tinyint(1) unsigned NOT NULL DEFAULT '0'
281
+ COMMENT '0 = NotPerformed, 1 = Performed',
282
+ `success_error` varchar(100) NOT NULL DEFAULT '',
283
+ `callback_error` varchar(100) NOT NULL DEFAULT '',
284
+ `sysmod` varchar(10) NOT NULL DEFAULT '',
285
+ PRIMARY KEY (`id`),
286
+ KEY `orderid` (`orderid`)
287
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
288
+ );
289
+ }
290
+
291
+ /**
292
+ * Checks returned main fields.
293
+ *
294
+ * @param mixed $mOrder
295
+ * @param bool $bUrlDecode
296
+ * @return int
297
+ */
298
+ final public function api_dibs_checkMainFields($mOrder, $bUrlDecode = TRUE) {
299
+ if(!isset($_POST['orderid'])) return 12;
300
+ $mOrder = $this->helper_dibs_obj_order($mOrder, TRUE);
301
+ if(!$mOrder->orderid) return 11;
302
+
303
+ if(!isset($_POST['amount'])) return 22;
304
+ $iAmount = (isset($_POST['voucherAmount']) && $_POST['voucherAmount'] > 0) ?
305
+ $_POST['amountOriginal'] : $_POST['amount'];
306
+ if(isset($_POST['s_pw']) && $_POST['s_pw'] == 3 &&
307
+ isset($_POST['fee']) && $_POST['fee'] > 0) $iAmount = $iAmount - $_POST['fee'];
308
+ if(abs((int)$iAmount - (int)self::api_dibs_round($mOrder->amount)) >= 0.01) return 21;
309
+ if(!isset($_POST['currency'])) return 32;
310
+ if((int)$mOrder->currency != (int)$_POST['currency']) return 31;
311
+
312
+ $sHMAC = $this->helper_dibs_tools_conf('hmac');
313
+ if(!empty($sHMAC) && self::api_dibs_checkMAC($sHMAC, $bUrlDecode) !== TRUE) return 41;
314
+
315
+ return 0;
316
+ }
317
+
318
+ /**
319
+ * Returns text representation of array code.
320
+ *
321
+ * @param int $iErrCode
322
+ * @return string
323
+ */
324
+ function api_dibs_errCodeToMessage($iErrCode) {
325
+ return "<h3>" . $this->helper_dibs_tools_lang('txt_err_fatal') . "</h3>\n" .
326
+ 'Error code: ' . $iErrCode . ". <br>\n Error message: " .
327
+ $this->helper_dibs_tools_lang('txt_err_' . $iErrCode) . "\n<br><br>\n" .
328
+ "<input type=\"button\" onclick=window.location.replace('" .
329
+ $this->helper_dibs_tools_url($this->helper_dibs_obj_urls()->carturl) .
330
+ "') value=\" " . $this->helper_dibs_tools_lang('txt_msg_toshop') . " \">";
331
+ }
332
+
333
+ /**
334
+ * Processes success redirect from payment gateway.
335
+ *
336
+ * @param mixed $mOrder
337
+ */
338
+ final public function api_dibs_action_success($mOrder) {
339
+ $iErr = $this->api_dibs_checkMainFields($mOrder);
340
+ if(empty($iErr)) {
341
+ $this->api_dibs_updateResultRow(array('success_action' => '1', 'success_error' => ''));
342
+ }
343
+ else {
344
+ $this->api_dibs_updateResultRow(array('success_error' => 'Errno: ' . $iErr));
345
+ echo $this->api_dibs_errCodeToMessage($iErr);
346
+ exit();
347
+ }
348
+ }
349
+
350
+ /**
351
+ * Processes cancel from payment gateway.
352
+ */
353
+ final public function api_dibs_action_cancel() {
354
+ if(isset($_POST['orderid']) && !empty($_POST['orderid'])) {
355
+ $this->api_dibs_updateResultRow(array('cancel_action' => '1'));
356
+ }
357
+ }
358
+
359
+ /**
360
+ * Processes callback from payment gateway.
361
+ *
362
+ * @param mixed $mOrder
363
+ */
364
+ final public function api_dibs_action_callback($mOrder) {
365
+ $iErr = $this->api_dibs_checkMainFields($mOrder, FALSE);
366
+ if(!empty($iErr)) {
367
+ if($iErr != 11 && $iErr != 12) {
368
+ $this->api_dibs_updateResultRow(array('callback_error' => 'Errno: ' . $iErr));
369
+ }
370
+ exit((string)$iErr);
371
+ }
372
+
373
+ $sQuery = "SELECT `status` FROM `" . $this->helper_dibs_tools_prefix() .
374
+ self::api_dibs_get_tableName() . "`
375
+ WHERE `orderid` = '" . self::api_dibs_sqlEncode($_POST['orderid']) . "'
376
+ LIMIT 1;";
377
+ if($this->helper_dibs_db_read_single($sQuery, 'status') == 0) {
378
+ $aFields = array('callback_action' => 1);
379
+ $aResponse = $_POST;
380
+ $iPayMethod = $this->api_dibs_get_method(TRUE);
381
+ foreach(self::$aRespFields as $sDbKey => $mPostKey) {
382
+ if(is_array($mPostKey)) {
383
+ $sPostKey = isset($mPostKey[$iPayMethod]) ? $mPostKey[$iPayMethod] : '';
384
+ }
385
+ else $sPostKey = $mPostKey;
386
+ unset($mPostKey);
387
+
388
+ if(!empty($sPostKey) && isset($_POST[$sPostKey])) {
389
+ unset($aResponse[$sPostKey]);
390
+ $aFields[$sDbKey] = $_POST[$sPostKey];
391
+ }
392
+ }
393
+ $aFields['ext_info'] = serialize($aResponse);
394
+ unset($aResponse, $sDbKey, $sPostKey);
395
+ $this->api_dibs_updateResultRow($aFields);
396
+
397
+ if(method_exists($this, 'helper_dibs_hook_callback')) {
398
+ $this->helper_dibs_hook_callback($mOrder);
399
+ }
400
+ }
401
+ else $this->api_dibs_updateResultRow(array('callback_error' => 'Err: status not 0.'));
402
+ exit();
403
+ }
404
+
405
+ /**
406
+ * Updates from array one order row in dibs results table.
407
+ *
408
+ * @param array $aFields
409
+ */
410
+ private function api_dibs_updateResultRow($aFields) {
411
+ if(isset($_POST['orderid']) && !empty($_POST['orderid'])) {
412
+ $sUpdate = "";
413
+ foreach($aFields as $sCell => $sVal) {
414
+ $sUpdate .= "`" . $sCell . "`=" . "'" . self::api_dibs_sqlEncode($sVal) . "',";
415
+ }
416
+
417
+ $this->helper_dibs_db_write(
418
+ "UPDATE `" . $this->helper_dibs_tools_prefix() . self::api_dibs_get_tableName() . "`
419
+ SET " . rtrim($sUpdate, ",") . "
420
+ WHERE `orderid` = '" . self::api_dibs_sqlEncode($_POST['orderid']) . "'
421
+ LIMIT 1;"
422
+ );
423
+ }
424
+ }
425
+
426
+ /** DIBS API TOOLS START **/
427
+ /**
428
+ * Calculates MAC for given array of data.
429
+ *
430
+ * @param array $aData
431
+ * @param string $sHMAC
432
+ * @param bool $bUrlDecode
433
+ * @return string
434
+ */
435
+ final public static function api_dibs_calcMAC($aData, $sHMAC, $bUrlDecode = FALSE) {
436
+ $sMAC = "";
437
+ if(!empty($sHMAC)) {
438
+ $sData = "";
439
+ if(isset($aData['MAC'])) unset($aData['MAC']);
440
+ ksort($aData);
441
+ foreach($aData as $sKey => $sVal) {
442
+ $sData .= "&" . $sKey . "=" . (($bUrlDecode === TRUE) ? urldecode($sVal) : $sVal);
443
+ }
444
+ $sMAC = hash_hmac("sha256", ltrim($sData, "&"), self::api_dibs_hextostr($sHMAC));
445
+ }
446
+ return $sMAC;
447
+ }
448
+
449
+
450
+ /**
451
+ * Compare calculated MAC with MAC from response urldecode response if second parameter is TRUE.
452
+ *
453
+ * @param string $sHMAC
454
+ * @param bool $bUrlDecode
455
+ * @return bool
456
+ */
457
+ final public static function api_dibs_checkMAC($sHMAC, $bUrlDecode = FALSE) {
458
+ $_POST['MAC'] = isset($_POST['MAC']) ? $_POST['MAC'] : "";
459
+ return ($_POST['MAC'] == self::api_dibs_calcMAC($_POST, $sHMAC, $bUrlDecode)) ?
460
+ TRUE : FALSE;
461
+ }
462
+
463
+ /**
464
+ * Returns ISO to DIBS currency array.
465
+ *
466
+ * @return array
467
+ */
468
+ final public static function api_dibs_get_currencyArray() {
469
+ return self::$aCurrency;
470
+ }
471
+
472
+ /**
473
+ * Getter for table name.
474
+ *
475
+ * @return string
476
+ */
477
+ final public static function api_dibs_get_tableName() {
478
+ return self::$sDibsTable;
479
+ }
480
+
481
+ /**
482
+ * Gets value by code from currency array. Supports fliped values.
483
+ *
484
+ * @param string $sCode
485
+ * @param bool $bFlip
486
+ * @return string
487
+ */
488
+ final public static function api_dibs_get_currencyValue($sCode, $bFlip = FALSE) {
489
+ $aCurrency = self::api_dibs_get_currencyArray();
490
+ if($bFlip === TRUE) $aCurrency = array_flip($aCurrency);
491
+ return isset($aCurrency[$sCode]) ? $aCurrency[$sCode] :
492
+ $aCurrency[self::$sDefaultCurr[$bFlip === TRUE ? 1 : 0]];
493
+ }
494
+
495
+ /**
496
+ * Convert hex HMAC to string.
497
+ *
498
+ * @param string $sHex
499
+ * @return string
500
+ */
501
+ private static function api_dibs_hextostr($sHex) {
502
+ $sRes = "";
503
+ foreach(explode("\n", trim(chunk_split($sHex,2))) as $h) $sRes .= chr(hexdec($h));
504
+ return $sRes;
505
+ }
506
+
507
+ /**
508
+ * Replaces sql-service quotes to simple quotes and escapes them by slashes.
509
+ *
510
+ * @param string $sVal
511
+ * @return string
512
+ */
513
+ public static function api_dibs_sqlEncode($sVal) {
514
+ return addslashes(str_replace("`", "'", trim(strip_tags((string)$sVal))));
515
+ }
516
+
517
+ /**
518
+ * Returns integer representation of amont. Saves two signs that are
519
+ * after floating point in float number by multiplication by 100.
520
+ * E.g.: converts to cents in money context.
521
+ * Workarround of float to int casting.
522
+ *
523
+ * @param float $fNum
524
+ * @return int
525
+ */
526
+ public static function api_dibs_round($fNum, $iPrec = 2) {
527
+ return empty($fNum) ? (int)0 : (int)(string)(round($fNum, $iPrec) * pow(10, $iPrec));
528
+ }
529
+
530
+ /**
531
+ * Fixes UTF-8 special symbols if encoding of CMS is not UTF-8.
532
+ * Main using is for wided latin alphabets.
533
+ *
534
+ * @param string $sText
535
+ * @return string
536
+ */
537
+ public static function api_dibs_utf8Fix($sText) {
538
+ return (mb_detect_encoding($sText) == "UTF-8" && mb_check_encoding($sText, "UTF-8")) ?
539
+ $sText : utf8_encode($sText);
540
+ }
541
+
542
+ /**
543
+ * Detects mobile device by user-agent and received headers.
544
+ *
545
+ * @return bool
546
+ */
547
+ private static function api_dibs_detectMobile() {
548
+ $sUserAgent = strtolower(getenv('HTTP_USER_AGENT'));
549
+ $sAccept = strtolower(getenv('HTTP_ACCEPT'));
550
+
551
+ if(strpos($sAccept,'text/vnd.wap.wml') !== FALSE ||
552
+ strpos($sAccept,'application/vnd.wap.xhtml+xml') !== FALSE ||
553
+ isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) return TRUE;
554
+
555
+ if(preg_match('/(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|' .
556
+ 'lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|' .
557
+ 'vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|' .
558
+ 'samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|' .
559
+ 'mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|'.
560
+ 'i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|' .
561
+ 's302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|' .
562
+ 'mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|' .
563
+ 'foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|' .
564
+ 'me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|' .
565
+ 'm50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |' .
566
+ 'sonyericsson|samsung|240x|x320vx10|nokia|sony cmd|motorola|up.browser|' .
567
+ 'up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|' .
568
+ 'psp|treo)/', $sUserAgent)) return TRUE;
569
+
570
+ if(in_array(substr($sUserAgent, 0, 4),
571
+ array("1207", "3gso", "4thp", "501i", "502i", "503i", "504i", "505i", "506i", "6310",
572
+ "6590", "770s", "802s", "a wa", "abac", "acer", "acoo", "acs-", "aiko", "airn",
573
+ "alav", "alca", "alco", "amoi", "anex", "anny", "anyw", "aptu", "arch", "argo",
574
+ "aste", "asus", "attw", "au-m", "audi", "aur ", "aus ", "avan", "beck", "bell",
575
+ "benq", "bilb", "bird", "blac", "blaz", "brew", "brvw", "bumb", "bw-n", "bw-u",
576
+ "c55/", "capi", "ccwa", "cdm-", "cell", "chtm", "cldc", "cmd-", "cond", "craw",
577
+ "dait", "dall", "dang", "dbte", "dc-s", "devi", "dica", "dmob", "doco", "dopo",
578
+ "ds-d", "ds12", "el49", "elai", "eml2", "emul", "eric", "erk0", "esl8", "ez40",
579
+ "ez60", "ez70", "ezos", "ezwa", "ezze", "fake", "fetc", "fly-", "fly_", "g-mo",
580
+ "g1 u", "g560", "gene", "gf-5", "go.w", "good", "grad", "grun", "haie", "hcit",
581
+ "hd-m", "hd-p", "hd-t", "hei-", "hiba", "hipt", "hita", "hp i", "hpip", "hs-c",
582
+ "htc ", "htc-", "htc_", "htca", "htcg", "htcp", "htcs", "htct", "http", "huaw",
583
+ "hutc", "i-20", "i-go", "i-ma", "i230", "iac", "iac-", "iac/", "ibro", "idea",
584
+ "ig01", "ikom", "im1k", "inno", "ipaq", "iris", "jata", "java", "jbro", "jemu",
585
+ "jigs", "kddi", "keji", "kgt", "kgt/", "klon", "kpt ", "kwc-", "kyoc", "kyok",
586
+ "leno", "lexi", "lg g", "lg-a", "lg-b", "lg-c", "lg-d", "lg-f", "lg-g", "lg-k",
587
+ "lg-l", "lg-m", "lg-o", "lg-p", "lg-s", "lg-t", "lg-u", "lg-w", "lg/k", "lg/l",
588
+ "lg/u", "lg50", "lg54", "lge-", "lge/", "libw", "lynx", "m-cr", "m1-w", "m3ga",
589
+ "m50/", "mate", "maui", "maxo", "mc01", "mc21", "mcca", "medi", "merc", "meri",
590
+ "midp", "mio8", "mioa", "mits", "mmef", "mo01", "mo02", "mobi", "mode", "modo",
591
+ "mot ", "mot-", "moto", "motv", "mozz", "mt50", "mtp1", "mtv ", "mwbp", "mywa",
592
+ "n100", "n101", "n102", "n202", "n203", "n300", "n302", "n500", "n502", "n505",
593
+ "n700", "n701", "n710", "nec-", "nem-", "neon", "netf", "newg", "newt", "nok6",
594
+ "noki", "nzph", "o2 x", "o2-x", "o2im", "opti", "opwv", "oran", "owg1", "p800",
595
+ "palm", "pana", "pand", "pant", "pdxg", "pg-1", "pg-2", "pg-3", "pg-6", "pg-8",
596
+ "pg-c", "pg13", "phil", "pire", "play", "pluc", "pn-2", "pock", "port", "pose",
597
+ "prox", "psio", "pt-g", "qa-a", "qc-2", "qc-3", "qc-5", "qc-7", "qc07", "qc12",
598
+ "qc21", "qc32", "qc60", "qci-", "qtek", "qwap", "r380", "r600", "raks", "rim9",
599
+ "rove", "rozo", "s55/", "sage", "sama", "samm", "sams", "sany", "sava", "sc01",
600
+ "sch-", "scoo", "scp-", "sdk/", "se47", "sec-", "sec0", "sec1", "semc", "send",
601
+ "seri", "sgh-", "shar", "sie-", "siem", "sk-0", "sl45", "slid", "smal", "smar",
602
+ "smb3", "smit", "smt5", "soft", "sony", "sp01", "sph-", "spv ", "spv-", "sy01",
603
+ "symb", "t-mo", "t218", "t250", "t600", "t610", "t618", "tagt", "talk", "tcl-",
604
+ "tdg-", "teli", "telm", "tim-", "topl", "tosh", "treo", "ts70", "tsm-", "tsm3",
605
+ "tsm5", "tx-9", "up.b", "upg1", "upsi", "utst", "v400", "v750", "veri", "virg",
606
+ "vite", "vk-v", "vk40", "vk50", "vk52", "vk53", "vm40", "voda", "vulc", "vx52",
607
+ "vx53", "vx60", "vx61", "vx70", "vx80", "vx81", "vx83", "vx85", "vx98", "w3c ",
608
+ "w3c-", "wap-", "wapa", "wapi", "wapj", "wapm", "wapp", "wapr", "waps", "wapt",
609
+ "wapu", "wapv", "wapy", "webc", "whit", "wig ", "winc", "winw", "wmlb", "wonu",
610
+ "x700", "xda-", "xda2", "xdag", "yas-", "your", "zeto", "zte-"))) return TRUE;
611
+
612
+ return FALSE;
613
+ }
614
+ /** DIBS API TOOLS END **/
615
+ }
616
+ ?>
app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_interface {
3
+
4
+ /**
5
+ * Process write SQL query (insert, update, delete) with build-in CMS ADO engine.
6
+ *
7
+ * @param string $sQuery
8
+ */
9
+ function helper_dibs_db_write($sQuery) {
10
+ $oWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
11
+ return $oWrite->query($sQuery);
12
+ }
13
+
14
+ /**
15
+ * Read single value ($sName) from SQL select result.
16
+ * If result with name $sName not found null returned.
17
+ *
18
+ * @param string $sQuery
19
+ * @param string $sName
20
+ * @return mixed
21
+ */
22
+ function helper_dibs_db_read_single($sQuery, $sName) {
23
+ $oRead = Mage::getSingleton('core/resource')->getConnection('core_read');
24
+ $mResult = $oRead->fetchRow($sQuery);
25
+ return isset($mResult[$sName]) ? $mResult[$sName] : null;
26
+ }
27
+
28
+ /**
29
+ * Return settings with CMS method.
30
+ *
31
+ * @param string $sVar
32
+ * @param string $sPrefix
33
+ * @return string
34
+ */
35
+ function helper_dibs_tools_conf($sVar, $sPrefix = 'DIBSPW_') {
36
+ return $this->getConfigData($sPrefix . $sVar);
37
+ }
38
+
39
+ /**
40
+ * Return CMS DB table prefix.
41
+ *
42
+ * @return string
43
+ */
44
+ function helper_dibs_tools_prefix() {
45
+ return Mage::getConfig()->getTablePrefix();
46
+ }
47
+
48
+ /**
49
+ * Returns text by key using CMS engine.
50
+ *
51
+ * @param type $sKey
52
+ * @return type
53
+ */
54
+ function helper_dibs_tools_lang($sKey) {
55
+ return Mage::helper('dibspw')->__('dibspw_' . $sKey);
56
+ }
57
+
58
+ /**
59
+ * Get full CMS url for page.
60
+ *
61
+ * @param string $sLink
62
+ * @return string
63
+ */
64
+ function helper_dibs_tools_url($sLink) {
65
+ return Mage::getUrl($sLink);
66
+ }
67
+
68
+ /**
69
+ * Build CMS order information to API object.
70
+ *
71
+ * @param mixed $mOrderInfo
72
+ * @param bool $bResponse
73
+ * @return object
74
+ */
75
+ function helper_dibs_obj_order($mOrderInfo, $bResponse = FALSE) {
76
+ if($bResponse === TRUE) {
77
+ $mOrderInfo->loadByIncrementId((int)$_POST['orderid']);
78
+ }
79
+
80
+ return (object)array(
81
+ 'orderid' => $mOrderInfo->getRealOrderId(),
82
+ 'amount' => $mOrderInfo->getTotalDue(),
83
+ 'currency' => $this->api_dibs_get_currencyValue(
84
+ $mOrderInfo->getOrderCurrency()->getCode()
85
+ )
86
+ );
87
+ }
88
+
89
+ /**
90
+ * Build CMS each ordered item information to API object.
91
+ *
92
+ * @param mixed $mOrderInfo
93
+ * @return object
94
+ */
95
+ function helper_dibs_obj_items($mOrderInfo) {
96
+ $aItems = array();
97
+ foreach($mOrderInfo->getAllItems() as $oItem) {
98
+ $aItems[] = (object)array(
99
+ 'id' => $oItem->getProductId(),
100
+ 'name' => $oItem->getName(),
101
+ 'sku' => $oItem->getSku(),
102
+ 'price' => $oItem->getPrice(),
103
+ 'qty' => $oItem->getQtyOrdered(),
104
+ 'tax' => $oItem->getTaxPercent()
105
+ );
106
+ }
107
+ return $aItems;
108
+ }
109
+
110
+ /**
111
+ * Build CMS shipping information to API object.
112
+ *
113
+ * @param mixed $mOrderInfo
114
+ * @return object
115
+ */
116
+ function helper_dibs_obj_ship($mOrderInfo) {
117
+ return (object)array(
118
+ 'rate' => isset($mOrderInfo['shipping_amount']) ?
119
+ $mOrderInfo['shipping_amount'] : (int)0,
120
+ 'tax' => $this->cms_get_shippingTaxPercent($mOrderInfo)
121
+ );
122
+ }
123
+
124
+ /**
125
+ * Build CMS customer addresses to API object.
126
+ *
127
+ * @param mixed $mOrderInfo
128
+ * @return object
129
+ */
130
+ function helper_dibs_obj_addr($mOrderInfo) {
131
+ $aShipping = $mOrderInfo->getShippingAddress();
132
+ $aBilling = $mOrderInfo->getBillingAddress();
133
+
134
+ return (object)array(
135
+ 'shippingfirstname' => $aShipping['firstname'],
136
+ 'shippinglastname' => $aShipping['lastname'],
137
+ 'shippingpostalcode' => $aShipping['postcode'],
138
+ 'shippingpostalplace'=> $aShipping['city'],
139
+ 'shippingaddress2' => $aShipping['street'],
140
+ 'shippingaddress' => $aShipping['country_id'] . " " .
141
+ $aShipping['region'],
142
+
143
+ 'billingfirstname' => $aBilling['firstname'],
144
+ 'billinglastname' => $aBilling['lastname'],
145
+ 'billingpostalcode' => $aBilling['postcode'],
146
+ 'billingpostalplace' => $aBilling['city'],
147
+ 'billingaddress2' => $aBilling['street'],
148
+ 'billingaddress' => $aBilling['country_id'] . " " .
149
+ $aBilling['region'],
150
+
151
+ 'billingmobile' => $aBilling['telephone'],
152
+ 'billingemail' => $mOrderInfo['customer_email']
153
+ );
154
+ }
155
+
156
+ /**
157
+ * Returns object with URLs needed for API,
158
+ * e.g.: callbackurl, acceptreturnurl, etc.
159
+ *
160
+ * @param mixed $mOrderInfo
161
+ * @return object
162
+ */
163
+ function helper_dibs_obj_urls($mOrderInfo = null) {
164
+ return (object)array(
165
+ 'acceptreturnurl' => "Dibspw/Dibspw/success",
166
+ 'callbackurl' => "Dibspw/Dibspw/callback",
167
+ 'cancelreturnurl' => "Dibspw/Dibspw/cancel",
168
+ 'carturl' => "customer/account/index"
169
+ );
170
+ }
171
+
172
+ /**
173
+ * Returns object with additional information to send with payment.
174
+ *
175
+ * @param mixed $mOrderInfo
176
+ * @return object
177
+ */
178
+ function helper_dibs_obj_etc($mOrderInfo) {
179
+ return (object)array(
180
+ 'sysmod' => 'mgn1_4_1_0',
181
+ 'callbackfix' => $this->helper_dibs_tools_url("Dibspw/Dibspw/callback")
182
+ );
183
+ }
184
+
185
+ function helper_dibs_hook_callback($oOrder) {
186
+ $session = Mage::getSingleton('checkout/session');
187
+ $session->setQuoteId($session->getDibspwStandardQuoteId(true));
188
+
189
+ if (((int)$this->helper_dibs_tools_conf('sendmailorderconfirmation', '')) == 1) {
190
+ $oOrder->sendNewOrderEmail();
191
+ }
192
+
193
+ $this->removeFromStock();
194
+ $this->setOrderStatusAfterPayment();
195
+ $session->setQuoteId($session->getDibspwStandardQuoteId(true));
196
+ }
197
+ }
198
+ ?>
app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers_cms.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class dibs_pw_helpers_cms extends Mage_Payment_Model_Method_Abstract {
3
+ protected $_code = 'Dibspw';
4
+
5
+ protected $cms_TextArray = array(
6
+ 'txt_err_fatal' => 'A fatal error has occured!',
7
+ 'txt_msg_toshop' => 'Return to shop',
8
+ 'txt_err_11' => 'Unknown orderid was returned from DIBS payment gateway!',
9
+ 'txt_err_12' => 'No orderid was returned from DIBS payment gateway!',
10
+ 'txt_err_21' => 'The amount received from DIBS payment gateway
11
+ differs from original order amount!',
12
+ 'txt_err_22' => 'No amount was returned from DIBS payment gateway!',
13
+ 'txt_err_31' => 'The currency type received from DIBS payment gateway
14
+ differs from original order currency type!',
15
+ 'txt_err_32' => 'No currency type was returned from DIBS payment
16
+ gateway!',
17
+ 'txt_err_41' => 'The fingerprint key does not match!',
18
+ 'txt_err_def' => 'Unknown error appeared. Please contact to shop
19
+ administration to check transaction.'
20
+ );
21
+
22
+ function cms_get_shippingTaxPercent($oOrder) {
23
+ if($oOrder['shipping_tax_amount'] == 0 || $oOrder['shipping_amount'] == 0) return 0;
24
+ else {
25
+ return ($oOrder['shipping_tax_amount'] * 100) / $oOrder['shipping_amount'];
26
+ }
27
+ }
28
+
29
+ public function cms_get_imghtml($item) {
30
+ return '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/' .
31
+ preg_replace("/\(\)_/s", "", strtolower($item)) . '.gif') .
32
+ '" border="0" />&nbsp;&nbsp;';
33
+ }
34
+
35
+ public function setOrderStatusAfterPayment(){
36
+ $order = Mage::getModel('sales/order');
37
+ $order->loadByIncrementId($_REQUEST['orderid']);
38
+ $order->setState($this->getConfigData('order_status_after_payment'),
39
+ true,
40
+ Mage::helper('dibspw')->__('DIBSPW_LABEL_22'));
41
+ // $order->addStatusToHistory($this->oDibsModel->getConfigData('order_status_after_payment'),
42
+ // $this->__('DIBSPW_LABEL_22'));
43
+ $order->save();
44
+ }
45
+
46
+ function removeFromStock() {
47
+ // Load the session object
48
+ $session = Mage::getSingleton('checkout/session');
49
+ $session->setDibspwStandardQuoteId($session->getQuoteId());
50
+
51
+ // Load the order object
52
+ $order = Mage::getModel('sales/order');
53
+ $order->loadByIncrementId($_POST['orderid']);
54
+
55
+ // remove items from stock
56
+ // http://www.magentocommerce.com/wiki/groups/132/protx_form_-_subtracting_stock_on_successful_payment
57
+ if (((int)$this->getConfigData('handlestock')) == 1) {
58
+ $items = $order->getAllItems(); // Get all items from the order
59
+ if ($items) {
60
+ foreach($items as $item) {
61
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
62
+ $product_id = $item->getProductId(); // get it's ID
63
+ // Load the stock for this product
64
+ $stock = Mage::getModel('cataloginventory/stock_item')
65
+ ->loadByProduct($product_id);
66
+ $stock->setQty($stock->getQty()-$quantity); // Set to new Qty
67
+ $stock->save(); // Save
68
+ continue;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ ?>
app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers_interface.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ interface dibs_pw_helpers_interface {
3
+ function helper_dibs_db_write($sQuery);
4
+ function helper_dibs_db_read_single($mResult, $sName);
5
+ function helper_dibs_tools_conf($sVar);
6
+ function helper_dibs_tools_prefix();
7
+ function helper_dibs_tools_lang($sKey);
8
+ function helper_dibs_tools_url($sLink);
9
+ function helper_dibs_obj_order($mOrderInfo, $bResponse = FALSE);
10
+ function helper_dibs_obj_items($mOrderInfo);
11
+ function helper_dibs_obj_ship($mOrderInfo);
12
+ function helper_dibs_obj_addr($mOrderInfo);
13
+ function helper_dibs_obj_urls($mOrderInfo = null);
14
+ function helper_dibs_obj_etc($mOrderInfo);
15
+ }
16
+ ?>
app/code/community/Dibspw/Dibspw/controllers/DibspwController.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dibs A/S
4
+ * Dibs Payment Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payments & Gateways Extensions
17
+ * @package Dibspw_Dibspw
18
+ * @author Dibs A/S
19
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ /**
24
+ * Payment Controller
25
+ **/
26
+
27
+ class Dibspw_Dibspw_DibspwController extends Mage_Core_Controller_Front_Action {
28
+ protected $_order;
29
+ private $oDibsModel;
30
+
31
+ function _construct() {
32
+ $this->oDibsModel= Mage::getModel('dibspw/Dibspw');
33
+ }
34
+
35
+ protected function _expireAjax(){
36
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
37
+ $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
38
+ exit;
39
+ }
40
+ }
41
+
42
+ public function addToStock() {
43
+ // Load the session object
44
+ $session = Mage::getSingleton('checkout/session');
45
+ $session->setDibspwStandardQuoteId($session->getQuoteId());
46
+
47
+ // Load the order object
48
+ $order = $this->getOrder();
49
+
50
+ // add items back on stock
51
+ // Put the order back on stock as it is not yet paid!
52
+ // http://www.magentocommerce.com/wiki/groups/132/protx_form_-_subtracting_stock_on_successful_payment
53
+
54
+ if (((int)$this->oDibsModel->getConfigData('handlestock')) == 1) {
55
+ if(!isset($_SESSION['stock_removed']) ||
56
+ $_SESSION['stock_removed'] != $session->getLastRealOrderId()) {
57
+ /* Put the stock back on, we don't want it taken off yet */
58
+ $items = $order->getAllItems(); // Get all items from the order
59
+ if ($items) {
60
+ foreach($items as $item) {
61
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
62
+ $product_id = $item->getProductId(); // get it's ID
63
+ // Load the stock for this product
64
+ $stock = Mage::getModel('cataloginventory/stock_item')
65
+ ->loadByProduct($product_id);
66
+ $stock->setQty($stock->getQty()+$quantity); // Set to new Qty
67
+ $stock->save(); // Save
68
+ continue;
69
+ }
70
+ }
71
+
72
+ // Flag so that stock is only updated once!
73
+ $_SESSION['stock_removed'] = $session->getLastRealOrderId();
74
+
75
+ }
76
+ }
77
+ }
78
+
79
+ // Remove from stock (if used)
80
+ public function redirectAction(){
81
+ // Load the session object
82
+ $session = Mage::getSingleton('checkout/session');
83
+ $session->setDibspwQuoteId($session->getQuoteId());
84
+
85
+ // Create the POST to DIBS (Inside Magento Checkout)
86
+ $this->loadLayout();
87
+ $this->getLayout()->getBlock('content')->append($this->getLayout()->createBlock('dibspw/redirect'));
88
+ $this->renderLayout();
89
+
90
+ // Create the POST to DIBS (In Separate "Blank" Window)
91
+ // $this->getResponse()->setBody($this->getLayout()->createBlock('Dibspw/redirect')->toHtml());
92
+
93
+ // Save order comment
94
+ $order = Mage::getModel('sales/order');
95
+ $order->loadByIncrementId($session->getLastRealOrderId());
96
+ $order->addStatusToHistory($order->getStatus(),$this->__('DIBSPW_LABEL_3'));
97
+ $order->save();
98
+
99
+ // Add items back on stock (if used)
100
+ $this->addToStock();
101
+ }
102
+
103
+ public function getOrder (){
104
+ if ($this->_order == null) {
105
+ $session = Mage::getSingleton('checkout/session');
106
+ $this->_order = Mage::getModel('sales/order');
107
+ $this->_order->loadByIncrementId($session->getLastRealOrderId());
108
+ }
109
+ return $this->_order;
110
+ }
111
+
112
+ public function successAction() {
113
+ $session = Mage::getSingleton('checkout/session');
114
+ $session->setQuoteId($session->getDibspwStandardQuoteId(true));
115
+ $order = Mage::getModel('sales/order');
116
+ $fields = array();
117
+
118
+ $this->oDibsModel->api_dibs_action_success($order);
119
+ Mage::app()->getFrontController()->getResponse()->setRedirect(
120
+ $this->oDibsModel->helper_dibs_tools_url('checkout/onepage/success')
121
+ );
122
+ }
123
+
124
+ public function callbackAction() {
125
+ $order = Mage::getModel('sales/order');
126
+ $this->oDibsModel->api_dibs_action_callback($order);
127
+ }
128
+
129
+ /**
130
+ * When a customer cancel payment from dibs.
131
+ */
132
+ public function cancelAction() {
133
+ $session = Mage::getSingleton('checkout/session');
134
+ $session->setQuoteId($session->getDibspwStandardQuoteId(true));
135
+ $fields = array();
136
+
137
+ // Save order comment
138
+ $order = Mage::getModel('sales/order');
139
+
140
+ if (isset($_POST['orderid'])) {
141
+ $order->loadByIncrementId((int)$_REQUEST['orderid']);
142
+ $order->registerCancellation($this->__('DIBSPW_LABEL_20'));
143
+ $order->save();
144
+
145
+ // Add items back on stock (if used)
146
+ $this->oDibsModel->removeFromStock();
147
+ $this->oDibsModel->api_dibs_action_cancel();
148
+
149
+ }
150
+ // Give back cart to customer for new attempt to buy
151
+ Mage::app()->getFrontController()->getResponse()->setRedirect(
152
+ $this->oDibsModel->helper_dibs_tools_url('checkout/cart')
153
+ );
154
+ }
155
+ }
app/code/community/Dibspw/Dibspw/etc/config.xml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Dibspw_Dibspw>
27
+ <version>4.1.0</version>
28
+ <depends>
29
+ <Mage_Paygate />
30
+ </depends>
31
+ </Dibspw_Dibspw>
32
+ </modules>
33
+ <global>
34
+ <blocks>
35
+ <dibspw>
36
+ <class>Dibspw_Dibspw_Block</class>
37
+ </dibspw>
38
+ </blocks>
39
+ <models>
40
+ <dibspw>
41
+ <class>Dibspw_Dibspw_Model</class>
42
+ <resourceModel>dibspw_mysql4</resourceModel>
43
+ </dibspw>
44
+ <dibspw_mysql4>
45
+ <class>Dibspw_Dibspw_Model_Mysql4</class>
46
+ <entities>
47
+ <api_debug>
48
+ <table>dibspw_api_debug</table>
49
+ </api_debug>
50
+ </entities>
51
+ </dibspw_mysql4>
52
+ </models>
53
+ <helpers>
54
+ <dibspw>
55
+ <class>Dibspw_Dibspw_Helper</class>
56
+ </dibspw>
57
+ </helpers>
58
+ <resources>
59
+ <dibspw_setup>
60
+ <setup>
61
+ <module>Dibspw_Dibspw</module>
62
+ </setup>
63
+ <connection>
64
+ <use>core_setup</use>
65
+ </connection>
66
+ </dibspw_setup>
67
+ <dibspw_write>
68
+ <connection>
69
+ <use>core_write</use>
70
+ </connection>
71
+ </dibspw_write>
72
+ <dibspw_read>
73
+ <connection>
74
+ <use>core_read</use>
75
+ </connection>
76
+ </dibspw_read>
77
+ </resources>
78
+ </global>
79
+ <frontend>
80
+ <routers>
81
+ <Dibspw>
82
+ <use>standard</use>
83
+ <args>
84
+ <module>Dibspw_Dibspw</module>
85
+ <frontName>Dibspw</frontName>
86
+ </args>
87
+ </Dibspw>
88
+ </routers>
89
+ </frontend>
90
+ <frontend>
91
+ <translate>
92
+ <modules>
93
+ <Mage_Dibspw>
94
+ <files>
95
+ <default>Mage_Dibspw.csv</default>
96
+ </files>
97
+ </Mage_Dibspw>
98
+ </modules>
99
+ </translate>
100
+ </frontend>
101
+ <adminhtml>
102
+ <translate>
103
+ <modules>
104
+ <Mage_Dibspw>
105
+ <files>
106
+ <default>Mage_Dibspw.csv</default>
107
+ </files>
108
+ </Mage_Dibspw>
109
+ </modules>
110
+ </translate>
111
+ </adminhtml>
112
+ <default>
113
+ <payment>
114
+ <Dibspw>
115
+ <active>0</active>
116
+ <url_failure>checkout/cart</url_failure>
117
+ <url_accept>checkout/success</url_accept>
118
+ <url_callback>checkout/cart</url_callback>
119
+ <model>dibspw/Dibspw</model>
120
+ <order_status>pending</order_status>
121
+ <order_status_after_payment>processing</order_status_after_payment>
122
+ <DIBSPW_testmode>1</DIBSPW_testmode>
123
+ <title>DIBS Payment Window | Secure Payment Services</title>
124
+ <DIBSPW_uniq>no</DIBSPW_uniq>
125
+ <DIBSPW_voucher>no</DIBSPW_voucher>
126
+ <DIBSPW_fee>no</DIBSPW_fee>
127
+ <DIBSPW_paytype>VISA,MC</DIBSPW_paytype>
128
+ <DIBSPW_method>2</DIBSPW_method>
129
+ <DIBSPW_lang>en_UK</DIBSPW_lang>
130
+ <sendmailorderconfirmation>1</sendmailorderconfirmation>
131
+ <dibspwlogos>DIBS</dibspwlogos>
132
+ <handlestock>1</handlestock>
133
+ <DIBSPW_distr>empty</DIBSPW_distr>
134
+ </Dibspw>
135
+ </payment>
136
+ </default>
137
+ </config>
app/code/community/Dibspw/Dibspw/etc/system.xml ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <sections>
26
+ <payment translate="label" module="payment">
27
+ <groups>
28
+ <Dibspw translate="label">
29
+ <label>DIBS Payment Window Module</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
+ <fields>
36
+ <active translate="label">
37
+ <label>Enabled</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
+ <title translate="label">
46
+ <label>Title (Payment method name displayed for customers. Ex: DibsGW) </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
+ </title>
53
+ <DIBSPW_mid translate="label">
54
+ <label>DIBS Merchant ID</label>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>3</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </DIBSPW_mid>
61
+ <DIBSPW_method translate="label">
62
+ <label>Payment Window</label>
63
+ <frontend_type>select</frontend_type>
64
+ <source_model>dibspw/system_config_source_paymentwindow</source_model>
65
+ <sort_order>4</sort_order>
66
+ <show_in_default>2</show_in_default>
67
+ <show_in_website>2</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </DIBSPW_method>
70
+ <DIBSPW_HMAC translate="label">
71
+ <label>HMAC Key</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>5</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ </DIBSPW_HMAC>
78
+ <DIBSPW_testmode translate="label">
79
+ <label>Test mode</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>dibspw/System_Config_Source_Dibsyesno</source_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
+ </DIBSPW_testmode>
87
+ <DIBSPW_fee translate="label">
88
+ <label>Add fee</label>
89
+ <frontend_type>select</frontend_type>
90
+ <source_model>dibspw/System_Config_Source_Dibsyesno</source_model>
91
+ <sort_order>7</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>0</show_in_store>
95
+ </DIBSPW_fee>
96
+ <DIBSPW_capturenow translate="label">
97
+ <label>Capture now</label>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>dibspw/System_Config_Source_Dibsyesno</source_model>
100
+ <sort_order>8</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>0</show_in_store>
104
+ </DIBSPW_capturenow>
105
+ <DIBSPW_voucher translate="label">
106
+ <label>Voucher Usage (Mobile PW only)</label>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>dibspw/System_Config_Source_Dibsyesno</source_model>
109
+ <sort_order>9</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>0</show_in_store>
113
+ </DIBSPW_voucher>
114
+ <DIBSPW_uniq translate="label">
115
+ <label>Unique order ID (Mobile PW only)</label>
116
+ <frontend_type>select</frontend_type>
117
+ <source_model>dibspw/System_Config_Source_Dibsyesno</source_model>
118
+ <sort_order>10</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>0</show_in_store>
122
+ </DIBSPW_uniq>
123
+ <DIBSPW_paytype translate="label">
124
+ <label>Paytype</label>
125
+ <frontend_type>text</frontend_type>
126
+ <sort_order>11</sort_order>
127
+ <show_in_default>1</show_in_default>
128
+ <show_in_website>1</show_in_website>
129
+ <show_in_store>0</show_in_store>
130
+ </DIBSPW_paytype>
131
+ <DIBSPW_lang translate="label">
132
+ <label>Language Payment Window</label>
133
+ <frontend_type>select</frontend_type>
134
+ <source_model>dibspw/system_config_source_lang</source_model>
135
+ <sort_order>12</sort_order>
136
+ <show_in_default>2</show_in_default>
137
+ <show_in_website>2</show_in_website>
138
+ <show_in_store>0</show_in_store>
139
+ </DIBSPW_lang>
140
+ <DIBSPW_account translate="label">
141
+ <label>Account</label>
142
+ <frontend_type>text</frontend_type>
143
+ <sort_order>13</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
+ </DIBSPW_account>
148
+ <DIBSPW_distr translate="label">
149
+ <label>Distribution method (Only relevant for PayByBill payment type).</label>
150
+ <frontend_type>select</frontend_type>
151
+ <source_model>dibspw/system_config_source_PBBdistribution</source_model>
152
+ <sort_order>14</sort_order>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>1</show_in_website>
155
+ <show_in_store>0</show_in_store>
156
+ </DIBSPW_distr>
157
+ <order_status translate="label">
158
+ <label>Order status (Before the payment is made)</label>
159
+ <frontend_type>select</frontend_type>
160
+ <source_model>dibspw/System_Config_Source_Orderstatusbefore</source_model>
161
+ <sort_order>15</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>0</show_in_store>
165
+ </order_status>
166
+ <order_status_after_payment translate="label">
167
+ <label>New order status (When the payment is made)</label>
168
+ <frontend_type>select</frontend_type>
169
+ <source_model>dibspw/System_Config_Source_Orderstatusafter</source_model>
170
+ <sort_order>16</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>0</show_in_store>
174
+ </order_status_after_payment>
175
+ <sendmailorderconfirmation translate="label">
176
+ <label>Send Email Order Confirmation. Enabling this setting will result in an email confirmation is send to the cardholder as the payment is made.</label>
177
+ <frontend_type>select</frontend_type>
178
+ <source_model>adminhtml/system_config_source_yesno</source_model>
179
+ <sort_order>17</sort_order>
180
+ <show_in_default>1</show_in_default>
181
+ <show_in_website>1</show_in_website>
182
+ <show_in_store>0</show_in_store>
183
+ </sendmailorderconfirmation>
184
+ <dibslogos translate="label">
185
+ <label>Which logos to show</label>
186
+ <frontend_type>multiselect</frontend_type>
187
+ <source_model>dibspw/system_config_source_dibslogos</source_model>
188
+ <sort_order>18</sort_order>
189
+ <show_in_default>1</show_in_default>
190
+ <show_in_website>1</show_in_website>
191
+ <show_in_store>0</show_in_store>
192
+ </dibslogos>
193
+ <handlestock translate="label">
194
+ <label>Handle stock. The quantity purchased in stock will at first be decremented as the payment is made.</label>
195
+ <frontend_type>select</frontend_type>
196
+ <source_model>adminhtml/system_config_source_yesno</source_model>
197
+ <sort_order>19</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>0</show_in_store>
201
+ </handlestock>
202
+ </fields>
203
+ </Dibspw>
204
+ </groups>
205
+ </payment>
206
+ </sections>
207
+ </config>
app/code/community/Dibspw/Dibspw/sql/dibspw_setup/mysql4-install-4.1.0.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ /**
25
+ * Payment Model
26
+ **/
27
+
28
+ $installer = $this;
29
+
30
+ $installer->startSetup();
31
+ $tableName_CoreResource = Mage::getSingleton('core/resource')->getTableName('core_resource');
32
+ $tableName_SalesFlatOrderPayment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
33
+ $sTablePrefix = Mage::getConfig()->getTablePrefix();
34
+ $installer->run("
35
+ delete from ".$tableName_CoreResource." where code = 'dibspw_setup';
36
+ CREATE TABLE IF NOT EXISTS `" . $sTablePrefix . "dibspw_results` (
37
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
38
+ `orderid` varchar(100) NOT NULL DEFAULT '',
39
+ `status` varchar(10) NOT NULL DEFAULT '0',
40
+ `testmode` tinyint(1) unsigned NOT NULL DEFAULT '0',
41
+ `transaction` varchar(100) NOT NULL DEFAULT '',
42
+ `amount` int(10) unsigned NOT NULL DEFAULT '0',
43
+ `currency` smallint(3) unsigned NOT NULL DEFAULT '0',
44
+ `fee` int(10) unsigned NOT NULL DEFAULT '0',
45
+ `paytype` varchar(32) NOT NULL DEFAULT '',
46
+ `voucheramount` int(10) unsigned NOT NULL DEFAULT '0',
47
+ `amountoriginal` int(10) unsigned NOT NULL DEFAULT '0',
48
+ `ext_info` text,
49
+ `validationerrors` text,
50
+ `capturestatus` varchar(10) NOT NULL DEFAULT '0',
51
+ `actioncode` varchar(20) NOT NULL DEFAULT '',
52
+ `success_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
53
+ `cancel_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
54
+ `callback_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
55
+ `success_error` varchar(100) NOT NULL DEFAULT '',
56
+ `callback_error` varchar(100) NOT NULL DEFAULT '',
57
+ `sysmod` varchar(10) NOT NULL DEFAULT '',
58
+ PRIMARY KEY (`id`),
59
+ KEY `orderid` (`orderid`)
60
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
61
+ UPDATE ".$tableName_SalesFlatOrderPayment." SET method='Dibspw' WHERE method='dibspw_standard';
62
+ ");
63
+ $installer->endSetup();
app/code/community/Dibspw/Dibspw/sql/dibspw_setup/mysql4-upgrade-4.0.1-4.1.0.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ /**
25
+ * Payment Model
26
+ **/
27
+
28
+ $installer = $this;
29
+
30
+ $installer->startSetup();
31
+ $tableName_CoreResource = Mage::getSingleton('core/resource')->getTableName('core_resource');
32
+ $tableName_SalesFlatOrderPayment = Mage::getSingleton('core/resource')->getTableName('sales_flat_order_payment');
33
+ $sTablePrefix = Mage::getConfig()->getTablePrefix();
34
+ $installer->run("
35
+ delete from ".$tableName_CoreResource." where code = 'dibspw_setup';
36
+ CREATE TABLE IF NOT EXISTS `" . $sTablePrefix ."dibspw_results` (
37
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
38
+ `orderid` varchar(100) NOT NULL DEFAULT '',
39
+ `status` varchar(10) NOT NULL DEFAULT '0',
40
+ `testmode` tinyint(1) unsigned NOT NULL DEFAULT '0',
41
+ `transaction` varchar(100) NOT NULL DEFAULT '',
42
+ `amount` int(10) unsigned NOT NULL DEFAULT '0',
43
+ `currency` smallint(3) unsigned NOT NULL DEFAULT '0',
44
+ `fee` int(10) unsigned NOT NULL DEFAULT '0',
45
+ `paytype` varchar(32) NOT NULL DEFAULT '',
46
+ `voucheramount` int(10) unsigned NOT NULL DEFAULT '0',
47
+ `amountoriginal` int(10) unsigned NOT NULL DEFAULT '0',
48
+ `ext_info` text,
49
+ `validationerrors` text,
50
+ `capturestatus` varchar(10) NOT NULL DEFAULT '0',
51
+ `actioncode` varchar(20) NOT NULL DEFAULT '',
52
+ `success_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
53
+ `cancel_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
54
+ `callback_action` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = NotPerformed, 1 = Performed',
55
+ `success_error` varchar(100) NOT NULL DEFAULT '',
56
+ `callback_error` varchar(100) NOT NULL DEFAULT '',
57
+ `sysmod` varchar(10) NOT NULL DEFAULT '',
58
+ PRIMARY KEY (`id`),
59
+ KEY `orderid` (`orderid`)
60
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
61
+ UPDATE ".$tableName_SalesFlatOrderPayment." SET method='Dibspw' WHERE method='dibspw_standard';
62
+ ");
63
+ $installer->endSetup();
app/code/community/Dibspw/Sales/Block/Order/Info.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
23
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Invoice view comments form
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Sale
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Dibspw_Sales_Block_Order_Info extends Mage_Sales_Block_Order_Info
35
+ {
36
+ protected $_links = array();
37
+
38
+ protected function _construct() {
39
+ parent::_construct();
40
+ $this->setTemplate('sales/order/info.phtml');
41
+ }
42
+
43
+ protected function PaymentPart($paymentstr) {
44
+ $PaymentPartStr = explode(',',$paymentstr,2);
45
+ return $PaymentPartStr[0];
46
+ }
47
+
48
+ protected function _prepareLayout() {
49
+ $headBlock = $this->getLayout()->getBlock('head');
50
+ if ($headBlock) {
51
+ $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
52
+ }
53
+ $this->setChild(
54
+ 'payment_info',
55
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
56
+ );
57
+ }
58
+
59
+ public function getPaymentInfoHtml() {
60
+
61
+ $res = $this->getChildHtml('payment_info');
62
+ $standard = Mage::getModel('dibspw/Dibspw');
63
+
64
+ // Read info directly from the database
65
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
66
+ $sTablePrefix = Mage::getConfig()->getTablePrefix();
67
+ $row = $read->fetchRow("select * from " . $sTablePrefix . dibs_pw_api::api_dibs_get_tableName() .
68
+ " where orderid = " . $this->getOrder()->getIncrementId());
69
+ if (count($row) > 0) {
70
+ if ($row['status'] == 'ACCEPTED') {
71
+ $res .= "<table border='0' width='100%'>";
72
+ if ($row['transact'] != '0') {
73
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_8') . "</td>";
74
+ $res .= "<td>" . $row['transact'] . "</td></tr>";
75
+ }
76
+ if ($row['paytype'] != '0') {
77
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_12') . "</td>";
78
+ $res .= "<td>" . $this->printLogo($row['paytype']) . "</td></tr>";
79
+ }
80
+ if ($row['fee'] != '0') {
81
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_11') . "</td>";
82
+ $res .= "<td>" . $this->getOrder()->getOrderCurrencyCode() . "&nbsp;" .
83
+ number_format(((int)$row['fee']) / 100, 2, ',', ' ') . "</td></tr>";
84
+ }
85
+ $res .= "</table><br>";
86
+
87
+ }
88
+ else {
89
+ $res .= "<br>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_19') . "<br>";
90
+ }
91
+ }
92
+
93
+ return $res;
94
+ }
95
+
96
+ public function printLogo($paytype) {
97
+ if(preg_match("/[a-z\(\)]+/is", $this->PaymentPart($paytype))) {
98
+ $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/' .
99
+ preg_replace("/\(\)_/s", "", strtolower($this->PaymentPart($paytype))) . '.gif') .
100
+ '" border="0" />';
101
+ }
102
+ else $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/dibs.gif') .
103
+ '" border="0" />';
104
+
105
+ return $res;
106
+ }
107
+
108
+ /**
109
+ * Retrieve current order model instance
110
+ *
111
+ * @return Mage_Sales_Model_Order
112
+ */
113
+ public function getOrder() {
114
+ return Mage::registry('current_order');
115
+ }
116
+
117
+ public function addLink($name, $path, $label) {
118
+ $this->_links[$name] = new Varien_Object(array(
119
+ 'name' => $name,
120
+ 'label' => $label,
121
+ 'url' => empty($path) ? '' : Mage::getUrl($path, array('order_id' => $this->getOrder()->getId()))
122
+ ));
123
+ return $this;
124
+ }
125
+
126
+ public function getLinks() {
127
+ $this->checkLinks();
128
+ return $this->_links;
129
+ }
130
+
131
+ private function checkLinks() {
132
+ $order = $this->getOrder();
133
+ if (!$order->hasInvoices()) {
134
+ unset($this->_links['invoice']);
135
+ }
136
+ if (!$order->hasShipments()) {
137
+ unset($this->_links['shipment']);
138
+ }
139
+ if (!$order->hasCreditmemos()) {
140
+ unset($this->_links['creditmemo']);
141
+ }
142
+ }
143
+
144
+ public function getReorderUrl($order) {
145
+ return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
146
+ }
147
+
148
+ public function getPrintUrl($order) {
149
+ return $this->getUrl('sales/order/print', array('order_id' => $order->getId()));
150
+ }
151
+ }
app/code/community/Dibspw/Sales/Block/Order/Print.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * Modifications copyrighted by Dibs A/S, (c) 2010.
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Order information for print
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Sales
33
+ */
34
+
35
+ class Dibspw_Sales_Block_Order_Print extends Mage_Sales_Block_Order_Print {
36
+
37
+ protected function _prepareLayout() {
38
+ $headBlock = $this->getLayout()->getBlock('head');
39
+ if ($headBlock) {
40
+ $headBlock->setTitle($this->__('Print Order # %s',
41
+ $this->getOrder()->getRealOrderId()));
42
+ }
43
+
44
+ $this->setChild(
45
+ 'payment_info',
46
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
47
+ );
48
+ }
49
+
50
+ public function getPaymentInfoHtml() {
51
+
52
+ $res = $this->getChildHtml('payment_info');
53
+ $standard = Mage::getModel('dibspw/Dibspw');
54
+
55
+ // Read info directly from the database
56
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
57
+ $sTablePrefix = Mage::getConfig()->getTablePrefix();
58
+ $row = $read->fetchRow("select * from " . $sTablePrefix . dibs_pw_api::api_dibs_get_tableName() .
59
+ " where orderid = " . $this->getOrder()->getIncrementId());
60
+ if (count($row) > 0){
61
+ if ($row['status'] == 'ACCEPTED') {
62
+ $res .= "<table border='0' width='100%'>";
63
+ if ($row['transact'] != '0') {
64
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_8') . "</td>";
65
+ $res .= "<td>" . $row['transact'] . "</td></tr>";
66
+ }
67
+ if ($row['paytype'] != '0') {
68
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_12') . "</td>";
69
+ $res .= "<td>" . $this->printLogo($row['paytype']) . "</td></tr>";
70
+ }
71
+ if ($row['fee'] != '0') {
72
+ $res .= "<tr><td>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_11') . "</td>";
73
+ $res .= "<td>" . $this->getOrder()->getOrderCurrencyCode() . "&nbsp;" .
74
+ number_format(((int)$row['fee']) / 100, 2, ',', ' ') . "</td></tr>";
75
+ }
76
+ $res .= "</table><br>";
77
+
78
+ }
79
+ else {
80
+ $res .= "<br>" . Mage::helper('dibspw')->__('DIBSPW_LABEL_19') . "<br>";
81
+ }
82
+ }
83
+
84
+ return $res;
85
+ }
86
+
87
+ public function printLogo($paytype) {
88
+ if(preg_match("/[a-z\(\)]+/is", $paytype)) {
89
+ $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/' .
90
+ preg_replace("/\(\)_/s", "", strtolower($paytype)) . '.gif') .
91
+ '" border="0" />';
92
+ }
93
+ else $res = '<img src="' . $this->getSkinUrl('images/Dibspw/Dibspw/dibs.gif') .
94
+ '" border="0" />';
95
+
96
+ return $res;
97
+ }
98
+
99
+ public function getOrder()
100
+ {
101
+ return Mage::registry('current_order');
102
+ }
103
+
104
+ protected function _prepareItem(Mage_Core_Block_Abstract $renderer)
105
+ {
106
+ $renderer->setPrintStatus(true);
107
+
108
+ return parent::_prepareItem($renderer);
109
+ }
110
+
111
+ }
app/code/community/Dibspw/Sales/etc/config.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <global>
26
+ <blocks>
27
+ <sales>
28
+ <rewrite>
29
+ <order_info>Dibspw_Sales_Block_Order_Info</order_info>
30
+ <order_print>Dibspw_Sales_Block_Order_Print</order_print>
31
+ </rewrite>
32
+ </sales>
33
+ </blocks>
34
+ </global>
35
+ </config>
app/design/frontend/base/default/template/Dibspw/Dibspw/redirect.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_DibspwModule
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ ?>
24
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
25
+ <html xmlns="http://www.w3.org/1999/xhtml">
26
+ <head>
27
+ <title>DIBS Payment</title>
28
+ <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
29
+ </head>
30
+ <body>
31
+ <?
32
+ $oPaymate = Mage::getModel('dibspw/Dibspw');
33
+ $aDibsparmeter = $oPaymate->getCheckoutFormFields();
34
+ ?>
35
+ <h2> You will be redirected to DIBS in a few seconds...</h2>
36
+ <form method="post" name="payment" id="payment" action ="<?
37
+ echo $oPaymate->api_dibs_get_formAction()
38
+ ?>">
39
+ <? foreach ($aDibsparmeter as $field=>$value) {?>
40
+ <input type="hidden" name="<? echo $field ?>" value="<? echo $value ?>" />
41
+ <?}?>
42
+ </form>
43
+
44
+ <script type="text/javascript">
45
+ setTimeout("document.getElementById('payment').submit();", 1000);
46
+ </script>
47
+
48
+ </body>
49
+ </html>
app/design/frontend/default/default/template/Dibspw/Dibspw/form.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_DibspwModule
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+
24
+ $paymate = Mage::getModel('dibspw/Dibspw');
25
+ $_code=$this->getMethodCode();
26
+ $sHTML = '<fieldset class="form-list">
27
+ <ul id="payment_form_'.$_code. '" style="display:none">
28
+ <li>' . $this->__('DIBSPW_LABEL_1');
29
+ $logoArray = explode(',', $paymate->getConfigData('dibspwlogos'));
30
+ $sTrusted = '';
31
+ $sCards = '';
32
+ foreach($logoArray as $item) {
33
+ if(preg_match("/^(DIBS|PCI|.*SECURE.*)$/s") && $paymate->showTrustedList()){
34
+ $sTrusted .= $paymate->cms_get_imghtml($item);
35
+ }
36
+
37
+ if(!preg_match("/^(DIBS|PCI|.*SECURE.*)$/s") && $paymate->showCardsList()) {
38
+ $sCards .= $paymate->cms_get_imghtml($item);
39
+ }
40
+ }
41
+
42
+ if($paymate->showTrustedList()) $sHTML .= '<br /><br />';
43
+ $sHTML .= $sTrusted;
44
+ if($paymate->showCardsList()) $sHTML .= '<br /><br />' . $this->__('DIBSPW_LABEL_2') . '<br />';
45
+ $sHTML .= $sCards;
46
+ $sHTML .= '</li></ul></fieldset>';
47
+ ?>
app/etc/modules/Dibspw_Adminhtml.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+
25
+ <config>
26
+ <modules>
27
+ <Dibspw_Adminhtml>
28
+ <active>true</active>
29
+ <codePool>community</codePool>
30
+ </Dibspw_Adminhtml>
31
+ </modules>
32
+ </config>
app/etc/modules/Dibspw_Dibspw.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+
25
+ <config>
26
+ <modules>
27
+ <Dibspw_Dibspw>
28
+ <active>true</active>
29
+ <codePool>community</codePool>
30
+ </Dibspw_Dibspw>
31
+ </modules>
32
+ </config>
app/etc/modules/Dibspw_Sales.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Dibs A/S
5
+ * Dibs Payment Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to license@magentocommerce.com so we can send you a copy immediately.
16
+ *
17
+ * @category Payments & Gateways Extensions
18
+ * @package Dibspw_Dibspw
19
+ * @author Dibs A/S
20
+ * @copyright Copyright (c) 2010 Dibs A/S. (http://www.dibs.dk/)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+
25
+ <config>
26
+ <modules>
27
+ <Dibspw_Sales>
28
+ <active>true</active>
29
+ <codePool>community</codePool>
30
+ </Dibspw_Sales>
31
+ </modules>
32
+ </config>
app/locale/da_DK/Mage_Dibspw.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "DIBSPW_LABEL_1","Du har valgt at betale online for din bestilling. N&#229;r du har lagt din ordre vil du blive overf&#248;rt til DIBS betalings system. Her skal du gennemf&#248;re din betaling. N&#229;r ordren er gennemf&#248;rt vil du automatisk blive f&#248;rt tilbage til vores butik."
2
+ "DIBSPW_LABEL_2","Du kan betale med disse betalingsformer:"
3
+ "DIBSPW_LABEL_3","Ordren er nu afgivet og betalingen vidrebehandles i DIBS betalings system (www.dibs.dk)"
4
+ "DIBSPW_LABEL_4","Ordre nummer"
5
+ "DIBSPW_LABEL_5","Bel&#248;b"
6
+ "DIBSPW_LABEL_6","Du bliver nu viderestillet til betalingssystemet"
7
+ "DIBSPW_LABEL_7","DIBS betalings information"
8
+ "DIBSPW_LABEL_8","Transaction ID:"
9
+ "DIBSPW_LABEL_9","Bel&#248;b:"
10
+ "DIBSPW_LABEL_10","Valuta kode:"
11
+ "DIBSPW_LABEL_11","Gebyr:"
12
+ "DIBSPW_LABEL_12","Betalingstype:"
13
+ "DIBSPW_LABEL_13","Kort nummer:"
14
+ "DIBSPW_LABEL_14","Udl&#248;b:"
15
+ "DIBSPW_LABEL_15","Land:"
16
+ "DIBSPW_LABEL_16","Indl&#248;ser:"
17
+ "DIBSPW_LABEL_17","3-D Secure:"
18
+ "DIBSPW_LABEL_18","G&#229; til DIBS administrationen og gennemf&#248;r betalingen"
19
+ "DIBSPW_LABEL_19","Ingen betaling er registreret p&#229; denne ordre"
20
+ "DIBSPW_LABEL_20","Kortholder har annulleret betalingsforl&#248;bet"
21
+ "DIBSPW_LABEL_21","'Callback' modtaget fra DIBS Payment Services (www.dibs.dk)"
22
+ "DIBSPW_LABEL_22","Kortholder returneret til butikken fra DIBS Payment Services (www.dibs.dk)"
23
+ "dibspw_txt_err_fatal", "A fatal error has occured."
24
+ "dibspw_txt_msg_toshop", "Return to shop"
25
+ "dibspw_txt_err_11", "Unknown orderid was returned from DIBS payment gateway."
26
+ "dibspw_txt_err_12", "No orderid was returned from DIBS payment gateway."
27
+ "dibspw_txt_err_21", "The amount received from DIBS payment gateway differs from original order amount."
28
+ "dibspw_txt_err_22", "No amount was returned from DIBS payment gateway."
29
+ "dibspw_txt_err_31", "The currency type received from DIBS payment gateway differs from original order currency type."
30
+ "dibspw_txt_err_32", "No currency type was returned from DIBS payment gateway."
31
+ "dibspw_txt_err_41", "The fingerprint key does not match."
32
+ "dibspw_txt_err_def", "Unknown error appeared. Please contact to shop administration to check transaction."
app/locale/en_US/Mage_Dibspw.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "DIBSPW_LABEL_1","You have chosen to pay for the order online. Once you've completed your order, you will be transferred to the DIBS payment system. Here you need to process your payment. Once payment is completed, you will automatically be returned to our shop."
2
+ "DIBSPW_LABEL_2","You can pay with the following payment cards:"
3
+ "DIBSPW_LABEL_3","The order is now placed and payment must now be made in DIBS Payment Solution (www.dibspayment.com)"
4
+ "DIBSPW_LABEL_4","Order number"
5
+ "DIBSPW_LABEL_5","Amount"
6
+ "DIBSPW_LABEL_6","Your are now being redirected to the payment gateway"
7
+ "DIBSPW_LABEL_7","DIBS Payment Information"
8
+ "DIBSPW_LABEL_8","Transaction ID:"
9
+ "DIBSPW_LABEL_9","Amount:"
10
+ "DIBSPW_LABEL_10","Currency Code:"
11
+ "DIBSPW_LABEL_11","Fee:"
12
+ "DIBSPW_LABEL_12","Pay type:"
13
+ "DIBSPW_LABEL_13","Card number:"
14
+ "DIBSPW_LABEL_14","Expire:"
15
+ "DIBSPW_LABEL_15","Country:"
16
+ "DIBSPW_LABEL_16","Acquirer:"
17
+ "DIBSPW_LABEL_17","3-D Secure:"
18
+ "DIBSPW_LABEL_18","Go to DIBS administration and process the payment"
19
+ "DIBSPW_LABEL_19","There is not registered any payment for this order yet!"
20
+ "DIBSPW_LABEL_20","Customer has cancelled the payment process - DIBS Payment Services (www.dibspayment.com)"
21
+ "DIBSPW_LABEL_21","'Callback' received from DIBS Payment Services (www.dibspayment.com)"
22
+ "DIBSPW_LABEL_22","Customer successfully returned back to store from DIBS Payment Services (www.dibspayment.com)"
23
+ "dibspw_txt_err_fatal", "A fatal error has occured."
24
+ "dibspw_txt_msg_toshop", "Return to shop"
25
+ "dibspw_txt_err_11", "Unknown orderid was returned from DIBS payment gateway."
26
+ "dibspw_txt_err_12", "No orderid was returned from DIBS payment gateway."
27
+ "dibspw_txt_err_21", "The amount received from DIBS payment gateway differs from original order amount."
28
+ "dibspw_txt_err_22", "No amount was returned from DIBS payment gateway."
29
+ "dibspw_txt_err_31", "The currency type received from DIBS payment gateway differs from original order currency type."
30
+ "dibspw_txt_err_32", "No currency type was returned from DIBS payment gateway."
31
+ "dibspw_txt_err_41", "The fingerprint key does not match."
32
+ "dibspw_txt_err_def", "Unknown error appeared. Please contact to shop administration to check transaction."
app/locale/nb_NO/Mage_Dibspw.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "DIBSPW_LABEL_1","Du har valgt &#229; betale ordren online. N&#229r du har fullf&#248;rt din ordre, vil du bli videresendt til DIBS betalingsleverand&#248;r. Her m&#229; du fullf&#248;re din betaling. N&#229;r betaligen er fullf&#248;rt, vil du bli sendt tilbake til v&#229;r butikk."
2
+ "DIBSPW_LABEL_2","Du kan betale med f&#248;lgende kort:"
3
+ "DIBSPW_LABEL_3","Ordren er plassert, og betalingen prosesseres av DIBS Payment Services (www.dibs.no)"
4
+ "DIBSPW_LABEL_4","Ordrenummer"
5
+ "DIBSPW_LABEL_5","Bel&#248;p"
6
+ "DIBSPW_LABEL_6","Du blir n&#229; videresendt til betalingsleverand&#248;ren"
7
+ "DIBSPW_LABEL_7","DIBS Betalingsinformasjon"
8
+ "DIBSPW_LABEL_8","Transaksjonsnummer:"
9
+ "DIBSPW_LABEL_9","Bel&#248;p:"
10
+ "DIBSPW_LABEL_10","Valutakode:"
11
+ "DIBSPW_LABEL_11","Gebyr:"
12
+ "DIBSPW_LABEL_12","Betalingstype:"
13
+ "DIBSPW_LABEL_13","Kortnummer:"
14
+ "DIBSPW_LABEL_14","Utl&#248;psdato:"
15
+ "DIBSPW_LABEL_15","Land:"
16
+ "DIBSPW_LABEL_16","Innl&#248;ser:"
17
+ "DIBSPW_LABEL_17","3-D Secure:"
18
+ "DIBSPW_LABEL_18","G&#229; til DIBS Administrasjonen og prosesser betalingen"
19
+ "DIBSPW_LABEL_19","Det er ikke registrert noen betaling for denne ordren enda!"
20
+ "DIBSPW_LABEL_20","Kunden har avbrutt betalingsprosessen - DIBS Payment Services (www.dibs.no)"
21
+ "DIBSPW_LABEL_21","'Callback' mottatt fra DIBS Payment Services (www.dibs.no)"
22
+ "DIBSPW_LABEL_22","Kunden har returnert vellykket tilbake til butikk fra DIBS Payment Services (www.dibs.no)"
23
+ "dibspw_txt_err_fatal", "A fatal error has occured."
24
+ "dibspw_txt_msg_toshop", "Return to shop"
25
+ "dibspw_txt_err_11", "Unknown orderid was returned from DIBS payment gateway."
26
+ "dibspw_txt_err_12", "No orderid was returned from DIBS payment gateway."
27
+ "dibspw_txt_err_21", "The amount received from DIBS payment gateway differs from original order amount."
28
+ "dibspw_txt_err_22", "No amount was returned from DIBS payment gateway."
29
+ "dibspw_txt_err_31", "The currency type received from DIBS payment gateway differs from original order currency type."
30
+ "dibspw_txt_err_32", "No currency type was returned from DIBS payment gateway."
31
+ "dibspw_txt_err_41", "The fingerprint key does not match."
32
+ "dibspw_txt_err_def", "Unknown error appeared. Please contact to shop administration to check transaction."
app/locale/nn_NO/Mage_Dibspw.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "DIBSPW_LABEL_1","Du har valgt &#229; betale ordren online. N&#229r du har fullf&#248;rt din ordre, vil du bli videresendt til DIBS betalingsleverand&#248;r. Her m&#229; du fullf&#248;re din betaling. N&#229;r betaligen er fullf&#248;rt, vil du bli sendt tilbake til v&#229;r butikk."
2
+ "DIBSPW_LABEL_2","Du kan betale med f&#248;lgende kort:"
3
+ "DIBSPW_LABEL_3","Ordren er plassert, og betalingen prosesseres av DIBS Payment Services (www.dibs.no)"
4
+ "DIBSPW_LABEL_4","Ordrenummer"
5
+ "DIBSPW_LABEL_5","Bel&#248;p"
6
+ "DIBSPW_LABEL_6","Du blir n&#229; videresendt til betalingsleverand&#248;ren"
7
+ "DIBSPW_LABEL_7","DIBS Betalingsinformasjon"
8
+ "DIBSPW_LABEL_8","Transaksjonsnummer:"
9
+ "DIBSPW_LABEL_9","Bel&#248;p:"
10
+ "DIBSPW_LABEL_10","Valutakode:"
11
+ "DIBSPW_LABEL_11","Gebyr:"
12
+ "DIBSPW_LABEL_12","Betalingstype:"
13
+ "DIBSPW_LABEL_13","Kortnummer:"
14
+ "DIBSPW_LABEL_14","Utl&#248;psdato:"
15
+ "DIBSPW_LABEL_15","Land:"
16
+ "DIBSPW_LABEL_16","Innl&#248;ser:"
17
+ "DIBSPW_LABEL_17","3-D Secure:"
18
+ "DIBSPW_LABEL_18","G&#229; til DIBS Administrasjonen og prosesser betalingen"
19
+ "DIBSPW_LABEL_19","Det er ikke registrert noen betaling for denne ordren enda!"
20
+ "DIBSPW_LABEL_20","Kunden har avbrutt betalingsprosessen - DIBS Payment Services (www.dibs.no)"
21
+ "DIBSPW_LABEL_21","'Callback' mottatt fra DIBS Payment Services (www.dibs.no)"
22
+ "DIBSPW_LABEL_22","Kunden har returnert vellykket tilbake til butikk fra DIBS Payment Services (www.dibs.no)"
23
+ "dibspw_txt_err_fatal", "A fatal error has occured."
24
+ "dibspw_txt_msg_toshop", "Return to shop"
25
+ "dibspw_txt_err_11", "Unknown orderid was returned from DIBS payment gateway."
26
+ "dibspw_txt_err_12", "No orderid was returned from DIBS payment gateway."
27
+ "dibspw_txt_err_21", "The amount received from DIBS payment gateway differs from original order amount."
28
+ "dibspw_txt_err_22", "No amount was returned from DIBS payment gateway."
29
+ "dibspw_txt_err_31", "The currency type received from DIBS payment gateway differs from original order currency type."
30
+ "dibspw_txt_err_32", "No currency type was returned from DIBS payment gateway."
31
+ "dibspw_txt_err_41", "The fingerprint key does not match."
32
+ "dibspw_txt_err_def", "Unknown error appeared. Please contact to shop administration to check transaction."
app/locale/sv_SE/Mage_Dibspw.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "DIBSPW_LABEL_1","Du har valt att betala f&#246;r ordern via internet. N&#228;r din order &#228;r avslutad kommer du bli skickad till DIBS betalningssystem. D&#228;r kommer du att beh&#246;va behandla din betalning. N&#228;r betalningen &#228;r genomf&#246;rd kommer du automatiskt att skickad tillbaka till v&#229;r butik."
2
+ "DIBSPW_LABEL_2","Du kan betala med f&#246;ljande betal/kreditkort:"
3
+ "DIBSPW_LABEL_3","Ordern har blivit mottagen och betalningen bearbetas av DIBS betalningssystem (www.dibs.se)"
4
+ "DIBSPW_LABEL_4","Ordernummer"
5
+ "DIBSPW_LABEL_5","Belopp"
6
+ "DIBSPW_LABEL_6","Du kommer nu att skickas till betalningssystemet"
7
+ "DIBSPW_LABEL_7","DIBS Betalningsinformation"
8
+ "DIBSPW_LABEL_8","TransaktionsID:"
9
+ "DIBSPW_LABEL_9","Belopp:"
10
+ "DIBSPW_LABEL_10","Valutakod:"
11
+ "DIBSPW_LABEL_11","Avgift:"
12
+ "DIBSPW_LABEL_12","Betals&#228;tt:"
13
+ "DIBSPW_LABEL_13","Kortnummer:"
14
+ "DIBSPW_LABEL_14","Utg&#229;ngsdatum:"
15
+ "DIBSPW_LABEL_15","Land:"
16
+ "DIBSPW_LABEL_16","Inl&#246;sare:"
17
+ "DIBSPW_LABEL_17","3-D Secure:"
18
+ "DIBSPW_LABEL_18","G&#229; till DIBS administrationsgr&#228;nssnitt och behandla betalningen"
19
+ "DIBSPW_LABEL_19","Det finns ingen registrerad betalning f&#246;r denna order &#228;nnu"
20
+ "DIBSPW_LABEL_20","Kunden har avbrutit betalningsprocessen - DIBS Payment Services (www.dibs.se)"
21
+ "DIBSPW_LABEL_21","'Callback' mottagen fr&#229;n DIBS Payment Services (www.dibs.se)"
22
+ "DIBSPW_LABEL_22","Kunden har kommit tillbaka till butiken fr&#229;n DIBS Payment Services (www.dibs.se)"
23
+ "dibspw_txt_err_fatal", "A fatal error has occured."
24
+ "dibspw_txt_msg_toshop", "Return to shop"
25
+ "dibspw_txt_err_11", "Unknown orderid was returned from DIBS payment gateway."
26
+ "dibspw_txt_err_12", "No orderid was returned from DIBS payment gateway."
27
+ "dibspw_txt_err_21", "The amount received from DIBS payment gateway differs from original order amount."
28
+ "dibspw_txt_err_22", "No amount was returned from DIBS payment gateway."
29
+ "dibspw_txt_err_31", "The currency type received from DIBS payment gateway differs from original order currency type."
30
+ "dibspw_txt_err_32", "No currency type was returned from DIBS payment gateway."
31
+ "dibspw_txt_err_41", "The fingerprint key does not match."
32
+ "dibspw_txt_err_def", "Unknown error appeared. Please contact to shop administration to check transaction."
package.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Dibspw</name>
4
+ <version>4.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Accept all types of payments from DIBS - Secure Internet Payment Service Provider.</summary>
10
+ <description>This is the payment gateway module for the DIBS payment gateway - http://www.dibspayment.com&#xD;
11
+ &#xD;
12
+ DIBS Payment Services is the leading Scandinavian Internet service provider.&#xD;
13
+ &#xD;
14
+ Security and credibility are important keywords to companies handling payment transactions. Hence, DIBS has achieved VISA/MasterCard PCI certification and devotes its efforts to constantly enhancing its security solutions.&#xD;
15
+ &#xD;
16
+ Card types accepted by the DIBS payment gateway:&#xD;
17
+ - Dankort&#xD;
18
+ - VISA/Dankort&#xD;
19
+ - VISA&#xD;
20
+ - VISA Electron&#xD;
21
+ - MasterCard&#xD;
22
+ - Maestro&#xD;
23
+ - JCB&#xD;
24
+ - Diners&#xD;
25
+ - American Express&#xD;
26
+ - Forbrugsforeningen&#xD;
27
+ - eWire&#xD;
28
+ - VISA 3D Secure&#xD;
29
+ - MaserCard 3D secure&#xD;
30
+ - JCB 3D secure&#xD;
31
+ - Danske Bank e-betaling&#xD;
32
+ - Nordea e-betaling&#xD;
33
+ &#xD;
34
+ A complete list can be found at http://www.dibspayment.com/</description>
35
+ <notes>4.1.0:&#xD;
36
+ - New module for DIBS Payment Window and Mobile Payment Window integration methods.</notes>
37
+ <authors><author><name>DIBS A/S</name><user>dibs</user><email>info@dibs.dk</email></author><author><name>DIBS A/S</name><user>niso</user><email>info@dibs.dk</email></author></authors>
38
+ <date>2012-03-21</date>
39
+ <time>15:19:22</time>
40
+ <contents><target name="magecommunity"><dir name="Dibspw"><dir name="Adminhtml"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="08be1cdbd4012b0ef3990eeb1d451f5b"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="594dbf5043a234d9a78013e8b810b5e4"/></dir></dir><dir name="Dibspw"><dir name="Block"><file name="Failure.php" hash="e032d841dcdcf11161215c95a56ac14f"/><file name="Form.php" hash="73d31cf65b33f08a616033ebb254ec81"/><file name="Redirect.php" hash="9ad740ed58027ae72340dddc2babf924"/></dir><dir name="Helper"><file name="Data.php" hash="623bffe033249cefe375816d7746d283"/></dir><dir name="Model"><file name="Dibspw.php" hash="e6955bce5e5e83f4ebe77a7fd510957c"/><dir name="Mysql4"><file name="Setup.php" hash="1c135886bc8a0794310ec7cb70e04e64"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Dibslogos.php" hash="11144f7fbfd82c6e4f54cc2e0d204525"/><file name="Dibspaytypes.php" hash="09b971321fc63ef845236f8087dc45c6"/><file name="Dibsyesno.php" hash="5f576ff3909cec6d880409c40b86f91a"/><file name="Lang.php" hash="1ea6118edd5624bc1f750a178ccb44ea"/><file name="Orderstatusafter.php" hash="541d8005e982a3ac5ac5573bebcae18a"/><file name="Orderstatusbefore.php" hash="5d2ddaa5e9389cf96ce2656e669188f8"/><file name="PBBdistribution.php" hash="9d4d91386c1d4f848a2357666af473f1"/><file name="Paymentwindow.php" hash="6568402efdbef3d2820353730d876f3e"/></dir></dir></dir><dir name="dibs_api"><dir name="pw"><file name="dibs_pw_api.php" hash="366861b59d5bca30523b2782955d7ab8"/><file name="dibs_pw_helpers.php" hash="552b1926d7c6513a15aa84ab492b05d3"/><file name="dibs_pw_helpers_cms.php" hash="faeca9ab0a1e4341edbcdc354e438bd0"/><file name="dibs_pw_helpers_interface.php" hash="17a79ee1e27fdd1c6590c07133ba8c04"/></dir></dir></dir><dir name="controllers"><file name="DibspwController.php" hash="fa868b6c483a40613a77ab3fc88c9010"/></dir><dir name="etc"><file name="config.xml" hash="94f61694046857f832fe150f358dc4c1"/><file name="system.xml" hash="7e2f698d844a704d354311123d49abaa"/></dir><dir name="sql"><dir name="dibspw_setup"><file name="mysql4-install-4.1.0.php" hash="a252a88138cd076c687ae19ff1a4c112"/><file name="mysql4-upgrade-4.0.1-4.1.0.php" hash="c204cb065f6763ba7a538ac4a7277fd9"/></dir></dir></dir><dir name="Sales"><dir name="Block"><dir name="Order"><file name="Info.php" hash="7cd1f48a3b60ab0b7b93af186a4d461c"/><file name="Print.php" hash="26ac55855e9a2be63f3868a046d51182"/></dir></dir><dir name="etc"><file name="config.xml" hash="bc9fda3461591b51b4d9e1daacc7324f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dibspw_Dibspw.xml" hash="7c82595e6638c292f71a0ad5be4ecaf0"/><file name="Dibspw_Sales.xml" hash="8b5f3d89fb38cc873dd0f5d95267059c"/><file name="Dibspw_Adminhtml.xml" hash="615925971da5c5c48e755c330205d709"/></dir></target><target name="magelocale"><dir name="da_DK"><file name="Mage_Dibspw.csv" hash="63faeb3d73eeda03fb8fd7c6649d91b6"/></dir><dir name="en_US"><file name="Mage_Dibspw.csv" hash="308839383dcdf24794634244d4e022fd"/></dir><dir name="nb_NO"><file name="Mage_Dibspw.csv" hash="3156fcc1cda649cf1cd75ed5601fd6f4"/></dir><dir name="nn_NO"><file name="Mage_Dibspw.csv" hash="3156fcc1cda649cf1cd75ed5601fd6f4"/></dir><dir name="sv_SE"><file name="Mage_Dibspw.csv" hash="3de9643378c2b736b533cd0172cb7220"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="Dibspw"><dir name="Dibspw"><file name="form.phtml" hash="7610a94e6554dcc03b6bf9d5a7c531c4"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="Dibspw"><dir name="Dibspw"><file name="redirect.phtml" hash="e614ca2e69b099878be4057529c0144b"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="Dibspw"><dir name="Dibspw"><file name="aktia.gif" hash="7afe00b19b4194fa4ffbdf20cdd469c1"/><file name="amex.gif" hash="f35f89ccdcb954e02a07f6c0a29c7b43"/><file name="bax.gif" hash="c315574fd839dae52a1316b6d8b836b6"/><file name="dibs.gif" hash="8b308757472fc5aaaedfefd5c79a2d54"/><file name="din.gif" hash="fabce04659a94993a230285b9a4651e9"/><file name="dk.gif" hash="daa5d5d2c0d541579b0e13aa3cd9d65b"/><file name="dnb.gif" hash="1f616c382b72248334f6aa1ca910003b"/><file name="edk.gif" hash="4485910a0fb40512233c1a59ddd31015"/><file name="elec.gif" hash="e5371ba0da9bb14990d1b8163cedd066"/><file name="elv.gif" hash="3bd20355343bd250a6a704fdbaf9ba62"/><file name="ew.gif" hash="b50385f7d878be6a3834310d1fbc3a1d"/><file name="ffk.gif" hash="d9cd7fa26230a850114b2dc99aea3b22"/><file name="fsb.gif" hash="d6da3e67f8096811c2ad0135b2aad80a"/><file name="git.gif" hash="b70e244f36e7aec94fe3f6373e1ae8d7"/><file name="ing.gif" hash="40f07b266bcd5953bb6c079f7eeaae67"/><file name="jcb.gif" hash="aea8c54e043a75b26887fa1307ad4312"/><file name="jcbsecure.gif" hash="1c687214f79b73d7e99f5011c9c22bce"/><file name="loading.gif" hash="7e99e1159a3686f6aa4f90043c554483"/><file name="mc.gif" hash="2680e078159e5aedb561c3a705801a44"/><file name="mcsecure.gif" hash="730735c1e2d36d9fa3bd6468fa0b1a7d"/><file name="moca.gif" hash="befd2f10976c0ab40333f01fc6db4743"/><file name="mtro.gif" hash="d5df5f7986a21bf5a78b9c7a3656facd"/><file name="oko.gif" hash="1cde3c12036ebd74a643aee2ffb0513a"/><file name="pbb.gif" hash="fff306c0ea2e7568eef562ec3dc6edd8"/><file name="pbbtest.gif" hash="fff306c0ea2e7568eef562ec3dc6edd8"/><file name="pci.gif" hash="b55a87df550ea6789c17e389604e28e1"/><file name="seb.gif" hash="502b1dbeb81bce51abd1ea149d4dde14"/><file name="shb.gif" hash="0aa7c7fab4133ff4843c0ae73cabe9de"/><file name="solo.gif" hash="17b9be1a06125dcc7d1a6be8fea38dd6"/><file name="val.gif" hash="e62b75eb172934e118a70366baac51ee"/><file name="visa.gif" hash="b61251f8c428aa5dca017c9f374957ef"/><file name="visasecure.gif" hash="517118742fce249485c8eaf6df174764"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="Dibspw"><dir name="Dibspw"><file name="aktia.gif" hash="7afe00b19b4194fa4ffbdf20cdd469c1"/><file name="amex.gif" hash="f35f89ccdcb954e02a07f6c0a29c7b43"/><file name="bax.gif" hash="c315574fd839dae52a1316b6d8b836b6"/><file name="dibs.gif" hash="8b308757472fc5aaaedfefd5c79a2d54"/><file name="din.gif" hash="fabce04659a94993a230285b9a4651e9"/><file name="dk.gif" hash="daa5d5d2c0d541579b0e13aa3cd9d65b"/><file name="dnb.gif" hash="1f616c382b72248334f6aa1ca910003b"/><file name="edk.gif" hash="4485910a0fb40512233c1a59ddd31015"/><file name="elec.gif" hash="e5371ba0da9bb14990d1b8163cedd066"/><file name="elv.gif" hash="3bd20355343bd250a6a704fdbaf9ba62"/><file name="ew.gif" hash="b50385f7d878be6a3834310d1fbc3a1d"/><file name="ffk.gif" hash="d9cd7fa26230a850114b2dc99aea3b22"/><file name="fsb.gif" hash="d6da3e67f8096811c2ad0135b2aad80a"/><file name="git.gif" hash="b70e244f36e7aec94fe3f6373e1ae8d7"/><file name="ing.gif" hash="40f07b266bcd5953bb6c079f7eeaae67"/><file name="jcb.gif" hash="aea8c54e043a75b26887fa1307ad4312"/><file name="jcbsecure.gif" hash="1c687214f79b73d7e99f5011c9c22bce"/><file name="loading.gif" hash="7e99e1159a3686f6aa4f90043c554483"/><file name="mc.gif" hash="2680e078159e5aedb561c3a705801a44"/><file name="mcsecure.gif" hash="730735c1e2d36d9fa3bd6468fa0b1a7d"/><file name="moca.gif" hash="befd2f10976c0ab40333f01fc6db4743"/><file name="mtro.gif" hash="d5df5f7986a21bf5a78b9c7a3656facd"/><file name="oko.gif" hash="1cde3c12036ebd74a643aee2ffb0513a"/><file name="pbb.gif" hash="fff306c0ea2e7568eef562ec3dc6edd8"/><file name="pbbtest.gif" hash="fff306c0ea2e7568eef562ec3dc6edd8"/><file name="pci.gif" hash="b55a87df550ea6789c17e389604e28e1"/><file name="seb.gif" hash="502b1dbeb81bce51abd1ea149d4dde14"/><file name="shb.gif" hash="0aa7c7fab4133ff4843c0ae73cabe9de"/><file name="solo.gif" hash="17b9be1a06125dcc7d1a6be8fea38dd6"/><file name="val.gif" hash="e62b75eb172934e118a70366baac51ee"/><file name="visa.gif" hash="b61251f8c428aa5dca017c9f374957ef"/><file name="visasecure.gif" hash="517118742fce249485c8eaf6df174764"/></dir></dir></dir></dir></dir></dir></target></contents>
41
+ <compatible/>
42
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
43
+ </package>
skin/adminhtml/base/default/images/Dibspw/Dibspw/aktia.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/amex.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/bax.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/dibs.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/din.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/dk.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/dnb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/edk.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/elec.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/elv.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/ew.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/ffk.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/fsb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/git.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/ing.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/jcb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/jcbsecure.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/loading.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/mc.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/mcsecure.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/moca.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/mtro.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/oko.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/pbb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/pbbtest.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/pci.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/seb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/shb.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/solo.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/val.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/visa.gif ADDED
Binary file
skin/adminhtml/base/default/images/Dibspw/Dibspw/visasecure.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/aktia.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/amex.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/bax.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/dibs.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/din.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/dk.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/dnb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/edk.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/elec.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/elv.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/ew.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/ffk.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/fsb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/git.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/ing.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/jcb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/jcbsecure.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/loading.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/mc.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/mcsecure.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/moca.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/mtro.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/oko.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/pbb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/pbbtest.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/pci.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/seb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/shb.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/solo.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/val.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/visa.gif ADDED
Binary file
skin/frontend/base/default/images/Dibspw/Dibspw/visasecure.gif ADDED
Binary file