Skip to content

Commit 074392d

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-52125
2 parents 5111c2e + 6a38dd7 commit 074392d

File tree

225 files changed

+1718
-1721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+1718
-1721
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Use the following table to verify you have the correct prerequisites to install
3333
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache.html">Apache</a></td>
3434
</tr>
3535
<tr>
36-
<td>PHP ~5.5.22 or 5.6.x</td>
36+
<td>PHP 5.6.x, 7.0.2 or 7.0.6</td>
3737
<td><code>php -v</code></td>
3838
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-ubuntu.html">PHP Ubuntu</a><br><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html">PHP CentOS</a></td>
3939
</tr>

app/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
#ini_set('display_errors', 1);
1212

1313
/* PHP version validation */
14-
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50522) {
14+
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID >= 70006)) {
1515
if (PHP_SAPI == 'cli') {
16-
echo 'Magento supports PHP 5.5.22 or later. ' .
16+
echo 'Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. ' .
1717
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
1818
} else {
1919
echo <<<HTML
2020
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
21-
<p>Magento supports PHP 5.5.22 or later. Please read
21+
<p>Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read
2222
<a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
2323
Magento System Requirements</a>.
2424
</div>

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-admin-notification",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-store": "100.1.*",
77
"magento/module-backend": "100.1.*",
88
"magento/module-media-storage": "100.1.*",

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-advanced-pricing-import-export",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-catalog": "101.0.*",
77
"magento/module-catalog-inventory": "100.1.*",
88
"magento/module-eav": "100.1.*",

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorization",
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-backend": "100.1.*",
77
"magento/framework": "100.1.*"
88
},

app/code/Magento/Authorizenet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorizenet",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-sales": "100.1.*",
77
"magento/module-store": "100.1.*",
88
"magento/module-quote": "100.1.*",

app/code/Magento/Backend/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-backend",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-store": "100.1.*",
77
"magento/module-directory": "100.1.*",
88
"magento/module-developer": "100.1.*",

app/code/Magento/Backup/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-backup",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.22|~5.6.0|~7.0.0",
5+
"php": "~5.6.0|7.0.2|~7.0.6",
66
"magento/module-store": "100.1.*",
77
"magento/module-backend": "100.1.*",
88
"magento/module-cron": "100.1.*",

app/code/Magento/Braintree/Block/Form.php

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
use Magento\Braintree\Gateway\Config\Config as GatewayConfig;
1010
use Magento\Braintree\Model\Adminhtml\Source\CcType;
1111
use Magento\Braintree\Model\Ui\ConfigProvider;
12+
use Magento\Framework\App\ObjectManager;
1213
use Magento\Framework\View\Element\Template\Context;
1314
use Magento\Payment\Block\Form\Cc;
15+
use Magento\Payment\Helper\Data;
1416
use Magento\Payment\Model\Config;
1517
use Magento\Vault\Model\VaultPaymentInterface;
1618

@@ -36,17 +38,16 @@ class Form extends Cc
3638
protected $ccType;
3739

3840
/**
39-
* @var VaultPaymentInterface
41+
* @var Data
4042
*/
41-
protected $vaultService;
43+
private $paymentDataHelper;
4244

4345
/**
4446
* @param Context $context
4547
* @param Config $paymentConfig
4648
* @param Quote $sessionQuote
4749
* @param GatewayConfig $gatewayConfig
4850
* @param CcType $ccType
49-
* @param VaultPaymentInterface $vaultService
5051
* @param array $data
5152
*/
5253
public function __construct(
@@ -55,14 +56,12 @@ public function __construct(
5556
Quote $sessionQuote,
5657
GatewayConfig $gatewayConfig,
5758
CcType $ccType,
58-
VaultPaymentInterface $vaultService,
5959
array $data = []
6060
) {
6161
parent::__construct($context, $paymentConfig, $data);
6262
$this->sessionQuote = $sessionQuote;
6363
$this->gatewayConfig = $gatewayConfig;
6464
$this->ccType = $ccType;
65-
$this->vaultService = $vaultService;
6665
}
6766

6867
/**
@@ -91,7 +90,9 @@ public function useCvv()
9190
*/
9291
public function isVaultEnabled()
9392
{
94-
return $this->vaultService->isActiveForPayment(ConfigProvider::CODE);
93+
$storeId = $this->_storeManager->getStore()->getId();
94+
$vaultPayment = $this->getVaultPayment();
95+
return $vaultPayment->isActive($storeId);
9596
}
9697

9798
/**
@@ -123,4 +124,26 @@ private function filterCardTypesForCountry(array $configCardTypes, $countryId)
123124
}
124125
return $filtered;
125126
}
127+
128+
/**
129+
* Get configured vault payment for Braintree
130+
* @return VaultPaymentInterface
131+
*/
132+
private function getVaultPayment()
133+
{
134+
return $this->getPaymentDataHelper()->getMethodInstance(ConfigProvider::CC_VAULT_CODE);
135+
}
136+
137+
/**
138+
* Get payment data helper instance
139+
* @return Data
140+
* @deprecated
141+
*/
142+
private function getPaymentDataHelper()
143+
{
144+
if ($this->paymentDataHelper === null) {
145+
$this->paymentDataHelper = ObjectManager::getInstance()->get(Data::class);
146+
}
147+
return $this->paymentDataHelper;
148+
}
126149
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Braintree\Gateway\Request;
7+
8+
use Magento\Payment\Gateway\Request\BuilderInterface;
9+
use Magento\Framework\App\ProductMetadataInterface;
10+
11+
/**
12+
* Class BnCodeDataBuilder
13+
*/
14+
class ChannelDataBuilder implements BuilderInterface
15+
{
16+
/**
17+
* @var ProductMetadataInterface
18+
*/
19+
private $productMetadata;
20+
21+
/**
22+
* @var string
23+
*/
24+
private static $channel = 'channel';
25+
26+
/**
27+
* @var string
28+
*/
29+
private static $channelValue = 'Magento2_Cart_%s_BT';
30+
31+
/**
32+
* Constructor
33+
*
34+
* @param ProductMetadataInterface $productMetadata
35+
*/
36+
public function __construct(ProductMetadataInterface $productMetadata)
37+
{
38+
$this->productMetadata = $productMetadata;
39+
}
40+
41+
/**
42+
* @inheritdoc
43+
*/
44+
public function build(array $buildSubject)
45+
{
46+
return [
47+
self::$channel => sprintf(self::$channelValue, $this->productMetadata->getEdition())
48+
];
49+
}
50+
}

0 commit comments

Comments
 (0)