Version Notes
4.1.9
- bugfixing release
4.1.8
- added support of Bundle Products
4.1.7
- utf encoding fixed
4.1.6
- Fixed bug with double quoted items names
- Fixed bug with HMAC code
- Added compatibility with compilation mode
- Added instruction for resolving problem with MAC code error
4.1.5
-Development
4.1.4
- Added Magento coupons support
- Fixed possible rounding issues
- Removed Mobile Payment Window, now DIBS Payment Window can automatically scale to different screen sizes.
4.1.3
- Removed protected Magento statuses from module configuration page (Closed, Completed)
- Fixed possible problems running extension on Windows-hosted Magento
- Page after cancel operation changed to orders list (instead of empty cart)
4.1.2&
- Confirmed compatibility with Magento 1.7.*
- Improved stability by using more low-level Magento API integration;
- Improved compatibility with DIBS invoice payments
- Added option to limit payment method usage by countries
- Added Transaction ID to order confirmation mail
4.1.1
- Fixed error on redirect with expired session&
- Improved compatibility with DIBS FlexWin Magento extension
- Fixed order statuses bug&
- Fixed account parameter bugs
- Fixed layout
- Fixed crash on dibspw_results table remove
- Fixed logo appearance bugs
- Fixed bug with message appearance in inappropriate places
- Added Sort Order option
- A lot of other fixes and improvements
4.1.0
- New module for DIBS Payment Window and Mobile Payment Window integration methods
Release Info
Developer | DIBS A/S |
Extension | Dibspw |
Version | 4.1.9 |
Comparing to | |
See all releases |
Code changes from version 4.1.8 to 4.1.9
- app/code/community/Dibspw/Dibspw/Model/Dibspw.php +1 -1
- app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_api.php +63 -75
- app/code/community/Dibspw/Dibspw/Model/dibs_api/pw/dibs_pw_helpers.php +17 -26
- app/code/community/Dibspw/Dibspw/etc/config.xml +1 -1
- app/code/community/Dibspw/Dibspw/etc/system.xml +0 -9
- app/code/community/Dibspw/Dibspw/sql/dibspw_setup/{mysql4-install-4.1.8.php → mysql4-install-4.1.9.php} +0 -0
- package.xml +7 -5
@@ -31,7 +31,7 @@ class Dibspw_Dibspw_Model_Dibspw extends dibs_pw_api {
|
|
31 |
parent::validate();
|
32 |
$sCurrencyCode = Mage::getSingleton('checkout/session')->getQuote()->getBaseCurrencyCode();
|
33 |
if (!array_key_exists($sCurrencyCode, dibs_pw_api::api_dibs_get_currencyArray())) {
|
34 |
-
Mage::throwException(Mage::helper('
|
35 |
$sCurrencyCode . ') is not compatabile with Dibs'));
|
36 |
}
|
37 |
return $this;
|
31 |
parent::validate();
|
32 |
$sCurrencyCode = Mage::getSingleton('checkout/session')->getQuote()->getBaseCurrencyCode();
|
33 |
if (!array_key_exists($sCurrencyCode, dibs_pw_api::api_dibs_get_currencyArray())) {
|
34 |
+
Mage::throwException(Mage::helper('dibspw')->__('Selected currency code (' .
|
35 |
$sCurrencyCode . ') is not compatabile with Dibs'));
|
36 |
}
|
37 |
return $this;
|
@@ -51,53 +51,57 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
51 |
'capturestatus' => 'captureStatus');
|
52 |
|
53 |
/**
|
54 |
-
* Array of currency's
|
55 |
*
|
56 |
* @var array
|
57 |
*/
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
101 |
|
102 |
/**
|
103 |
* Returns CMS order common information converted to standardized order information objects.
|
@@ -142,7 +146,6 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
142 |
if(count($oOrder->etc) > 0) {
|
143 |
foreach($oOrder->etc as $sKey => $sVal) $aData['s_' . $sKey] = $sVal;
|
144 |
}
|
145 |
-
//array_walk($aData, create_function('&$val', '$val = trim($val);'));
|
146 |
$sMAC = $this->api_dibs_calcMAC($aData, $this->helper_dibs_tools_conf('HMAC'));
|
147 |
if(!empty($sMAC)) $aData['MAC'] = $sMAC;
|
148 |
|
@@ -156,9 +159,10 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
156 |
* @param object $oOrder Formated to object order common information.
|
157 |
*/
|
158 |
private function api_dibs_commonFields(&$aData, $oOrder) {
|
159 |
-
|
160 |
-
$aData['
|
161 |
-
$aData['
|
|
|
162 |
$aData['currency'] = $oOrder->order->currency;
|
163 |
$aData['language'] = $this->helper_dibs_tools_conf('lang');
|
164 |
if((string)$this->helper_dibs_tools_conf('fee') == 'yes') $aData['addfee'] = 1;
|
@@ -184,25 +188,20 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
184 |
private function api_dibs_invoiceFields(&$aData, $mOrderInfo) {
|
185 |
$oOrder = $this->api_dibs_invoiceOrderObject($mOrderInfo);
|
186 |
foreach($oOrder->addr as $sKey => $sVal) {
|
187 |
-
//$sVal = trim($sVal);
|
188 |
-
//if(!empty($sVal)) $aData[$sKey] = self::api_dibs_utf8Fix($sVal);
|
189 |
$aData[$sKey] = $sVal;
|
190 |
-
|
191 |
}
|
|
|
192 |
$oOrder->items[] = $oOrder->ship;
|
193 |
if(isset($oOrder->items) && count($oOrder->items) > 0) {
|
194 |
$aData['oitypes'] = 'QUANTITY;UNITCODE;DESCRIPTION;AMOUNT;ITEMID';
|
195 |
-
|
196 |
$aData['oinames'] = 'Qty;UnitCode;Description;Amount;ItemId';
|
197 |
-
|
198 |
if(isset($oOrder->items[0]->tax)) {
|
199 |
$aData['oitypes'] .= (self::$bTaxAmount ? ';VATAMOUNT' : ';VATPERCENT');
|
200 |
$aData['oinames'] .= (self::$bTaxAmount ? ';VatAmount' : ';VatPercent');
|
201 |
}
|
202 |
-
|
203 |
$i = 1;
|
204 |
foreach($oOrder->items as $oItem) {
|
205 |
-
$iTmpPrice = self::api_dibs_round($oItem->price);
|
206 |
if(!empty($iTmpPrice)) {
|
207 |
$sTmpName = !empty($oItem->name) ? $oItem->name : $oItem->sku;
|
208 |
if(empty($sTmpName)) $sTmpName = $oItem->id;
|
@@ -295,7 +294,7 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
295 |
|
296 |
$iAmount = (isset($_POST['voucherAmount']) && $_POST['voucherAmount'] > 0) ?
|
297 |
$_POST['amountOriginal'] : $_POST['amount'];
|
298 |
-
if(abs((int)$iAmount - (int)self::api_dibs_round($mOrderInfo->amount)) >= 0.01) return 4;
|
299 |
|
300 |
if((int)$mOrderInfo->currency != (int)$_POST['currency']) return 6;
|
301 |
|
@@ -454,19 +453,6 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
454 |
foreach($aData as $sKey => $sVal) {
|
455 |
$sData .= '&' . $sKey . '=' . (($bUrlDecode === TRUE) ? urldecode($sVal) : $sVal);
|
456 |
}
|
457 |
-
|
458 |
-
|
459 |
-
$str="";
|
460 |
-
$str .= "array(";
|
461 |
-
|
462 |
-
foreach( $tData as $k=>$v ){
|
463 |
-
$str .= '"'.$k.'" =>'.'"'.$v.'"'.',';
|
464 |
-
}
|
465 |
-
$str .= ")";
|
466 |
-
$fl = fopen("D:\\itwillbegood.txt" ,"w+");
|
467 |
-
fputs( $fl, $str);
|
468 |
-
|
469 |
-
|
470 |
$sMAC = hash_hmac('sha256', ltrim($sData, '&'), self::api_dibs_hextostr($sHMAC));
|
471 |
}
|
472 |
|
@@ -491,7 +477,7 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
491 |
*
|
492 |
* @return string
|
493 |
*/
|
494 |
-
final public function api_dibs_get_formAction() {
|
495 |
return self::$sFormAction;
|
496 |
}
|
497 |
|
@@ -520,13 +506,15 @@ class dibs_pw_api extends dibs_pw_helpers {
|
|
520 |
* @param bool $bFlip If we need to flip self::$aCurrency array and look in another format.
|
521 |
* @return string
|
522 |
*/
|
523 |
-
final public static function
|
524 |
-
|
525 |
-
|
526 |
-
return
|
527 |
-
|
|
|
528 |
}
|
529 |
|
|
|
530 |
/**
|
531 |
* Convert hex HMAC to string.
|
532 |
*
|
51 |
'capturestatus' => 'captureStatus');
|
52 |
|
53 |
/**
|
54 |
+
* Array of currency's with of digits after the decimal separator.
|
55 |
*
|
56 |
* @var array
|
57 |
*/
|
58 |
+
|
59 |
+
private static $aCurrency = array(
|
60 |
+
'AFA'=>array('004',2),'ALL'=>array('008',2),'AMD'=>array('051',2),'ANG'=>array('532',2),
|
61 |
+
'AOA'=>array('973',2),'ARS'=>array('032',2),'AUD'=>array('036',2),'AWG'=>array('533',2),
|
62 |
+
'BAM'=>array('977',2),'BBD'=>array('052',2),'BDT'=>array('050',2),'BGN'=>array('975',2),
|
63 |
+
'BHD'=>array('048',3),'BIF'=>array('108',0),'BMD'=>array('060',2),'BND'=>array('096',2),
|
64 |
+
'BOB'=>array('068',2),'BRL'=>array('986',2),'BSD'=>array('044',2),'BTN'=>array('064',2),
|
65 |
+
'BWP'=>array('072',2),'BYR'=>array('974',0),'BZD'=>array('084',2),'CAD'=>array('124',2),
|
66 |
+
'CDF'=>array('976',2),'CHF'=>array('756',2),'CLP'=>array('152',0),'CNY'=>array('156',2),
|
67 |
+
'COP'=>array('170',2),'CRC'=>array('188',2),'CUP'=>array('192',2),'CVE'=>array('132',2),
|
68 |
+
'CZK'=>array('203',2),'DJF'=>array('262',0),'DKK'=>array('208',2),'DOP'=>array('214',2),
|
69 |
+
'DZD'=>array('012',2),'EGP'=>array('818',2),'ERN'=>array('232',2),'ETB'=>array('230',2),
|
70 |
+
'EUR'=>array('978',2),'FJD'=>array('242',2),'FKP'=>array('238',2),'GBP'=>array('826',2),
|
71 |
+
'GEL'=>array('981',2),'GIP'=>array('292',2),'GMD'=>array('270',2),'GNF'=>array('324',0),
|
72 |
+
'GTQ'=>array('320',2),'GYD'=>array('328',2),'HKD'=>array('344',2),'HNL'=>array('340',2),
|
73 |
+
'HRK'=>array('191',2),'HTG'=>array('332',2),'HUF'=>array('348',2),'IDR'=>array('360',2),
|
74 |
+
'ILS'=>array('376',2),'INR'=>array('356',2),'IQD'=>array('368',3),'IRR'=>array('364',2),
|
75 |
+
'ISK'=>array('352',0),'JMD'=>array('388',2),'JOD'=>array('400',3),'JPY'=>array('392',0),
|
76 |
+
'KES'=>array('404',2),'KGS'=>array('417',2),'KHR'=>array('116',2),'KMF'=>array('174',0),
|
77 |
+
'KPW'=>array('408',2),'KRW'=>array('410',0),'KWD'=>array('414',3),'KYD'=>array('136',2),
|
78 |
+
'KZT'=>array('398',2),'LAK'=>array('418',2),'LBP'=>array('422',2),'LKR'=>array('144',2),
|
79 |
+
'LRD'=>array('430',2),'LSL'=>array('426',2),'LTL'=>array('440',2),'LVL'=>array('428',2),
|
80 |
+
'LYD'=>array('434',3),'MAD'=>array('504',2),'MDL'=>array('498',2),'MKD'=>array('807',2),
|
81 |
+
'MMK'=>array('104',2),'MNT'=>array('496',2),'MOP'=>array('446',2),'MRO'=>array('478',0),
|
82 |
+
'MUR'=>array('480',2),'MVR'=>array('462',2),'MWK'=>array('454',2),'MXN'=>array('484',2),
|
83 |
+
'MYR'=>array('458',2),'NAD'=>array('516',2),'NGN'=>array('566',2),'NIO'=>array('558',2),
|
84 |
+
'NOK'=>array('578',2),'NPR'=>array('524',2),'NZD'=>array('554',2),'OMR'=>array('512',3),
|
85 |
+
'PAB'=>array('590',2),'PEN'=>array('604',2),'PGK'=>array('598',2),'PHP'=>array('608',2),
|
86 |
+
'PKR'=>array('586',2),'PLN'=>array('985',2),'PYG'=>array('600',0),'QAR'=>array('634',2),
|
87 |
+
'RUB'=>array('643',2),'RWF'=>array('646',0),'SAR'=>array('682',2),'SBD'=>array('090',2),
|
88 |
+
'SCR'=>array('690',2),'SEK'=>array('752',2),'SGD'=>array('702',2),'SHP'=>array('654',2),
|
89 |
+
'SLL'=>array('694',2),'SOS'=>array('706',2),'STD'=>array('678',2),'SVC'=>array('222',2),
|
90 |
+
'SYP'=>array('760',2),'SZL'=>array('748',2),'THB'=>array('764',2),'TJS'=>array('972',2),
|
91 |
+
'TND'=>array('788',3),'TOP'=>array('776',2),'TRY'=>array('949',2),'TTD'=>array('780',2),
|
92 |
+
'TWD'=>array('901',2),'TZS'=>array('834',2),'UAH'=>array('980',2),'UGX'=>array('800',2),
|
93 |
+
'USD'=>array('840',2),'UYU'=>array('858',2),'UZS'=>array('860',2),'VND'=>array('704',0),
|
94 |
+
'VUV'=>array('548',0),'XAF'=>array('950',0),'XCD'=>array('951',2),'XOF'=>array('952',0),
|
95 |
+
'XPF'=>array('953',0),'YER'=>array('886',2),'ZAR'=>array('710',2),'ZMK'=>array('894',2),
|
96 |
+
'ADP'=>array('020',0),'AZM'=>array('031',0),'BGL'=>array('100',2),'BOV'=>array('984',2),
|
97 |
+
'CLF'=>array('990',0),'CYP'=>array('196',2),'ECS'=>array('218',0),'ECV'=>array('983',0),
|
98 |
+
'EEK'=>array('233',2),'GHC'=>array('288',0),'GWP'=>array('624',2),'MGF'=>array('450',0),
|
99 |
+
'MTL'=>array('470',2),'MXV'=>array('979',2),'MZM'=>array('508',0),'ROL'=>array('642',2),
|
100 |
+
'RUR'=>array('810',2),'SDD'=>array('736',0),'SIT'=>array('705',1),'SKK'=>array('703',1),
|
101 |
+
'SRG'=>array('740',2),'TMM'=>array('795',0),'TPE'=>array('626',2),'TRL'=>array('792',0),
|
102 |
+
'VEB'=>array('862',2),'YUM'=>array('891',2),'ZWD'=>array('716',2));
|
103 |
+
|
104 |
+
|
105 |
|
106 |
/**
|
107 |
* Returns CMS order common information converted to standardized order information objects.
|
146 |
if(count($oOrder->etc) > 0) {
|
147 |
foreach($oOrder->etc as $sKey => $sVal) $aData['s_' . $sKey] = $sVal;
|
148 |
}
|
|
|
149 |
$sMAC = $this->api_dibs_calcMAC($aData, $this->helper_dibs_tools_conf('HMAC'));
|
150 |
if(!empty($sMAC)) $aData['MAC'] = $sMAC;
|
151 |
|
159 |
* @param object $oOrder Formated to object order common information.
|
160 |
*/
|
161 |
private function api_dibs_commonFields(&$aData, $oOrder) {
|
162 |
+
self::$sDefaultCurr = $oOrder->order->currency;
|
163 |
+
$aData['orderid'] = $oOrder->order->orderid;
|
164 |
+
$aData['merchant'] = $this->helper_dibs_tools_conf('mid');
|
165 |
+
$aData['amount'] = self::api_dibs_round($oOrder->order->amount, dibs_pw_api::api_dibs_get_currencyMinValue( $oOrder->order->currency ));
|
166 |
$aData['currency'] = $oOrder->order->currency;
|
167 |
$aData['language'] = $this->helper_dibs_tools_conf('lang');
|
168 |
if((string)$this->helper_dibs_tools_conf('fee') == 'yes') $aData['addfee'] = 1;
|
188 |
private function api_dibs_invoiceFields(&$aData, $mOrderInfo) {
|
189 |
$oOrder = $this->api_dibs_invoiceOrderObject($mOrderInfo);
|
190 |
foreach($oOrder->addr as $sKey => $sVal) {
|
|
|
|
|
191 |
$aData[$sKey] = $sVal;
|
|
|
192 |
}
|
193 |
+
|
194 |
$oOrder->items[] = $oOrder->ship;
|
195 |
if(isset($oOrder->items) && count($oOrder->items) > 0) {
|
196 |
$aData['oitypes'] = 'QUANTITY;UNITCODE;DESCRIPTION;AMOUNT;ITEMID';
|
|
|
197 |
$aData['oinames'] = 'Qty;UnitCode;Description;Amount;ItemId';
|
|
|
198 |
if(isset($oOrder->items[0]->tax)) {
|
199 |
$aData['oitypes'] .= (self::$bTaxAmount ? ';VATAMOUNT' : ';VATPERCENT');
|
200 |
$aData['oinames'] .= (self::$bTaxAmount ? ';VatAmount' : ';VatPercent');
|
201 |
}
|
|
|
202 |
$i = 1;
|
203 |
foreach($oOrder->items as $oItem) {
|
204 |
+
$iTmpPrice = self::api_dibs_round($oItem->price, dibs_pw_api::api_dibs_get_currencyMinValue( self::$sDefaultCurr ));
|
205 |
if(!empty($iTmpPrice)) {
|
206 |
$sTmpName = !empty($oItem->name) ? $oItem->name : $oItem->sku;
|
207 |
if(empty($sTmpName)) $sTmpName = $oItem->id;
|
294 |
|
295 |
$iAmount = (isset($_POST['voucherAmount']) && $_POST['voucherAmount'] > 0) ?
|
296 |
$_POST['amountOriginal'] : $_POST['amount'];
|
297 |
+
if(abs((int)$iAmount - (int)self::api_dibs_round($mOrderInfo->amount, dibs_pw_api::api_dibs_get_currencyMinValue( $_POST['currency'] ) )) >= 0.01) return 4;
|
298 |
|
299 |
if((int)$mOrderInfo->currency != (int)$_POST['currency']) return 6;
|
300 |
|
453 |
foreach($aData as $sKey => $sVal) {
|
454 |
$sData .= '&' . $sKey . '=' . (($bUrlDecode === TRUE) ? urldecode($sVal) : $sVal);
|
455 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
$sMAC = hash_hmac('sha256', ltrim($sData, '&'), self::api_dibs_hextostr($sHMAC));
|
457 |
}
|
458 |
|
477 |
*
|
478 |
* @return string
|
479 |
*/
|
480 |
+
final public static function api_dibs_get_formAction() {
|
481 |
return self::$sFormAction;
|
482 |
}
|
483 |
|
506 |
* @param bool $bFlip If we need to flip self::$aCurrency array and look in another format.
|
507 |
* @return string
|
508 |
*/
|
509 |
+
final public static function api_dibs_get_currencyMinValue($sCode) {
|
510 |
+
|
511 |
+
$minValue = isset(dibs_pw_api::$aCurrency[$sCode]) ? dibs_pw_api::$aCurrency[$sCode][1] : 2;
|
512 |
+
return $minValue;
|
513 |
+
|
514 |
+
|
515 |
}
|
516 |
|
517 |
+
|
518 |
/**
|
519 |
* Convert hex HMAC to string.
|
520 |
*
|
@@ -84,14 +84,13 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
84 |
if($bResponse === TRUE) {
|
85 |
$mOrderInfo->loadByIncrementId((int)$_POST['orderid']);
|
86 |
}
|
87 |
-
|
88 |
return (object)array(
|
89 |
'orderid' => $mOrderInfo->getRealOrderId(),
|
90 |
'amount' => $mOrderInfo->getTotalDue(),
|
91 |
-
'currency' => $
|
92 |
-
|
93 |
-
|
94 |
-
);
|
95 |
}
|
96 |
|
97 |
/**
|
@@ -106,13 +105,11 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
106 |
if($this->helper_dibs_tools_conf('bundle') == 'yes') {
|
107 |
$spitBundle = true;
|
108 |
}
|
109 |
-
|
110 |
foreach($mOrderInfo->getAllItems() as $oItem) {
|
111 |
-
|
112 |
-
//
|
113 |
-
if($
|
114 |
-
($spitBundle == true && $oItem->getChildrenItems())) continue;
|
115 |
-
|
116 |
|
117 |
$aItems[] = (object)array(
|
118 |
'id' => $oItem->getProductId(),
|
@@ -123,20 +120,8 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
123 |
'tax' => 0
|
124 |
);
|
125 |
|
126 |
-
|
127 |
-
//!$oItem->getParentItem()
|
128 |
-
//getChildrenItems()
|
129 |
-
//var_dump($oItem);
|
130 |
}
|
131 |
|
132 |
-
|
133 |
-
//var_dump($mOrderInfo->getAllItems());
|
134 |
-
|
135 |
-
//echo $this->helper_dibs_tools_conf('bundle');
|
136 |
-
|
137 |
-
//exit;
|
138 |
-
|
139 |
-
|
140 |
$fDiscount = $mOrderInfo->getDiscountAmount();
|
141 |
if(!empty($fDiscount)) {
|
142 |
$aItems[] = (object)array(
|
@@ -152,6 +137,11 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
152 |
$fTaxTotal = 0;
|
153 |
$aTaxes = $mOrderInfo->getFullTaxInfo();
|
154 |
foreach($aTaxes as $aTax) if(isset($aTax['amount'])) $fTaxTotal += $aTax['amount'];
|
|
|
|
|
|
|
|
|
|
|
155 |
$aItems[] = (object)array(
|
156 |
'id' => 'tax0',
|
157 |
'name' => $this->helper_dibs_tools_lang('tax_total'),
|
@@ -162,6 +152,7 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
162 |
);
|
163 |
|
164 |
return $aItems;
|
|
|
165 |
}
|
166 |
|
167 |
/**
|
@@ -190,7 +181,9 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
190 |
function helper_dibs_obj_addr($mOrderInfo) {
|
191 |
$aShipping = $mOrderInfo->getShippingAddress();
|
192 |
$aBilling = $mOrderInfo->getBillingAddress();
|
193 |
-
|
|
|
|
|
194 |
return (object)array(
|
195 |
'shippingfirstname' => $aShipping['firstname'],
|
196 |
'shippinglastname' => $aShipping['lastname'],
|
@@ -199,7 +192,6 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
199 |
'shippingaddress2' => $aShipping['street'],
|
200 |
'shippingaddress' => $aShipping['country_id'] . " " .
|
201 |
$aShipping['region'],
|
202 |
-
|
203 |
'billingfirstname' => $aBilling['firstname'],
|
204 |
'billinglastname' => $aBilling['lastname'],
|
205 |
'billingpostalcode' => $aBilling['postcode'],
|
@@ -207,7 +199,6 @@ class dibs_pw_helpers extends dibs_pw_helpers_cms implements dibs_pw_helpers_int
|
|
207 |
'billingaddress2' => $aBilling['street'],
|
208 |
'billingaddress' => $aBilling['country_id'] . " " .
|
209 |
$aBilling['region'],
|
210 |
-
|
211 |
'billingmobile' => $aBilling['telephone'],
|
212 |
'billingemail' => $mOrderInfo['customer_email']
|
213 |
);
|
84 |
if($bResponse === TRUE) {
|
85 |
$mOrderInfo->loadByIncrementId((int)$_POST['orderid']);
|
86 |
}
|
87 |
+
|
88 |
return (object)array(
|
89 |
'orderid' => $mOrderInfo->getRealOrderId(),
|
90 |
'amount' => $mOrderInfo->getTotalDue(),
|
91 |
+
'currency' => $mOrderInfo->getOrderCurrency()->getCode()
|
92 |
+
|
93 |
+
);
|
|
|
94 |
}
|
95 |
|
96 |
/**
|
105 |
if($this->helper_dibs_tools_conf('bundle') == 'yes') {
|
106 |
$spitBundle = true;
|
107 |
}
|
108 |
+
|
109 |
foreach($mOrderInfo->getAllItems() as $oItem) {
|
110 |
+
|
111 |
+
// Just exclude chilren from bundle products
|
112 |
+
if($oItem->getParentItem()) continue;
|
|
|
|
|
113 |
|
114 |
$aItems[] = (object)array(
|
115 |
'id' => $oItem->getProductId(),
|
120 |
'tax' => 0
|
121 |
);
|
122 |
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
$fDiscount = $mOrderInfo->getDiscountAmount();
|
126 |
if(!empty($fDiscount)) {
|
127 |
$aItems[] = (object)array(
|
137 |
$fTaxTotal = 0;
|
138 |
$aTaxes = $mOrderInfo->getFullTaxInfo();
|
139 |
foreach($aTaxes as $aTax) if(isset($aTax['amount'])) $fTaxTotal += $aTax['amount'];
|
140 |
+
|
141 |
+
// Add HiddenTaxAmount to whole Tax amount if we calculate Tax After Discount to avoid amount errors.
|
142 |
+
if( (bool)Mage::getStoreConfig('tax/calculation/apply_after_discount', null) ) {
|
143 |
+
$fTaxTotal += $mOrderInfo->getHiddenTaxAmount();
|
144 |
+
}
|
145 |
$aItems[] = (object)array(
|
146 |
'id' => 'tax0',
|
147 |
'name' => $this->helper_dibs_tools_lang('tax_total'),
|
152 |
);
|
153 |
|
154 |
return $aItems;
|
155 |
+
|
156 |
}
|
157 |
|
158 |
/**
|
181 |
function helper_dibs_obj_addr($mOrderInfo) {
|
182 |
$aShipping = $mOrderInfo->getShippingAddress();
|
183 |
$aBilling = $mOrderInfo->getBillingAddress();
|
184 |
+
|
185 |
+
$aShipping['street'] = str_replace("\n", " ", $aShipping['street']);
|
186 |
+
$aBilling['street'] = str_replace("\n", " ", $aBilling['street']);
|
187 |
return (object)array(
|
188 |
'shippingfirstname' => $aShipping['firstname'],
|
189 |
'shippinglastname' => $aShipping['lastname'],
|
192 |
'shippingaddress2' => $aShipping['street'],
|
193 |
'shippingaddress' => $aShipping['country_id'] . " " .
|
194 |
$aShipping['region'],
|
|
|
195 |
'billingfirstname' => $aBilling['firstname'],
|
196 |
'billinglastname' => $aBilling['lastname'],
|
197 |
'billingpostalcode' => $aBilling['postcode'],
|
199 |
'billingaddress2' => $aBilling['street'],
|
200 |
'billingaddress' => $aBilling['country_id'] . " " .
|
201 |
$aBilling['region'],
|
|
|
202 |
'billingmobile' => $aBilling['telephone'],
|
203 |
'billingemail' => $mOrderInfo['customer_email']
|
204 |
);
|
@@ -24,7 +24,7 @@
|
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Dibspw_Dibspw>
|
27 |
-
<version>4.1.
|
28 |
<depends>
|
29 |
<Mage_Paygate />
|
30 |
</depends>
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Dibspw_Dibspw>
|
27 |
+
<version>4.1.9</version>
|
28 |
<depends>
|
29 |
<Mage_Paygate />
|
30 |
</depends>
|
@@ -132,15 +132,6 @@
|
|
132 |
<show_in_website>1</show_in_website>
|
133 |
<show_in_store>1</show_in_store>
|
134 |
</DIBSPW_distr>
|
135 |
-
<DIBSPW_bundle translate="label">
|
136 |
-
<label>Show bunle products separetly (in Payment Window)</label>
|
137 |
-
<frontend_type>select</frontend_type>
|
138 |
-
<source_model>dibspw/System_Config_Source_Dibsyesno</source_model>
|
139 |
-
<show_in_default>1</show_in_default>
|
140 |
-
<sort_order>15</sort_order>
|
141 |
-
<show_in_website>1</show_in_website>
|
142 |
-
<show_in_store>1</show_in_store>
|
143 |
-
</DIBSPW_bundle>
|
144 |
<order_status translate="label">
|
145 |
<label>New order status (Before the payment is made)</label>
|
146 |
<frontend_type>select</frontend_type>
|
132 |
<show_in_website>1</show_in_website>
|
133 |
<show_in_store>1</show_in_store>
|
134 |
</DIBSPW_distr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
<order_status translate="label">
|
136 |
<label>New order status (Before the payment is made)</label>
|
137 |
<frontend_type>select</frontend_type>
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Dibspw</name>
|
4 |
-
<version>4.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -31,7 +31,9 @@ Card types accepted by the DIBS payment gateway: 
|
|
31 |
- Danske Bank e-betaling 
|
32 |
- Nordea e-betaling 
|
33 |
A complete list can be found at http://www.dibspayment.com/</description>
|
34 |
-
<notes>4.1.
|
|
|
|
|
35 |
- added support of Bundle Products 
|
36 |
4.1.7 
|
37 |
- utf encoding fixed 
|
@@ -78,9 +80,9 @@ A complete list can be found at http://www.dibspayment.com/</description>
|
|
78 |
4.1.0 
|
79 |
- New module for DIBS Payment Window and Mobile Payment Window integration methods </notes>
|
80 |
<authors><author><name>DIBS A/S</name><user>niso</user><email>info@dibs.dk</email></author></authors>
|
81 |
-
<date>2012-
|
82 |
-
<time>
|
83 |
-
<contents><target name="mageskin"><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><target name="magecommunity"><dir name="Dibspw"><dir name="Dibspw"><dir name="Block"><file name="Failure.php" hash="17e6a66c34637fac033d3e04c9e6a45e"/><file name="Form.php" hash="ac2155fe9ed943a258118dfb127ea30f"/><file name="Info.php" hash="aac79075c0ac7a5e40951066d905dd81"/><file name="Redirect.php" hash="b67600699025f99eaadb6cc7f27b42b1"/></dir><dir name="Helper"><file name="Data.php" hash="3ac20dd79b0d2e0cc1609f6b65d330c5"/></dir><dir name="Model"><file name="Dibspw.php" hash="
|
84 |
<compatible/>
|
85 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
86 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Dibspw</name>
|
4 |
+
<version>4.1.9</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
31 |
- Danske Bank e-betaling 
|
32 |
- Nordea e-betaling 
|
33 |
A complete list can be found at http://www.dibspayment.com/</description>
|
34 |
+
<notes>4.1.9
|
35 |
+
- bugfixing release
|
36 |
+
4.1.8 
|
37 |
- added support of Bundle Products 
|
38 |
4.1.7 
|
39 |
- utf encoding fixed 
|
80 |
4.1.0 
|
81 |
- New module for DIBS Payment Window and Mobile Payment Window integration methods </notes>
|
82 |
<authors><author><name>DIBS A/S</name><user>niso</user><email>info@dibs.dk</email></author></authors>
|
83 |
+
<date>2012-12-19</date>
|
84 |
+
<time>16:55:23</time>
|
85 |
+
<contents><target name="mageskin"><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><target name="magecommunity"><dir name="Dibspw"><dir name="Dibspw"><dir name="Block"><file name="Failure.php" hash="17e6a66c34637fac033d3e04c9e6a45e"/><file name="Form.php" hash="ac2155fe9ed943a258118dfb127ea30f"/><file name="Info.php" hash="aac79075c0ac7a5e40951066d905dd81"/><file name="Redirect.php" hash="b67600699025f99eaadb6cc7f27b42b1"/></dir><dir name="Helper"><file name="Data.php" hash="3ac20dd79b0d2e0cc1609f6b65d330c5"/></dir><dir name="Model"><file name="Dibspw.php" hash="3d43225fe5268bad9b9247facecb391e"/><dir name="Mysql4"><file name="Setup.php" hash="1c135886bc8a0794310ec7cb70e04e64"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bundle.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Dibslogos.php" hash="d6cb9db1bd11f8cb40f79fc20fa9c44d"/><file name="Dibspaytypes.php" hash="7efbab315ad0cbdad7149f38c4a155d5"/><file name="Dibsyesno.php" hash="bd2708b2993a928f07215f09ba500094"/><file name="Lang.php" hash="80bf6fdae3628913d10b46f60608c517"/><file name="Orderstatusafter.php" hash="b2f27bddca028be1769051c5b191f1cc"/><file name="Orderstatusbefore.php" hash="e5ff243f2f310609465310c3719327d3"/><file name="PBBdistribution.php" hash="670ced20a731d657081ab720ad9bbc7a"/></dir></dir></dir><dir name="dibs_api"><dir name="pw"><file name="dibs_pw_api.php" hash="5dc1384ab24437d8981061a93f99f4b3"/><file name="dibs_pw_helpers.php" hash="43d715a6b9bf550388ddd4d1624a7ee7"/><file name="dibs_pw_helpers_cms.php" hash="6289c67d4a6f26edb0695c80f58f576c"/><file name="dibs_pw_helpers_interface.php" hash="17a79ee1e27fdd1c6590c07133ba8c04"/><dir name="tmpl"><file name="dibs_pw_error" hash="7f82ad3b9f30425d21cc8991d7c90bf5"/></dir></dir></dir></dir><dir name="controllers"><file name="DibspwController.php" hash="2d596e8dba502511e5894d5adc04e7d3"/></dir><dir name="etc"><file name="config.xml" hash="1d8b27eaf53ec6efdf65cbbb71a10ac6"/><file name="system.xml" hash="56269fd456c10d6e491f935d86350707"/></dir><dir name="sql"><dir name="dibspw_setup"><file name="mysql4-install-4.1.9.php" hash="0bbcb740b5a1d9d23a5293490224bf70"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dibspw_Dibspw.xml" hash="7c82595e6638c292f71a0ad5be4ecaf0"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_Dibspw.csv" hash="3acbdcdc0c8b8764786f85b0e9d7ed7c"/></dir><dir name="nb_NO"><file name="Mage_Dibspw.csv" hash="cabb502e57de177d8949e7f90a5310a7"/><file name="Mage_Dibspw.csv" hash="cabb502e57de177d8949e7f90a5310a7"/></dir><dir name="nn_NO"><file name="Mage_Dibspw.csv" hash="eb9fd99ef73be26d112ffbc53ca8dab5"/></dir><dir name="sv_SE"><file name="Mage_Dibspw.csv" hash="a588b3fc332f095788e8a85aa6544ee9"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="dibspw"><dir name="dibspw"><file name="failure.phtml" hash="f5a7ed44946651f7ad4b1beeca7499be"/><file name="form.phtml" hash="c101fa3c34271f92a8276e76310dd98f"/><file name="redirect.phtml" hash="28e2ab33b1394bc721208a06deccb785"/></dir></dir></dir></dir></dir></dir></target></contents>
|
86 |
<compatible/>
|
87 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
88 |
</package>
|