Failed Conditions
Push — feature/post-pay ( 539a6f...adf651 )
by Remco
05:08
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   +82 added lines, -82 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,68 +78,68 @@  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
 		// Shipping address.
88 88
 		$shipping_address = $payment->get_shipping_address();
89 89
 
90
-		if ( null !== $shipping_address ) {
90
+		if (null !== $shipping_address) {
91 91
 			$shipping_detail = new Address();
92 92
 
93 93
 			$name = $shipping_address->get_name();
94 94
 
95
-			if ( null !== $name ) {
96
-				$shipping_detail->set_first_name( $name->get_first_name() );
97
-				$shipping_detail->set_middle_name( $name->get_middle_name() );
98
-				$shipping_detail->set_last_name( $name->get_last_name() );
95
+			if (null !== $name) {
96
+				$shipping_detail->set_first_name($name->get_first_name());
97
+				$shipping_detail->set_middle_name($name->get_middle_name());
98
+				$shipping_detail->set_last_name($name->get_last_name());
99 99
 			}
100 100
 
101
-			$shipping_detail->set_street( $shipping_address->get_street_name() );
102
-			$shipping_detail->set_house_number( $shipping_address->get_house_number() );
103
-			$shipping_detail->set_house_number_addition( $shipping_address->get_house_number_addition() );
104
-			$shipping_detail->set_postal_code( $shipping_address->get_postal_code() );
105
-			$shipping_detail->set_city( $shipping_address->get_city() );
106
-			$shipping_detail->set_country_code( $shipping_address->get_country_code() );
101
+			$shipping_detail->set_street($shipping_address->get_street_name());
102
+			$shipping_detail->set_house_number($shipping_address->get_house_number());
103
+			$shipping_detail->set_house_number_addition($shipping_address->get_house_number_addition());
104
+			$shipping_detail->set_postal_code($shipping_address->get_postal_code());
105
+			$shipping_detail->set_city($shipping_address->get_city());
106
+			$shipping_detail->set_country_code($shipping_address->get_country_code());
107 107
 		}
108 108
 
109 109
 		// Billing address.
110
-		$billing_address  = $payment->get_billing_address();
110
+		$billing_address = $payment->get_billing_address();
111 111
 
112
-		if ( null !== $billing_address ) {
112
+		if (null !== $billing_address) {
113 113
 			$billing_detail = new Address();
114 114
 
115 115
 			$name = $billing_address->get_name();
116 116
 
117
-			if ( null !== $name ) {
118
-				$billing_detail->set_first_name( $name->get_first_name() );
119
-				$billing_detail->set_middle_name( $name->get_middle_name() );
120
-				$billing_detail->set_last_name( $name->get_last_name() );
117
+			if (null !== $name) {
118
+				$billing_detail->set_first_name($name->get_first_name());
119
+				$billing_detail->set_middle_name($name->get_middle_name());
120
+				$billing_detail->set_last_name($name->get_last_name());
121 121
 			}
122 122
 
123
-			$billing_detail->set_street( $billing_address->get_street_name() );
124
-			$billing_detail->set_house_number( $billing_address->get_house_number() );
125
-			$billing_detail->set_house_number_addition( $billing_address->get_house_number_addition() );
126
-			$billing_detail->set_postal_code( $billing_address->get_postal_code() );
127
-			$billing_detail->set_city( $billing_address->get_city() );
128
-			$billing_detail->set_country_code( $billing_address->get_country_code() );
123
+			$billing_detail->set_street($billing_address->get_street_name());
124
+			$billing_detail->set_house_number($billing_address->get_house_number());
125
+			$billing_detail->set_house_number_addition($billing_address->get_house_number_addition());
126
+			$billing_detail->set_postal_code($billing_address->get_postal_code());
127
+			$billing_detail->set_city($billing_address->get_city());
128
+			$billing_detail->set_country_code($billing_address->get_country_code());
129 129
 		}
130 130
 
131 131
 		// Customer information.
132 132
 		$customer = $payment->get_customer();
133 133
 
134
-		if ( null !== $customer ) {
134
+		if (null !== $customer) {
135 135
 			$customer_information = new CustomerInformation();
136 136
 			
137
-			$customer_information->set_email_address( $customer->get_email() );
138
-			$customer_information->set_telephone_number( $customer->get_phone() );
137
+			$customer_information->set_email_address($customer->get_email());
138
+			$customer_information->set_telephone_number($customer->get_phone());
139 139
 		}
140 140
 
141 141
 		// Payment brand.
142
-		$payment_brand = PaymentBrands::transform( $payment->get_method() );
142
+		$payment_brand = PaymentBrands::transform($payment->get_method());
143 143
 
144 144
 		// New order.
145 145
 		$order = new Order(
@@ -151,37 +151,37 @@  discard block
 block discarded – undo
151 151
 			$payment->get_return_url()
152 152
 		);
153 153
 
154
-		$order->set_description( $payment->get_description() );
155
-		$order->set_language( $payment->get_customer()->get_language() );
156
-		$order->set_order_items( $payment->get_order_items() );
157
-		$order->set_shipping_detail( $shipping_detail );
158
-		$order->set_billing_detail( $billing_detail );
159
-		$order->set_customer_information( $customer_information );
160
-		$order->set_payment_brand( $payment_brand );
154
+		$order->set_description($payment->get_description());
155
+		$order->set_language($payment->get_customer()->get_language());
156
+		$order->set_order_items($payment->get_order_items());
157
+		$order->set_shipping_detail($shipping_detail);
158
+		$order->set_billing_detail($billing_detail);
159
+		$order->set_customer_information($customer_information);
160
+		$order->set_payment_brand($payment_brand);
161 161
 
162
-		if ( null !== $payment_brand ) {
162
+		if (null !== $payment_brand) {
163 163
 			// Payment brand force should only be set if payment brand is not empty.
164
-			$order->set_payment_brand_force( PaymentBrandForce::FORCE_ONCE );
164
+			$order->set_payment_brand_force(PaymentBrandForce::FORCE_ONCE);
165 165
 		}
166 166
 
167 167
 		// Maybe update access token.
168 168
 		$this->maybe_update_access_token();
169 169
 
170 170
 		// Handle errors.
171
-		if ( $this->get_client_error() ) {
171
+		if ($this->get_client_error()) {
172 172
 			return;
173 173
 		}
174 174
 
175 175
 		// Announce order.
176
-		$result = $this->client->order_announce( $this->config, $order );
176
+		$result = $this->client->order_announce($this->config, $order);
177 177
 
178 178
 		// Handle errors.
179
-		if ( $this->get_client_error() ) {
179
+		if ($this->get_client_error()) {
180 180
 			return;
181 181
 		}
182 182
 
183
-		if ( $result ) {
184
-			$payment->set_action_url( $result->redirectUrl );
183
+		if ($result) {
184
+			$payment->set_action_url($result->redirectUrl);
185 185
 		}
186 186
 	}
187 187
 
@@ -190,45 +190,45 @@  discard block
 block discarded – undo
190 190
 	 *
191 191
 	 * @param Payment $payment Payment.
192 192
 	 */
193
-	public function update_status( Payment $payment ) {
194
-		if ( ! ReturnParameters::contains( $_GET ) ) { // WPCS: CSRF ok.
193
+	public function update_status(Payment $payment) {
194
+		if ( ! ReturnParameters::contains($_GET)) { // WPCS: CSRF ok.
195 195
 			return;
196 196
 		}
197 197
 
198
-		$parameters = ReturnParameters::from_array( $_GET ); // WPCS: CSRF ok.
198
+		$parameters = ReturnParameters::from_array($_GET); // WPCS: CSRF ok.
199 199
 
200 200
 		// Note.
201 201
 		$note_values = array(
202 202
 			'order_id'  => $parameters->get_order_id(),
203 203
 			'status'    => $parameters->get_status(),
204 204
 			'signature' => $parameters->get_signature(),
205
-			'valid'     => $parameters->is_valid( $this->config->signing_key ) ? 'true' : 'false',
205
+			'valid'     => $parameters->is_valid($this->config->signing_key) ? 'true' : 'false',
206 206
 		);
207 207
 
208 208
 		$note = '';
209 209
 
210 210
 		$note .= '<p>';
211
-		$note .= __( 'OmniKassa 2.0 return URL requested:', 'pronamic_ideal' );
211
+		$note .= __('OmniKassa 2.0 return URL requested:', 'pronamic_ideal');
212 212
 		$note .= '</p>';
213 213
 
214 214
 		$note .= '<dl>';
215 215
 
216
-		foreach ( $note_values as $key => $value ) {
217
-			$note .= sprintf( '<dt>%s</dt>', esc_html( $key ) );
218
-			$note .= sprintf( '<dd>%s</dd>', esc_html( $value ) );
216
+		foreach ($note_values as $key => $value) {
217
+			$note .= sprintf('<dt>%s</dt>', esc_html($key));
218
+			$note .= sprintf('<dd>%s</dd>', esc_html($value));
219 219
 		}
220 220
 
221 221
 		$note .= '</dl>';
222 222
 
223
-		$payment->add_note( $note );
223
+		$payment->add_note($note);
224 224
 
225 225
 		// Validate.
226
-		if ( ! $parameters->is_valid( $this->config->signing_key ) ) {
226
+		if ( ! $parameters->is_valid($this->config->signing_key)) {
227 227
 			return;
228 228
 		}
229 229
 
230 230
 		// Status.
231
-		$payment->set_status( Statuses::transform( $parameters->get_status() ) );
231
+		$payment->set_status(Statuses::transform($parameters->get_status()));
232 232
 	}
233 233
 
234 234
 	/**
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
 	 *
239 239
 	 * @return void
240 240
 	 */
241
-	public function handle_notification( Notification $notification ) {
242
-		if ( ! $notification->is_valid( $this->config->signing_key ) ) {
241
+	public function handle_notification(Notification $notification) {
242
+		if ( ! $notification->is_valid($this->config->signing_key)) {
243 243
 			return;
244 244
 		}
245 245
 
246
-		switch ( $notification->get_event_name() ) {
246
+		switch ($notification->get_event_name()) {
247 247
 			case 'merchant.order.status.changed':
248
-				$this->handle_merchant_order_status_changed( $notification );
248
+				$this->handle_merchant_order_status_changed($notification);
249 249
 		}
250 250
 	}
251 251
 
@@ -256,39 +256,39 @@  discard block
 block discarded – undo
256 256
 	 *
257 257
 	 * @return void
258 258
 	 */
259
-	private function handle_merchant_order_status_changed( Notification $notification ) {
259
+	private function handle_merchant_order_status_changed(Notification $notification) {
260 260
 		do {
261
-			$order_results = $this->client->get_order_results( $notification->get_authentication() );
261
+			$order_results = $this->client->get_order_results($notification->get_authentication());
262 262
 
263
-			if ( ! $order_results || $order_results->is_valid( $this->config->signing_key ) ) {
263
+			if ( ! $order_results || $order_results->is_valid($this->config->signing_key)) {
264 264
 				return;
265 265
 			}
266 266
 
267
-			foreach ( $order_results as $order_result ) {
268
-				$payment = get_pronamic_payment_by_meta( '_pronamic_payment_omnikassa_2_merchant_order_id', $order_result->get_merchant_order_id() );
267
+			foreach ($order_results as $order_result) {
268
+				$payment = get_pronamic_payment_by_meta('_pronamic_payment_omnikassa_2_merchant_order_id', $order_result->get_merchant_order_id());
269 269
 
270
-				if ( empty( $payment ) ) {
270
+				if (empty($payment)) {
271 271
 					continue;
272 272
 				}
273 273
 
274
-				$payment->set_transaction_id( $order_result->get_omnikassa_order_id() );
275
-				$payment->set_status( Statuses::transform( $order_result->get_order_status() ) );
274
+				$payment->set_transaction_id($order_result->get_omnikassa_order_id());
275
+				$payment->set_status(Statuses::transform($order_result->get_order_status()));
276 276
 
277 277
 				// Note.
278 278
 				$note = '';
279 279
 
280 280
 				$note .= '<p>';
281
-				$note .= __( 'OmniKassa 2.0 webhook URL requested:', 'pronamic_ideal' );
281
+				$note .= __('OmniKassa 2.0 webhook URL requested:', 'pronamic_ideal');
282 282
 				$note .= '</p>';
283 283
 				$note .= '<pre>';
284
-				$note .= wp_json_encode( $order_result->get_json(), JSON_PRETTY_PRINT );
284
+				$note .= wp_json_encode($order_result->get_json(), JSON_PRETTY_PRINT);
285 285
 				$note .= '</pre>';
286 286
 
287
-				$payment->add_note( $note );
287
+				$payment->add_note($note);
288 288
 
289 289
 				$payment->save();
290 290
 			}
291
-		} while ( $order_results->more_available() );
291
+		} while ($order_results->more_available());
292 292
 	}
293 293
 
294 294
 	/**
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
 	 * @return void
298 298
 	 */
299 299
 	private function maybe_update_access_token() {
300
-		if ( $this->config->is_access_token_valid() ) {
300
+		if ($this->config->is_access_token_valid()) {
301 301
 			return;
302 302
 		}
303 303
 
304 304
 		$data = $this->client->get_access_token_data();
305 305
 
306
-		if ( ! is_object( $data ) ) {
306
+		if ( ! is_object($data)) {
307 307
 			return;
308 308
 		}
309 309
 
310 310
 		$this->config->access_token             = $data->token;
311 311
 		$this->config->access_token_valid_until = $data->validUntil;
312 312
 
313
-		update_post_meta( $this->config->post_id, '_pronamic_gateway_omnikassa_2_access_token', $data->token );
313
+		update_post_meta($this->config->post_id, '_pronamic_gateway_omnikassa_2_access_token', $data->token);
314 314
 		update_post_meta(
315 315
 			$this->config->post_id,
316 316
 			'_pronamic_gateway_omnikassa_2_access_token_valid_until',
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 	private function get_client_error() {
327 327
 		$error = $this->client->get_error();
328 328
 
329
-		if ( is_wp_error( $error ) ) {
329
+		if (is_wp_error($error)) {
330 330
 			$this->error = $error;
331 331
 
332 332
 			return $error;
Please login to merge, or discard this patch.