Passed
Push — master ( 941e4d...c8e476 )
by Brian
06:36
created
includes/payments/class-getpaid-checkout.php 1 patch
Indentation   +247 added lines, -247 removed lines patch added patch discarded remove patch
@@ -12,177 +12,177 @@  discard block
 block discarded – undo
12 12
  */
13 13
 class GetPaid_Checkout {
14 14
 
15
-	/**
16
-	 * @var GetPaid_Payment_Form_Submission
17
-	 */
18
-	protected $payment_form_submission;
19
-
20
-	/**
21
-	 * Class constructor.
22
-	 * 
23
-	 * @param GetPaid_Payment_Form_Submission $submission
24
-	 */
25
-	public function __construct( $submission ) {
26
-		$this->payment_form_submission = $submission;
27
-	}
28
-
29
-	/**
30
-	 * Processes the checkout.
31
-	 *
32
-	 */
33
-	public function process_checkout() {
34
-
35
-		// Validate the submission.
36
-		$this->validate_submission();
37
-
38
-		// Prepare the invoice.
39
-		$items      = $this->get_submission_items();
40
-		$invoice    = $this->get_submission_invoice();
41
-		$invoice    = $this->process_submission_invoice( $invoice, $items );
42
-		$prepared   = $this->prepare_submission_data_for_saving();
43
-
44
-		$this->prepare_billing_info( $invoice );
45
-
46
-		$shipping   = $this->prepare_shipping_info( $invoice );
47
-
48
-		// Save the invoice.
49
-		$invoice->set_is_viewed( true );
50
-		$invoice->recalculate_total();
15
+    /**
16
+     * @var GetPaid_Payment_Form_Submission
17
+     */
18
+    protected $payment_form_submission;
19
+
20
+    /**
21
+     * Class constructor.
22
+     * 
23
+     * @param GetPaid_Payment_Form_Submission $submission
24
+     */
25
+    public function __construct( $submission ) {
26
+        $this->payment_form_submission = $submission;
27
+    }
28
+
29
+    /**
30
+     * Processes the checkout.
31
+     *
32
+     */
33
+    public function process_checkout() {
34
+
35
+        // Validate the submission.
36
+        $this->validate_submission();
37
+
38
+        // Prepare the invoice.
39
+        $items      = $this->get_submission_items();
40
+        $invoice    = $this->get_submission_invoice();
41
+        $invoice    = $this->process_submission_invoice( $invoice, $items );
42
+        $prepared   = $this->prepare_submission_data_for_saving();
43
+
44
+        $this->prepare_billing_info( $invoice );
45
+
46
+        $shipping   = $this->prepare_shipping_info( $invoice );
47
+
48
+        // Save the invoice.
49
+        $invoice->set_is_viewed( true );
50
+        $invoice->recalculate_total();
51 51
         $invoice->save();
52 52
 
53
-		do_action( 'getpaid_checkout_invoice_updated', $invoice );
53
+        do_action( 'getpaid_checkout_invoice_updated', $invoice );
54 54
 
55
-		// Send to the gateway.
56
-		$this->post_process_submission( $invoice, $prepared, $shipping );
57
-	}
55
+        // Send to the gateway.
56
+        $this->post_process_submission( $invoice, $prepared, $shipping );
57
+    }
58 58
 
59
-	/**
60
-	 * Validates the submission.
61
-	 *
62
-	 */
63
-	protected function validate_submission() {
59
+    /**
60
+     * Validates the submission.
61
+     *
62
+     */
63
+    protected function validate_submission() {
64 64
 
65
-		$submission = $this->payment_form_submission;
66
-		$data       = $submission->get_data();
65
+        $submission = $this->payment_form_submission;
66
+        $data       = $submission->get_data();
67 67
 
68
-		// Do we have an error?
68
+        // Do we have an error?
69 69
         if ( ! empty( $submission->last_error ) ) {
70
-			wp_send_json_error( $submission->last_error );
70
+            wp_send_json_error( $submission->last_error );
71 71
         }
72 72
 
73
-		// We need a billing email.
73
+        // We need a billing email.
74 74
         if ( ! $submission->has_billing_email() ) {
75 75
             wp_send_json_error( __( 'Provide a valid billing email.', 'invoicing' ) );
76
-		}
76
+        }
77 77
 
78
-		// Non-recurring gateways should not be allowed to process recurring invoices.
79
-		if ( $submission->should_collect_payment_details() && $submission->has_recurring && ! wpinv_gateway_support_subscription( $data['wpi-gateway'] ) ) {
80
-			wp_send_json_error( __( 'The selected payment gateway does not support subscription payments.', 'invoicing' ) );
81
-		}
78
+        // Non-recurring gateways should not be allowed to process recurring invoices.
79
+        if ( $submission->should_collect_payment_details() && $submission->has_recurring && ! wpinv_gateway_support_subscription( $data['wpi-gateway'] ) ) {
80
+            wp_send_json_error( __( 'The selected payment gateway does not support subscription payments.', 'invoicing' ) );
81
+        }
82 82
 
83
-		// Ensure the gateway is active.
84
-		if ( $submission->should_collect_payment_details() && ! wpinv_is_gateway_active( $data['wpi-gateway'] ) ) {
85
-			wpinv_set_error( 'invalid_gateway', __( 'The selected payment gateway is not active', 'invoicing' ) );
86
-		}
83
+        // Ensure the gateway is active.
84
+        if ( $submission->should_collect_payment_details() && ! wpinv_is_gateway_active( $data['wpi-gateway'] ) ) {
85
+            wpinv_set_error( 'invalid_gateway', __( 'The selected payment gateway is not active', 'invoicing' ) );
86
+        }
87 87
 
88
-		// Clear any existing errors.
89
-		wpinv_clear_errors();
88
+        // Clear any existing errors.
89
+        wpinv_clear_errors();
90 90
 
91
-		// Allow themes and plugins to hook to errors
92
-		do_action( 'getpaid_checkout_error_checks', $submission );
91
+        // Allow themes and plugins to hook to errors
92
+        do_action( 'getpaid_checkout_error_checks', $submission );
93 93
 
94
-		// Do we have any errors?
94
+        // Do we have any errors?
95 95
         if ( wpinv_get_errors() ) {
96 96
             wp_send_json_error( getpaid_get_errors_html() );
97
-		}
97
+        }
98 98
 
99
-	}
99
+    }
100 100
 
