Skip to content

Commit 8744435

Browse files
author
Oleksii Korshenko
authored
Merge pull request #286 from magento-mpi/MPI-bugfixes
Fixed issues: - MAGETWO-56344: [Github] #5902 Braintree doesn't work when using table prefixing - MAGETWO-55953: Exception occurs when tracking shipment with invalid FedEx tracking number - MAGETWO-56801: [GITHUB] Fixed column description for "website_id" column #4388 - MAGETWO-56745: [Github] PayPal Express Checkout "Display on Shopping Cart -> NO" does not work - MAGETWO-56467: Free shipping threshold fields are mixed up in UPS and Fedex configurations - MAGETWO-56342: [Github] #5910 Braintree sandbox errors when using alternative Merchant Account ID - MAGETWO-56115: [Github] #5857 Impossible to configure custom availability gateway validator - MAGETWO-54134: CE module depends on EE code - MAGETWO-56447: UPS not providing shipping rates for Puerto Rico
2 parents 661a3a9 + 2653330 commit 8744435

File tree

33 files changed

+2230
-858
lines changed

33 files changed

+2230
-858
lines changed

app/code/Magento/Braintree/Gateway/Config/Config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,14 @@ public function getDynamicDescriptors()
193193
}
194194
return $values;
195195
}
196+
197+
/**
198+
* Get Merchant account ID
199+
*
200+
* @return string
201+
*/
202+
public function getMerchantAccountId()
203+
{
204+
return $this->getValue(self::KEY_MERCHANT_ACCOUNT_ID);
205+
}
196206
}

app/code/Magento/Braintree/Gateway/Request/PaymentDataBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function build(array $buildSubject)
8787
self::ORDER_ID => $order->getOrderIncrementId()
8888
];
8989

90-
$merchantAccountId = $this->config->getValue(Config::KEY_MERCHANT_ACCOUNT_ID);
90+
$merchantAccountId = $this->config->getMerchantAccountId();
9191
if (!empty($merchantAccountId)) {
9292
$result[self::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
9393
}

app/code/Magento/Braintree/Model/Ui/ConfigProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Braintree\Model\Ui;
77

8+
use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
89
use Magento\Checkout\Model\ConfigProviderInterface;
910
use Magento\Braintree\Gateway\Config\Config;
1011
use Magento\Braintree\Model\Adapter\BraintreeAdapter;
@@ -86,7 +87,14 @@ public function getConfig()
8687
public function getClientToken()
8788
{
8889
if (empty($this->clientToken)) {
89-
$this->clientToken = $this->adapter->generate();
90+
$params = [];
91+
92+
$merchantAccountId = $this->config->getMerchantAccountId();
93+
if (!empty($merchantAccountId)) {
94+
$params[PaymentDataBuilder::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
95+
}
96+
97+
$this->clientToken = $this->adapter->generate($params);
9098
}
9199

92100
return $this->clientToken;

app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ public function testBuild()
133133
->willReturnMap($additionalData);
134134

135135
$this->configMock->expects(static::once())
136-
->method('getValue')
137-
->with(Config::KEY_MERCHANT_ACCOUNT_ID)
136+
->method('getMerchantAccountId')
138137
->willReturn(self::MERCHANT_ACCOUNT_ID);
139138

140139
$this->paymentDO->expects(static::once())

app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
class ConfigProviderTest extends \PHPUnit_Framework_TestCase
1919
{
2020
const SDK_URL = 'https://js.braintreegateway.com/v2/braintree.js';
21-
2221
const CLIENT_TOKEN = 'token';
22+
const MERCHANT_ACCOUNT_ID = '245345';
2323

2424
/**
2525
* @var Config|MockObject
@@ -76,11 +76,17 @@ public function testGetConfig($config, $expected)
7676

7777
/**
7878
* @covers \Magento\Braintree\Model\Ui\ConfigProvider::getClientToken
79+
* @dataProvider getClientTokenDataProvider
7980
*/
80-
public function testGetClientToken()
81+
public function testGetClientToken($merchantAccountId, $params)
8182
{
83+
$this->config->expects(static::once())
84+
->method('getMerchantAccountId')
85+
->willReturn($merchantAccountId);
86+
8287
$this->braintreeAdapter->expects(static::once())
8388
->method('generate')
89+
->with($params)
8490
->willReturn(self::CLIENT_TOKEN);
8591

8692
static::assertEquals(self::CLIENT_TOKEN, $this->configProvider->getClientToken());
@@ -140,4 +146,21 @@ public function getConfigDataProvider()
140146
]
141147
];
142148
}
149+
150+
/**
151+
* @return array
152+
*/
153+
public function getClientTokenDataProvider()
154+
{
155+
return [
156+
[
157+
'merchantAccountId' => '',
158+
'params' => []
159+
],
160+
[
161+
'merchantAccountId' => self::MERCHANT_ACCOUNT_ID,
162+
'params' => ['merchantAccountId' => self::MERCHANT_ACCOUNT_ID]
163+
]
164+
];
165+
}
143166
}

app/code/Magento/CatalogInventory/Setup/InstallSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
249249
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
250250
5,
251251
['unsigned' => true, 'nullable' => false, 'default' => 0],
252-
'Is Divided into Multiple Boxes for Shipping'
252+
'Website ID'
253253
)
254254
->addIndex(
255255
$installer->getIdxName(

app/code/Magento/CatalogInventory/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_CatalogInventory" setup_version="2.0.0">
9+
<module name="Magento_CatalogInventory" setup_version="2.0.1">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
</sequence>

app/code/Magento/Dhl/Model/Plugin/Rma/Block/Adminhtml/Rma/Edit/Tab/General/Shippingmethod.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/Dhl/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"lib-libxml": "*"
1717
},
1818
"suggest": {
19-
"magento/module-checkout": "100.2.*",
20-
"magento/module-rma": "100.2.*"
19+
"magento/module-checkout": "100.2.*"
2120
},
2221
"type": "magento2-module",
2322
"version": "100.2.0-dev",

app/code/Magento/Dhl/etc/di.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@
99
<type name="Magento\Checkout\Block\Cart\LayoutProcessor">
1010
<plugin name="checkout_cart_shipping_dhl" type="Magento\Dhl\Model\Plugin\Checkout\Block\Cart\Shipping"/>
1111
</type>
12-
<type name="Magento\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod">
13-
<plugin name="rma_tab_shippingmethod_dhl"
14-
type="Magento\Dhl\Model\Plugin\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod"/>
15-
</type>
1612
</config>

0 commit comments

Comments
 (0)