Passed
Push — master ( 2975b0...fd42df )
by Brian
05:40 queued 01:38
created
includes/gateways/class-getpaid-bank-transfer-gateway.php 2 patches
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -13,30 +13,30 @@  discard block
 block discarded – undo
13 13
 class GetPaid_Bank_Transfer_Gateway extends GetPaid_Payment_Gateway {
14 14
 
15 15
     /**
16
-	 * Payment method id.
17
-	 *
18
-	 * @var string
19
-	 */
16
+     * Payment method id.
17
+     *
18
+     * @var string
19
+     */
20 20
     public $id = 'bank_transfer';
21 21
 
22
-	/**
23
-	 * An array of features that this gateway supports.
24
-	 *
25
-	 * @var array
26
-	 */
27
-	protected $supports = array( 'addons' );
22
+    /**
23
+     * An array of features that this gateway supports.
24
+     *
25
+     * @var array
26
+     */
27
+    protected $supports = array( 'addons' );
28 28
 
29 29
     /**
30
-	 * Payment method order.
31
-	 *
32
-	 * @var int
33
-	 */
34
-	public $order = 8;
30
+     * Payment method order.
31
+     *
32
+     * @var int
33
+     */
34
+    public $order = 8;
35 35
 
36 36
     /**
37
-	 * Class constructor.
38
-	 */
39
-	public function __construct() {
37
+     * Class constructor.
38
+     */
39
+    public function __construct() {
40 40
         parent::__construct();
41 41
 
42 42
         $this->title                = __( 'Direct bank transfer', 'invoicing' );
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
         $this->checkout_button_text = __( 'Proceed', 'invoicing' );
45 45
         $this->instructions         = apply_filters( 'wpinv_bank_instructions', $this->get_option( 'info' ) );
46 46
 
47
-		add_action( 'wpinv_receipt_end', array( $this, 'thankyou_page' ) );
48
-		add_action( 'getpaid_invoice_line_items', array( $this, 'thankyou_page' ), 40 );
49
-		add_action( 'wpinv_email_invoice_details', array( $this, 'email_instructions' ), 10, 3 );
47
+        add_action( 'wpinv_receipt_end', array( $this, 'thankyou_page' ) );
48
+        add_action( 'getpaid_invoice_line_items', array( $this, 'thankyou_page' ), 40 );
49
+        add_action( 'wpinv_email_invoice_details', array( $this, 'email_instructions' ), 10, 3 );
50 50
 
51 51
     }
52 52
 
53 53
     /**
54
-	 * Process Payment.
55
-	 *
56
-	 *
57
-	 * @param WPInv_Invoice $invoice Invoice.
58
-	 * @param array $submission_data Posted checkout fields.
59
-	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
60
-	 * @return array
61
-	 */
62
-	public function process_payment( $invoice, $submission_data, $submission ) {
54
+     * Process Payment.
55
+     *
56
+     *
57
+     * @param WPInv_Invoice $invoice Invoice.
58
+     * @param array $submission_data Posted checkout fields.
59
+     * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
60
+     * @return array
61
+     */
62
+    public function process_payment( $invoice, $submission_data, $submission ) {
63 63
 
64 64
         // Add a transaction id.
65 65
         $invoice->set_transaction_id( $invoice->generate_key('trans_') );
@@ -80,66 +80,66 @@  discard block
 block discarded – undo
80 80
     }
81 81
 
82 82
     /**
83
-	 * Output for the order received page.
84
-	 *
85
-	 * @param WPInv_Invoice $invoice Invoice.
86
-	 */
87
-	public function thankyou_page( $invoice ) {
83
+     * Output for the order received page.
84
+     *
85
+     * @param WPInv_Invoice $invoice Invoice.
86
+     */
87
+    public function thankyou_page( $invoice ) {
88 88
 
89 89
         if ( 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
90 90
 
91
-			echo '<div class="mt-4 mb-2 getpaid-bank-transfer-details">' . PHP_EOL;
91
+            echo '<div class="mt-4 mb-2 getpaid-bank-transfer-details">' . PHP_EOL;
92 92
 
93 93
             if ( ! empty( $this->instructions ) ) {
94 94
                 echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) );
95
-			}
95
+            }
96 96
 
97
-			$this->bank_details( $invoice );
97
+            $this->bank_details( $invoice );
98 98
 			
99
-			echo '</div>';
99
+            echo '</div>';
100 100
         
101 101
         }
102 102
 
103
-	}
103
+    }
104 104
     
