-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from magento-mpi/MAGETWO-32996
[MPI] Worldpay
- Loading branch information
Showing
36 changed files
with
815 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Payment\Block; | ||
|
||
use Magento\Framework\Phrase; | ||
use Magento\Framework\View\Element\Template\Context; | ||
use Magento\Payment\Gateway\ConfigInterface; | ||
|
||
class ConfigurableInfo extends \Magento\Payment\Block\Info | ||
{ | ||
/** | ||
* @var ConfigInterface | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* @param Context $context | ||
* @param ConfigInterface $config | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
ConfigInterface $config, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
$this->config = $config; | ||
|
||
if (isset($data['pathPattern'])) { | ||
$this->config->setPathPattern($data['pathPattern']); | ||
} | ||
|
||
if (isset($data['pathPattern'])) { | ||
$this->config->setMethodCode($data['methodCode']); | ||
} | ||
} | ||
|
||
/** | ||
* Prepare PayPal-specific payment information | ||
* | ||
* @param \Magento\Framework\Object|array|null $transport | ||
* @return \Magento\Framework\Object | ||
*/ | ||
protected function _prepareSpecificInformation($transport = null) | ||
{ | ||
$transport = parent::_prepareSpecificInformation($transport); | ||
$payment = $this->getInfo(); | ||
$fieldsToStore = explode(',', (string)$this->config->getValue('paymentInfoKeys')); | ||
if ($this->getIsSecureMode()) { | ||
$fieldsToStore = array_diff( | ||
$fieldsToStore, | ||
explode(',', (string)$this->config->getValue('privateInfoKeys')) | ||
); | ||
} | ||
|
||
foreach ($fieldsToStore as $field) { | ||
if ($payment->getAdditionalInformation($field) !== null) { | ||
$this->setDataToTransfer( | ||
$transport, | ||
$field, | ||
$payment->getAdditionalInformation($field) | ||
); | ||
|
||
} | ||
} | ||
|
||
return $transport; | ||
} | ||
|
||
/** | ||
* Sets data to transport | ||
* | ||
* @param \Magento\Framework\Object $transport | ||
* @param string $field | ||
* @param string $value | ||
* @return void | ||
*/ | ||
protected function setDataToTransfer( | ||
\Magento\Framework\Object $transport, | ||
$field, | ||
$value | ||
) { | ||
$transport->setData( | ||
(string)$this->getLabel($field), | ||
(string)$this->getValueView( | ||
$field, | ||
$value | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* Returns label | ||
* | ||
* @param string $field | ||
* @return string | Phrase | ||
*/ | ||
protected function getLabel($field) | ||
{ | ||
return $field; | ||
} | ||
|
||
/** | ||
* Returns value view | ||
* | ||
* @param string $field | ||
* @param string $value | ||
* @return string | Phrase | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
protected function getValueView($field, $value) | ||
{ | ||
return $value; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Payment\Gateway\Command; | ||
|
||
use Magento\Payment\Gateway\Command; | ||
use Magento\Payment\Gateway\CommandInterface; | ||
|
||
class NullCommand implements CommandInterface | ||
{ | ||
/** | ||
* Null command. Does nothing. Stable. | ||
* | ||
* @param array $commandSubject | ||
* | ||
* @return null|Command\ResultInterface | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function execute(array $commandSubject) | ||
{ | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.