101
-	/**
102
-	 * Retrieves submission items.
103
-	 *
104
-	 * @return GetPaid_Form_Item[]
105
-	 */
106
-	protected function get_submission_items() {
101
+    /**
102
+     * Retrieves submission items.
103
+     *
104
+     * @return GetPaid_Form_Item[]
105
+     */
106
+    protected function get_submission_items() {
107 107
 
108
-		$items = $this->payment_form_submission->get_items();
108
+        $items = $this->payment_form_submission->get_items();
109 109
 
110 110
         // Ensure that we have items.
111 111
         if ( empty( $items ) && ! $this->payment_form_submission->has_fees() ) {
112 112
             wp_send_json_error( __( 'Please provide at least one item or amount.', 'invoicing' ) );
113
-		}
114
-
115
-		return $items;
116
-	}
117
-
118
-	/**
119
-	 * Retrieves submission invoice.
120
-	 *
121
-	 * @return WPInv_Invoice
122
-	 */
123
-	protected function get_submission_invoice() {
124
-		$submission = $this->payment_form_submission;
125
-
126
-		if ( ! $submission->has_invoice() ) {
127
-			$invoice = new WPInv_Invoice();
128
-			$invoice->created_via( 'payment_form' );
129
-			return $invoice;
130 113
         }
131 114
 
132
-		$invoice = $submission->get_invoice();
115
+        return $items;
116
+    }
133 117
 
134
-		// Make sure that it is neither paid or refunded.
135
-		if ( $invoice->is_paid() || $invoice->is_refunded() ) {
136
-			wp_send_json_error( __( 'This invoice has already been paid for.', 'invoicing' ) );
137
-		}
118
+    /**
119
+     * Retrieves submission invoice.
120
+     *
121
+     * @return WPInv_Invoice
122
+     */
123
+    protected function get_submission_invoice() {
124
+        $submission = $this->payment_form_submission;
138 125
 
139
-		return $invoice;
140
-	}
126
+        if ( ! $submission->has_invoice() ) {
127
+            $invoice = new WPInv_Invoice();
128
+            $invoice->created_via( 'payment_form' );
129
+            return $invoice;
130
+        }
141 131
 
142
-	/**
143
-	 * Processes the submission invoice.
144
-	 *
145
-	 * @param WPInv_Invoice $invoice
146
-	 * @param GetPaid_Form_Item[] $items
147
-	 * @return WPInv_Invoice
148
-	 */
149
-	protected function process_submission_invoice( $invoice, $items ) {
132
+        $invoice = $submission->get_invoice();
150 133
 
151
-		$submission = $this->payment_form_submission;
152
-		$data       = $submission->get_data();
134
+        // Make sure that it is neither paid or refunded.
135
+        if ( $invoice->is_paid() || $invoice->is_refunded() ) {
136
+            wp_send_json_error( __( 'This invoice has already been paid for.', 'invoicing' ) );
137
+        }
153 138
 
154
-		// Set-up the invoice details.
155
-		$invoice->set_email( sanitize_email( $submission->get_billing_email() ) );
156
-		$invoice->set_user_id( $this->get_submission_customer() );
157
-		$invoice->set_payment_form( absint( $submission->get_payment_form()->get_id() ) );
139
+        return $invoice;
140
+    }
141
+
142
+    /**
143
+     * Processes the submission invoice.
144
+     *
145
+     * @param WPInv_Invoice $invoice
146
+     * @param GetPaid_Form_Item[] $items
147
+     * @return WPInv_Invoice
148
+     */
149
+    protected function process_submission_invoice( $invoice, $items ) {
150
+
151
+        $submission = $this->payment_form_submission;
152
+        $data       = $submission->get_data();
153
+
154
+        // Set-up the invoice details.
155
+        $invoice->set_email( sanitize_email( $submission->get_billing_email() ) );
156
+        $invoice->set_user_id( $this->get_submission_customer() );
157
+        $invoice->set_payment_form( absint( $submission->get_payment_form()->get_id() ) );
158 158
         $invoice->set_items( $items );
159 159
         $invoice->set_fees( $submission->get_fees() );
160 160
         $invoice->set_taxes( $submission->get_taxes() );
161
-		$invoice->set_discounts( $submission->get_discounts() );
162
-		$invoice->set_gateway( $data['wpi-gateway'] );
161
+        $invoice->set_discounts( $submission->get_discounts() );
162
+        $invoice->set_gateway( $data['wpi-gateway'] );
163 163
 
164
-		if ( $submission->has_discount_code() ) {
164
+        if ( $submission->has_discount_code() ) {
165 165
             $invoice->set_discount_code( $submission->get_discount_code() );
166
-		}
167
-
168
-		getpaid_maybe_add_default_address( $invoice );
169
-		return $invoice;
170
-	}
171
-
172
-	/**
173
-	 * Retrieves the submission's customer.
174
-	 *
175
-	 * @return int The customer id.
176
-	 */
177
-	protected function get_submission_customer() {
178
-		$submission = $this->payment_form_submission;
179
-
180
-		// If this is an existing invoice...
181
-		if ( $submission->has_invoice() ) {
182
-			return $submission->get_invoice()->get_user_id();
183
-		}
184
-
185
-		// (Maybe) create the user.
166
+        }
167
+
168
+        getpaid_maybe_add_default_address( $invoice );
169
+        return $invoice;
170
+    }
171
+
172
+    /**
173
+     * Retrieves the submission's customer.
174
+     *
175
+     * @return int The customer id.
176
+     */
177
+    protected function get_submission_customer() {
178
+        $submission = $this->payment_form_submission;
179
+
180
+        // If this is an existing invoice...
181
+        if ( $submission->has_invoice() ) {
182
+            return $submission->get_invoice()->get_user_id();
183
+        }
184
+
185
+        // (Maybe) create the user.
186 186
         $user = get_current_user_id();
187 187
 
188 188
         if ( empty( $user ) ) {
@@ -199,31 +199,31 @@  discard block
 block discarded – undo
199 199
 
200 200
         if ( is_numeric( $user ) ) {
201 201
             return $user;
202
-		}
202
+        }
203 203
 
204
-		return $user->ID;
204
+        return $user->ID;
205 205
 
206
-	}
206
+    }
207 207
 
