Completed
Push — develop ( 4cab8a...bff725 )
by Remco
05:37
created
src/Extension.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -47,21 +47,21 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function __construct() {
49 49
 		// @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/lib/MeprGatewayFactory.php#L48-50
50
-		add_filter( 'mepr-gateway-paths', array( $this, 'gateway_paths' ) );
50
+		add_filter('mepr-gateway-paths', array($this, 'gateway_paths'));
51 51
 
52
-		add_filter( 'pronamic_payment_redirect_url_' . self::SLUG, array( __CLASS__, 'redirect_url' ), 10, 2 );
53
-		add_action( 'pronamic_payment_status_update_' . self::SLUG, array( __CLASS__, 'status_update' ), 10, 1 );
52
+		add_filter('pronamic_payment_redirect_url_' . self::SLUG, array(__CLASS__, 'redirect_url'), 10, 2);
53
+		add_action('pronamic_payment_status_update_' . self::SLUG, array(__CLASS__, 'status_update'), 10, 1);
54 54
 
55
-		add_filter( 'pronamic_payment_source_text_' . self::SLUG, array( __CLASS__, 'source_text' ), 10, 2 );
56
-		add_filter( 'pronamic_payment_source_description_' . self::SLUG, array( __CLASS__, 'source_description' ), 10, 2 );
57
-		add_filter( 'pronamic_payment_source_url_' . self::SLUG, array( __CLASS__, 'source_url' ), 10, 2 );
58
-		add_filter( 'pronamic_subscription_source_text_' . self::SLUG, array( __CLASS__, 'subscription_source_text' ), 10, 2 );
59
-		add_filter( 'pronamic_subscription_source_description_' . self::SLUG, array( __CLASS__, 'subscription_source_description' ), 10, 2 );
60
-		add_filter( 'pronamic_subscription_source_url_' . self::SLUG, array( __CLASS__, 'subscription_source_url' ), 10, 2 );
55
+		add_filter('pronamic_payment_source_text_' . self::SLUG, array(__CLASS__, 'source_text'), 10, 2);
56
+		add_filter('pronamic_payment_source_description_' . self::SLUG, array(__CLASS__, 'source_description'), 10, 2);
57
+		add_filter('pronamic_payment_source_url_' . self::SLUG, array(__CLASS__, 'source_url'), 10, 2);
58
+		add_filter('pronamic_subscription_source_text_' . self::SLUG, array(__CLASS__, 'subscription_source_text'), 10, 2);
59
+		add_filter('pronamic_subscription_source_description_' . self::SLUG, array(__CLASS__, 'subscription_source_description'), 10, 2);
60
+		add_filter('pronamic_subscription_source_url_' . self::SLUG, array(__CLASS__, 'subscription_source_url'), 10, 2);
61 61
 
62
-		add_action( 'mepr_subscription_pre_delete', array( $this, 'subscription_pre_delete' ), 10, 1 );
62
+		add_action('mepr_subscription_pre_delete', array($this, 'subscription_pre_delete'), 10, 1);
63 63
 
64
-		add_action( 'mepr_subscription_transition_status', array( $this, 'memberpress_subscription_transition_status' ), 10, 3 );
64
+		add_action('mepr_subscription_transition_status', array($this, 'memberpress_subscription_transition_status'), 10, 3);
65 65
 	}
66 66
 
67 67
 	/**
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @param array $paths Array with gateway paths.
73 73
 	 * @return array
74 74
 	 */