105 105
     /**
106
-	 * Add content to the WPI emails.
107
-	 *
108
-	 * @param WPInv_Invoice $invoice Invoice.
109
-	 * @param string     $email_type Email format: plain text or HTML.
110
-	 * @param bool     $sent_to_admin Sent to admin.
111
-	 */
112
-	public function email_instructions( $invoice, $email_type, $sent_to_admin ) {
106
+     * Add content to the WPI emails.
107
+     *
108
+     * @param WPInv_Invoice $invoice Invoice.
109
+     * @param string     $email_type Email format: plain text or HTML.
110
+     * @param bool     $sent_to_admin Sent to admin.
111
+     */
112
+    public function email_instructions( $invoice, $email_type, $sent_to_admin ) {
113 113
 
114
-		if ( ! $sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
114
+        if ( ! $sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
115 115
 
116
-			echo '<div class="wpi-email-row getpaid-bank-transfer-details">';
116
+            echo '<div class="wpi-email-row getpaid-bank-transfer-details">';
117 117
 
118
-			if ( $this->instructions ) {
119
-				echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL );
118
+            if ( $this->instructions ) {
119
+                echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL );
120 120
             }
121 121
 
122
-			$this->bank_details( $invoice );
122
+            $this->bank_details( $invoice );
123 123
 			
124
-			echo '</div>';
124
+            echo '</div>';
125 125
 
126
-		}
126
+        }
127 127
 
128 128
     }
129 129
     