208
-	/**
208
+    /**
209 209
      * Prepares submission data for saving to the database.
210 210
      *
211
-	 * @return array
211
+     * @return array
212 212
      */
213 213
     public function prepare_submission_data_for_saving() {
214 214
 
215
-		$submission = $this->payment_form_submission;
215
+        $submission = $this->payment_form_submission;
216 216
 
217
-		// Prepared submission details.
217
+        // Prepared submission details.
218 218
         $prepared = array();
219 219
 
220 220
         // Raw submission details.
221
-		$data     = $submission->get_data();
221
+        $data     = $submission->get_data();
222 222
 
223
-		// Loop through the submitted details.
223
+        // Loop through the submitted details.
224 224
         foreach ( $submission->get_payment_form()->get_elements() as $field ) {
225 225
 
226
-			// Skip premade fields.
226
+            // Skip premade fields.
227 227
             if ( ! empty( $field['premade'] ) || $field['type'] == 'address' ) {
228 228
                 continue;
229 229
             }
@@ -241,93 +241,93 @@  discard block
 block discarded – undo
241 241
                     $label = $field['label'];
242 242
                 }
243 243
 
244
-				$prepared[ wpinv_clean( $label ) ] = wp_kses_post( $data[ $field['id'] ] );
244
+                $prepared[ wpinv_clean( $label ) ] = wp_kses_post( $data[ $field['id'] ] );
245 245
 
246 246
             }
