@@ -34,12 +34,10 @@ class Base extends Info
34
34
* @var DateTime\TimezoneInterface
35
35
*/
36
36
private $ timezone ;
37
-
38
37
/**
39
38
* @var Registry
40
39
*/
41
40
private $ registry ;
42
-
43
41
/**
44
42
* @var PriceCurrencyInterface
45
43
*/
@@ -66,23 +64,17 @@ public function __construct(
66
64
$ this ->price = $ price ;
67
65
}
68
66
69
- /**
70
- * @return bool|string
71
- */
72
- public function getCheckoutType ()
67
+ public function getCheckoutType (): ?string
73
68
{
74
69
try {
75
70
return $ this ->getInfo ()->getAdditionalInformation ('checkout_type ' );
76
71
} catch (\Exception $ e ) {
77
72
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
78
- return false ;
73
+ return null ;
79
74
}
80
75
}
81
76
82
- /**
83
- * @return bool|string
84
- */
85
- public function getExpiresAt ()
77
+ public function getExpiresAt (): ?string
86
78
{
87
79
try {
88
80
if ($ expiresAt = $ this ->getInfo ()->getAdditionalInformation ('expires_at ' )) {
@@ -92,80 +84,67 @@ public function getExpiresAt()
92
84
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
93
85
}
94
86
95
- return false ;
87
+ return null ;
96
88
}
97
89
98
90
/**
99
- * @param int|null $storeId
100
- * @return bool|string
91
+ * @param mixed $storeId
101
92
*/
102
- public function getPaymentLink ($ storeId = null )
93
+ public function getPaymentLink ($ storeId = null ): ? string
103
94
{
104
95
if ($ checkoutUrl = $ this ->getCheckoutUrl ()) {
105
96
return $ this ->mollieHelper ->getPaymentLinkMessage ($ checkoutUrl , $ storeId );
106
97
}
107
98
108
- return false ;
99
+ return null ;
109
100
}
110
101
111
- /**
112
- * @return bool|string
113
- */
114
- public function getCheckoutUrl ()
102
+ public function getCheckoutUrl (): ?string
115
103
{
116
104
try {
117
105
return $ this ->getInfo ()->getAdditionalInformation ('checkout_url ' );
118
106
} catch (\Exception $ e ) {
119
107
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
120
- return false ;
108
+ return null ;
121
109
}
122
110
}
123
111
124
- /**
125
- * @return bool|string
126
- */
127
- public function getPaymentStatus ()
112
+ public function getPaymentStatus (): ?string
128
113
{
129
114
try {
130
115
return $ this ->getInfo ()->getAdditionalInformation ('payment_status ' );
131
116
} catch (\Exception $ e ) {
132
117
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
133
- return false ;
118
+ return null ;
134
119
}
135
120
}
136
121
137
- /**
138
- * @return bool|string
139
- */
140
- public function getDashboardUrl ()
122
+ public function getDashboardUrl (): ?string
141
123
{
142
124
try {
143
125
return $ this ->getInfo ()->getAdditionalInformation ('dashboard_url ' );
144
126
} catch (\Exception $ e ) {
145
127
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
146
- return false ;
128
+ return null ;
147
129
}
148
130
}
149
131
150
- public function getChangePaymentStatusUrl (): string
132
+ public function getChangePaymentStatusUrl (): ? string
151
133
{
152
134
try {
153
135
return (string )$ this ->getInfo ()->getAdditionalInformation ('mollie_change_payment_state_url ' );
154
136
} catch (\Exception $ exception ) {
155
- return '' ;
137
+ return null ;
156
138
}
157
139
}
158
140
159
- /**
160
- * @return bool|string
161
- */
162
- public function getMollieId ()
141
+ public function getMollieId (): ?string
163
142
{
164
143
try {
165
144
return $ this ->getInfo ()->getAdditionalInformation ('mollie_id ' );
166
145
} catch (\Exception $ e ) {
167
146
$ this ->mollieHelper ->addTolog ('error ' , $ e ->getMessage ());
168
- return false ;
147
+ return null ;
169
148
}
170
149
}
171
150
@@ -189,10 +168,9 @@ public function isBuyNowPayLaterMethod(): bool
189
168
}
190
169
191
170
/**
192
- * @return mixed
193
171
* @throws \Magento\Framework\Exception\LocalizedException
194
172
*/
195
- public function getPaymentImage ()
173
+ public function getPaymentImage (): string
196
174
{
197
175
$ code = $ this ->getInfo ()->getMethod ();
198
176
if (strpos ($ code , 'mollie_methods_ ' ) !== false ) {
@@ -202,10 +180,7 @@ public function getPaymentImage()
202
180
return $ code . '.svg ' ;
203
181
}
204
182
205
- /**
206
- * @return string|null
207
- */
208
- public function getOrderId ()
183
+ public function getOrderId (): ?string
209
184
{
210
185
try {
211
186
return $ this ->getInfo ()->getParentId ();
@@ -240,10 +215,7 @@ public function formatPrice($amount)
240
215
return $ this ->price ->format ($ amount );
241
216
}
242
217
243
- /**
244
- * @return OrderInterface|null
245
- */
246
- private function getOrder ()
218
+ private function getOrder (): ?OrderInterface
247
219
{
248
220
return $ this ->registry ->registry ('current_order ' );
249
221
}
0 commit comments