3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
7
+
6
8
namespace Magento \Braintree \Block \Paypal ;
7
9
8
10
use Magento \Braintree \Gateway \Config \PayPal \Config ;
@@ -49,8 +51,6 @@ class Button extends Template implements ShortcutInterface
49
51
private $ payment ;
50
52
51
53
/**
52
- * Constructor
53
- *
54
54
* @param Context $context
55
55
* @param ResolverInterface $localeResolver
56
56
* @param Session $checkoutSession
@@ -98,6 +98,8 @@ public function getAlias()
98
98
}
99
99
100
100
/**
101
+ * Returns container id.
102
+ *
101
103
* @return string
102
104
*/
103
105
public function getContainerId ()
@@ -106,6 +108,8 @@ public function getContainerId()
106
108
}
107
109
108
110
/**
111
+ * Returns locale.
112
+ *
109
113
* @return string
110
114
*/
111
115
public function getLocale ()
@@ -114,6 +118,8 @@ public function getLocale()
114
118
}
115
119
116
120
/**
121
+ * Returns currency.
122
+ *
117
123
* @return string
118
124
*/
119
125
public function getCurrency ()
@@ -122,6 +128,8 @@ public function getCurrency()
122
128
}
123
129
124
130
/**
131
+ * Returns amount.
132
+ *
125
133
* @return float
126
134
*/
127
135
public function getAmount ()
@@ -130,6 +138,8 @@ public function getAmount()
130
138
}
131
139
132
140
/**
141
+ * Returns if is active.
142
+ *
133
143
* @return bool
134
144
*/
135
145
public function isActive ()
@@ -139,6 +149,8 @@ public function isActive()
139
149
}
140
150
141
151
/**
152
+ * Returns merchant name.
153
+ *
142
154
* @return string
143
155
*/
144
156
public function getMerchantName ()
@@ -147,6 +159,8 @@ public function getMerchantName()
147
159
}
148
160
149
161
/**
162
+ * Returns client token.
163
+ *
150
164
* @return string|null
151
165
*/
152
166
public function getClientToken ()
@@ -155,10 +169,22 @@ public function getClientToken()
155
169
}
156
170
157
171
/**
172
+ * Returns action success.
173
+ *
158
174
* @return string
159
175
*/
160
176
public function getActionSuccess ()
161
177
{
162
178
return $ this ->getUrl (ConfigProvider::CODE . '/paypal/review ' , ['_secure ' => true ]);
163
179
}
180
+
181
+ /**
182
+ * Gets environment value.
183
+ *
184
+ * @return string
185
+ */
186
+ public function getEnvironment (): string
187
+ {
188
+ return $ this ->configProvider ->getConfig ()['payment ' ][ConfigProvider::CODE ]['environment ' ];
189
+ }
164
190
}
0 commit comments