Skip to content

Commit 2b8700c

Browse files
committed
AC-1228::Fetch BN Code
1 parent 50cdfb0 commit 2b8700c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Locale\ResolverInterface;
1313
use Magento\Store\Model\ScopeInterface;
1414
use Magento\Store\Model\StoreManagerInterface;
15+
use Magento\Paypal\Model\Payflowpro;
1516

1617
/**
1718
* Provides configuration values for PayPal in-context checkout
@@ -43,18 +44,25 @@ class SmartButtonConfig
4344
*/
4445
private $sdkUrl;
4546

47+
/**
48+
* @var Payflowpro
49+
*/
50+
private $payflowpro;
51+
4652
/**
4753
* @param ResolverInterface $localeResolver
4854
* @param ConfigFactory $configFactory
4955
* @param ScopeConfigInterface $scopeConfig
5056
* @param SdkUrl $sdkUrl
57+
* @param Payflowpro $payflowpro
5158
* @param array $defaultStyles
5259
*/
5360
public function __construct(
5461
ResolverInterface $localeResolver,
5562
ConfigFactory $configFactory,
5663
ScopeConfigInterface $scopeConfig,
5764
SdkUrl $sdkUrl,
65+
Payflowpro $payflowpro,
5866
$defaultStyles = []
5967
) {
6068
$this->localeResolver = $localeResolver;
@@ -63,6 +71,7 @@ public function __construct(
6371
$this->scopeConfig = $scopeConfig;
6472
$this->defaultStyles = $defaultStyles;
6573
$this->sdkUrl = $sdkUrl;
74+
$this->payflowpro = $payflowpro;
6675
}
6776

6877
/**
@@ -77,13 +86,15 @@ public function getConfig(string $page): array
7786
Data::XML_PATH_GUEST_CHECKOUT,
7887
ScopeInterface::SCOPE_STORE
7988
);
89+
$config = $this->payflowpro->getConfig();
8090
return [
8191
'styles' => $this->getButtonStyles($page),
8292
'isVisibleOnProductPage' => (bool)$this->config->getValue('visible_on_product'),
8393
'isGuestCheckoutAllowed' => $isGuestCheckoutAllowed,
8494
'sdkUrl' => $this->sdkUrl->getUrl(),
8595
'dataAttributes' => [
86-
'data-partner-attribution-id' => 'BN_CODE'
96+
'data-partner-attribution-id' => $config->getBuildNotationCode() != '' ?
97+
$config->getBuildNotationCode() : ''
8798
]
8899
];
89100
}

0 commit comments

Comments
 (0)