247 247
 
248
-		}
248
+        }
249 249
 
250
-		return $prepared;
250
+        return $prepared;
251 251
 
252
-	}
252
+    }
253 253
 
254
-	/**
254
+    /**
255 255
      * Retrieves address details.
256 256
      *
257
-	 * @return array
258
-	 * @param WPInv_Invoice $invoice
259
-	 * @param string $type
257
+     * @return array
258
+     * @param WPInv_Invoice $invoice
259
+     * @param string $type
260 260
      */
261 261
     public function prepare_address_details( $invoice, $type = 'billing' ) {
262 262
 
263
-		$data     = $this->payment_form_submission->get_data();
264
-		$type     = sanitize_key( $type );
265
-		$address  = array();
266
-		$prepared = array();
263
+        $data     = $this->payment_form_submission->get_data();
264
+        $type     = sanitize_key( $type );
265
+        $address  = array();
266
+        $prepared = array();
267 267
 
268
-		if ( ! empty( $data[ $type ] ) ) {
269
-			$address = $data[ $type ];
270
-		}
268
+        if ( ! empty( $data[ $type ] ) ) {
269
+            $address = $data[ $type ];
270
+        }
271 271
 
272
-		// Clean address details.
273
-		foreach ( $address as $key => $value ) {
274
-			$key             = sanitize_key( $key );
275
-			$key             = str_replace( 'wpinv_', '', $key );
276
-			$value           = wpinv_clean( $value );
277
-			$prepared[ $key] = apply_filters( "getpaid_checkout_{$type}_address_$key", $value, $this->payment_form_submission, $invoice );
278
-		}
272
+        // Clean address details.
273
+        foreach ( $address as $key => $value ) {
274
+            $key             = sanitize_key( $key );
275
+            $key             = str_replace( 'wpinv_', '', $key );
276
+            $value           = wpinv_clean( $value );
277
+            $prepared[ $key] = apply_filters( "getpaid_checkout_{$type}_address_$key", $value, $this->payment_form_submission, $invoice );
278
+        }
279 279
 
280
-		// Filter address details.
281
-		$prepared = apply_filters( "getpaid_checkout_{$type}_address", $prepared, $this->payment_form_submission, $invoice );
280
+        // Filter address details.
281
+        $prepared = apply_filters( "getpaid_checkout_{$type}_address", $prepared, $this->payment_form_submission, $invoice );
282 282
 
283
-		// Remove non-whitelisted values.
284
-		return array_filter( $prepared, 'getpaid_is_address_field_whitelisted', ARRAY_FILTER_USE_KEY );
283
+        // Remove non-whitelisted values.
284
+        return array_filter( $prepared, 'getpaid_is_address_field_whitelisted', ARRAY_FILTER_USE_KEY );
285 285
 
286
-	}
286
+    }
287 287
 
288
-	/**
288
+    /**
289 289
      * Prepares the billing details.
290 290
      *
291
-	 * @return array
292
-	 * @param WPInv_Invoice $invoice
291
+     * @return array
292
+     * @param WPInv_Invoice $invoice
293 293
      */
