-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'support/1.x/release/1.12.0' into support/1.x/master
- Loading branch information
Showing
193 changed files
with
1,365 additions
and
17,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
app/code/community/Lyranetwork/Payzen/Block/Customer/Index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Copyright © Lyra Network. | ||
* This file is part of PayZen plugin for Magento. See COPYING.md for license details. | ||
* | ||
* @author Lyra Network (https://www.lyra.com/) | ||
* @copyright Lyra Network | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Lyranetwork_Payzen_Block_Customer_Index extends Mage_Core_Block_Template | ||
{ | ||
public function getStoredPaymentMeans() | ||
{ | ||
|
||
$means = array(); | ||
|
||
$session = Mage::getSingleton('customer/session'); | ||
|
||
// Customer not logged in. | ||
$customer = $session->getCustomer(); | ||
if (! $customer || ! $session->isLoggedIn()) { | ||
return $means; | ||
} | ||
|
||
$aliasIds = array( | ||
'payzen_identifier' => 'payzen_masked_card', | ||
'payzen_sepa_identifier' => 'payzen_sepa_iban' | ||
); | ||
|
||
foreach ($aliasIds as $aliasId => $maskedId) { | ||
// Check if there is a saved alias. | ||
if (! Mage::helper('payzen/payment')->getCustomerAttribute($customer, $aliasId)) { | ||
continue; | ||
} | ||
|
||
$card = array(); | ||
$card['alias'] = $aliasId; | ||
$card['pm'] = $maskedId; | ||
|
||
$maskedPan = Mage::helper('payzen/payment')->getCustomerAttribute($customer,$maskedId); | ||
$pos = strpos($maskedPan, '|'); | ||
|
||
if ($pos !== false) { | ||
$card['brand'] = substr($maskedPan, 0, $pos); | ||
$card['number'] = substr($maskedPan, $pos + 1); | ||
} else { | ||
$card['brand'] = ''; | ||
$card['number'] = $maskedPan; | ||
} | ||
|
||
$means[] = $card; | ||
} | ||
|
||
return $means; | ||
} | ||
|
||
public function getCcTypeImageSrc($card) | ||
{ | ||
return Mage::getBlockSingleton('payzen/standard')->getCcTypeImageSrc($card); | ||
} | ||
} | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.