Skip to content

Commit c2286a5

Browse files
committed
MAGETWO-53714: BNCODE is not send in PayPal solutions properly for CE and EE
1 parent 04795a6 commit c2286a5

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

app/code/Magento/Paypal/Model/AbstractConfig.php

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

8+
use Magento\Framework\App\ProductMetadataInterface;
89
use Magento\Payment\Model\Method\ConfigInterface;
910
use Magento\Payment\Model\MethodInterface;
1011
use Magento\Store\Model\ScopeInterface;
@@ -49,6 +50,11 @@ abstract class AbstractConfig implements ConfigInterface
4950
*/
5051
protected $pathPattern;
5152

53+
/**
54+
* @var ProductMetadataInterface
55+
*/
56+
private $productMetadata;
57+
5258
/**
5359
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
5460
*/
@@ -323,10 +329,25 @@ public function isMethodSupportedForCountry($method = null, $countryCode = null)
323329
*/
324330
public function getBuildNotationCode()
325331
{
326-
return $this->_scopeConfig->getValue(
332+
$bnCode = $this->_scopeConfig->getValue(
327333
'paypal/bncode',
328334
ScopeInterface::SCOPE_STORE,
329335
$this->_storeId
330336
);
337+
return sprintf($bnCode, $this->getProductMetadata()->getEdition());
338+
}
339+
340+
/**
341+
* The getter function to get the ProductMetadata
342+
*
343+
* @return ProductMetadataInterface
344+
* @deprecated
345+
*/
346+
protected function getProductMetadata()
347+
{
348+
if ($this->productMetadata === null) {
349+
$this->productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
350+
}
351+
return $this->productMetadata;
331352
}
332353
}

app/code/Magento/Paypal/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
99
<default>
1010
<paypal>
11-
<bncode>Magento_Cart_Community</bncode>
11+
<bncode>Magento_Cart_%s</bncode>
1212
<style>
1313
<logo></logo>
1414
</style>

0 commit comments

Comments
 (0)