Test Failed
Push — feature/post-pay ( 02b246...ca08f2 )
by Reüel
05:13
created
src/Security.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,35 +25,35 @@  discard block
 block discarded – undo
25 25
 	 * @param string   $signing_key Signing Key.
26 26
 	 * @return string|null
27 27
 	 */
28
-	public static function get_signature( Signable $signable, $signing_key ) {
28
+	public static function get_signature(Signable $signable, $signing_key) {
29 29
 		$data = $signable->get_signature_data();
30 30
 
31
-		if ( empty( $data ) ) {
31
+		if (empty($data)) {
32 32
 			return null;
33 33
 		}
34 34
 
35
-		if ( empty( $signing_key ) ) {
35
+		if (empty($signing_key)) {
36 36
 			return null;
37 37
 		}
38 38
 
39
-		$decoded_signing_key = base64_decode( $signing_key );
39
+		$decoded_signing_key = base64_decode($signing_key);
40 40
 
41
-		if ( false === $decoded_signing_key ) {
41
+		if (false === $decoded_signing_key) {
42 42
 			return null;
43 43
 		}
44 44
 
45 45
 		// Convert array to comma separated string.
46
-		foreach ( $data as &$part ) {
47
-			if ( ! is_array( $part ) ) {
46
+		foreach ($data as &$part) {
47
+			if ( ! is_array($part)) {
48 48
 				continue;
49 49
 			}
50 50
 
51
-			$part = implode( ',', $part );
51
+			$part = implode(',', $part);
52 52
 		}
53 53
 
54 54
 		$signature = hash_hmac(
55 55
 			'sha512',
56
-			implode( ',', $data ),
56
+			implode(',', $data),
57 57
 			$decoded_signing_key
58 58
 		);
59 59
 
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 	 * @param string $signature_b Signature B.
68 68
 	 * @return bool True if valid, false otherwise.
69 69
 	 */
70
-	public static function validate_signature( $signature_a, $signature_b ) {
71
-		if ( empty( $signature_a ) || empty( $signature_b ) ) {
70
+	public static function validate_signature($signature_a, $signature_b) {
71
+		if (empty($signature_a) || empty($signature_b)) {
72 72
 			// Empty signature string or null from calculation.
73 73
 			return false;
74 74
 		}
75 75
 
76
-		return ( 0 === strcasecmp( $signature_a, $signature_b ) );
76
+		return (0 === strcasecmp($signature_a, $signature_b));
77 77
 	}
78 78
 }
Please login to merge, or discard this patch.
src/Order.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 	 * @param Money  $amount               Amount.
155 155
 	 * @param string $merchant_return_url  Merchant return URL.
156 156
 	 */
157
-	public function __construct( $merchant_order_id, $amount, $merchant_return_url ) {
158
-		$this->timestamp           = date( DATE_ATOM );
157
+	public function __construct($merchant_order_id, $amount, $merchant_return_url) {
158
+		$this->timestamp           = date(DATE_ATOM);
159 159
 		$this->merchant_order_id   = $merchant_order_id;
160 160
 		$this->amount              = $amount;
161 161
 		$this->merchant_return_url = $merchant_return_url;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @param string $description Description.
168 168
 	 */
169
-	public function set_description( $description ) {
169
+	public function set_description($description) {
170 170
 		$this->description = $description;
171 171
 	}
172 172
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	 *
176 176
 	 * @param string $language Language.
177 177
 	 */
178
-	public function set_language( $language ) {
178
+	public function set_language($language) {
179 179
 		$this->language = $language;
180 180
 	}
181 181
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 *
185 185
 	 * @param string|null $payment_brand Payment brand.
186 186
 	 */
187
-	public function set_payment_brand( $payment_brand ) {
187
+	public function set_payment_brand($payment_brand) {
188 188
 		$this->payment_brand = $payment_brand;
189 189
 	}
190 190
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @param string $payment_brand_force Payment brand force.
195 195
 	 */
196
-	public function set_payment_brand_force( $payment_brand_force ) {
196
+	public function set_payment_brand_force($payment_brand_force) {
197 197
 		$this->payment_brand_force = $payment_brand_force;
198 198
 	}
199 199
 
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 	 *
205 205
 	 * @return void
206 206
 	 */
207
-	public function set_order_items( Items $items ) {
207
+	public function set_order_items(Items $items) {
208 208
 		$order_items = new OrderItems();
209 209
 
210 210
 		$items = $items->getIterator();
211 211
 
212
-		while ( $items->valid() ) {
212
+		while ($items->valid()) {
213 213
 			$item = $items->current();
214 214
 
215 215
 			// New order item.
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
 					'quantity' => $item->get_quantity(),
221 221
 					'amount'   => new Money(
222 222
 						$this->amount->get_currency(),
223
-						Util::amount_to_cents( $item->get_price() )
223
+						Util::amount_to_cents($item->get_price())
224 224
 					),
225 225
 					'category' => ProductCategories::DIGITAL,
226 226
 				)
227 227
 			);
228 228
 
229 229
 			// Add order item.
230
-			$order_items->add_item( $order_item );
230
+			$order_items->add_item($order_item);
231 231
 
232 232
 			$items->next();
233 233
 		}
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @param Address $shipping_detail Shipping address details.
242 242
 	 */
243
-	public function set_shipping_detail( Address $shipping_detail ) {
243
+	public function set_shipping_detail(Address $shipping_detail) {
244 244
 		$this->shipping_detail = $shipping_detail;
245 245
 	}
246 246
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	 *
250 250
 	 * @param Address $billing_detail Billing address details.
251 251
 	 */
252
-	public function set_billing_detail( Address $billing_detail ) {
252
+	public function set_billing_detail(Address $billing_detail) {
253 253
 		$this->billing_detail = $billing_detail;
254 254
 	}
255 255
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 *
259 259
 	 * @param CustomerInformation $customer_information Customer information.
260 260
 	 */
261
-	public function set_customer_information( CustomerInformation $customer_information ) {
261
+	public function set_customer_information(CustomerInformation $customer_information) {
262 262
 		$this->customer_information = $customer_information;
263 263
 	}
264 264
 
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
 			'description'     => $this->description,
275 275
 		);
276 276
 
277
-		if ( null !== $this->order_items ) {
277
+		if (null !== $this->order_items) {
278 278
 			$data['orderItems'] = $this->order_items->get_json();
279 279
 		}
280 280
 
281 281
 		$data['amount'] = $this->amount->get_json();
282 282
 
283
-		if ( null !== $this->shipping_detail ) {
283
+		if (null !== $this->shipping_detail) {
284 284
 			$data['shippingDetail'] = $this->shipping_detail->get_json();
285 285
 		}
286 286
 
287
-		if ( null !== $this->billing_detail ) {
287
+		if (null !== $this->billing_detail) {
288 288
 			$data['billingDetail'] = $this->billing_detail->get_json();
289 289
 		}
290 290
 
291
-		if ( null !== $this->customer_information ) {
291
+		if (null !== $this->customer_information) {
292 292
 			$data['customerInformation'] = $this->customer_information->get_json();
293 293
 		}
294 294
 
@@ -320,28 +320,28 @@  discard block
 block discarded – undo
320 320
 		// Optional fields.
321 321
 		$optional = array();
322 322
 
323
-		if ( null !== $this->order_items ) {
323
+		if (null !== $this->order_items) {
324 324
 			$optional['order_items'] = $this->order_items->get_signature_data();
325 325
 		}
326 326
 
327
-		if ( null !== $this->shipping_detail ) {
327
+		if (null !== $this->shipping_detail) {
328 328
 			$optional['shipping_detail'] = $this->shipping_detail->get_signature_data();
329 329
 		}
330 330
 
331 331
 		$optional['payment_brand']       = $this->payment_brand;
332 332
 		$optional['payment_brand_force'] = $this->payment_brand_force;
333 333
 
334
-		if ( null !== $this->customer_information ) {
334
+		if (null !== $this->customer_information) {
335 335
 			$optional['customer_information'] = $this->customer_information->get_signature_data();
336 336
 		}
337 337
 
338
-		if ( null !== $this->billing_detail ) {
338
+		if (null !== $this->billing_detail) {
339 339
 			$optional['billing_detail'] = $this->billing_detail->get_signature_data();
340 340
 		}
341 341
 
342 342
 		// Remove empty optional fields.
343
-		$optional = array_filter( $optional );
343
+		$optional = array_filter($optional);
344 344
 
345
-		return array_merge( $fields, $optional );
345
+		return array_merge($fields, $optional);
346 346
 	}
347 347
 }
Please login to merge, or discard this patch.
src/Gateway.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param Config $config Config.
37 37
 	 */
38
-	public function __construct( Config $config ) {
39
-		parent::__construct( $config );
38
+	public function __construct(Config $config) {
39
+		parent::__construct($config);
40 40
 
41
-		$this->set_method( self::METHOD_HTTP_REDIRECT );
41
+		$this->set_method(self::METHOD_HTTP_REDIRECT);
42 42
 
43 43
 		// Client.
44 44
 		$this->client = new Client();
45 45
 
46 46
 		$url = Client::URL_PRODUCTION;
47 47
 
48
-		if ( self::MODE_TEST === $config->mode ) {
48
+		if (self::MODE_TEST === $config->mode) {
49 49
 			$url = Client::URL_SANDBOX;
50 50
 		}
51 51
 
52
-		$this->client->set_url( $url );
53
-		$this->client->set_refresh_token( $config->refresh_token );
54
-		$this->client->set_signing_key( $config->signing_key );
52
+		$this->client->set_url($url);
53
+		$this->client->set_refresh_token($config->refresh_token);
54
+		$this->client->set_signing_key($config->signing_key);
55 55
 	}
56 56
 
57 57
 	/**
@@ -78,87 +78,87 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @param Payment $payment Payment.
80 80
 	 */
81
-	public function start( Payment $payment ) {
81
+	public function start(Payment $payment) {
82 82
 		// Merchant order ID.
83
-		$merchant_order_id = $payment->format_string( $this->config->order_id );
83
+		$merchant_order_id = $payment->format_string($this->config->order_id);
84 84
 
85
-		$payment->set_meta( 'omnikassa_2_merchant_order_id', $merchant_order_id );
85
+		$payment->set_meta('omnikassa_2_merchant_order_id', $merchant_order_id);
86 86
 
87 87
 		// Billing and shipping details.
88 88
 		$shipping_address = $payment->get_shipping_address();
89 89
 		$billing_address  = $payment->get_billing_address();
90 90
 
91 91
 		$shipping_detail = new Address();
92
-		$shipping_detail->set_first_name( $shipping_address->get_name()->get_first_name() );
93
-		$shipping_detail->set_middle_name( $shipping_address->get_name()->get_middle_name() );
94
-		$shipping_detail->set_last_name( $shipping_address->get_name()->get_last_name() );
95
-		$shipping_detail->set_street( $shipping_address->get_street_name() );
96
-		$shipping_detail->set_house_number( $shipping_address->get_house_number() );
97
-		$shipping_detail->set_house_number_addition( $shipping_address->get_house_number_addition() );
98
-		$shipping_detail->set_postal_code( $shipping_address->get_postal_code() );
99
-		$shipping_detail->set_city( $shipping_address->get_city() );
100
-		$shipping_detail->set_country_code( $shipping_address->get_country_code() );
92
+		$shipping_detail->set_first_name($shipping_address->get_name()->get_first_name());
93
+		$shipping_detail->set_middle_name($shipping_address->get_name()->get_middle_name());
94
+		$shipping_detail->set_last_name($shipping_address->get_name()->get_last_name());
95
+		$shipping_detail->set_street($shipping_address->get_street_name());
96
+		$shipping_detail->set_house_number($shipping_address->get_house_number());
97
+		$shipping_detail->set_house_number_addition($shipping_address->get_house_number_addition());
98
+		$shipping_detail->set_postal_code($shipping_address->get_postal_code());
99
+		$shipping_detail->set_city($shipping_address->get_city());
100
+		$shipping_detail->set_country_code($shipping_address->get_country_code());
101 101
 
102 102
 		$billing_detail = new Address();
103
-		$billing_detail->set_first_name( $billing_address->get_name()->get_first_name() );
104
-		$billing_detail->set_middle_name( $billing_address->get_name()->get_middle_name() );
105
-		$billing_detail->set_last_name( $billing_address->get_name()->get_last_name() );
106
-		$billing_detail->set_street( $billing_address->get_street_name() );
107
-		$billing_detail->set_house_number( $billing_address->get_house_number() );
108
-		$billing_detail->set_house_number_addition( $billing_address->get_house_number_addition() );
109
-		$billing_detail->set_postal_code( $billing_address->get_postal_code() );
110
-		$billing_detail->set_city( $billing_address->get_city() );
111
-		$billing_detail->set_country_code( $billing_address->get_country_code() );
103
+		$billing_detail->set_first_name($billing_address->get_name()->get_first_name());
104
+		$billing_detail->set_middle_name($billing_address->get_name()->get_middle_name());
105
+		$billing_detail->set_last_name($billing_address->get_name()->get_last_name());
106
+		$billing_detail->set_street($billing_address->get_street_name());
107
+		$billing_detail->set_house_number($billing_address->get_house_number());
108
+		$billing_detail->set_house_number_addition($billing_address->get_house_number_addition());
109
+		$billing_detail->set_postal_code($billing_address->get_postal_code());
110
+		$billing_detail->set_city($billing_address->get_city());
111
+		$billing_detail->set_country_code($billing_address->get_country_code());
112 112
 
113 113
 		// Customer information.
114 114
 		$customer_information = new CustomerInformation();
115
-		$customer_information->set_email_address( $payment->get_contact()->get_email() );
116
-		$customer_information->set_telephone_number( $payment->get_contact()->get_phone() );
115
+		$customer_information->set_email_address($payment->get_contact()->get_email());
116
+		$customer_information->set_telephone_number($payment->get_contact()->get_phone());
117 117
 
118 118
 		// Payment brand.
119
-		$payment_brand = PaymentBrands::transform( $payment->get_method() );
119
+		$payment_brand = PaymentBrands::transform($payment->get_method());
120 120
 
121 121
 		// New order.
122 122
 		$order = new Order(
123 123
 			$merchant_order_id,
124 124
 			new Money(
125 125
 				$payment->get_currency(),
126
-				Core_Util::amount_to_cents( $payment->get_amount()->get_amount() )
126
+				Core_Util::amount_to_cents($payment->get_amount()->get_amount())
127 127
 			),
128 128
 			$payment->get_return_url()
129 129
 		);
130 130
 
131
-		$order->set_description( $payment->get_description() );
132
-		$order->set_language( $payment->get_contact()->get_language() );
133
-		$order->set_order_items( $payment->get_order_items() );
134
-		$order->set_shipping_detail( $shipping_detail );
135
-		$order->set_billing_detail( $billing_detail );
136
-		$order->set_customer_information( $customer_information );
137
-		$order->set_payment_brand( $payment_brand );
131
+		$order->set_description($payment->get_description());
132
+		$order->set_language($payment->get_contact()->get_language());
133
+		$order->set_order_items($payment->get_order_items());
134
+		$order->set_shipping_detail($shipping_detail);
135
+		$order->set_billing_detail($billing_detail);
136
+		$order->set_customer_information($customer_information);
137
+		$order->set_payment_brand($payment_brand);
138 138
 
139
-		if ( null !== $payment_brand ) {
139
+		if (null !== $payment_brand) {
140 140
 			// Payment brand force should only be set if payment brand is not empty.
141
-			$order->set_payment_brand_force( PaymentBrandForce::FORCE_ONCE );
141
+			$order->set_payment_brand_force(PaymentBrandForce::FORCE_ONCE);
142 142
 		}
143 143
 
144 144
 		// Maybe update access token.
145 145
 		$this->maybe_update_access_token();
146 146
 
147 147
 		// Handle errors.
148
-		if ( $this->get_client_error() ) {
148
+		if ($this->get_client_error()) {
149 149
 			return;
150 150
 		}
151 151
 
152 152
 		// Announce order.
153
-		$result = $this->client->order_announce( $this->config, $order );
153
+		$result = $this->client->order_announce($this->config, $order);
154 154
 
155 155
 		// Handle errors.
156
-		if ( $this->get_client_error() ) {
156
+		if ($this->get_client_error()) {
157 157
 			return;
158 158
 		}
159 159
 
160
-		if ( $result ) {
161
-			$payment->set_action_url( $result->redirectUrl );
160
+		if ($result) {
161
+			$payment->set_action_url($result->redirectUrl);
162 162
 		}
163 163
 	}
164 164
 
@@ -167,45 +167,45 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @param Payment $payment Payment.
169 169
 	 */
170
-	public function update_status( Payment $payment ) {
171
-		if ( ! ReturnParameters::contains( $_GET ) ) { // WPCS: CSRF ok.
170
+	public function update_status(Payment $payment) {
171
+		if ( ! ReturnParameters::contains($_GET)) { // WPCS: CSRF ok.
172 172
 			return;
173 173
 		}
174 174
 
175
-		$parameters = ReturnParameters::from_array( $_GET ); // WPCS: CSRF ok.
175
+		$parameters = ReturnParameters::from_array($_GET); // WPCS: CSRF ok.
176 176
 
177 177
 		// Note.
178 178
 		$note_values = array(
179 179
 			'order_id'  => $parameters->get_order_id(),
180 180
 			'status'    => $parameters->get_status(),
181 181
 			'signature' => $parameters->get_signature(),
182
-			'valid'     => $parameters->is_valid( $this->config->signing_key ) ? 'true' : 'false',
182
+			'valid'     => $parameters->is_valid($this->config->signing_key) ? 'true' : 'false',
183 183
 		);
184 184
 
185 185
 		$note = '';
186 186
 
187 187
 		$note .= '<p>';
188
-		$note .= __( 'OmniKassa 2.0 return URL requested:', 'pronamic_ideal' );
188
+		$note .= __('OmniKassa 2.0 return URL requested:', 'pronamic_ideal');
189 189
 		$note .= '</p>';
190 190
 
191 191
 		$note .= '<dl>';
192 192
 
193
-		foreach ( $note_values as $key => $value ) {
194
-			$note .= sprintf( '<dt>%s</dt>', esc_html( $key ) );
195
-			$note .= sprintf( '<dd>%s</dd>', esc_html( $value ) );
193
+		foreach ($note_values as $key => $value) {
194
+			$note .= sprintf('<dt>%s</dt>', esc_html($key));
195
+			$note .= sprintf('<dd>%s</dd>', esc_html($value));
196 196
 		}
197 197
 
198 198
 		$note .= '</dl>';
199 199
 
200
-		$payment->add_note( $note );
200
+		$payment->add_note($note);
201 201
 
202 202
 		// Validate.
203
-		if ( ! $parameters->is_valid( $this->config->signing_key ) ) {
203
+		if ( ! $parameters->is_valid($this->config->signing_key)) {
204 204
 			return;
205 205
 		}
206 206
 
207 207
 		// Status.
208
-		$payment->set_status( Statuses::transform( $parameters->get_status() ) );
208
+		$payment->set_status(Statuses::transform($parameters->get_status()));
209 209
 	}
210 210
 
211 211
 	/**
@@ -215,14 +215,14 @@  discard block
 block discarded – undo
215 215
 	 *
216 216
 	 * @return void
217 217
 	 */
218
-	public function handle_notification( Notification $notification ) {
219
-		if ( ! $notification->is_valid( $this->config->signing_key ) ) {
218
+	public function handle_notification(Notification $notification) {
219
+		if ( ! $notification->is_valid($this->config->signing_key)) {
220 220
 			return;
221 221
 		}
222 222
 
223
-		switch ( $notification->get_event_name() ) {
223
+		switch ($notification->get_event_name()) {
224 224
 			case 'merchant.order.status.changed':
225
-				$this->handle_merchant_order_status_changed( $notification );
225
+				$this->handle_merchant_order_status_changed($notification);
226 226
 		}
227 227
 	}
228 228
 
@@ -233,39 +233,39 @@  discard block
 block discarded – undo
233 233
 	 *
234 234
 	 * @return void
235 235
 	 */
236
-	private function handle_merchant_order_status_changed( Notification $notification ) {
236
+	private function handle_merchant_order_status_changed(Notification $notification) {
237 237
 		do {
238
-			$order_results = $this->client->get_order_results( $notification->get_authentication() );
238
+			$order_results = $this->client->get_order_results($notification->get_authentication());
239 239
 
240
-			if ( ! $order_results || $order_results->is_valid( $this->config->signing_key ) ) {
240
+			if ( ! $order_results || $order_results->is_valid($this->config->signing_key)) {
241 241
 				return;
242 242
 			}
243 243
 
244
-			foreach ( $order_results as $order_result ) {
245
-				$payment = get_pronamic_payment_by_meta( '_pronamic_payment_omnikassa_2_merchant_order_id', $order_result->get_merchant_order_id() );
244
+			foreach ($order_results as $order_result) {
245
+				$payment = get_pronamic_payment_by_meta('_pronamic_payment_omnikassa_2_merchant_order_id', $order_result->get_merchant_order_id());
246 246
 
247
-				if ( empty( $payment ) ) {
247
+				if (empty($payment)) {
248 248
 					continue;
249 249
 				}
250 250
 
251
-				$payment->set_transaction_id( $order_result->get_omnikassa_order_id() );
252
-				$payment->set_status( Statuses::transform( $order_result->get_order_status() ) );
251
+				$payment->set_transaction_id($order_result->get_omnikassa_order_id());
252
+				$payment->set_status(Statuses::transform($order_result->get_order_status()));
253 253
 
254 254
 				// Note.
255 255
 				$note = '';
256 256
 
257 257
 				$note .= '<p>';
258
-				$note .= __( 'OmniKassa 2.0 webhook URL requested:', 'pronamic_ideal' );
258
+				$note .= __('OmniKassa 2.0 webhook URL requested:', 'pronamic_ideal');
259 259
 				$note .= '</p>';
260 260
 				$note .= '<pre>';
261
-				$note .= wp_json_encode( $order_result->get_json(), JSON_PRETTY_PRINT );
261
+				$note .= wp_json_encode($order_result->get_json(), JSON_PRETTY_PRINT);
262 262
 				$note .= '</pre>';
263 263
 
264
-				$payment->add_note( $note );
264
+				$payment->add_note($note);
265 265
 
266 266
 				$payment->save();
267 267
 			}
268
-		} while ( $order_results->more_available() );
268
+		} while ($order_results->more_available());
269 269
 	}
270 270
 
271 271
 	/**
@@ -274,20 +274,20 @@  discard block
 block discarded – undo
274 274
 	 * @return void
275 275
 	 */
276 276
 	private function maybe_update_access_token() {
277
-		if ( $this->config->is_access_token_valid() ) {
277
+		if ($this->config->is_access_token_valid()) {
278 278
 			return;
279 279
 		}
280 280
 
281 281
 		$data = $this->client->get_access_token_data();
282 282
 
283
-		if ( ! is_object( $data ) ) {
283
+		if ( ! is_object($data)) {
284 284
 			return;
285 285
 		}
286 286
 
287 287
 		$this->config->access_token             = $data->token;
288 288
 		$this->config->access_token_valid_until = $data->validUntil;
289 289
 
290
-		update_post_meta( $this->config->post_id, '_pronamic_gateway_omnikassa_2_access_token', $data->token );
290
+		update_post_meta($this->config->post_id, '_pronamic_gateway_omnikassa_2_access_token', $data->token);
291 291
 		update_post_meta(
292 292
 			$this->config->post_id,
293 293
 			'_pronamic_gateway_omnikassa_2_access_token_valid_until',
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 	private function get_client_error() {
304 304
 		$error = $this->client->get_error();
305 305
 
306
-		if ( is_wp_error( $error ) ) {
306
+		if (is_wp_error($error)) {
307 307
 			$this->error = $error;
308 308
 
309 309
 			return $error;
Please login to merge, or discard this patch.