-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/PAYONE-GmbH/magento-2 int…
…o MAG2-77-Back-button-problem # Conflicts: # Model/PayoneConfig.php # Setup/UpgradeSchema.php # Test/Unit/Controller/Onepage/CancelTest.php # Test/Unit/Controller/Onepage/PlaceOrderTest.php # etc/module.xml
- Loading branch information
Showing
66 changed files
with
2,025 additions
and
469 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2018 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Block\Customer; | ||
|
||
use Payone\Core\Model\PayoneConfig; | ||
|
||
/** | ||
* Block class for deactivating display of the creditcard management | ||
*/ | ||
class Link extends \Magento\Framework\View\Element\Html\Link\Current | ||
{ | ||
/** | ||
* PAYONE base helper | ||
* | ||
* @var \Payone\Core\Helper\Base | ||
*/ | ||
protected $baseHelper; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param \Magento\Framework\View\Element\Template\Context $context | ||
* @param \Magento\Framework\App\DefaultPathInterface $defaultPath | ||
* @param \Payone\Core\Helper\Base $baseHelper | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\View\Element\Template\Context $context, | ||
\Magento\Framework\App\DefaultPathInterface $defaultPath, | ||
\Payone\Core\Helper\Base $baseHelper, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $defaultPath, $data); | ||
$this->baseHelper = $baseHelper; | ||
} | ||
|
||
/** | ||
* Render block HTML | ||
* | ||
* @return string | ||
*/ | ||
public function toHtml() | ||
{ | ||
if ((bool)$this->baseHelper->getConfigParam('save_data_enabled', PayoneConfig::METHOD_CREDITCARD, 'payone_payment') === true) { | ||
return parent::toHtml(); | ||
} | ||
return ''; | ||
} | ||
} |
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,99 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2018 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Block\Payments; | ||
|
||
use Magento\Framework\View\Element\Template; | ||
use Payone\Core\Model\PayoneConfig; | ||
use Payone\Core\Model\ResourceModel\SavedPaymentData; | ||
use Magento\Customer\Model\Session; | ||
|
||
/** | ||
* Block class for saved payment data | ||
*/ | ||
class Management extends \Magento\Framework\View\Element\Template | ||
{ | ||
/** | ||
* SavedPaymentData resource class | ||
* | ||
* @var SavedPaymentData | ||
*/ | ||
protected $savedPaymentData; | ||
|
||
/** | ||
* Customer session object | ||
* | ||
* @var Session | ||
*/ | ||
protected $customerSession; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param Template\Context $context | ||
* @param SavedPaymentData $savedPaymentData | ||
* @param Session $customerSession | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
Template\Context $context, | ||
SavedPaymentData $savedPaymentData, | ||
Session $customerSession, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
$this->savedPaymentData = $savedPaymentData; | ||
$this->customerSession = $customerSession; | ||
} | ||
|
||
public function getCardtypeUrl($aData) | ||
{ | ||
return 'https://cdn.pay1.de/cc/'.strtolower($aData['payment_data']['cardtype']).'/s/default.png'; | ||
} | ||
|
||
/** | ||
* Load all saved payment data of the current customer | ||
* | ||
* @return array | ||
*/ | ||
public function getSavedPaymentData() | ||
{ | ||
$iCustomerId = $this->customerSession->getCustomerId(); | ||
return $this->savedPaymentData->getSavedPaymentData($iCustomerId, PayoneConfig::METHOD_CREDITCARD); | ||
} | ||
|
||
/** | ||
* Generate action url | ||
* | ||
* @param int $iId | ||
* @param string $sAction | ||
* @return string | ||
*/ | ||
public function getActionUrl($iId, $sAction) | ||
{ | ||
return $this->getUrl('payone/payments/'.$sAction, ['id' => $iId]); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2018 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Controller\Payments; | ||
|
||
use Magento\Framework\App\Action\Context; | ||
use Payone\Core\Model\ResourceModel\SavedPaymentData; | ||
use Magento\Customer\Model\Session; | ||
|
||
/** | ||
* Delete saved payment data controller | ||
*/ | ||
class Delete extends \Magento\Framework\App\Action\Action | ||
{ | ||
/** | ||
* SavedPaymentData resource class | ||
* | ||
* @var SavedPaymentData | ||
*/ | ||
protected $savedPaymentData; | ||
|
||
/** | ||
* Customer session object | ||
* | ||
* @var Session | ||
*/ | ||
protected $customerSession; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param Context $context | ||
* @param SavedPaymentData $savedPaymentData | ||
* @param Session $customerSession | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
SavedPaymentData $savedPaymentData, | ||
Session $customerSession | ||
) { | ||
parent::__construct($context); | ||
$this->savedPaymentData = $savedPaymentData; | ||
$this->customerSession = $customerSession; | ||
} | ||
|
||
/** | ||
* Dispatch request | ||
* | ||
* @return \Magento\Framework\Controller\Result\Redirect | ||
*/ | ||
public function execute() | ||
{ | ||
$iDeleteId = $this->getRequest()->getParam('id'); | ||
$iCustomerId = $this->customerSession->getCustomerId(); | ||
if ($iCustomerId) { | ||
$this->savedPaymentData->deletePaymentData($iDeleteId, $iCustomerId); | ||
} | ||
return $this->resultRedirectFactory->create()->setPath('payone/payments/management'); | ||
} | ||
} |
Oops, something went wrong.