-
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 #664 from magento-fearless-kiwis/MAGETWO-62136
[Kiwi] Prepare code base for 2.1.4
- Loading branch information
Showing
590 changed files
with
17,737 additions
and
2,960 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
76 changes: 76 additions & 0 deletions
76
app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.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,76 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Braintree\Block\Customer\PayPal; | ||
|
||
use Magento\Braintree\Gateway\Config\PayPal\Config; | ||
use Magento\Braintree\Model\Ui\PayPal\ConfigProvider; | ||
use Magento\Framework\View\Element\Template; | ||
use Magento\Vault\Api\Data\PaymentTokenInterface; | ||
use Magento\Vault\Block\AbstractTokenRenderer; | ||
|
||
/** | ||
* Class VaultTokenRenderer | ||
*/ | ||
class VaultTokenRenderer extends AbstractTokenRenderer | ||
{ | ||
/** | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
public function __construct( | ||
Template\Context $context, | ||
Config $config, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getIconUrl() | ||
{ | ||
return $this->config->getPayPalIcon()['url']; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getIconHeight() | ||
{ | ||
return $this->config->getPayPalIcon()['height']; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getIconWidth() | ||
{ | ||
return $this->config->getPayPalIcon()['width']; | ||
} | ||
|
||
/** | ||
* Can render specified token | ||
* | ||
* @param PaymentTokenInterface $token | ||
* @return boolean | ||
*/ | ||
public function canRender(PaymentTokenInterface $token) | ||
{ | ||
return $token->getPaymentMethodCode() === ConfigProvider::PAYPAL_CODE; | ||
} | ||
|
||
/** | ||
* Get email of PayPal payer | ||
* @return string | ||
*/ | ||
public function getPayerEmail() | ||
{ | ||
return $this->getTokenDetails()['payerEmail']; | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
app/code/Magento/Braintree/Gateway/Request/DescriptorDataBuilder.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,44 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Braintree\Gateway\Request; | ||
|
||
use Magento\Payment\Gateway\Request\BuilderInterface; | ||
use Magento\Braintree\Gateway\Config\Config; | ||
|
||
/** | ||
* Class DescriptorDataBuilder | ||
*/ | ||
class DescriptorDataBuilder implements BuilderInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private static $descriptorKey = 'descriptor'; | ||
|
||
/** | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* DescriptorDataBuilder constructor. | ||
* @param Config $config | ||
*/ | ||
public function __construct(Config $config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function build(array $buildSubject) | ||
{ | ||
$values = $this->config->getDynamicDescriptors(); | ||
return !empty($values) ? [self::$descriptorKey => $values] : []; | ||
} | ||
} |
Oops, something went wrong.