Skip to content

Commit

Permalink
[BOT] Migrate release 1.12.0 to GitHub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil Berhouche committed Dec 2, 2020
1 parent 2052c27 commit 0540910
Show file tree
Hide file tree
Showing 193 changed files with 1,365 additions and 17,594 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
1.12.0, 2020-12-02:
- Reorganize backend (REST API keys moved to general configuration section).
- Do payment from backend by redirection in all cases.
- Refund payment using REST API.
- Payment validation using REST API.
- Accept and deny payment using REST API.
- [embedded] Possibility to display embedded payment fields in a popin.
- Do not use vads_order_info* gateway parameter.
- [alias] Display the brand of the registered means of payment in payment by alias.
- [alias] Check registred alias Validity before proposing it for payment.
- [alias] Added possibility to delete registered payment means.

1.11.4, 2020-11-06:
- [embedded] Bug fix: Force redirection when there is an error in payment form token creation.
- [embedded] Bug fix: Display 3DS results for REST API payments.
Expand All @@ -22,6 +34,7 @@
1.11.1, 2020-04-29:
- [embedded] Bugfix: Payment fields error relative to new JavaScript client library.
- [embedded] Disable 1-Click payment buttons when using payment with embedded fields.
- [sofort] Bug fix: do not cancel order on buyer return if transaction status is NOT_CREATED.
- Improve some plugin translations.

