Skip to content

Commit dd91179

Browse files
MC-34360: [Paypal Express Checkout] Can't place an order if the currency is euro
- add currency to skd url
1 parent 32247ca commit dd91179

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\App\Config\ScopeConfigInterface;
1212
use Magento\Framework\Locale\ResolverInterface;
1313
use Magento\Store\Model\ScopeInterface;
14-
use Magento\Paypal\Model\Config as PayPalConfig;
14+
use Magento\Store\Model\StoreManagerInterface;
1515

1616
/**
1717
* Provides configuration values for PayPal in-context checkout
@@ -50,6 +50,11 @@ class SmartButtonConfig
5050
*/
5151
private $unsupportedPaymentMethods;
5252

53+
/**
54+
* @var StoreManagerInterface
55+
*/
56+
private $storeManager;
57+
5358
/**
5459
* Base url for Paypal SDK
5560
*/
@@ -59,6 +64,7 @@ class SmartButtonConfig
5964
* @param ResolverInterface $localeResolver
6065
* @param ConfigFactory $configFactory
6166
* @param ScopeConfigInterface $scopeConfig
67+
* @param StoreManagerInterface $storeManager
6268
* @param array $defaultStyles
6369
* @param array $disallowedFundingMap
6470
* @param array $unsupportedPaymentMethods
@@ -67,6 +73,7 @@ public function __construct(
6773
ResolverInterface $localeResolver,
6874
ConfigFactory $configFactory,
6975
ScopeConfigInterface $scopeConfig,
76+
StoreManagerInterface $storeManager,
7077
$defaultStyles = [],
7178
$disallowedFundingMap = [],
7279
$unsupportedPaymentMethods = []
@@ -75,6 +82,7 @@ public function __construct(
7582
$this->config = $configFactory->create();
7683
$this->config->setMethod(Config::METHOD_EXPRESS);
7784
$this->scopeConfig = $scopeConfig;
85+
$this->storeManager = $storeManager;
7886
$this->defaultStyles = $defaultStyles;
7987
$this->disallowedFundingMap = $disallowedFundingMap;
8088
$this->unsupportedPaymentMethods = $unsupportedPaymentMethods;
@@ -123,6 +131,7 @@ private function generatePaypalSdkUrl(string $page): string
123131
'merchant-id' => $this->config->getValue('merchant_id'),
124132
'locale' => $this->localeResolver->getLocale(),
125133
'intent' => $this->getIntent(),
134+
'currency' => $this->storeManager->getStore()->getCurrentCurrencyCode(),
126135
];
127136
if ($disallowedFunding) {
128137
$params['disable-funding'] = $disallowedFunding;

0 commit comments

Comments
 (0)