Version Notes
Fix: IBAN check Focum Achteraf betalen
Download this release
Release Info
Developer | Magento Core Team |
Extension | sisowpayment |
Version | 4.3.1 |
Comparing to | |
See all releases |
Code changes from version 4.3.0 to 4.3.1
app/code/local/Sisow/Block/Redirect.php
CHANGED
@@ -253,10 +253,11 @@ class Sisow_Block_Redirect extends Mage_Core_Block_Abstract
|
|
253 |
if(($ex = $base->TransactionRequest($arg)) < 0)
|
254 |
{
|
255 |
Mage::log($orderIncrementId . ': Sisow TransactionRequest failed('.$ex.', '.$base->errorCode.', '.$base->errorMessage.')', null, 'log_sisow.log');
|
256 |
-
|
257 |
-
|
|
|
258 |
Mage::getSingleton('checkout/session')->addError($base->errorMessage);
|
259 |
-
else if ($base->payment == focum)
|
260 |
Mage::getSingleton('checkout/session')->addError("Betalen met Achteraf Betalen is op dit moment niet mogelijk, betaal anders.");
|
261 |
else
|
262 |
Mage::getSingleton('checkout/session')->addError("Sisow: " . $this->__('No communication')." (". $ex .", ". $base->errorCode . ")");
|
253 |
if(($ex = $base->TransactionRequest($arg)) < 0)
|
254 |
{
|
255 |
Mage::log($orderIncrementId . ': Sisow TransactionRequest failed('.$ex.', '.$base->errorCode.', '.$base->errorMessage.')', null, 'log_sisow.log');
|
256 |
+
if($base->errorCode == 'IBAN')
|
257 |
+
Mage::getSingleton('checkout/session')->addError("U heeft een verkeerd IBAN ingevoerd.");
|
258 |
+
else if( ($base->payment == 'klarna' || $base->payment == 'klarnaacc') && $base->errorMessage != '')
|
259 |
Mage::getSingleton('checkout/session')->addError($base->errorMessage);
|
260 |
+
else if ($base->payment == 'klarna' || $base->payment == 'klarnaacc' || $base->payment == focum)
|
261 |
Mage::getSingleton('checkout/session')->addError("Betalen met Achteraf Betalen is op dit moment niet mogelijk, betaal anders.");
|
262 |
else
|
263 |
Mage::getSingleton('checkout/session')->addError("Sisow: " . $this->__('No communication')." (". $ex .", ". $base->errorCode . ")");
|
app/code/local/Sisow/Model/Base.php
CHANGED
@@ -239,6 +239,13 @@ class Sisow_Model_Base extends Mage_Core_Model_Abstract
|
|
239 |
}
|
240 |
}
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
if (!$this->send("TransactionRequest", $pars))
|
243 |
return -8;
|
244 |
$this->trxId = $this->parse("trxid");
|
@@ -473,4 +480,47 @@ class Sisow_Model_Base extends Mage_Core_Model_Abstract
|
|
473 |
else
|
474 |
return 'US';
|
475 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
}
|
239 |
}
|
240 |
}
|
241 |
|
242 |
+
if(array_key_exists('iban', $pars) && !$this->checkIBAN($pars['iban']))
|
243 |
+
{
|
244 |
+
$this->errorCode = 'IBAN';
|
245 |
+
$this->errorMessage = 'Check IBAN';
|
246 |
+
return -9;
|
247 |
+
}
|
248 |
+
|
249 |
if (!$this->send("TransactionRequest", $pars))
|
250 |
return -8;
|
251 |
$this->trxId = $this->parse("trxid");
|
480 |
else
|
481 |
return 'US';
|
482 |
}
|
483 |
+
|
484 |
+
public function checkIBAN($iban)
|
485 |
+
{
|
486 |
+
$iban = strtolower($iban);
|
487 |
+
$Countries = array(
|
488 |
+
'al'=>28,'ad'=>24,'at'=>20,'az'=>28,'bh'=>22,'be'=>16,'ba'=>20,'br'=>29,'bg'=>22,'cr'=>21,'hr'=>21,'cy'=>28,'cz'=>24,
|
489 |
+
'dk'=>18,'do'=>28,'ee'=>20,'fo'=>18,'fi'=>18,'fr'=>27,'ge'=>22,'de'=>22,'gi'=>23,'gr'=>27,'gl'=>18,'gt'=>28,'hu'=>28,
|
490 |
+
'is'=>26,'ie'=>22,'il'=>23,'it'=>27,'jo'=>30,'kz'=>20,'kw'=>30,'lv'=>21,'lb'=>28,'li'=>21,'lt'=>20,'lu'=>20,'mk'=>19,
|
491 |
+
'mt'=>31,'mr'=>27,'mu'=>30,'mc'=>27,'md'=>24,'me'=>22,'nl'=>18,'no'=>15,'pk'=>24,'ps'=>29,'pl'=>28,'pt'=>25,'qa'=>29,
|
492 |
+
'ro'=>24,'sm'=>27,'sa'=>24,'rs'=>22,'sk'=>24,'si'=>19,'es'=>24,'se'=>24,'ch'=>21,'tn'=>24,'tr'=>26,'ae'=>23,'gb'=>22,'vg'=>24
|
493 |
+
);
|
494 |
+
$Chars = array(
|
495 |
+
'a'=>10,'b'=>11,'c'=>12,'d'=>13,'e'=>14,'f'=>15,'g'=>16,'h'=>17,'i'=>18,'j'=>19,'k'=>20,'l'=>21,'m'=>22,
|
496 |
+
'n'=>23,'o'=>24,'p'=>25,'q'=>26,'r'=>27,'s'=>28,'t'=>29,'u'=>30,'v'=>31,'w'=>32,'x'=>33,'y'=>34,'z'=>35
|
497 |
+
);
|
498 |
+
|
499 |
+
if (strlen($iban) != $Countries[ substr($iban,0,2) ]) { return false; }
|
500 |
+
|
501 |
+
$MovedChar = substr($iban, 4) . substr($iban,0,4);
|
502 |
+
$MovedCharArray = str_split($MovedChar);
|
503 |
+
$NewString = "";
|
504 |
+
|
505 |
+
foreach ($MovedCharArray as $k => $v) {
|
506 |
+
|
507 |
+
if ( !is_numeric($MovedCharArray[$k]) ) {
|
508 |
+
$MovedCharArray[$k] = $Chars[$MovedCharArray[$k]];
|
509 |
+
}
|
510 |
+
$NewString .= $MovedCharArray[$k];
|
511 |
+
}
|
512 |
+
if (function_exists("bcmod")) { return bcmod($NewString, '97') == 1; }
|
513 |
+
|
514 |
+
$x = $NewString; $y = "97";
|
515 |
+
$take = 5; $mod = "";
|
516 |
+
|
517 |
+
do {
|
518 |
+
$a = (int)$mod . substr($x, 0, $take);
|
519 |
+
$x = substr($x, $take);
|
520 |
+
$mod = $a % $y;
|
521 |
+
}
|
522 |
+
while (strlen($x));
|
523 |
+
|
524 |
+
return (int)$mod == 1;
|
525 |
+
}
|
526 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>sisowpayment</name>
|
4 |
-
<version>4.3.
|
5 |
<stability>stable</stability>
|
6 |
<license/>
|
7 |
<channel>community</channel>
|
@@ -17,13 +17,11 @@ Klarna Account
|
|
17 |
Klarna Invoice
|
18 |
MisterCash
|
19 |
Sofort</description>
|
20 |
-
<notes>Fix:
|
21 |
-
Added: Giropay payment method
|
22 |
-
Added: EPS payment method</notes>
|
23 |
<authors><author><name>Sisow</name><user>auto-converted</user><email>support@sisow.nl</email></author></authors>
|
24 |
-
<date>2015-
|
25 |
-
<time>
|
26 |
-
<contents><target name="magelocale"><dir name="nl_NL"><file name="Sisow.csv" hash="bd2ef07e171945a0784a8ee8b79362bb"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sisow.xml" hash="7da3fbd82a48d5428b8c723bafbb946b"/></dir></target><target name="magelocal"><dir name="Sisow"><dir name="Block"><dir name="Adminhtml"><file name="Notice.php" hash="56154d92843b3c8a205837010405923e"/></dir><dir name="Paymentfee"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="c086b64c05012dc579ee54fb6e50c5a3"/></dir></dir></dir><dir name="Checkout"><file name="Fee.php" hash="c7b7b19d5f2d2c5fbd07f355f8f57f9e"/></dir><dir name="Creditmemo"><file name="Totals.php" hash="ccfaa67f45416ab398ec55ea7356b537"/></dir><dir name="Invoice"><dir name="Totals"><file name="Fee.php" hash="a715f52568aa5f4a42a65437be3d0fb8"/></dir></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="2158794a5836acedc765900403649b16"/></dir></dir></dir><dir name="Paymentmethod"><file name="Creditcard.php" hash="bddf58a2a12dae02e5061b04e68345da"/><file name="Default.php" hash="b1c2947be1e0e731a5aea8757f038018"/><file name="DefaultInfo.php" hash="12bc768b15a910295c911f4790ae936a"/><file name="Eps.php" hash="561dd123d17e0b8b44c8d365d0bc4e00"/><file name="Focum.php" hash="cc242ee202d45176ff1265ca445ec937"/><file name="Giropay.php" hash="712d77e79fcab547ca5544b7e6b2807f"/><file name="Ideal.php" hash="45d11ae70ca002c9c2f10431d65f388e"/><file name="IdealInfo.php" hash="f2be70b33ab781c89a25c4be6f738067"/><file name="Klarna.php" hash="8b529f2c376fd78888b91d8d73339118"/><file name="Klarnaacc.php" hash="2923d73bb1a9b8ad712d7671c6012e37"/><file name="Overboeking.php" hash="87050fba1fb782fce9e02e5c8095ef2e"/></dir><file name="Redirect.php" hash="
|
27 |
<compatible/>
|
28 |
<dependencies/>
|
29 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>sisowpayment</name>
|
4 |
+
<version>4.3.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license/>
|
7 |
<channel>community</channel>
|
17 |
Klarna Invoice
|
18 |
MisterCash
|
19 |
Sofort</description>
|
20 |
+
<notes>Fix: IBAN check Focum Achteraf betalen</notes>
|
|
|
|
|
21 |
<authors><author><name>Sisow</name><user>auto-converted</user><email>support@sisow.nl</email></author></authors>
|
22 |
+
<date>2015-06-02</date>
|
23 |
+
<time>11:28:17</time>
|
24 |
+
<contents><target name="magelocale"><dir name="nl_NL"><file name="Sisow.csv" hash="bd2ef07e171945a0784a8ee8b79362bb"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sisow.xml" hash="7da3fbd82a48d5428b8c723bafbb946b"/></dir></target><target name="magelocal"><dir name="Sisow"><dir name="Block"><dir name="Adminhtml"><file name="Notice.php" hash="56154d92843b3c8a205837010405923e"/></dir><dir name="Paymentfee"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="c086b64c05012dc579ee54fb6e50c5a3"/></dir></dir></dir><dir name="Checkout"><file name="Fee.php" hash="c7b7b19d5f2d2c5fbd07f355f8f57f9e"/></dir><dir name="Creditmemo"><file name="Totals.php" hash="ccfaa67f45416ab398ec55ea7356b537"/></dir><dir name="Invoice"><dir name="Totals"><file name="Fee.php" hash="a715f52568aa5f4a42a65437be3d0fb8"/></dir></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="2158794a5836acedc765900403649b16"/></dir></dir></dir><dir name="Paymentmethod"><file name="Creditcard.php" hash="bddf58a2a12dae02e5061b04e68345da"/><file name="Default.php" hash="b1c2947be1e0e731a5aea8757f038018"/><file name="DefaultInfo.php" hash="12bc768b15a910295c911f4790ae936a"/><file name="Eps.php" hash="561dd123d17e0b8b44c8d365d0bc4e00"/><file name="Focum.php" hash="cc242ee202d45176ff1265ca445ec937"/><file name="Giropay.php" hash="712d77e79fcab547ca5544b7e6b2807f"/><file name="Ideal.php" hash="45d11ae70ca002c9c2f10431d65f388e"/><file name="IdealInfo.php" hash="f2be70b33ab781c89a25c4be6f738067"/><file name="Klarna.php" hash="8b529f2c376fd78888b91d8d73339118"/><file name="Klarnaacc.php" hash="2923d73bb1a9b8ad712d7671c6012e37"/><file name="Overboeking.php" hash="87050fba1fb782fce9e02e5c8095ef2e"/></dir><file name="Redirect.php" hash="b2e5c13b798b253c02e44d47857f65cc"/></dir><dir name="Helper"><file name="Data.php" hash="42c4a6fdcc9e0c827829f54144775fb6"/><file name="Paymentfee.php" hash="44f51f6166d85f0d6df2348c094ba0aa"/></dir><dir name="Model"><dir name="Config"><file name="Autoinvoice.php" hash="d4edbab951b4b16e8ccab660bbee8fda"/><file name="GeneralAutoinvoice.php" hash="603d830548bf012631fa0e0f00738802"/><file name="Newordermail.php" hash="b0225e1243442e4c1df1ea4eaab72c5c"/><file name="NewordermailMethod.php" hash="41813afa9531be21163c6a4c1550b759"/></dir><dir name="Methods"><file name="Abstract.php" hash="414b9f57a3e10811d4ba7eb3ca5ad227"/><file name="Ebill.php" hash="b4e00783ca4854a4a13e2f4ed78e0e77"/><file name="Eps.php" hash="2e167aa5f5de19e61372b82eefc43c40"/><file name="Focum.php" hash="8802d0c495c6188340391d0d6f5faa0c"/><file name="Giropay.php" hash="e9c83931c3d1491ff14d12288c4f6348"/><file name="Ideal.php" hash="26275c27874cd4e1eb32b7d59540c65e"/><file name="Klarna.php" hash="46a92a6a29e51e2e152389475e77d025"/><file name="Klarnaacc.php" hash="6905ba077eab559fe4d24a864e0ed416"/><file name="Maestro.php" hash="7372b9babeb8e60e6e7de39a6a249747"/><file name="Mastercard.php" hash="f09053c2dd9581aa094063254178207f"/><file name="Mistercash.php" hash="f56cfae23c74791432cef1e50733829c"/><file name="Overboeking.php" hash="028a8cb928c8fe1fd84645a5427ceae1"/><file name="Paypalec.php" hash="8f802ac3efc8709ab17e130671b1c8dd"/><file name="Sofort.php" hash="f9ebf43bda7ffd62582c869a5ba5014b"/><file name="Visa.php" hash="0214e927261846df04892bdf2c048792"/><file name="WebshopGiftcard.php" hash="3ea06c83b6c0d1f87f1d61dcbf3a55c7"/></dir><dir name="Observer"><file name="Order.php" hash="e5e0ce8e5a05c3c2f87d3893b9932be8"/><file name="Paymentfee.php" hash="78835217b2b6875e14da8b6630c21456"/><file name="Sendebill.php" hash="3042553c46184cea135d9e527055092c"/><file name="Submit.php" hash="47aa5da33f953cf9363f05578b2850fe"/></dir><dir name="Paymentfee"><dir name="Creditmemo"><file name="Total.php" hash="2340fd22ec6597f5fad53d9faea2d9fe"/></dir><dir name="Invoice"><dir name="Pdf"><file name="Total.php" hash="cec95df39f550cd70e6eb63b16cfb627"/></dir><file name="Tax.php" hash="5fba21bc05a7ed55b3c57ccb4b2790b5"/><file name="Total.php" hash="b77c63f1173d2112056a782490968cf6"/></dir><dir name="Quote"><file name="Quote.php" hash="838ad691a2da75b942a8ef41c2815a9a"/><file name="TaxTotal.php" hash="bd7cd2a16dc3dbc8c7a3c82746a0f671"/><file name="Total.php" hash="d2c8afd1ec4c96b6215ae28766e18177"/></dir></dir><file name="Base.php" hash="3a0cb9d55f7faeb7d5feca0a109157b0"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="eb415c1b7ca547226c6c9721a01a0219"/><file name="NotifyController.php" hash="4793822e1b937191ace1f2925038082f"/></dir><dir name="etc"><file name="config.xml" hash="75bd39c2d21962d9f9a5744379c79a7d"/><file name="system.xml" hash="26b9ad4d30b9a172fbe2991dc1083d62"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sisow"><dir name="adminhtml"><file name="notice.phtml" hash="7fa2d76678ad34eae48516fd757c30df"/></dir><dir name="checkout"><file name="default_info.phtml" hash="558581601de86afce3bd62ea50de7a4e"/><file name="ideal_info.phtml" hash="864ee0e16191ef6dca5c18522172b51c"/></dir><file name="form.phtml" hash="0dc40ad38b62218d6f947674312b7a61"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sisow"><dir name="checkout"><file name="default_form.phtml" hash="200cebfa46ff85c95fdc0cedda4441a4"/><file name="default_info.phtml" hash="94eeee994f2f21dc36489f6b7824e616"/><file name="eps_form.phtml" hash="a202c60fba2712e9f677fa0ba6034068"/><file name="focum_form.phtml" hash="e1076aadcee16249baaf0b5e4c079d1a"/><file name="giropay_form.phtml" hash="64100a34bd184137a52be2bf18f78478"/><file name="ideal_form.phtml" hash="37f399e0cd922e70586a3be6a00f76a3"/><file name="ideal_info.phtml" hash="88e15559e2f0cca9744b4dae1a81a1ea"/><file name="klarna_form.phtml" hash="8a232f3e8f6e3bcf453298a922dd26bf"/><file name="klarnaacc_form.phtml" hash="c2e32986bbd9a95bea23b1ff8d49ef0e"/><file name="overboeking_form.phtml" hash="164e244d6df230f20f460012fc72a7d8"/></dir><dir name="paymentfee"><dir name="checkout"><file name="fee.phtml" hash="79362bab3963195ad6727d077fe87b11"/></dir></dir><file name="form.phtml" hash="8874a0713c384d1346f6ae713f2cb9bd"/><file name="formecare.phtml" hash="0de41387de5f0c8d35066c0f30e113c2"/><file name="formovb.phtml" hash="20da22a0ef4384411bf971ff133a6a2c"/></dir></dir><dir name="layout"><file name="sisow.xml" hash="bc2d1b353ba1597e72e1087967cc5275"/></dir></dir></dir></dir></target></contents>
|
25 |
<compatible/>
|
26 |
<dependencies/>
|
27 |
</package>
|