1.11.0, 2020-03-04:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Lyranetwork_Payzen_Block_Adminhtml_Redirect extends Lyranetwork_Payzen_Block_Redirect
{
/**
* Get checkout session namespace
* Get checkout session namespace.
*
* @return Mage_Adminhtml_Model_Session_Quote
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct()
/**
* Obtain existing data from form element.
*
* Each row will be instance of Varien_Object
* Each row will be instance of Varien_Object.
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public function __construct()
'rate',
array(
'label' => Mage::helper('payzen')->__('Rate'),
'style' => 'width: 100px;',
'style' => 'width: 100px;'
)
);

$this->addColumn(
'cap',
array(
'label' => Mage::helper('payzen')->__('Cap'),
'style' => 'width: 100px;',
'style' => 'width: 100px;'
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
class Lyranetwork_Payzen_Block_Adminhtml_System_Config_Field_Label extends Mage_Adminhtml_Block_System_Config_Form_Field
{

/**
* Unset some non-related element parameters.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public function __construct()
'label',
array(
'label' => Mage::helper('payzen')->__('Label'),
'style' => 'width: 150px;',
'style' => 'width: 150px;'
)
);
$this->addColumn(
'minimum',
array(
'label' => Mage::helper('payzen')->__('Min. amount'),
'style' => 'width: 80px;',
'style' => 'width: 80px;'
)
);
$this->addColumn(
'maximum',
array(
'label' => Mage::helper('payzen')->__('Max. amount'),
'style' => 'width: 80px;',
'style' => 'width: 80px;'
)
);

Expand All @@ -45,7 +45,7 @@ public function __construct()
'contract',
array(
'label' => Mage::helper('payzen')->__('Contract'),
'style' => 'width: 65px;',
'style' => 'width: 65px;'
)
);
}
Expand All @@ -54,21 +54,21 @@ public function __construct()
'count',
array(
'label' => Mage::helper('payzen')->__('Count'),
'style' => 'width: 65px;',
'style' => 'width: 65px;'
)
);
$this->addColumn(
'period',
array(
'label' => Mage::helper('payzen')->__('Period'),
'style' => 'width: 65px;',
'style' => 'width: 65px;'
)
);
$this->addColumn(
'first',
array(
'label' => Mage::helper('payzen')->__('1st installment'),
'style' => 'width: 70px;',
'style' => 'width: 70px;'
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)

protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '<input id="'.$element->getId().'" class="input-text" type="hidden">';
$html = '<input id="' . $element->getId() . '" class="input-text" type="hidden">';

$html .= $element->getElementHtml();
return $html;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct()
'label',
array(
'label' => Mage::helper('payzen')->__('Label'),
'style' => 'width: 150px;',
'style' => 'width: 150px;'
)
);
$this->addColumn(
Expand All @@ -34,28 +34,28 @@ public function __construct()
'minimum',
array(
'label' => Mage::helper('payzen')->__('Min. amount'),
'style' => 'width: 80px;',
'style' => 'width: 80px;'
)
);
$this->addColumn(
'maximum',
array(
'label' => Mage::helper('payzen')->__('Max. amount'),
'style' => 'width: 80px;',
'style' => 'width: 80px;'
)
);
$this->addColumn(
'count',
array(
'label' => Mage::helper('payzen')->__('Count'),
'style' => 'width: 65px;',
'style' => 'width: 65px;'
)
);
$this->addColumn(
'rate',
array(
'label' => Mage::helper('payzen')->__('Rate'),
'style' => 'width: 65px;',
'style' => 'width: 65px;'
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __construct()
/**
* Obtain existing data from form element.
*
* Each row will be instance of Varien_Object
* Each row will be instance of Varien_Object.
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getArrayRows()
$options = array(
'pan' => Mage::helper('payzen')->__('Card Number'),
'expiry' => Mage::helper('payzen')->__('Expiration Date'),
'cvv' => Mage::helper('payzen')->__('CVV'),
'cvv' => Mage::helper('payzen')->__('CVV')
);

$savedOptions = $this->getElement()->getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Lyranetwork_Payzen_Block_Adminhtml_System_Config_Fieldset_Payment
extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
{
/**
* Render fieldset html
* Render fieldset html.
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
Expand Down
63 changes: 63 additions & 0 deletions app/code/community/Lyranetwork/Payzen/Block/Customer/Index.php
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.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function isOneclickAvailable()
{
$model = Mage::getModel('payzen/payment_standard');

// 1-Click is not available in current context
// 1-Click is not available in current context.
$configContext = $model->getConfigData('one_click_location');
if ($configContext !== Lyranetwork_Payzen_Helper_Payment::ONECLICK_LOCATION_CART
&& $configContext !== Lyranetwork_Payzen_Helper_Payment::ONECLICK_LOCATION_BOTH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function isOneclickAvailable()
{
$model = Mage::getModel('payzen/payment_standard');

// 1-Click is not available in current context
// 1-Click is not available in current context.
$configContext = $model->getConfigData('one_click_location');
if ($configContext !== Lyranetwork_Payzen_Helper_Payment::ONECLICK_LOCATION_PRODUCT
&& $configContext !== Lyranetwork_Payzen_Helper_Payment::ONECLICK_LOCATION_BOTH
Expand Down
5 changes: 2 additions & 3 deletions app/code/community/Lyranetwork/Payzen/Block/Rest/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class Lyranetwork_Payzen_Block_Rest_Head extends Mage_Core_Block_Template
{

protected function _construct()
{
parent::_construct();
Expand All @@ -20,7 +19,7 @@ protected function _construct()
public function getPublicKey()
{
$test = $this->_getHelper()->getCommonConfigData('ctx_mode') === 'TEST';
return $this->getConfigData($test ? 'rest_public_key_test' : 'rest_public_key_prod');
return $this->_getHelper()->getCommonConfigData($test ? 'rest_public_key_test' : 'rest_public_key_prod');
}

public function getPlaceholder($name)
Expand Down Expand Up @@ -75,7 +74,7 @@ public function getConfigData($name)
*/
protected function _toHtml()
{
if (! $this->getConfigData('active') || $this->getConfigData('card_info_mode') != 4) {
if (! $this->getConfigData('active') || ! Mage::getModel('payzen/payment_standard')->isEmbedded()) {
return '';
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Lyranetwork/Payzen/Block/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function _isIframeMode()
protected function _isRestMode()
{
$check = ($this->_getMethodInstance() instanceof Lyranetwork_Payzen_Model_Payment_Standard)
&& ($this->_getMethodInstance()->getConfigData('card_info_mode') == '4')
&& $this->_getMethodInstance()->isEmbedded()
&& $this->_getMethodInstance()->getFormToken(false);

return $check;
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Lyranetwork/Payzen/Block/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function _construct()
{
parent::_construct();

if (($this->getConfigData('card_info_mode') == '4') && $this->getFormToken()) {
if ($this->_getModel()->isEmbedded() && $this->getFormToken()) {
$this->setTemplate('payzen/standard_rest.phtml');
} else {
$this->setTemplate('payzen/standard.phtml');
Expand Down
30 changes: 8 additions & 22 deletions app/code/community/Lyranetwork/Payzen/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

class Lyranetwork_Payzen_Helper_Data extends Mage_Core_Helper_Abstract
{
const MODE_FORM = 1;
const MODE_LOCAL_TYPE = 2;
const MODE_IFRAME = 3;
const MODE_EMBEDDED = 4;
const MODE_POPIN = 5;
/**
* @var array a global var to easily enable/disable features
*/
Expand Down Expand Up @@ -47,7 +52,8 @@ public function getCommonConfigData($field, $storeId = null)
$storeId = Mage::getSingleton('adminhtml/session_quote')->getStoreId();
}

return Mage::getStoreConfig('payment/payzen/' . $field, $storeId);
$value = Mage::getStoreConfig('payment/payzen/' . $field, $storeId);
return is_string($value) ? trim($value) : $value;
}

/**
Expand All @@ -60,7 +66,7 @@ public function getConfigArray($name = '')
{
$result = array();

$xmlNode = 'global/payment/payzen/'.$name;
$xmlNode = 'global/payment/payzen/' . $name;
foreach (Mage::getConfig()->getNode($xmlNode)->asArray() as $xmlData) {
$result[$xmlData['code']] = $xmlData['name'];
}
Expand Down Expand Up @@ -210,26 +216,6 @@ public function getReviewState()
}
}

/**
* Check if server has requirements to do WS operations.
*
* @throws Lyranetwork_Payzen_Model_WsException
*/
public function checkWsRequirements()
{
if (! extension_loaded('soap')) {
throw new Lyranetwork_Payzen_Model_WsException(
'SOAP extension for PHP must be enabled on the server in order to use gateway web services.'
);
}

if (! extension_loaded('openssl')) {
throw new Lyranetwork_Payzen_Model_WsException(
'OPENSSL extension for PHP must be enabled on the server in order to use gateway web services.'
);
}
}

/**
* Log function. Uses Mage::log() with built-in extra data (module version, method called...).
*
Expand Down
Loading

0 comments on commit 0540910

Please sign in to comment.