Skip to content

Commit

Permalink
Merge pull request #286 from magento-mpi/MPI-bugfixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Oleksii Korshenko authored Aug 26, 2016
2 parents 661a3a9 + 2653330 commit 8744435
Show file tree
Hide file tree
Showing 33 changed files with 2,230 additions and 858 deletions.
10 changes: 10 additions & 0 deletions app/code/Magento/Braintree/Gateway/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,14 @@ public function getDynamicDescriptors()
}
return $values;
}

/**
* Get Merchant account ID
*
* @return string
*/
public function getMerchantAccountId()
{
return $this->getValue(self::KEY_MERCHANT_ACCOUNT_ID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function build(array $buildSubject)
self::ORDER_ID => $order->getOrderIncrementId()
];

$merchantAccountId = $this->config->getValue(Config::KEY_MERCHANT_ACCOUNT_ID);
$merchantAccountId = $this->config->getMerchantAccountId();
if (!empty($merchantAccountId)) {
$result[self::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
}
Expand Down
10 changes: 9 additions & 1 deletion app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
namespace Magento\Braintree\Model\Ui;

use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Braintree\Gateway\Config\Config;
use Magento\Braintree\Model\Adapter\BraintreeAdapter;
Expand Down Expand Up @@ -86,7 +87,14 @@ public function getConfig()
public function getClientToken()
{
if (empty($this->clientToken)) {
$this->clientToken = $this->adapter->generate();
$params = [];

$merchantAccountId = $this->config->getMerchantAccountId();
if (!empty($merchantAccountId)) {
$params[PaymentDataBuilder::MERCHANT_ACCOUNT_ID] = $merchantAccountId;
}

$this->clientToken = $this->adapter->generate($params);
}

return $this->clientToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public function testBuild()
->willReturnMap($additionalData);

$this->configMock->expects(static::once())
->method('getValue')
->with(Config::KEY_MERCHANT_ACCOUNT_ID)
->method('getMerchantAccountId')
->willReturn(self::MERCHANT_ACCOUNT_ID);

$this->paymentDO->expects(static::once())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
class ConfigProviderTest extends \PHPUnit_Framework_TestCase
{
const SDK_URL = 'https://js.braintreegateway.com/v2/braintree.js';

const CLIENT_TOKEN = 'token';
const MERCHANT_ACCOUNT_ID = '245345';

/**
* @var Config|MockObject
Expand Down Expand Up @@ -76,11 +76,17 @@ public function testGetConfig($config, $expected)

/**
* @covers \Magento\Braintree\Model\Ui\ConfigProvider::getClientToken
* @dataProvider getClientTokenDataProvider
*/
public function testGetClientToken()
public function testGetClientToken($merchantAccountId, $params)
{
$this->config->expects(static::once())
->method('getMerchantAccountId')
->willReturn($merchantAccountId);

$this->braintreeAdapter->expects(static::once())
->method('generate')
->with($params)
->willReturn(self::CLIENT_TOKEN);

static::assertEquals(self::CLIENT_TOKEN, $this->configProvider->getClientToken());
Expand Down Expand Up @@ -140,4 +146,21 @@ public function getConfigDataProvider()
]
];
}

/**
* @return array
*/
public function getClientTokenDataProvider()
{
return [
[
'merchantAccountId' => '',
'params' => []
],
[
'merchantAccountId' => self::MERCHANT_ACCOUNT_ID,
'params' => ['merchantAccountId' => self::MERCHANT_ACCOUNT_ID]
]
];
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
5,
['unsigned' => true, 'nullable' => false, 'default' => 0],
'Is Divided into Multiple Boxes for Shipping'
'Website ID'
)
->addIndex(
$installer->getIdxName(
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_CatalogInventory" setup_version="2.0.0">
<module name="Magento_CatalogInventory" setup_version="2.0.1">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions app/code/Magento/Dhl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"lib-libxml": "*"
},
"suggest": {
"magento/module-checkout": "100.2.*",
"magento/module-rma": "100.2.*"
"magento/module-checkout": "100.2.*"
},
"type": "magento2-module",
"version": "100.2.0-dev",
Expand Down
4 changes: 0 additions & 4 deletions app/code/Magento/Dhl/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
<type name="Magento\Checkout\Block\Cart\LayoutProcessor">
<plugin name="checkout_cart_shipping_dhl" type="Magento\Dhl\Model\Plugin\Checkout\Block\Cart\Shipping"/>
</type>
<type name="Magento\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod">
<plugin name="rma_tab_shippingmethod_dhl"
type="Magento\Dhl\Model\Plugin\Rma\Block\Adminhtml\Rma\Edit\Tab\General\Shippingmethod"/>
</type>
</config>
Loading

0 comments on commit 8744435

Please sign in to comment.