130 130
     /**
131
-	 * Get bank details and place into a list format.
132
-	 *
133
-	 * @param WPInv_Invoice $invoice Invoice.
134
-	 */
135
-	protected function bank_details( $invoice ) {
131
+     * Get bank details and place into a list format.
132
+     *
133
+     * @param WPInv_Invoice $invoice Invoice.
134
+     */
135
+    protected function bank_details( $invoice ) {
136 136
 
137
-		// Get the invoice country and country $locale.
138
-		$country = $invoice->get_country();
139
-		$locale  = $this->get_country_locale();
137
+        // Get the invoice country and country $locale.
138
+        $country = $invoice->get_country();
139
+        $locale  = $this->get_country_locale();
140 140
 
141
-		// Get sortcode label in the $locale array and use appropriate one.
142
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
141
+        // Get sortcode label in the $locale array and use appropriate one.
142
+        $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
143 143
 
144 144
         $bank_fields = array(
145 145
             'ac_name'     => __( 'Account Name', 'invoicing' ),
@@ -168,144 +168,144 @@  discard block
 block discarded – undo
168 168
             return;
169 169
         }
170 170
 
171
-		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters( 'wpinv_receipt_bank_details_title', __( 'Bank Details', 'invoicing' ) ) . '</h3>' . PHP_EOL;
171
+        echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters( 'wpinv_receipt_bank_details_title', __( 'Bank Details', 'invoicing' ) ) . '</h3>' . PHP_EOL;
172 172
 
173
-		echo '<table class="table table-bordered getpaid-bank-transfer-details">' . PHP_EOL;
173
+        echo '<table class="table table-bordered getpaid-bank-transfer-details">' . PHP_EOL;
174 174
 
175
-		foreach ( $bank_info as $key => $data ) {
175
+        foreach ( $bank_info as $key => $data ) {
176 176
 
177
-			$key   = sanitize_html_class( $key );
178
-			$label = wp_kses_post( $data['label'] );
179
-			$value = wp_kses_post( wptexturize( $data['value'] ) );
177
+            $key   = sanitize_html_class( $key );
178
+            $label = wp_kses_post( $data['label'] );
179
+            $value = wp_kses_post( wptexturize( $data['value'] ) );
180 180
 
181
-			echo "<tr class='getpaid-bank-transfer-$key'><th>$label</th><td>$value</td></tr>" . PHP_EOL;
182
-		}
181
+            echo "<tr class='getpaid-bank-transfer-$key'><th>$label</th><td>$value</td></tr>" . PHP_EOL;
182
+        }
183 183
 
184
-		echo '</table>';
184
+        echo '</table>';
185 185
 
186 186
     }
187 187
     
188 188
     /**
189
-	 * Get country locale if localized.
190
-	 *
191
-	 * @return array
192
-	 */
193
-	public function get_country_locale() {
194
-
195
-		if ( empty( $this->locale ) ) {
196
-
197
-			// Locale information to be used - only those that are not 'Sort Code'.
198
-			$this->locale = apply_filters(
199
-				'getpaid_get_bank_transfer_locale',
200
-				array(
201
-					'AU' => array(
202
-						'sortcode' => array(
203
-							'label' => __( 'BSB', 'invoicing' ),
204
-						),
205
-					),
206
-					'CA' => array(
207
-						'sortcode' => array(
208
-							'label' => __( 'Bank transit number', 'invoicing' ),
209
-						),
210
-					),
211
-					'IN' => array(
212
-						'sortcode' => array(
213
-							'label' => __( 'IFSC', 'invoicing' ),
214
-						),
215
-					),
216
-					'IT' => array(
217
-						'sortcode' => array(
218
-							'label' => __( 'Branch sort', 'invoicing' ),
219
-						),
220
-					),
221
-					'NZ' => array(
222
-						'sortcode' => array(
223
-							'label' => __( 'Bank code', 'invoicing' ),
224
-						),
225
-					),
226
-					'SE' => array(
227
-						'sortcode' => array(
228
-							'label' => __( 'Bank code', 'invoicing' ),
229
-						),
230
-					),
231
-					'US' => array(
232
-						'sortcode' => array(
233
-							'label' => __( 'Routing number', 'invoicing' ),
234
-						),
235
-					),
236
-					'ZA' => array(
237
-						'sortcode' => array(
238
-							'label' => __( 'Branch code', 'invoicing' ),
239
-						),
240
-					),
241
-				)
242
-			);
243
-
244
-		}
245
-
246
-		return $this->locale;
247
-
248
-	}
249
-
250
-	/**
251
-	 * Filters the gateway settings.
252
-	 * 
253
-	 * @param array $admin_settings
254
-	 */
255
-	public function admin_settings( $admin_settings ) {
189
+     * Get country locale if localized.
190
+     *
191
+     * @return array
192
+     */
193
+    public function get_country_locale() {
194
+
195
+        if ( empty( $this->locale ) ) {
196
+
197
+            // Locale information to be used - only those that are not 'Sort Code'.
198
+            $this->locale = apply_filters(
199
+                'getpaid_get_bank_transfer_locale',
200
+                array(
201
+                    'AU' => array(
202
+                        'sortcode' => array(
203
+                            'label' => __( 'BSB', 'invoicing' ),
204
+                        ),
205
+                    ),
206
+                    'CA' => array(
207
+                        'sortcode' => array(
208
+                            'label' => __( 'Bank transit number', 'invoicing' ),
209
+                        ),
210
+                    ),
211
+                    'IN' => array(
212
+                        'sortcode' => array(
213
+                            'label' => __( 'IFSC', 'invoicing' ),
214
+                        ),
215
+                    ),
216
+                    'IT' => array(
217
+                        'sortcode' => array(
218
+                            'label' => __( 'Branch sort', 'invoicing' ),
219
+                        ),
220
+                    ),
221
+                    'NZ' => array(
222
+                        'sortcode' => array(
223
+                            'label' => __( 'Bank code', 'invoicing' ),
224
+                        ),
225
+                    ),
226
+                    'SE' => array(
227
+                        'sortcode' => array(
228
+                            'label' => __( 'Bank code', 'invoicing' ),
229
+                        ),
230
+                    ),
231
+                    'US' => array(
232
+                        'sortcode' => array(
233
+                            'label' => __( 'Routing number', 'invoicing' ),
234
+                        ),
235
+                    ),
236
+                    'ZA' => array(
237
+                        'sortcode' => array(
238
+                            'label' => __( 'Branch code', 'invoicing' ),
239
+                        ),
240
+                    ),
241
+                )
242
+            );
243
+
244
+        }
245
+
246
+        return $this->locale;
247
+
248
+    }
249
+
250
+    /**
251
+     * Filters the gateway settings.
252
+     * 
253
+     * @param array $admin_settings
254
+     */
255
+    public function admin_settings( $admin_settings ) {
256 256
 
257 257
         $admin_settings['worldpay_desc']['std']    = __( "Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing' );
258
-		$admin_settings['worldpay_active']['desc'] = __( 'Enable bank transfer', 'invoicing' );
258
+        $admin_settings['worldpay_active']['desc'] = __( 'Enable bank transfer', 'invoicing' );
259 259
 
260
-		$locale  = $this->get_country_locale();
260
+        $locale  = $this->get_country_locale();
261 261
 
262
-		// Get sortcode label in the $locale array and use appropriate one.
263
-		$country  = wpinv_default_billing_country();
264
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
262
+        // Get sortcode label in the $locale array and use appropriate one.
263
+        $country  = wpinv_default_billing_country();
264
+        $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
265 265
 
266
-		$admin_settings['bank_transfer_ac_name'] = array(
266
+        $admin_settings['bank_transfer_ac_name'] = array(
267 267
             'type' => 'text',
268 268
             'id'   => 'bank_transfer_ac_name',
269 269
             'name' => __( 'Account Name', 'invoicing' ),
270
-		);
270
+        );
271 271
 		
272
-		$admin_settings['bank_transfer_ac_no'] = array(
272
+        $admin_settings['bank_transfer_ac_no'] = array(
273 273
             'type' => 'text',
274 274
             'id'   => 'bank_transfer_ac_no',
275 275
             'name' => __( 'Account Number', 'invoicing' ),
276
-		);
276
+        );
277 277
 		
278
-		$admin_settings['bank_transfer_bank_name'] = array(
278
+        $admin_settings['bank_transfer_bank_name'] = array(
279 279
             'type' => 'text',
280 280
             'id'   => 'bank_transfer_bank_name',
281 281
             'name' => __( 'Bank Name', 'invoicing' ),
282
-		);
282
+        );
283 283
 
284
-		$admin_settings['bank_transfer_ifsc'] = array(
284
+        $admin_settings['bank_transfer_ifsc'] = array(
285 285
             'type' => 'text',
286 286
             'id'   => 'bank_transfer_ifsc',
287 287
             'name' => __( 'IFSC Code', 'invoicing' ),
288
-		);
288
+        );
289 289
 
290
-		$admin_settings['bank_transfer_iban'] = array(
290
+        $admin_settings['bank_transfer_iban'] = array(
291 291
             'type' => 'text',
292 292
             'id'   => 'bank_transfer_iban',
293 293
             'name' => __( 'IBAN', 'invoicing' ),
294
-		);
294
+        );
295 295
 
296
-		$admin_settings['bank_transfer_bic'] = array(
296
+        $admin_settings['bank_transfer_bic'] = array(
297 297
             'type' => 'text',
298 298
             'id'   => 'bank_transfer_bic',
299 299
             'name' => __( 'BIC/Swift Code', 'invoicing' ),
300
-		);
300
+        );
301 301
 		
302
-		$admin_settings['bank_transfer_sort_code'] = array(
303
-			'type' => 'text',
304
-			'id'   => 'bank_transfer_sort_code',
305
-			'name' => $sortcode,
306
-		);
302
+        $admin_settings['bank_transfer_sort_code'] = array(
303
+            'type' => 'text',
304
+            'id'   => 'bank_transfer_sort_code',
305
+            'name' => $sortcode,
306
+        );
307 307
 
308
-		$admin_settings['bank_transfer_info'] = array(
308
+        $admin_settings['bank_transfer_info'] = array(
309 309
             'id'   => 'bank_transfer_info',
310 310
             'name' => __( 'Instructions', 'invoicing' ),
311 311
             'desc' => __( 'Instructions that will be added to the thank you page and emails.', 'invoicing' ),
@@ -315,17 +315,17 @@  discard block
 block discarded – undo
315 315
             'rows' => 5
316 316
         );
317 317
 
318
-		return $admin_settings;
319
-	}
318
+        return $admin_settings;
319
+    }
320 320
 
321
-	/**
322
-	 * Processes invoice addons.
323
-	 *
324
-	 * @param WPInv_Invoice $invoice
325
-	 * @param GetPaid_Form_Item[] $items
326
-	 * @return WPInv_Invoice
327
-	 */
328
-	public function process_addons( $invoice, $items ) {
321
+    /**
322
+     * Processes invoice addons.
323
+     *
324
+     * @param WPInv_Invoice $invoice
325
+     * @param GetPaid_Form_Item[] $items
326
+     * @return WPInv_Invoice
327
+     */
328
+    public function process_addons( $invoice, $items ) {
329 329
 
330 330
         foreach ( $items as $item ) {
331 331
             $invoice->add_item( $item );
@@ -333,6 +333,6 @@  discard block
 block discarded – undo
333 333
 
334 334
         $invoice->recalculate_total();
335 335
         $invoice->save();
336
-	}
336
+    }
337 337
 
338 338
 }
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Bank transfer Payment Gateway class.
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 *
25 25
 	 * @var array
26 26
 	 */
27
-	protected $supports = array( 'addons' );
27
+	protected $supports = array('addons');
28 28
 
29 29
     /**
30 30
 	 * Payment method order.
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 	public function __construct() {
40 40
         parent::__construct();
41 41
 
42
-        $this->title                = __( 'Direct bank transfer', 'invoicing' );
43
-        $this->method_title         = __( 'Bank transfer', 'invoicing' );
44
-        $this->checkout_button_text = __( 'Proceed', 'invoicing' );
45
-        $this->instructions         = apply_filters( 'wpinv_bank_instructions', $this->get_option( 'info' ) );
42
+        $this->title                = __('Direct bank transfer', 'invoicing');
43
+        $this->method_title         = __('Bank transfer', 'invoicing');
44
+        $this->checkout_button_text = __('Proceed', 'invoicing');
45
+        $this->instructions         = apply_filters('wpinv_bank_instructions', $this->get_option('info'));
46 46
 
47
-		add_action( 'wpinv_receipt_end', array( $this, 'thankyou_page' ) );
48
-		add_action( 'getpaid_invoice_line_items', array( $this, 'thankyou_page' ), 40 );
49
-		add_action( 'wpinv_email_invoice_details', array( $this, 'email_instructions' ), 10, 3 );
47
+		add_action('wpinv_receipt_end', array($this, 'thankyou_page'));
48
+		add_action('getpaid_invoice_line_items', array($this, 'thankyou_page'), 40);
49
+		add_action('wpinv_email_invoice_details', array($this, 'email_instructions'), 10, 3);
50 50
 
51 51
     }
52 52
 
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
 	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
60 60
 	 * @return array
61 61
 	 */
62
-	public function process_payment( $invoice, $submission_data, $submission ) {
62
+	public function process_payment($invoice, $submission_data, $submission) {
63 63
 
64 64
         // Add a transaction id.
65
-        $invoice->set_transaction_id( $invoice->generate_key('trans_') );
65
+        $invoice->set_transaction_id($invoice->generate_key('trans_'));
66 66
 
67 67
         // Set it as pending payment.
68
-        if ( ! $invoice->needs_payment() ) {
68
+        if (!$invoice->needs_payment()) {
69 69
             $invoice->mark_paid();
70
-        } else if ( ! $invoice->is_paid() ) {
71
-            $invoice->set_status( 'wpi-onhold' );
70
+        } else if (!$invoice->is_paid()) {
71
+            $invoice->set_status('wpi-onhold');
72 72
         }
73 73
 
74 74
         // Save it.
75 75
         $invoice->save();
76 76
 
77 77
         // Send to the success page.
78
-        wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
78
+        wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key()));
79 79
 
80 80
     }
81 81
 
@@ -84,17 +84,17 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @param WPInv_Invoice $invoice Invoice.
86 86
 	 */
87
-	public function thankyou_page( $invoice ) {
87
+	public function thankyou_page($invoice) {
88 88
 
89
-        if ( 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
89
+        if ('bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
90 90
 
91 91
 			echo '<div class="mt-4 mb-2 getpaid-bank-transfer-details">' . PHP_EOL;
92 92
 
93
-            if ( ! empty( $this->instructions ) ) {
94
-                echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) );
93
+            if (!empty($this->instructions)) {
94
+                echo wp_kses_post(wpautop(wptexturize($this->instructions)));
95 95
 			}
96 96
 
97
-			$this->bank_details( $invoice );
97
+			$this->bank_details($invoice);
98 98
 			
99 99
 			echo '</div>';
100 100
         
@@ -109,17 +109,17 @@  discard block
 block discarded – undo
109 109
 	 * @param string     $email_type Email format: plain text or HTML.
110 110
 	 * @param bool     $sent_to_admin Sent to admin.
111 111
 	 */
112
-	public function email_instructions( $invoice, $email_type, $sent_to_admin ) {
112
+	public function email_instructions($invoice, $email_type, $sent_to_admin) {
113 113
 
114
-		if ( ! $sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
114
+		if (!$sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
115 115
 
116 116
 			echo '<div class="wpi-email-row getpaid-bank-transfer-details">';
117 117
 
118
-			if ( $this->instructions ) {
119
-				echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL );
118
+			if ($this->instructions) {
119
+				echo wp_kses_post(wpautop(wptexturize($this->instructions)) . PHP_EOL);
120 120
             }
121 121
 
122
-			$this->bank_details( $invoice );
122
+			$this->bank_details($invoice);
123 123
 			
124 124
 			echo '</div>';
125 125
 
@@ -132,51 +132,51 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @param WPInv_Invoice $invoice Invoice.
134 134
 	 */
135
-	protected function bank_details( $invoice ) {
135
+	protected function bank_details($invoice) {
136 136
 
137 137
 		// Get the invoice country and country $locale.
138 138
 		$country = $invoice->get_country();
139 139
 		$locale  = $this->get_country_locale();
140 140
 
141 141
 		// Get sortcode label in the $locale array and use appropriate one.
142
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
142
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
143 143
 
144 144
         $bank_fields = array(
145
-            'ac_name'     => __( 'Account Name', 'invoicing' ),
146
-            'ac_no'       => __( 'Account Number', 'invoicing' ),
147
-            'bank_name'   => __( 'Bank Name', 'invoicing' ),
148
-            'ifsc'        => __( 'IFSC code', 'invoicing' ),
149
-            'iban'        => __( 'IBAN', 'invoicing' ),
150
-            'bic'         => __( 'BIC/Swift code', 'invoicing' ),
145
+            'ac_name'     => __('Account Name', 'invoicing'),
146
+            'ac_no'       => __('Account Number', 'invoicing'),
147
+            'bank_name'   => __('Bank Name', 'invoicing'),
148
+            'ifsc'        => __('IFSC code', 'invoicing'),
149
+            'iban'        => __('IBAN', 'invoicing'),
150
+            'bic'         => __('BIC/Swift code', 'invoicing'),
151 151
             'sort_code'   => $sortcode,
152 152
         );
153 153
 
154 154
         $bank_info = array();
155 155
 
156
-        foreach ( $bank_fields as $field => $label ) {
157
-            $value = $this->get_option( $field );
156
+        foreach ($bank_fields as $field => $label) {
157
+            $value = $this->get_option($field);
158 158
 
159
-            if ( ! empty( $value ) ) {
160
-                $bank_info[$field] = array( 'label' => $label, 'value' => $value );
159
+            if (!empty($value)) {
160
+                $bank_info[$field] = array('label' => $label, 'value' => $value);
161 161
             }
162 162
 
163 163
         }
164 164
 
165
-        $bank_info = apply_filters( 'wpinv_bank_info', $bank_info );
165
+        $bank_info = apply_filters('wpinv_bank_info', $bank_info);
166 166
 
167
-        if ( empty( $bank_info ) ) {
167
+        if (empty($bank_info)) {
168 168
             return;
169 169
         }
170 170
 
171
-		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters( 'wpinv_receipt_bank_details_title', __( 'Bank Details', 'invoicing' ) ) . '</h3>' . PHP_EOL;
171
+		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters('wpinv_receipt_bank_details_title', __('Bank Details', 'invoicing')) . '</h3>' . PHP_EOL;
172 172
 
173 173
 		echo '<table class="table table-bordered getpaid-bank-transfer-details">' . PHP_EOL;
174 174
 
175
-		foreach ( $bank_info as $key => $data ) {
175
+		foreach ($bank_info as $key => $data) {
176 176
 
177
-			$key   = sanitize_html_class( $key );
178
-			$label = wp_kses_post( $data['label'] );
179
-			$value = wp_kses_post( wptexturize( $data['value'] ) );
177
+			$key   = sanitize_html_class($key);
178
+			$label = wp_kses_post($data['label']);
179
+			$value = wp_kses_post(wptexturize($data['value']));
180 180
 
181 181
 			echo "<tr class='getpaid-bank-transfer-$key'><th>$label</th><td>$value</td></tr>" . PHP_EOL;
182 182
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	public function get_country_locale() {
194 194
 
195
-		if ( empty( $this->locale ) ) {
195
+		if (empty($this->locale)) {
196 196
 
197 197
 			// Locale information to be used - only those that are not 'Sort Code'.
198 198
 			$this->locale = apply_filters(
@@ -200,42 +200,42 @@  discard block
 block discarded – undo
200 200
 				array(
201 201
 					'AU' => array(
202 202
 						'sortcode' => array(
203
-							'label' => __( 'BSB', 'invoicing' ),
203
+							'label' => __('BSB', 'invoicing'),
204 204
 						),
205 205
 					),
206 206
 					'CA' => array(
207 207
 						'sortcode' => array(
208
-							'label' => __( 'Bank transit number', 'invoicing' ),
208
+							'label' => __('Bank transit number', 'invoicing'),
209 209
 						),
210 210
 					),
211 211
 					'IN' => array(
212 212
 						'sortcode' => array(
213
-							'label' => __( 'IFSC', 'invoicing' ),
213
+							'label' => __('IFSC', 'invoicing'),
214 214
 						),
215 215
 					),
216 216
 					'IT' => array(
217 217
 						'sortcode' => array(
218
-							'label' => __( 'Branch sort', 'invoicing' ),
218
+							'label' => __('Branch sort', 'invoicing'),
219 219
 						),
220 220
 					),
221 221
 					'NZ' => array(
222 222
 						'sortcode' => array(
223
-							'label' => __( 'Bank code', 'invoicing' ),
223
+							'label' => __('Bank code', 'invoicing'),
224 224
 						),
225 225
 					),
226 226
 					'SE' => array(
227 227
 						'sortcode' => array(
228
-							'label' => __( 'Bank code', 'invoicing' ),
228
+							'label' => __('Bank code', 'invoicing'),
229 229
 						),
230 230
 					),
231 231
 					'US' => array(
232 232
 						'sortcode' => array(
233
-							'label' => __( 'Routing number', 'invoicing' ),
233
+							'label' => __('Routing number', 'invoicing'),
234 234
 						),
235 235
 					),
236 236
 					'ZA' => array(
237 237
 						'sortcode' => array(
238
-							'label' => __( 'Branch code', 'invoicing' ),
238
+							'label' => __('Branch code', 'invoicing'),
239 239
 						),
240 240
 					),
241 241
 				)
@@ -252,51 +252,51 @@  discard block
 block discarded – undo
252 252
 	 * 
253 253
 	 * @param array $admin_settings
254 254
 	 */
255
-	public function admin_settings( $admin_settings ) {
255
+	public function admin_settings($admin_settings) {
256 256
 
257
-        $admin_settings['worldpay_desc']['std']    = __( "Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing' );
258
-		$admin_settings['worldpay_active']['desc'] = __( 'Enable bank transfer', 'invoicing' );
257
+        $admin_settings['worldpay_desc']['std'] = __("Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing');
258
+		$admin_settings['worldpay_active']['desc'] = __('Enable bank transfer', 'invoicing');
259 259
 
260
-		$locale  = $this->get_country_locale();
260
+		$locale = $this->get_country_locale();
261 261
 
262 262
 		// Get sortcode label in the $locale array and use appropriate one.
263 263
 		$country  = wpinv_default_billing_country();
264
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
264
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
265 265
 
266 266
 		$admin_settings['bank_transfer_ac_name'] = array(
267 267
             'type' => 'text',
268 268
             'id'   => 'bank_transfer_ac_name',
269
-            'name' => __( 'Account Name', 'invoicing' ),
269
+            'name' => __('Account Name', 'invoicing'),
270 270
 		);
271 271
 		
272 272
 		$admin_settings['bank_transfer_ac_no'] = array(
273 273
             'type' => 'text',
274 274
             'id'   => 'bank_transfer_ac_no',
275
-            'name' => __( 'Account Number', 'invoicing' ),
275
+            'name' => __('Account Number', 'invoicing'),
276 276
 		);
277 277
 		
278 278
 		$admin_settings['bank_transfer_bank_name'] = array(
279 279
             'type' => 'text',
280 280
             'id'   => 'bank_transfer_bank_name',
281
-            'name' => __( 'Bank Name', 'invoicing' ),
281
+            'name' => __('Bank Name', 'invoicing'),
282 282
 		);
283 283
 
284 284
 		$admin_settings['bank_transfer_ifsc'] = array(
285 285
             'type' => 'text',
286 286
             'id'   => 'bank_transfer_ifsc',
287
-            'name' => __( 'IFSC Code', 'invoicing' ),
287
+            'name' => __('IFSC Code', 'invoicing'),
288 288
 		);
289 289
 
290 290
 		$admin_settings['bank_transfer_iban'] = array(
291 291
             'type' => 'text',
292 292
             'id'   => 'bank_transfer_iban',
293
-            'name' => __( 'IBAN', 'invoicing' ),
293
+            'name' => __('IBAN', 'invoicing'),
294 294
 		);
295 295
 
296 296
 		$admin_settings['bank_transfer_bic'] = array(
297 297
             'type' => 'text',
298 298
             'id'   => 'bank_transfer_bic',
299
-            'name' => __( 'BIC/Swift Code', 'invoicing' ),
299
+            'name' => __('BIC/Swift Code', 'invoicing'),
300 300
 		);
301 301
 		
302 302
 		$admin_settings['bank_transfer_sort_code'] = array(
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
 
308 308
 		$admin_settings['bank_transfer_info'] = array(
309 309
             'id'   => 'bank_transfer_info',
310
-            'name' => __( 'Instructions', 'invoicing' ),
311
-            'desc' => __( 'Instructions that will be added to the thank you page and emails.', 'invoicing' ),
310
+            'name' => __('Instructions', 'invoicing'),
311
+            'desc' => __('Instructions that will be added to the thank you page and emails.', 'invoicing'),
312 312
             'type' => 'textarea',
313
-            'std'  => __( "Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing' ),
313
+            'std'  => __("Make your payment directly into our bank account. Please use your Invoice Number as the payment reference. Your invoice won't be processed until the funds have cleared in our account.", 'invoicing'),
314 314
             'cols' => 50,
315 315
             'rows' => 5
316 316
         );
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
 	 * @param GetPaid_Form_Item[] $items
326 326
 	 * @return WPInv_Invoice
327 327
 	 */
328
-	public function process_addons( $invoice, $items ) {
328
+	public function process_addons($invoice, $items) {
329 329
 
330
-        foreach ( $items as $item ) {
331
-            $invoice->add_item( $item );
330
+        foreach ($items as $item) {
331
+            $invoice->add_item($item);
332 332
         }
333 333
 
334 334
         $invoice->recalculate_total();
Please login to merge, or discard this patch.