Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Decode IBAN/BIC(SWIFT) in Form #61

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/app/code/community/Itabs/Debit/Block/Account/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ public function getBankName()
*/
public function getAccountBLZ()
{
return $this->_getAccountData('debit_payment_acount_blz');
if ($data = $this->getInfoData('cc_type')) {
if (!is_numeric($data)) {
$data = Mage::helper('core')->decrypt($data);
}

return $data;
} elseif ($data = $this->_getAccountData('debit_payment_acount_blz')) {
return $data;
} else {
return '';
}
}

/**
Expand Down Expand Up @@ -92,7 +102,11 @@ public function getAccountNumber()
*/
public function getAccountSwift()
{
if (Mage::getStoreConfigFlag('payment/debit/save_account_data')) {
return Mage::helper('core')->decrypt($this->_getAccountData('debit_payment_account_swift'));
} else {
return $this->_getAccountData('debit_payment_account_swift');
}
}

/**
Expand All @@ -101,8 +115,11 @@ public function getAccountSwift()
* @return string
*/
public function getAccountIban()
{
{ if (Mage::getStoreConfigFlag('payment/debit/save_account_data')) {
return Mage::helper('core')->decrypt($this->_getAccountData('debit_payment_account_iban'));
} else {
return $this->_getAccountData('debit_payment_account_iban');
}
}

/**
Expand Down
14 changes: 10 additions & 4 deletions src/app/code/community/Itabs/Debit/Block/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ public function getAccountName()
*
* @return string
*/
public function getAccountSwift()
{
public function getAccountSwift(){
if (Mage::getStoreConfigFlag('payment/debit/save_account_data')) {
return Mage::helper('core')->decrypt($this->_getAccountData('debit_payment_account_swift'));
} else {
return $this->_getAccountData('debit_payment_account_swift');
}
}

/**
Expand All @@ -104,7 +107,11 @@ public function getAccountSwift()
*/
public function getAccountIban()
{
return $this->_getAccountData('debit_payment_account_iban');
if (Mage::getStoreConfigFlag('payment/debit/save_account_data')) {
return Mage::helper('core')->decrypt($this->_getAccountData('debit_payment_account_iban'));
} else {
return $this->_getAccountData('debit_payment_account_iban');
}
}

/**
Expand Down Expand Up @@ -141,7 +148,6 @@ protected function _getAccountData($field)
if (strlen($data) == 0) {
return '';
}

return $this->escapeHtml($data);
}

Expand Down
1 change: 1 addition & 0 deletions src/app/locale/de_DE/Itabs_Debit.csv
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"Export as CSV","CSV-Export"
"Store Owner Bank Account","Bankverbindung des Shop-Betreibers"
"Account Owner","Kontoinhaber"
"Account owner","Kontoinhaber"
"Routing Number","Bankleitzahl"
"Please enter bankaccount credentials of the store owner in the system configuration.","Bitte geben Sie in der System-Konfiguration die Bankverbindung des Shopbetreibers ein. Anderenfalls können Sie keine gültige Export-Datei erzeugen."
"Please note: SEPA Debit Payment orders can only be exported as CSV for now.","Bitte beachten Sie: SEPA-Lastschrift Bestellungen können vorerst nur als CSV-Datei exportiert werden."
Expand Down