75
-	public function gateway_paths( $paths ) {
76
-		$paths[] = dirname( __FILE__ ) . '/../gateways/';
75
+	public function gateway_paths($paths) {
76
+		$paths[] = dirname(__FILE__) . '/../gateways/';
77 77
 
78 78
 		return $paths;
79 79
 	}
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 	 *
89 89
 	 * @return string
90 90
 	 */
91
-	public static function redirect_url( $url, Payment $payment ) {
91
+	public static function redirect_url($url, Payment $payment) {
92 92
 		global $transaction;
93 93
 
94 94
 		$transaction_id = $payment->get_source_id();
95 95
 
96
-		$transaction = new MeprTransaction( $transaction_id );
96
+		$transaction = new MeprTransaction($transaction_id);
97 97
 
98
-		switch ( $payment->get_status() ) {
98
+		switch ($payment->get_status()) {
99 99
 			case Statuses::CANCELLED:
100 100
 			case Statuses::EXPIRED:
101 101
 			case Statuses::FAILURE:
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 						'action'   => 'payment_form',
107 107
 						'txn'      => $transaction->trans_num,
108 108
 						'errors'   => array(
109
-							__( 'Payment failed. Please try again.', 'pronamic_ideal' ),
109
+							__('Payment failed. Please try again.', 'pronamic_ideal'),
110 110
 						),
111
-						'_wpnonce' => wp_create_nonce( 'mepr_payment_form' ),
111
+						'_wpnonce' => wp_create_nonce('mepr_payment_form'),
112 112
 					),
113 113
 					$product->url()
114 114
 				);
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 				// @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782
119 119
 				$mepr_options = MeprOptions::fetch();
120 120
 
121
-				$product         = new MeprProduct( $transaction->product_id );
122
-				$sanitized_title = sanitize_title( $product->post_title );
121
+				$product         = new MeprProduct($transaction->product_id);
122
+				$sanitized_title = sanitize_title($product->post_title);
123 123
 
124 124
 				$args = array(
125 125
 					'membership_id' => $product->ID,
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					'trans_num'     => $transaction->trans_num,
128 128
 				);
129 129
 
130
-				$url = $mepr_options->thankyou_page_url( http_build_query( $args ) );
130
+				$url = $mepr_options->thankyou_page_url(http_build_query($args));
131 131
 
132 132
 				break;
133 133
 			case Statuses::OPEN:
@@ -145,26 +145,26 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @param Payment $payment The payment whose status is updated.
147 147
 	 */
148
-	public static function status_update( Payment $payment ) {
148
+	public static function status_update(Payment $payment) {
149 149
 		$transaction_id = $payment->get_source_id();
150 150
 
151
-		$transaction = new MeprTransaction( $transaction_id );
151
+		$transaction = new MeprTransaction($transaction_id);
152 152
 
153
-		if ( $payment->get_recurring() ) {
153
+		if ($payment->get_recurring()) {
154 154
 			$subscription = $transaction->subscription();
155 155
 
156
-			if ( empty( $subscription ) || empty( $subscription->id ) ) {
156
+			if (empty($subscription) || empty($subscription->id)) {
157 157
 				$subscription_id = $payment->get_subscription()->get_source_id();
158 158
 
159
-				$subscription = new MeprSubscription( $subscription_id );
159
+				$subscription = new MeprSubscription($subscription_id);
160 160
 			}
161 161
 
162 162
 			// Same source ID and first transaction ID for recurring payment means we need to add a new transaction.
163
-			if ( $payment->get_source_id() === $subscription->id ) {
163
+			if ($payment->get_source_id() === $subscription->id) {
164 164
 				// First transaction.
165 165
 				$first_txn = $subscription->first_txn();
166 166
 
167
-				if ( false === $first_txn || ! ( $first_txn instanceof MeprTransaction ) ) {
167
+				if (false === $first_txn || ! ($first_txn instanceof MeprTransaction)) {
168 168
 					$first_txn             = new MeprTransaction();
169 169
 					$first_txn->user_id    = $subscription->user_id;
170 170
 					$first_txn->product_id = $subscription->product_id;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 				// Transaction number.
176 176
 				$trans_num = $payment->get_transaction_id();
177 177
 
178
-				if ( empty( $trans_num ) ) {
178
+				if (empty($trans_num)) {
179 179
 					$trans_num = uniqid();
180 180
 				}
181 181
 
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
 				$transaction->status          = MeprTransaction::$pending_str;
192 192
 				$transaction->subscription_id = $subscription->id;
193 193
 
194
-				$transaction->set_gross( $payment->get_amount()->get_amount() );
194
+				$transaction->set_gross($payment->get_amount()->get_amount());
195 195
 
196 196
 				$transaction->store();
197 197
 
198 198
 				// Set source ID.
199
-				$payment->set_meta( 'source_id', $transaction->id );
199
+				$payment->set_meta('source_id', $transaction->id);
200 200
 
201 201
 				$payment->source_id = $transaction->id;
202 202
 
203
-				if ( MeprSubscription::$active_str === $subscription->status ) {
203
+				if (MeprSubscription::$active_str === $subscription->status) {
204 204
 					/*
205 205
 					 * We create a 'confirmed' 'subscription_confirmation'
206 206
 					 * transaction for a grace period of 15 days.
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
 					$subscription_confirmation->txn_type        = MeprTransaction::$subscription_confirmation_str;
223 223
 					$subscription_confirmation->status          = MeprTransaction::$confirmed_str;
224 224
 					$subscription_confirmation->subscription_id = $subscription->id;
225
-					$subscription_confirmation->expires_at      = MeprUtils::ts_to_mysql_date( strtotime( $payment->post->post_date_gmt ) + MeprUtils::days( 15 ), 'Y-m-d 23:59:59' );
225
+					$subscription_confirmation->expires_at      = MeprUtils::ts_to_mysql_date(strtotime($payment->post->post_date_gmt) + MeprUtils::days(15), 'Y-m-d 23:59:59');
226 226
 
227
-					$subscription_confirmation->set_subtotal( 0.00 );
227
+					$subscription_confirmation->set_subtotal(0.00);
228 228
 
229 229
 					$subscription_confirmation->store();
230 230
 				}
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
 			)
240 240
 		);
241 241
 
242
-		if ( $should_update ) {
242
+		if ($should_update) {
243 243
 			$gateway = new Gateway();
244 244
 
245 245
 			$gateway->mp_txn = $transaction;
246 246
 
247
-			switch ( $payment->get_status() ) {
247
+			switch ($payment->get_status()) {
248 248
 				case Statuses::CANCELLED:
249 249
 				case Statuses::EXPIRED:
250 250
 				case Statuses::FAILURE:
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
 					break;
254 254
 				case Statuses::SUCCESS:
255
-					if ( $payment->get_recurring() ) {
255
+					if ($payment->get_recurring()) {
256 256
 						$gateway->record_subscription_payment();
257 257
 					} else {
258 258
 						$gateway->record_payment();
@@ -271,25 +271,25 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 * @param int $subscription_id MemberPress subscription id.
273 273
 	 */
274
-	public function subscription_pre_delete( $subscription_id ) {
275
-		$subscription = get_pronamic_subscription_by_meta( '_pronamic_subscription_source_id', $subscription_id );
274
+	public function subscription_pre_delete($subscription_id) {
275
+		$subscription = get_pronamic_subscription_by_meta('_pronamic_subscription_source_id', $subscription_id);
276 276
 
277
-		if ( ! $subscription ) {
277
+		if ( ! $subscription) {
278 278
 			return;
279 279
 		}
280 280
 
281 281
 		// Add note.
282 282
 		$note = sprintf(
283 283
 			/* translators: %s: MemberPress */
284
-			__( '%s subscription deleted.', 'pronamic_ideal' ),
285
-			__( 'MemberPress', 'pronamic_ideal' )
284
+			__('%s subscription deleted.', 'pronamic_ideal'),
285
+			__('MemberPress', 'pronamic_ideal')
286 286
 		);
287 287
 
288
-		$subscription->add_note( $note );
288
+		$subscription->add_note($note);
289 289
 
290 290
 		// The status of canceled or completed subscriptions will not be changed automatically.
291
-		if ( ! in_array( $subscription->get_status(), array( Statuses::CANCELLED, Statuses::COMPLETED ), true ) ) {
292
-			$subscription->set_status( Statuses::CANCELLED );
291
+		if ( ! in_array($subscription->get_status(), array(Statuses::CANCELLED, Statuses::COMPLETED), true)) {
292
+			$subscription->set_status(Statuses::CANCELLED);
293 293
 
294 294
 			$subscription->save();
295 295
 		}
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
 	 *
304 304
 	 * @return string
305 305
 	 */
306
-	public static function source_text( $text, Payment $payment ) {
307
-		$text = __( 'MemberPress', 'pronamic_ideal' ) . '<br />';
306
+	public static function source_text($text, Payment $payment) {
307
+		$text = __('MemberPress', 'pronamic_ideal') . '<br />';
308 308
 
309 309
 		$text .= sprintf(
310 310
 			'<a href="%s">%s</a>',
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 					'action' => 'edit',
315 315
 					'id'     => $payment->source_id,
316 316
 				),
317
-				admin_url( 'admin.php' )
317
+				admin_url('admin.php')
318 318
 			),
319 319
 			/* translators: %s: payment source id */
320
-			sprintf( __( 'Transaction %s', 'pronamic_ideal' ), $payment->source_id )
320
+			sprintf(__('Transaction %s', 'pronamic_ideal'), $payment->source_id)
321 321
 		);
322 322
 
323 323
 		return $text;
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 	 *
332 332
 	 * @return string
333 333
 	 */
334
-	public static function subscription_source_text( $text, Subscription $subscription ) {
335
-		$text = __( 'MemberPress', 'pronamic_ideal' ) . '<br />';
334
+	public static function subscription_source_text($text, Subscription $subscription) {
335
+		$text = __('MemberPress', 'pronamic_ideal') . '<br />';
336 336
 
337 337
 		$text .= sprintf(
338 338
 			'<a href="%s">%s</a>',
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
 					'page'         => 'memberpress-subscriptions',
342 342
 					'subscription' => $subscription->source_id,
343 343
 				),
344
-				admin_url( 'admin.php' )
344
+				admin_url('admin.php')
345 345
 			),
346 346
 			/* translators: %s: payment source id */
347
-			sprintf( __( 'Subscription %s', 'pronamic_ideal' ), $subscription->source_id )
347
+			sprintf(__('Subscription %s', 'pronamic_ideal'), $subscription->source_id)
348 348
 		);
349 349
 
350 350
 		return $text;
@@ -358,8 +358,8 @@  discard block
 block discarded – undo
358 358
 	 *
359 359
 	 * @return string
360 360
 	 */
361
-	public static function source_description( $description, Payment $payment ) {
362
-		return __( 'MemberPress Transaction', 'pronamic_ideal' );
361
+	public static function source_description($description, Payment $payment) {
362
+		return __('MemberPress Transaction', 'pronamic_ideal');
363 363
 	}
364 364
 
365 365
 	/**
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
 	 *
371 371
 	 * @return string
372 372
 	 */
373
-	public static function subscription_source_description( $description, Subscription $subscription ) {
374
-		return __( 'MemberPress Subscription', 'pronamic_ideal' );
373
+	public static function subscription_source_description($description, Subscription $subscription) {
374
+		return __('MemberPress Subscription', 'pronamic_ideal');
375 375
 	}
376 376
 
377 377
 	/**
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 	 *
383 383
 	 * @return string
384 384
 	 */
385
-	public static function source_url( $url, Payment $payment ) {
385
+	public static function source_url($url, Payment $payment) {
386 386
 		$url = add_query_arg(
387 387
 			array(
388 388
 				'page'   => 'memberpress-trans',
389 389
 				'action' => 'edit',
390 390
 				'id'     => $payment->source_id,
391 391
 			),
392
-			admin_url( 'admin.php' )
392
+			admin_url('admin.php')
393 393
 		);
394 394
 
395 395
 		return $url;
@@ -403,13 +403,13 @@  discard block
 block discarded – undo
403 403
 	 *
404 404
 	 * @return string
405 405
 	 */
406
-	public static function subscription_source_url( $url, Subscription $subscription ) {
406
+	public static function subscription_source_url($url, Subscription $subscription) {
407 407
 		$url = add_query_arg(
408 408
 			array(
409 409
 				'page'         => 'memberpress-subscriptions',
410 410
 				'subscription' => $subscription->source_id,
411 411
 			),
412
-			admin_url( 'admin.php' )
412
+			admin_url('admin.php')
413 413
 		);
414 414
 
415 415
 		return $url;
@@ -426,16 +426,16 @@  discard block
 block discarded – undo
426 426
 	 * @param string           $status_new               New status identifier.
427 427
 	 * @param MeprSubscription $memberpress_subscription MemberPress subscription object.
428 428
 	 */
429
-	public function memberpress_subscription_transition_status( $status_old, $status_new, $memberpress_subscription ) {
430
-		$subscription = get_pronamic_subscription_by_meta( '_pronamic_subscription_source_id', $memberpress_subscription->id );
429
+	public function memberpress_subscription_transition_status($status_old, $status_new, $memberpress_subscription) {
430
+		$subscription = get_pronamic_subscription_by_meta('_pronamic_subscription_source_id', $memberpress_subscription->id);
431 431
 
432
-		if ( empty( $subscription ) ) {
432
+		if (empty($subscription)) {
433 433
 			return;
434 434
 		}
435 435
 
436
-		$status = SubscriptionStatuses::transform( $status_new );
436
+		$status = SubscriptionStatuses::transform($status_new);
437 437
 
438
-		$subscription->set_status( $status );
438
+		$subscription->set_status($status);
439 439
 
440 440
 		$subscription->save();
441 441
 	}
Please login to merge, or discard this patch.
src/PaymentData.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param MeprTransaction $transaction MemberPress transaction object.
68 68
 	 * @param Gateway         $gateway     MemberPress gateway object.
69 69
 	 */
70
-	public function __construct( MeprTransaction $transaction, Gateway $gateway ) {
70
+	public function __construct(MeprTransaction $transaction, Gateway $gateway) {
71 71
 		parent::__construct();
72 72
 
73 73
 		$this->transaction = $transaction;
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
 		$items = new Items();
136 136
 
137 137
 		$item = new Item();
138
-		$item->set_number( $this->get_order_id() );
139
-		$item->set_description( $this->get_description() );
140
-		$item->set_price( $this->transaction->total );
141
-		$item->set_quantity( 1 );
138
+		$item->set_number($this->get_order_id());
139
+		$item->set_description($this->get_description());
140
+		$item->set_price($this->transaction->total);
141
+		$item->set_quantity(1);
142 142
 
143
-		$items->addItem( $item );
143
+		$items->addItem($item);
144 144
 
145 145
 		return $items;
146 146
 	}
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 	 * @return string|null
217 217
 	 */
218 218
 	public function get_address() {
219
-		$value = $this->user->address( 'one', false );
219
+		$value = $this->user->address('one', false);
220 220
 
221
-		if ( false === $value ) {
221
+		if (false === $value) {
222 222
 			return null;
223 223
 		}
224 224
 
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 	 * @return string|null
234 234
 	 */
235 235
 	public function get_city() {
236
-		$value = $this->user->address( 'city', false );
236
+		$value = $this->user->address('city', false);
237 237
 
238
-		if ( false === $value ) {
238
+		if (false === $value) {
239 239
 			return null;
240 240
 		}
241 241
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 * @return string|null
251 251
 	 */
252 252
 	public function get_zip() {
253
-		$value = $this->user->address( 'zip', false );
253
+		$value = $this->user->address('zip', false);
254 254
 
255
-		if ( false === $value ) {
255
+		if (false === $value) {
256 256
 			return null;
257 257
 		}
258 258
 
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 	 * @return string|null
268 268
 	 */
269 269
 	public function get_country() {
270
-		$value = $this->user->address( 'country', false );
270
+		$value = $this->user->address('country', false);
271 271
 
272
-		if ( false === $value ) {
272
+		if (false === $value) {
273 273
 			return null;
274 274
 		}
275 275
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
 		// @link https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782
290 290
 		// @link https://github.com/wp-premium/memberpress-basic/blob/1.3.18/app/models/MeprOptions.php#L806-L835
291
-		return $mepr_options->thankyou_page_url( 'trans_num=' . $this->transaction->id );
291
+		return $mepr_options->thankyou_page_url('trans_num=' . $this->transaction->id);
292 292
 	}
293 293
 
294 294
 	/**
@@ -300,19 +300,19 @@  discard block
 block discarded – undo
300 300
 	 * @return string
301 301
 	 */
302 302
 	public function get_cancel_url() {
303
-		if ( isset( $this->transaction->product_id ) && $this->transaction->product_id > 0 ) {
304
-			$product = new MeprProduct( $this->transaction->product_id );
303
+		if (isset($this->transaction->product_id) && $this->transaction->product_id > 0) {
304
+			$product = new MeprProduct($this->transaction->product_id);
305 305
 
306
-			$url = $this->gateway->message_page_url( $product, 'cancel' );
306
+			$url = $this->gateway->message_page_url($product, 'cancel');
307 307
 
308
-			if ( false !== $url ) {
308
+			if (false !== $url) {
309 309
 				return $url;
310 310
 			}
311 311
 		}
312 312
 
313 313
 		$mepr_options = MeprOptions::fetch();
314 314
 
315
-		return $mepr_options->account_page_url( 'action=subscriptions' );
315
+		return $mepr_options->account_page_url('action=subscriptions');
316 316
 	}
317 317
 
318 318
 	/**
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	public function get_error_url() {
333 333
 		$mepr_options = MeprOptions::fetch();
334 334
 
335
-		return $mepr_options->account_page_url( 'action=subscriptions' );
335
+		return $mepr_options->account_page_url('action=subscriptions');
336 336
 	}
337 337
 
338 338
 	/**
@@ -345,26 +345,26 @@  discard block
 block discarded – undo
345 345
 	public function get_subscription() {
346 346
 		$product = $this->transaction->product();
347 347
 
348
-		if ( $product->is_one_time_payment() ) {
348
+		if ($product->is_one_time_payment()) {
349 349
 			return false;
350 350
 		}
351 351
 
352 352
 		$mp_subscription = $this->transaction->subscription();
353 353
 
354
-		if ( ! $mp_subscription ) {
354
+		if ( ! $mp_subscription) {
355 355
 			return false;
356 356
 		}
357 357
 
358 358
 		$frequency = '';
359 359
 
360
-		if ( $mp_subscription->limit_cycles ) {
360
+		if ($mp_subscription->limit_cycles) {
361 361
 			$frequency = $mp_subscription->limit_cycles;
362 362
 		}
363 363
 
364 364
 		$subscription                  = new Subscription();
365 365
 		$subscription->frequency       = $frequency;
366 366
 		$subscription->interval        = $product->period;
367
-		$subscription->interval_period = Core_Util::to_period( $product->period_type );
367
+		$subscription->interval_period = Core_Util::to_period($product->period_type);
368 368
 		$subscription->description     = sprintf(
369 369
 			'Order #%s - %s',
370 370
 			$this->get_source_id(),
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
 	public function get_subscription_source_id() {
391 391
 		$subscription = $this->get_subscription();
392 392
 
393
-		if ( ! $subscription ) {
393
+		if ( ! $subscription) {
394 394
 			return false;
395 395
 		}
396 396
 
397
-		if ( ! empty( $this->transaction->subscription_id ) ) {
397
+		if ( ! empty($this->transaction->subscription_id)) {
398 398
 			return $this->transaction->subscription_id;
399 399
 		}
400 400
 
Please login to merge, or discard this patch.