11
11
use Magento \Framework \App \Config \ScopeConfigInterface ;
12
12
use Magento \Framework \Locale \ResolverInterface ;
13
13
use Magento \Store \Model \ScopeInterface ;
14
- use Magento \Paypal \Model \Config as PayPalConfig ;
14
+ use Magento \Store \Model \StoreManagerInterface ;
15
15
16
16
/**
17
17
* Provides configuration values for PayPal in-context checkout
@@ -50,6 +50,11 @@ class SmartButtonConfig
50
50
*/
51
51
private $ unsupportedPaymentMethods ;
52
52
53
+ /**
54
+ * @var StoreManagerInterface
55
+ */
56
+ private $ storeManager ;
57
+
53
58
/**
54
59
* Base url for Paypal SDK
55
60
*/
@@ -59,6 +64,7 @@ class SmartButtonConfig
59
64
* @param ResolverInterface $localeResolver
60
65
* @param ConfigFactory $configFactory
61
66
* @param ScopeConfigInterface $scopeConfig
67
+ * @param StoreManagerInterface $storeManager
62
68
* @param array $defaultStyles
63
69
* @param array $disallowedFundingMap
64
70
* @param array $unsupportedPaymentMethods
@@ -67,6 +73,7 @@ public function __construct(
67
73
ResolverInterface $ localeResolver ,
68
74
ConfigFactory $ configFactory ,
69
75
ScopeConfigInterface $ scopeConfig ,
76
+ StoreManagerInterface $ storeManager ,
70
77
$ defaultStyles = [],
71
78
$ disallowedFundingMap = [],
72
79
$ unsupportedPaymentMethods = []
@@ -75,6 +82,7 @@ public function __construct(
75
82
$ this ->config = $ configFactory ->create ();
76
83
$ this ->config ->setMethod (Config::METHOD_EXPRESS );
77
84
$ this ->scopeConfig = $ scopeConfig ;
85
+ $ this ->storeManager = $ storeManager ;
78
86
$ this ->defaultStyles = $ defaultStyles ;
79
87
$ this ->disallowedFundingMap = $ disallowedFundingMap ;
80
88
$ this ->unsupportedPaymentMethods = $ unsupportedPaymentMethods ;
@@ -123,6 +131,7 @@ private function generatePaypalSdkUrl(string $page): string
123
131
'merchant-id ' => $ this ->config ->getValue ('merchant_id ' ),
124
132
'locale ' => $ this ->localeResolver ->getLocale (),
125
133
'intent ' => $ this ->getIntent (),
134
+ 'currency ' => $ this ->storeManager ->getStore ()->getCurrentCurrencyCode (),
126
135
];
127
136
if ($ disallowedFunding ) {
128
137
$ params ['disable-funding ' ] = $ disallowedFunding ;
0 commit comments