294 294
     protected function prepare_billing_info( &$invoice ) {
295 295
 
296
-		$billing_address = $this->prepare_address_details( $invoice, 'billing' );
296
+        $billing_address = $this->prepare_address_details( $invoice, 'billing' );
297 297
 
298
-		// Update the invoice with the billing details.
299
-		$invoice->set_props( $billing_address );
298
+        // Update the invoice with the billing details.
299
+        $invoice->set_props( $billing_address );
300 300
 
301
-	}
301
+    }
302 302
 
303
-	/**
303
+    /**
304 304
      * Prepares the shipping details.
305 305
      *
306
-	 * @return array
307
-	 * @param WPInv_Invoice $invoice
306
+     * @return array
307
+     * @param WPInv_Invoice $invoice
308 308
      */
309 309
     protected function prepare_shipping_info( $invoice ) {
310 310
 
311
-		$data = $this->payment_form_submission->get_data();
311
+        $data = $this->payment_form_submission->get_data();
312 312
 
313
-		if ( empty( $data['same-shipping-address'] ) ) {
314
-			return $this->prepare_address_details( $invoice, 'shipping' );
315
-		}
313
+        if ( empty( $data['same-shipping-address'] ) ) {
314
+            return $this->prepare_address_details( $invoice, 'shipping' );
315
+        }
316 316
 
317
-		return $this->prepare_address_details( $invoice, 'billing' );
317
+        return $this->prepare_address_details( $invoice, 'billing' );
318 318
 
319
-	}
319
+    }
320 320
 
321
-	/**
322
-	 * Confirms the submission is valid and send users to the gateway.
323
-	 *
324
-	 * @param WPInv_Invoice $invoice
325
-	 * @param array $prepared_payment_form_data
326
-	 * @param array $shipping
327
-	 */
328
-	protected function post_process_submission( $invoice, $prepared_payment_form_data, $shipping ) {
321
+    /**
322
+     * Confirms the submission is valid and send users to the gateway.
323
+     *
324
+     * @param WPInv_Invoice $invoice
325
+     * @param array $prepared_payment_form_data
326
+     * @param array $shipping
327
+     */
328
+    protected function post_process_submission( $invoice, $prepared_payment_form_data, $shipping ) {
329 329
 
330
-		// Ensure the invoice exists.
330
+        // Ensure the invoice exists.
331 331
         if ( ! $invoice->exists() ) {
332 332
             wp_send_json_error( __( 'An error occured while saving your invoice. Please try again.', 'invoicing' ) );
333 333
         }
@@ -335,81 +335,81 @@  discard block
 block discarded – undo
335 335
         // Save payment form data.
336 336
         if ( ! empty( $prepared_payment_form_data ) ) {
337 337
             update_post_meta( $invoice->get_id(), 'payment_form_data', $prepared_payment_form_data );
338
-		}
338
+        }
339 339
 
340
-		// Save payment form data.
340
+        // Save payment form data.
341 341
         if ( ! empty( $shipping ) ) {
342 342
             update_post_meta( $invoice->get_id(), 'shipping_address', $shipping );
343
-		}
343
+        }
344 344
 
345
-		// Backwards compatibility.
345
+        // Backwards compatibility.
346 346
         add_filter( 'wp_redirect', array( $this, 'send_redirect_response' ) );
347 347
 
348
-		$this->process_payment( $invoice );
348
+        $this->process_payment( $invoice );
349 349
 
350 350
         // If we are here, there was an error.
351
-		wpinv_send_back_to_checkout( $invoice );
351
+        wpinv_send_back_to_checkout( $invoice );
352 352
 
353
-	}
353
+    }
354 354
 
355
-	/**
356
-	 * Processes the actual payment.
357
-	 *
358
-	 * @param WPInv_Invoice $invoice
359
-	 */
360
-	protected function process_payment( $invoice ) {
355
+    /**
356
+     * Processes the actual payment.
357
+     *
358
+     * @param WPInv_Invoice $invoice
359
+     */
360
+    protected function process_payment( $invoice ) {
361 361
 
362
-		// Clear any checkout errors.
363
-		wpinv_clear_errors();
362
+        // Clear any checkout errors.
363
+        wpinv_clear_errors();
364 364
 
365
-		// No need to send free invoices to the gateway.
366
-		if ( $invoice->is_free() ) {
367
-			$this->process_free_payment( $invoice );
368
-		}
365
+        // No need to send free invoices to the gateway.
366
+        if ( $invoice->is_free() ) {
367
+            $this->process_free_payment( $invoice );
368
+        }
369 369
 
370
-		$submission = $this->payment_form_submission;
370
+        $submission = $this->payment_form_submission;
371 371
 
372
-		// Fires before sending to the gateway.
373
-		do_action( 'getpaid_checkout_before_gateway', $invoice, $submission );
372
+        // Fires before sending to the gateway.
373
+        do_action( 'getpaid_checkout_before_gateway', $invoice, $submission );
374 374
 
375
-		// Allow the sumission data to be modified before it is sent to the gateway.
376
-		$submission_data    = $submission->get_data();
377
-		$submission_gateway = apply_filters( 'getpaid_gateway_submission_gateway', $invoice->get_gateway(), $submission, $invoice );
378
-		$submission_data    = apply_filters( 'getpaid_gateway_submission_data', $submission_data, $submission, $invoice );
375
+        // Allow the sumission data to be modified before it is sent to the gateway.
376
+        $submission_data    = $submission->get_data();
377
+        $submission_gateway = apply_filters( 'getpaid_gateway_submission_gateway', $invoice->get_gateway(), $submission, $invoice );
378
+        $submission_data    = apply_filters( 'getpaid_gateway_submission_data', $submission_data, $submission, $invoice );
379 379
 
380
-		// Validate the currency.
381
-		if ( ! apply_filters( "getpaid_gateway_{$submission_gateway}_is_valid_for_currency", true, $invoice->get_currency() ) ) {
382
-			wpinv_set_error( 'invalid_currency', __( 'The chosen payment gateway does not support this currency', 'invoicing' ) );
383
-		}
380
+        // Validate the currency.
381
+        if ( ! apply_filters( "getpaid_gateway_{$submission_gateway}_is_valid_for_currency", true, $invoice->get_currency() ) ) {
382
+            wpinv_set_error( 'invalid_currency', __( 'The chosen payment gateway does not support this currency', 'invoicing' ) );
383
+        }
384 384
 
385
-		// Check to see if we have any errors.
386
-		if ( wpinv_get_errors() ) {
387
-			wpinv_send_back_to_checkout( $invoice );
388
-		}
385
+        // Check to see if we have any errors.
386
+        if ( wpinv_get_errors() ) {
387
+            wpinv_send_back_to_checkout( $invoice );
388
+        }
389 389
 
390
-		// Send info to the gateway for payment processing
391
-		do_action( "getpaid_gateway_$submission_gateway", $invoice, $submission_data, $submission );
390
+        // Send info to the gateway for payment processing
391
+        do_action( "getpaid_gateway_$submission_gateway", $invoice, $submission_data, $submission );
392 392
 
393
-		// Backwards compatibility.
394
-		wpinv_send_to_gateway( $submission_gateway, $invoice );
393
+        // Backwards compatibility.
394
+        wpinv_send_to_gateway( $submission_gateway, $invoice );
395 395
 
396
-	}
396
+    }
397 397
 
398
-	/**
399
-	 * Marks the invoice as paid in case the checkout is free.
400
-	 *
401
-	 * @param WPInv_Invoice $invoice
402
-	 */
403
-	protected function process_free_payment( $invoice ) {
398
+    /**
399
+     * Marks the invoice as paid in case the checkout is free.
400
+     *
401
+     * @param WPInv_Invoice $invoice
402
+     */
403
+    protected function process_free_payment( $invoice ) {
404 404
 
405
-		$invoice->set_gateway( 'none' );
406
-		$invoice->add_note( __( "This is a free invoice and won't be sent to the payment gateway", 'invoicing' ), false, false, true );
407
-		$invoice->mark_paid();
408
-		wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
405
+        $invoice->set_gateway( 'none' );
406
+        $invoice->add_note( __( "This is a free invoice and won't be sent to the payment gateway", 'invoicing' ), false, false, true );
407
+        $invoice->mark_paid();
408
+        wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
409 409
 
410
-	}
410
+    }
411 411
 
412
-	/**
412
+    /**
413 413
      * Sends a redrect response to payment details.
414 414
      *
415 415
      */
Please login to merge, or discard this patch.