Passed
Push — master ( cf4341...21f781 )
by Brian
05:01
created
ayecode/wp-ayecode-ui/includes/components/class-aui-component-button.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function get($args = array()){
21
+	public static function get($args = array()) {
22 22
 		$defaults = array(
23 23
 			'type'       => 'a', // a, button, badge
24 24
 			'href'       => '#',
@@ -42,38 +42,38 @@  discard block
 block discarded – undo
42 42
 		/**
43 43
 		 * Parse incoming $args into an array and merge it with $defaults
44 44
 		 */
45
-		$args   = wp_parse_args( $args, $defaults );
45
+		$args   = wp_parse_args($args, $defaults);
46 46
 		$output = '';
47
-		if ( ! empty( $args['type'] ) ) {
47
+		if (!empty($args['type'])) {
48 48
 			$type = $args['type'] != 'a' ? esc_attr($args['type']) : 'a';
49 49
 
50 50
 			// open/type
51
-			if($type=='a'){
51
+			if ($type == 'a') {
52 52
 				$new_window = !empty($args['new_window']) ? ' target="_blank" ' : '';
53
-				$output .= '<a href="' . $args['href'] . '"'.$new_window;
54
-			}elseif($type=='badge'){
53
+				$output .= '<a href="' . $args['href'] . '"' . $new_window;
54
+			}elseif ($type == 'badge') {
55 55
 				$output .= '<span ';
56
-			}else{
56
+			} else {
57 57
 				$output .= '<button type="' . $type . '" ';
58 58
 			}
59 59
 
60 60
 			// name
61
-			if(!empty($args['name'])){
61
+			if (!empty($args['name'])) {
62 62
 				$output .= AUI_Component_Helper::name($args['name']);
63 63
 			}
64 64
 
65 65
 			// id
66
-			if(!empty($args['id'])){
66
+			if (!empty($args['id'])) {
67 67
 				$output .= AUI_Component_Helper::id($args['id']);
68 68
 			}
69 69
 
70 70
 			// title
71
-			if(!empty($args['title'])){
71
+			if (!empty($args['title'])) {
72 72
 				$output .= AUI_Component_Helper::title($args['title']);
73 73
 			}
74 74
 
75 75
 			// value
76
-			if(!empty($args['value'])){
76
+			if (!empty($args['value'])) {
77 77
 				$output .= AUI_Component_Helper::value($args['value']);
78 78
 			}
79 79
 
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
 			$output .= AUI_Component_Helper::aria_attributes($args);
89 89
 
90 90
 			// extra attributes
91
-			if(!empty($args['extra_attributes'])){
91
+			if (!empty($args['extra_attributes'])) {
92 92
 				$output .= AUI_Component_Helper::extra_attributes($args['extra_attributes']);
93 93
 			}
94 94
 
95 95
 			// onclick, we don't escape this
96
-			if(!empty($args['onclick'])){
97
-				$output .= ' onclick="'.$args['onclick'].'" ';
96
+			if (!empty($args['onclick'])) {
97
+				$output .= ' onclick="' . $args['onclick'] . '" ';
98 98
 			}
99 99
 
100 100
 			// style, we don't escape this
101
-			if(!empty($args['style'])){
102
-				$output .= ' style="'.$args['style'].'" ';
101
+			if (!empty($args['style'])) {
102
+				$output .= ' style="' . $args['style'] . '" ';
103 103
 			}
104 104
 
105 105
 			// close opening tag
@@ -108,37 +108,37 @@  discard block
 block discarded – undo
108 108
 
109 109
 			// hover content
110 110
 			$hover_content = false;
111
-			if(!empty($args['hover_content']) || !empty($args['hover_icon'])){
112
-				$output .= "<span class='hover-content'>".AUI_Component_Helper::icon($args['hover_icon'],$args['hover_content']).$args['hover_content']."</span>";
111
+			if (!empty($args['hover_content']) || !empty($args['hover_icon'])) {
112
+				$output .= "<span class='hover-content'>" . AUI_Component_Helper::icon($args['hover_icon'], $args['hover_content']) . $args['hover_content'] . "</span>";
113 113
 				$hover_content = true;
114 114
 			}
115 115
 			
116 116
 			// content
117
-			if($hover_content){$output .= "<span class='hover-content-original'>";}
118
-			if(!empty($args['content']) || !empty($args['icon'])){
119
-				$output .= AUI_Component_Helper::icon($args['icon'],$args['content'],$args['icon_extra_attributes']).$args['content'];
117
+			if ($hover_content) {$output .= "<span class='hover-content-original'>"; }
118
+			if (!empty($args['content']) || !empty($args['icon'])) {
119
+				$output .= AUI_Component_Helper::icon($args['icon'], $args['content'], $args['icon_extra_attributes']) . $args['content'];
120 120
 			}
121
-			if($hover_content){$output .= "</span>";}
121
+			if ($hover_content) {$output .= "</span>"; }
122 122
 					
123 123
 
124 124
 
125 125
 			// close
126
-			if($type=='a'){
126
+			if ($type == 'a') {
127 127
 				$output .= '</a>';
128
-			}elseif($type=='badge'){
128
+			}elseif ($type == 'badge') {
129 129
 				$output .= '</span>';
130
-			}else{
130
+			} else {
131 131
 				$output .= '</button>';
132 132
 			}
133 133
 
134 134
 			// maybe new line after?  This adds better spacing between buttons.
135
-			if(!empty($args['new_line_after'])){
135
+			if (!empty($args['new_line_after'])) {
136 136
 				$output .= PHP_EOL;
137 137
 			}
138 138
 
139 139
 
140 140
 			// wrap
141
-			if(!$args['no_wrap']){
141
+			if (!$args['no_wrap']) {
142 142
 				$output = AUI_Component_Input::wrap(array(
143 143
 					'content' => $output,
144 144
 				));
Please login to merge, or discard this patch.
includes/data/zip-regexes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @package Invoicing/data
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 return array(
12 12
     "AD" => "AD\d{3}",
Please login to merge, or discard this patch.
widgets/invoice-history.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
             'block-keywords'=> "['invoicing','history']",
23 23
             'class_name'     => __CLASS__,
24 24
             'base_id'       => 'wpinv_history',
25
-            'name'          => __('GetPaid > Invoice History','invoicing'),
25
+            'name'          => __('GetPaid > Invoice History', 'invoicing'),
26 26
             'widget_ops'    => array(
27 27
                 'classname'   => 'wpinv-history-class bsui',
28
-                'description' => esc_html__('Displays invoice history.','invoicing'),
28
+                'description' => esc_html__('Displays invoice history.', 'invoicing'),
29 29
             ),
30 30
             'arguments'     => array(
31 31
                 'title'  => array(
32
-                    'title'       => __( 'Widget title', 'invoicing' ),
33
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
32
+                    'title'       => __('Widget title', 'invoicing'),
33
+                    'desc'        => __('Enter widget title.', 'invoicing'),
34 34
                     'type'        => 'text',
35 35
                     'desc_tip'    => true,
36 36
                     'default'     => '',
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         );
42 42
 
43 43
 
44
-        parent::__construct( $options );
44
+        parent::__construct($options);
45 45
     }
46 46
 
47 47
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return mixed|string|bool
55 55
 	 */
56
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
56
+    public function output($args = array(), $widget_args = array(), $content = '') {
57 57
         return getpaid_invoice_history();
58 58
     }
59 59
 
Please login to merge, or discard this patch.
widgets/invoice-receipt.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
             'block-keywords'=> "['invoicing','receipt']",
23 23
             'class_name'     => __CLASS__,
24 24
             'base_id'       => 'wpinv_receipt',
25
-            'name'          => __('GetPaid > Invoice Receipt','invoicing'),
25
+            'name'          => __('GetPaid > Invoice Receipt', 'invoicing'),
26 26
             'widget_ops'    => array(
27 27
                 'classname'   => 'wpinv-receipt-class bsui',
28
-                'description' => esc_html__('Displays invoice receipt after checkout.','invoicing'),
28
+                'description' => esc_html__('Displays invoice receipt after checkout.', 'invoicing'),
29 29
             ),
30 30
             'arguments'     => array(
31 31
                 'title'  => array(
32
-                    'title'       => __( 'Widget title', 'invoicing' ),
33
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
32
+                    'title'       => __('Widget title', 'invoicing'),
33
+                    'desc'        => __('Enter widget title.', 'invoicing'),
34 34
                     'type'        => 'text',
35 35
                     'desc_tip'    => true,
36 36
                     'default'     => '',
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         );
42 42
 
43 43
 
44
-        parent::__construct( $options );
44
+        parent::__construct($options);
45 45
     }
46 46
 
47 47
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return mixed|string|bool
55 55
 	 */
56
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
56
+    public function output($args = array(), $widget_args = array(), $content = '') {
57 57
         return wpinv_payment_receipt();
58 58
     }
59 59
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-items.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,51 +21,51 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Invoice items.
30 30
         $items = $invoice->get_items();
31 31
 
32 32
         // New item url.
33
-        $new_item = admin_url( 'post-new.php?post_type=wpi_item' );
33
+        $new_item = admin_url('post-new.php?post_type=wpi_item');
34 34
 
35 35
         // Totals.
36
-        $total = wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() );
36
+        $total = wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency());
37 37
 
38
-        if ( $invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total() ) {
39
-            $recurring_total = wpinv_price( wpinv_format_amount( $invoice->get_recurring_total() ), $invoice->get_currency() );
40
-            $total          .= '<small class="form-text text-muted">' . sprintf( __( 'Recurring Price: %s', 'invoicing' ), $recurring_total ) . '</small>';
38
+        if ($invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total()) {
39
+            $recurring_total = wpinv_price(wpinv_format_amount($invoice->get_recurring_total()), $invoice->get_currency());
40
+            $total          .= '<small class="form-text text-muted">' . sprintf(__('Recurring Price: %s', 'invoicing'), $recurring_total) . '</small>';
41 41
         }
42 42
 
43 43
         $totals = array(
44 44
 
45 45
             'subtotal'  => array(
46
-                'label' => __( 'Items Subtotal', 'invoicing' ),
47
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_subtotal() ), $invoice->get_currency() ),
46
+                'label' => __('Items Subtotal', 'invoicing'),
47
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_subtotal()), $invoice->get_currency()),
48 48
             ),
49 49
 
50 50
             'discount'  => array(
51
-                'label' => __( 'Total Discount', 'invoicing' ),
52
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_discount() ), $invoice->get_currency() ),
51
+                'label' => __('Total Discount', 'invoicing'),
52
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_total_discount()), $invoice->get_currency()),
53 53
             ),
54 54
 
55 55
             'tax'       => array(
56
-                'label' => __( 'Total Tax', 'invoicing' ),
57
-                'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_tax() ), $invoice->get_currency() ),
56
+                'label' => __('Total Tax', 'invoicing'),
57
+                'value' => wpinv_price(wpinv_format_amount($invoice->get_total_tax()), $invoice->get_currency()),
58 58
             ),
59 59
 
60 60
             'total'     => array(
61
-                'label' => __( 'Invoice Total', 'invoicing' ),
61
+                'label' => __('Invoice Total', 'invoicing'),
62 62
                 'value' => $total,
63 63
             )
64 64
         );
65 65
 
66 66
 
67
-        if ( ! wpinv_use_taxes() ) {
68
-            unset( $totals['tax'] );
67
+        if (!wpinv_use_taxes()) {
68
+            unset($totals['tax']);
69 69
         }
70 70
         ?>
71 71
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
             }
82 82
         </style>
83 83
 
84
-                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class( $invoice->get_template( 'edit' ) ); ?> <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
84
+                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class($invoice->get_template('edit')); ?> <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
85 85
 
86
-                    <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
87
-                        <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?>
86
+                    <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
87
+                        <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?>
88 88
 
89 89
                         <div class="row">
90 90
                             <div class="col-12 col-sm-6">
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
                                         array(
94 94
                                             'id'          => 'wpinv_template',
95 95
                                             'name'        => 'wpinv_template',
96
-                                            'label'       => __( 'Template', 'invoicing' ),
96
+                                            'label'       => __('Template', 'invoicing'),
97 97
                                             'label_type'  => 'vertical',
98
-                                            'placeholder' => __( 'Choose a template', 'invoicing' ),
98
+                                            'placeholder' => __('Choose a template', 'invoicing'),
99 99
                                             'class'       => 'form-control-sm',
100
-                                            'value'       => $invoice->get_template( 'edit' ),
100
+                                            'value'       => $invoice->get_template('edit'),
101 101
                                             'options'     => array(
102
-                                                'quantity' => __( 'Quantity', 'invoicing' ),
103
-                                                'hours'    => __( 'Hours', 'invoicing' ),
104
-                                                'amount'   => __( 'Amount Only', 'invoicing' ),
102
+                                                'quantity' => __('Quantity', 'invoicing'),
103
+                                                'hours'    => __('Hours', 'invoicing'),
104
+                                                'amount'   => __('Amount Only', 'invoicing'),
105 105
                                             ),
106 106
                                             'data-allow-clear' => 'false',
107 107
                                             'select2'          => true,
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
                                         array(
118 118
                                             'id'          => 'wpinv_currency',
119 119
                                             'name'        => 'wpinv_currency',
120
-                                            'label'       => __( 'Currency', 'invoicing' ),
120
+                                            'label'       => __('Currency', 'invoicing'),
121 121
                                             'label_type'  => 'vertical',
122
-                                            'placeholder' => __( 'Select Invoice Currency', 'invoicing' ),
122
+                                            'placeholder' => __('Select Invoice Currency', 'invoicing'),
123 123
                                             'class'       => 'form-control-sm',
124
-                                            'value'       => $invoice->get_currency( 'edit' ),
124
+                                            'value'       => $invoice->get_currency('edit'),
125 125
                                             'required'    => false,
126 126
                                             'data-allow-clear' => 'false',
127 127
                                             'select2'          => true,
@@ -133,24 +133,24 @@  discard block
 block discarded – undo
133 133
                             </div>
134 134
                         </div>
135 135
 
136
-                        <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?>
136
+                        <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?>
137 137
                     <?php endif; ?>
138 138
 
139 139
                     <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items">
140 140
                         <thead>
141 141
                             <tr>
142
-                                <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th>
142
+                                <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th>
143 143
                                 <th class="getpaid-quantity hide-if-amount text-right">
144
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
145
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
144
+                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
145
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
146 146
                                 </th>
147 147
                                 <th class="getpaid-price hide-if-amount text-right">
148
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span>
149
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span>
148
+                                    <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span>
149
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span>
150 150
                                 </th>
151 151
                                 <th class="getpaid-item-subtotal text-right">
152
-                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span>
153
-                                    <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span>
152
+                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span>
153
+                                    <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span>
154 154
                                 </th>
155 155
                                 <th class="getpaid-item-actions hide-if-not-editable" width="70px">&nbsp;</th>
156 156
                             </tr>
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 		                <tbody class="getpaid_invoice_line_items">
159 159
                             <tr class="hide-if-has-items hide-if-not-editable">
160 160
                                 <td colspan="2" class="pt-4 pb-4">
161
-                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button>
162
-	                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
161
+                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button>
162
+	                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
163 163
                                 </td>
164 164
                                 <td class="hide-if-amount">&nbsp;</th>
165 165
                                 <td class="hide-if-amount">&nbsp;</th>
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
                             <div class="col-12 col-sm-6 offset-sm-6">
192 192
                                 <table class="getpaid-invoice-totals text-right w-100">
193 193
                                     <tbody>
194
-                                        <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?>
195
-                                            <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>">
196
-                                                <td class="label"><?php echo sanitize_text_field( $data['label'] ) ?>:</td>
194
+                                        <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?>
195
+                                            <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>">
196
+                                                <td class="label"><?php echo sanitize_text_field($data['label']) ?>:</td>
197 197
                                                 <td width="1%"></td>
198
-                                                <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td>
198
+                                                <td class="value"><?php echo wp_kses_post($data['value']) ?></td>
199 199
                                             </tr>
200 200
                                         <?php endforeach; ?>
201 201
                                     </tbody>
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
                     <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable">
209 209
                         <div class="row">
210 210
                             <div class="text-left col-12 col-sm-8">
211
-                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button>
212
-                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
213
-                                <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?>
211
+                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button>
212
+                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
213
+                                <?php do_action('getpaid-invoice-items-actions', $invoice); ?>
214 214
                             </div>
215 215
                             <div class="text-right col-12 col-sm-4">
216
-                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button>
216
+                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button>
217 217
                             </div>
218 218
                         </div>
219 219
                     </div>
220 220
 
221 221
                     <div class="getpaid-invoice-item-actions hide-if-editable">
222
-                        <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p>
222
+                        <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p>
223 223
                     </div>
224 224
 
225 225
                     <!-- Add items to an invoice -->
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
                         <div class="modal-dialog modal-dialog-centered" role="document">
228 228
                             <div class="modal-content">
229 229
                                 <div class="modal-header">
230
-                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5>
231
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
230
+                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5>
231
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
232 232
                                         <span aria-hidden="true">&times;</span>
233 233
                                     </button>
234 234
                                 </div>
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
                                     <table class="widefat">
237 237
                                         <thead>
238 238
                                             <tr>
239
-                                                <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th>
239
+                                                <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th>
240 240
                                                 <th class="pr-0 text-right hide-if-amount">
241
-                                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
242
-                                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
241
+                                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
242
+                                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
243 243
                                                 </th>
244 244
                                             </tr>
245 245
                                         </thead>
246 246
 										<tbody>
247 247
 								            <tr>
248 248
 									            <td class="pl-0 text-left">
249
-                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e( 'Search for an item…', 'invoicing' ); ?>"></select>
249
+                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e('Search for an item…', 'invoicing'); ?>"></select>
250 250
                                                 </td>
251 251
 									            <td class="pr-0 text-right hide-if-amount">
252 252
                                                     <input type="number" class="w100" step="1" min="1" autocomplete="off" value="1" placeholder="1">
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 						            </table>
257 257
                                 </div>
258 258
                                 <div class="modal-footer">
259
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
260
-                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button>
259
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
260
+                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button>
261 261
                                 </div>
262 262
                             </div>
263 263
                         </div>
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
                         <div class="modal-dialog modal-dialog-centered" role="document">
269 269
                             <div class="modal-content">
270 270
                                 <div class="modal-header">
271
-                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5>
272
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
271
+                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5>
272
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
273 273
                                         <span aria-hidden="true">&times;</span>
274 274
                                     </button>
275 275
                                 </div>
@@ -277,27 +277,27 @@  discard block
 block discarded – undo
277 277
                                     <div class="getpaid-edit-item-div">
278 278
                                         <input type="hidden" name="id" class="form-control form-control-sm item-id">
279 279
                                         <label class="form-group w-100">
280
-                                            <span><?php _e( 'Name', 'invoicing' ); ?></span>
281
-                                            <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name">
280
+                                            <span><?php _e('Name', 'invoicing'); ?></span>
281
+                                            <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name">
282 282
                                         </label>
283 283
                                         <label class="form-group w-100">
284
-                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span>
285
-                                            <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span>
286
-                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price">
284
+                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span>
285
+                                            <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span>
286
+                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price">
287 287
                                         </label>
288 288
                                         <label class="form-group w-100 hide-if-amount">
289
-                                            <span><?php _e( 'Quantity', 'invoicing' ); ?></span>
289
+                                            <span><?php _e('Quantity', 'invoicing'); ?></span>
290 290
                                             <input type="number" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity">
291 291
                                         </label>
292 292
                                         <label class="form-group w-100">
293
-                                            <span><?php _e( 'Item Description', 'invoicing' ); ?></span>
294
-                                            <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea>
293
+                                            <span><?php _e('Item Description', 'invoicing'); ?></span>
294
+                                            <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea>
295 295
                                         </label>
296 296
                                     </div>
297 297
                                 </div>
298 298
                                 <div class="modal-footer">
299
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
300
-                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button>
299
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
300
+                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button>
301 301
                                 </div>
302 302
                             </div>
303 303
                         </div>
Please login to merge, or discard this patch.
templates/payment-forms/cart-totals.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Totals rows.
13 13
 $totals = apply_filters(
14 14
     'getpaid_payment_form_cart_table_totals',
15 15
     array(
16
-        'subtotal' => __( 'Subtotal', 'invoicing' ),
17
-        'tax'      => __( 'Tax', 'invoicing' ),
18
-        'discount' => __( 'Discount', 'invoicing' ),
19
-        'total'    => __( 'Total', 'invoicing' ),
16
+        'subtotal' => __('Subtotal', 'invoicing'),
17
+        'tax'      => __('Tax', 'invoicing'),
18
+        'discount' => __('Discount', 'invoicing'),
19
+        'total'    => __('Total', 'invoicing'),
20 20
     ),
21 21
     $form
22 22
 );
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
 $currency = $form->get_currency();
25 25
 $country  = wpinv_get_default_country();
26 26
 
27
-if ( ! empty( $form->invoice ) ) {
28
-    $country  = $form->invoice->get_country();
27
+if (!empty($form->invoice)) {
28
+    $country = $form->invoice->get_country();
29 29
 }
30 30
 
31
-if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) {
32
-    unset( $totals['tax'] );
31
+if (!wpinv_use_taxes() && isset($totals['tax'])) {
32
+    unset($totals['tax']);
33 33
 }
34 34
 
35
-do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals );
35
+do_action('getpaid_before_payment_form_cart_totals', $form, $totals);
36 36
 
37 37
 $tax       = 0;
38 38
 $sub_total = 0;
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 $discount  = 0;
41 41
 
42 42
 // Calculate totals.
43
-foreach ( $form->get_items() as $item ) {
43
+foreach ($form->get_items() as $item) {
44 44
 
45
-    if ( ! empty( $form->invoice ) && 'amount' == $form->invoice->get_template() ) {
45
+    if (!empty($form->invoice) && 'amount' == $form->invoice->get_template()) {
46 46
         $amount = $item->get_price();
47 47
     } else {
48 48
         $amount = $item->get_sub_total();
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
     // Include the tax.
53
-    if ( wpinv_use_taxes() ) {
54
-        $rate = wpinv_get_tax_rate( $country, false, $item->get_id() );
53
+    if (wpinv_use_taxes()) {
54
+        $rate = wpinv_get_tax_rate($country, false, $item->get_id());
55 55
 
56
-        if ( wpinv_prices_include_tax() ) {
57
-            $pre_tax  = ( $amount - $amount * $rate * 0.01 );
56
+        if (wpinv_prices_include_tax()) {
57
+            $pre_tax  = ($amount - $amount * $rate * 0.01);
58 58
             $item_tax = $amount - $pre_tax;
59 59
         } else {
60 60
             $pre_tax  = $amount;
@@ -66,41 +66,41 @@  discard block
 block discarded – undo
66 66
         $total     = $sub_total + $tax;
67 67
 
68 68
     } else {
69
-        $total  = $total + $amount;
69
+        $total = $total + $amount;
70 70
     }
71 71
 
72 72
 }
73 73
 
74 74
 ?>
75 75
 <div class='border-top getpaid-payment-form-items-cart-totals'>
76
-    <?php foreach ( $totals as $key => $label ) : ?>
77
-        <div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr( $key ); ?>">
76
+    <?php foreach ($totals as $key => $label) : ?>
77
+        <div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr($key); ?>">
78 78
             <div class="row">
79 79
                 <div class="col-12 offset-sm-5 col-sm-4">
80
-                    <?php echo sanitize_text_field( $label ); ?>
80
+                    <?php echo sanitize_text_field($label); ?>
81 81
                 </div>
82
-                <div class="col-12 col-sm-3 getpaid-form-cart-totals-total-<?php echo esc_attr( $key ); ?>">
82
+                <div class="col-12 col-sm-3 getpaid-form-cart-totals-total-<?php echo esc_attr($key); ?>">
83 83
                     <?php
84
-                        do_action( "getpaid_payment_form_cart_totals_$key", $form );
84
+                        do_action("getpaid_payment_form_cart_totals_$key", $form);
85 85
 
86 86
                         // Total tax.
87
-                        if ( 'tax' == $key ) {
88
-                            echo wpinv_price( wpinv_format_amount( $tax ), $currency );
87
+                        if ('tax' == $key) {
88
+                            echo wpinv_price(wpinv_format_amount($tax), $currency);
89 89
                         }
90 90
 
91 91
                         // Total discount.
92
-                        if ( 'discount' == $key ) {
93
-                            echo wpinv_price( wpinv_format_amount( $discount ), $currency );
92
+                        if ('discount' == $key) {
93
+                            echo wpinv_price(wpinv_format_amount($discount), $currency);
94 94
                         }
95 95
 
96 96
                         // Sub total.
97
-                        if ( 'subtotal' == $key ) {
98
-                            echo wpinv_price( wpinv_format_amount( $sub_total ), $currency );
97
+                        if ('subtotal' == $key) {
98
+                            echo wpinv_price(wpinv_format_amount($sub_total), $currency);
99 99
                         }
100 100
 
101 101
                         // Total.
102
-                        if ( 'total' == $key ) {
103
-                            echo wpinv_price( wpinv_format_amount( $total ), $currency );
102
+                        if ('total' == $key) {
103
+                            echo wpinv_price(wpinv_format_amount($total), $currency);
104 104
                         }
105 105
                     ?>
106 106
                 </div>
@@ -110,4 +110,4 @@  discard block
 block discarded – undo
110 110
 </div>
111 111
 
112 112
 <?php
113
-do_action(  'getpaid_payment_form_cart_totals', $form, $totals );
113
+do_action('getpaid_payment_form_cart_totals', $form, $totals);
Please login to merge, or discard this patch.
includes/gateways/class-getpaid-bank-transfer-gateway.php 1 patch
Spacing   +66 added lines, -66 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.
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	public function __construct() {
33 33
         parent::__construct();
34 34
 
35
-        $this->title                = __( 'Direct bank transfer', 'invoicing' );
36
-        $this->method_title         = __( 'Bank transfer', 'invoicing' );
37
-        $this->checkout_button_text = __( 'Proceed', 'invoicing' );
38
-        $this->instructions         = apply_filters( 'wpinv_bank_instructions', $this->get_option( 'info' ) );
35
+        $this->title                = __('Direct bank transfer', 'invoicing');
36
+        $this->method_title         = __('Bank transfer', 'invoicing');
37
+        $this->checkout_button_text = __('Proceed', 'invoicing');
38
+        $this->instructions         = apply_filters('wpinv_bank_instructions', $this->get_option('info'));
39 39
 
40
-		add_action( 'wpinv_receipt_end', array( $this, 'thankyou_page' ) );
41
-		add_action( 'getpaid_invoice_line_items', array( $this, 'thankyou_page' ), 40 );
42
-		add_action( 'wpinv_email_invoice_details', array( $this, 'email_instructions' ), 10, 3 );
40
+		add_action('wpinv_receipt_end', array($this, 'thankyou_page'));
41
+		add_action('getpaid_invoice_line_items', array($this, 'thankyou_page'), 40);
42
+		add_action('wpinv_email_invoice_details', array($this, 'email_instructions'), 10, 3);
43 43
 
44 44
     }
45 45
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
53 53
 	 * @return array
54 54
 	 */
55
-	public function process_payment( $invoice, $submission_data, $submission ) {
55
+	public function process_payment($invoice, $submission_data, $submission) {
56 56
 
57 57
         // Add a transaction id.
58
-        $invoice->set_transaction_id( $invoice->generate_key('trans_') );
58
+        $invoice->set_transaction_id($invoice->generate_key('trans_'));
59 59
 
60 60
         // Set it as pending payment.
61
-        if ( ! $invoice->needs_payment() ) {
61
+        if (!$invoice->needs_payment()) {
62 62
             $invoice->mark_paid();
63
-        } else if ( ! $invoice->is_paid() ) {
64
-            $invoice->set_status( 'wpi-onhold' );
63
+        } else if (!$invoice->is_paid()) {
64
+            $invoice->set_status('wpi-onhold');
65 65
         }
66 66
 
67 67
         // Save it.
68 68
         $invoice->save();
69 69
 
70 70
         // Send to the success page.
71
-        wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
71
+        wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key()));
72 72
 
73 73
     }
74 74
 
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 	 *
78 78
 	 * @param WPInv_Invoice $invoice Invoice.
79 79
 	 */
80
-	public function thankyou_page( $invoice ) {
80
+	public function thankyou_page($invoice) {
81 81
 
82
-        if ( 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
82
+        if ('bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
83 83
 
84 84
 			echo '<div class="mt-4 mb-2 getpaid-bank-transfer-details">' . PHP_EOL;
85 85
 
86
-            if ( ! empty( $this->instructions ) ) {
87
-                echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) );
86
+            if (!empty($this->instructions)) {
87
+                echo wp_kses_post(wpautop(wptexturize($this->instructions)));
88 88
 			}
89 89
 
90
-			$this->bank_details( $invoice );
90
+			$this->bank_details($invoice);
91 91
 			
92 92
 			echo '</div>';
93 93
         
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 	 * @param string     $email_type Email format: plain text or HTML.
103 103
 	 * @param bool     $sent_to_admin Sent to admin.
104 104
 	 */
105
-	public function email_instructions( $invoice, $email_type, $sent_to_admin ) {
105
+	public function email_instructions($invoice, $email_type, $sent_to_admin) {
106 106
 
107
-		if ( ! $sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment() ) {
107
+		if (!$sent_to_admin && 'bank_transfer' === $invoice->get_gateway() && $invoice->needs_payment()) {
108 108
 
109 109
 			echo '<div class="wpi-email-row getpaid-bank-transfer-details">';
110 110
 
111
-			if ( $this->instructions ) {
112
-				echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL );
111
+			if ($this->instructions) {
112
+				echo wp_kses_post(wpautop(wptexturize($this->instructions)) . PHP_EOL);
113 113
             }
114 114
 
115
-			$this->bank_details( $invoice );
115
+			$this->bank_details($invoice);
116 116
 			
117 117
 			echo '</div>';
118 118
 
@@ -125,51 +125,51 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @param WPInv_Invoice $invoice Invoice.
127 127
 	 */
128
-	protected function bank_details( $invoice ) {
128
+	protected function bank_details($invoice) {
129 129
 
130 130
 		// Get the invoice country and country $locale.
131 131
 		$country = $invoice->get_country();
132 132
 		$locale  = $this->get_country_locale();
133 133
 
134 134
 		// Get sortcode label in the $locale array and use appropriate one.
135
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
135
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
136 136
 
137 137
         $bank_fields = array(
138
-            'ac_name'     => __( 'Account Name', 'invoicing' ),
139
-            'ac_no'       => __( 'Account Number', 'invoicing' ),
140
-            'bank_name'   => __( 'Bank Name', 'invoicing' ),
141
-            'ifsc'        => __( 'IFSC code', 'invoicing' ),
142
-            'iban'        => __( 'IBAN', 'invoicing' ),
143
-            'bic'         => __( 'BIC/Swift code', 'invoicing' ),
138
+            'ac_name'     => __('Account Name', 'invoicing'),
139
+            'ac_no'       => __('Account Number', 'invoicing'),
140
+            'bank_name'   => __('Bank Name', 'invoicing'),
141
+            'ifsc'        => __('IFSC code', 'invoicing'),
142
+            'iban'        => __('IBAN', 'invoicing'),
143
+            'bic'         => __('BIC/Swift code', 'invoicing'),
144 144
             'sort_code'   => $sortcode,
145 145
         );
146 146
 
147 147
         $bank_info = array();
148 148
 
149
-        foreach ( $bank_fields as $field => $label ) {
150
-            $value = $this->get_option( $field );
149
+        foreach ($bank_fields as $field => $label) {
150
+            $value = $this->get_option($field);
151 151
 
152
-            if ( ! empty( $value ) ) {
153
-                $bank_info[$field] = array( 'label' => $label, 'value' => $value );
152
+            if (!empty($value)) {
153
+                $bank_info[$field] = array('label' => $label, 'value' => $value);
154 154
             }
155 155
 
156 156
         }
157 157
 
158
-        $bank_info = apply_filters( 'wpinv_bank_info', $bank_info );
158
+        $bank_info = apply_filters('wpinv_bank_info', $bank_info);
159 159
 
160
-        if ( empty( $bank_info ) ) {
160
+        if (empty($bank_info)) {
161 161
             return;
162 162
         }
163 163
 
164
-		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters( 'wpinv_receipt_bank_details_title', __( 'Bank Details', 'invoicing' ) ) . '</h3>' . PHP_EOL;
164
+		echo '<h3 class="getpaid-bank-transfer-title"> ' . apply_filters('wpinv_receipt_bank_details_title', __('Bank Details', 'invoicing')) . '</h3>' . PHP_EOL;
165 165
 
166 166
 		echo '<table class="table table-bordered getpaid-bank-transfer-details">' . PHP_EOL;
167 167
 
168
-		foreach ( $bank_info as $key => $data ) {
168
+		foreach ($bank_info as $key => $data) {
169 169
 
170
-			$key   = sanitize_html_class( $key );
171
-			$label = wp_kses_post( $data['label'] );
172
-			$value = wp_kses_post( wptexturize( $data['value'] ) );
170
+			$key   = sanitize_html_class($key);
171
+			$label = wp_kses_post($data['label']);
172
+			$value = wp_kses_post(wptexturize($data['value']));
173 173
 
174 174
 			echo "<tr class='getpaid-bank-transfer-$key'><th>$label</th><td>$value</td></tr>" . PHP_EOL;
175 175
 		}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	public function get_country_locale() {
187 187
 
188
-		if ( empty( $this->locale ) ) {
188
+		if (empty($this->locale)) {
189 189
 
190 190
 			// Locale information to be used - only those that are not 'Sort Code'.
191 191
 			$this->locale = apply_filters(
@@ -193,42 +193,42 @@  discard block
 block discarded – undo
193 193
 				array(
194 194
 					'AU' => array(
195 195
 						'sortcode' => array(
196
-							'label' => __( 'BSB', 'invoicing' ),
196
+							'label' => __('BSB', 'invoicing'),
197 197
 						),
198 198
 					),
199 199
 					'CA' => array(
200 200
 						'sortcode' => array(
201
-							'label' => __( 'Bank transit number', 'invoicing' ),
201
+							'label' => __('Bank transit number', 'invoicing'),
202 202
 						),
203 203
 					),
204 204
 					'IN' => array(
205 205
 						'sortcode' => array(
206
-							'label' => __( 'IFSC', 'invoicing' ),
206
+							'label' => __('IFSC', 'invoicing'),
207 207
 						),
208 208
 					),
209 209
 					'IT' => array(
210 210
 						'sortcode' => array(
211
-							'label' => __( 'Branch sort', 'invoicing' ),
211
+							'label' => __('Branch sort', 'invoicing'),
212 212
 						),
213 213
 					),
214 214
 					'NZ' => array(
215 215
 						'sortcode' => array(
216
-							'label' => __( 'Bank code', 'invoicing' ),
216
+							'label' => __('Bank code', 'invoicing'),
217 217
 						),
218 218
 					),
219 219
 					'SE' => array(
220 220
 						'sortcode' => array(
221
-							'label' => __( 'Bank code', 'invoicing' ),
221
+							'label' => __('Bank code', 'invoicing'),
222 222
 						),
223 223
 					),
224 224
 					'US' => array(
225 225
 						'sortcode' => array(
226
-							'label' => __( 'Routing number', 'invoicing' ),
226
+							'label' => __('Routing number', 'invoicing'),
227 227
 						),
228 228
 					),
229 229
 					'ZA' => array(
230 230
 						'sortcode' => array(
231
-							'label' => __( 'Branch code', 'invoicing' ),
231
+							'label' => __('Branch code', 'invoicing'),
232 232
 						),
233 233
 					),
234 234
 				)
@@ -245,51 +245,51 @@  discard block
 block discarded – undo
245 245
 	 * 
246 246
 	 * @param array $admin_settings
247 247
 	 */
248
-	public function admin_settings( $admin_settings ) {
248
+	public function admin_settings($admin_settings) {
249 249
 
250
-        $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' );
251
-		$admin_settings['worldpay_active']['desc'] = __( 'Enable bank transfer', 'invoicing' );
250
+        $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');
251
+		$admin_settings['worldpay_active']['desc'] = __('Enable bank transfer', 'invoicing');
252 252
 
253
-		$locale  = $this->get_country_locale();
253
+		$locale = $this->get_country_locale();
254 254
 
255 255
 		// Get sortcode label in the $locale array and use appropriate one.
256 256
 		$country  = wpinv_default_billing_country();
257
-		$sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'invoicing' );
257
+		$sortcode = isset($locale[$country]['sortcode']['label']) ? $locale[$country]['sortcode']['label'] : __('Sort code', 'invoicing');
258 258
 
259 259
 		$admin_settings['bank_transfer_ac_name'] = array(
260 260
             'type' => 'text',
261 261
             'id'   => 'bank_transfer_ac_name',
262
-            'name' => __( 'Account Name', 'invoicing' ),
262
+            'name' => __('Account Name', 'invoicing'),
263 263
 		);
264 264
 		
265 265
 		$admin_settings['bank_transfer_ac_no'] = array(
266 266
             'type' => 'text',
267 267
             'id'   => 'bank_transfer_ac_no',
268
-            'name' => __( 'Account Number', 'invoicing' ),
268
+            'name' => __('Account Number', 'invoicing'),
269 269
 		);
270 270
 		
271 271
 		$admin_settings['bank_transfer_bank_name'] = array(
272 272
             'type' => 'text',
273 273
             'id'   => 'bank_transfer_bank_name',
274
-            'name' => __( 'Bank Name', 'invoicing' ),
274
+            'name' => __('Bank Name', 'invoicing'),
275 275
 		);
276 276
 
277 277
 		$admin_settings['bank_transfer_ifsc'] = array(
278 278
             'type' => 'text',
279 279
             'id'   => 'bank_transfer_ifsc',
280
-            'name' => __( 'IFSC Code', 'invoicing' ),
280
+            'name' => __('IFSC Code', 'invoicing'),
281 281
 		);
282 282
 
283 283
 		$admin_settings['bank_transfer_iban'] = array(
284 284
             'type' => 'text',
285 285
             'id'   => 'bank_transfer_iban',
286
-            'name' => __( 'IBAN', 'invoicing' ),
286
+            'name' => __('IBAN', 'invoicing'),
287 287
 		);
288 288
 
289 289
 		$admin_settings['bank_transfer_bic'] = array(
290 290
             'type' => 'text',
291 291
             'id'   => 'bank_transfer_bic',
292
-            'name' => __( 'BIC/Swift Code', 'invoicing' ),
292
+            'name' => __('BIC/Swift Code', 'invoicing'),
293 293
 		);
294 294
 		
295 295
 		$admin_settings['bank_transfer_sort_code'] = array(
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 
301 301
 		$admin_settings['bank_transfer_info'] = array(
302 302
             'id'   => 'bank_transfer_info',
303
-            'name' => __( 'Instructions', 'invoicing' ),
304
-            'desc' => __( 'Instructions that will be added to the thank you page and emails.', 'invoicing' ),
303
+            'name' => __('Instructions', 'invoicing'),
304
+            'desc' => __('Instructions that will be added to the thank you page and emails.', 'invoicing'),
305 305
             'type' => 'textarea',
306
-            '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' ),
306
+            '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'),
307 307
             'cols' => 50,
308 308
             'rows' => 5
309 309
         );
Please login to merge, or discard this patch.
includes/gateways/class-getpaid-worldpay-gateway.php 1 patch
Spacing   +86 added lines, -86 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
  * Worldpay Payment Gateway class.
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @var array
47 47
 	 */
48
-    protected $supports = array( 'sandbox' );
48
+    protected $supports = array('sandbox');
49 49
     
50 50
     /**
51 51
 	 * Currencies this gateway is allowed for.
52 52
 	 *
53 53
 	 * @var array
54 54
 	 */
55
-	public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' );
55
+	public $currencies = array('AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR');
56 56
 
57 57
     /**
58 58
 	 * URL to view a transaction.
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function __construct() {
75 75
 
76
-        $this->method_title         = __( 'Worldpay', 'invoicing' );
77
-        $this->title                = __( 'Worldpay - Credit Card / Debit Card', 'invoicing' );
78
-        $this->checkout_button_text = __( 'Proceed to Worldpay', 'invoicing' );
79
-        $this->notify_url           = wpinv_get_ipn_url( $this->id );
76
+        $this->method_title         = __('Worldpay', 'invoicing');
77
+        $this->title                = __('Worldpay - Credit Card / Debit Card', 'invoicing');
78
+        $this->checkout_button_text = __('Proceed to Worldpay', 'invoicing');
79
+        $this->notify_url           = wpinv_get_ipn_url($this->id);
80 80
 
81
-        add_filter( 'wpinv_gateway_description', array( $this, 'sandbox_notice' ), 10, 2 );
82
-        add_filter( 'getpaid_worldpay_args', array( $this, 'hash_args' ) );
81
+        add_filter('wpinv_gateway_description', array($this, 'sandbox_notice'), 10, 2);
82
+        add_filter('getpaid_worldpay_args', array($this, 'hash_args'));
83 83
 
84 84
         parent::__construct();
85 85
     }
@@ -93,24 +93,24 @@  discard block
 block discarded – undo
93 93
 	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
94 94
 	 * @return array
95 95
 	 */
96
-	public function process_payment( $invoice, $submission_data, $submission ) {
96
+	public function process_payment($invoice, $submission_data, $submission) {
97 97
 
98 98
         // Get redirect url.
99
-        $worldpay_redirect = esc_url( $this->get_request_url( $invoice ) );
99
+        $worldpay_redirect = esc_url($this->get_request_url($invoice));
100 100
 
101 101
         // Get submission args.
102
-        $worldpay_args     = $this->get_worldpay_args( $invoice );
102
+        $worldpay_args     = $this->get_worldpay_args($invoice);
103 103
 
104 104
         $form = "<form action='$worldpay_redirect' name='wpi_worldpay_form' method='POST'>";
105 105
 
106
-        foreach ( $worldpay_args as $key => $value ) {
106
+        foreach ($worldpay_args as $key => $value) {
107 107
 
108
-            if ( false === $value || '' === trim( $value ) ) {
108
+            if (false === $value || '' === trim($value)) {
109 109
                 continue;
110 110
             }
111 111
 
112
-            $value = esc_attr( $value );
113
-            $key   = wpinv_clean( $key );
112
+            $value = esc_attr($value);
113
+            $key   = wpinv_clean($key);
114 114
             $form .= "<input type='hidden' name='$key' value='$value'>";
115 115
         }
116 116
 
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 	 * @param  WPInv_Invoice $invoice Invoice object.
134 134
 	 * @return string
135 135
 	 */
136
-	public function get_request_url( $invoice ) {
136
+	public function get_request_url($invoice) {
137 137
 
138 138
         // Endpoint for this request
139
-		$this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase';
139
+		$this->endpoint = $this->is_sandbox($invoice) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase';
140 140
 
141 141
         return $this->endpoint;
142 142
 
@@ -148,34 +148,34 @@  discard block
 block discarded – undo
148 148
 	 * @param  WPInv_Invoice $invoice Invoice object.
149 149
 	 * @return array
150 150
 	 */
151
-	protected function get_worldpay_args( $invoice ) {
151
+	protected function get_worldpay_args($invoice) {
152 152
 
153 153
 		return apply_filters(
154 154
 			'getpaid_worldpay_args',
155 155
 			array(
156
-                'amount'         => wpinv_sanitize_amount( $invoice->get_total() ), // mandatory
157
-                'cartId'         => wpinv_clean( $invoice->get_number() ), // mandatory reference for the item purchased
158
-                'currency'       => wpinv_clean( $invoice->get_currency() ), // mandatory
159
-                'instId'         => wpinv_clean( $this->get_option( 'instId', '' ) ), // mandatory
160
-                'testMode'       => $this->is_sandbox( $invoice ) ? 100 : 0, // mandatory
161
-                'name'           => wpinv_clean( $invoice->get_full_name() ),
162
-                'address'        => wpinv_clean( $invoice->get_address() ),
163
-                'postcode'       => wpinv_clean( $invoice->get_zip() ),
164
-                'tel'            => wpinv_clean( $invoice->get_phone() ),
165
-                'email'          => sanitize_email( $invoice->get_email() ),
166
-                'country'        => wpinv_clean( $invoice->get_country() ),
167
-                'desc'           => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ),
168
-                'MC_description' => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ),
169
-                'MC_callback'    => esc_url_raw( $this->notify_url ),
170
-                'resultfile'     => esc_url_raw( $this->get_return_url( $invoice ) ),
171
-                'MC_key'         => wpinv_clean( $invoice->get_key() ),
156
+                'amount'         => wpinv_sanitize_amount($invoice->get_total()), // mandatory
157
+                'cartId'         => wpinv_clean($invoice->get_number()), // mandatory reference for the item purchased
158
+                'currency'       => wpinv_clean($invoice->get_currency()), // mandatory
159
+                'instId'         => wpinv_clean($this->get_option('instId', '')), // mandatory
160
+                'testMode'       => $this->is_sandbox($invoice) ? 100 : 0, // mandatory
161
+                'name'           => wpinv_clean($invoice->get_full_name()),
162
+                'address'        => wpinv_clean($invoice->get_address()),
163
+                'postcode'       => wpinv_clean($invoice->get_zip()),
164
+                'tel'            => wpinv_clean($invoice->get_phone()),
165
+                'email'          => sanitize_email($invoice->get_email()),
166
+                'country'        => wpinv_clean($invoice->get_country()),
167
+                'desc'           => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())),
168
+                'MC_description' => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())),
169
+                'MC_callback'    => esc_url_raw($this->notify_url),
170
+                'resultfile'     => esc_url_raw($this->get_return_url($invoice)),
171
+                'MC_key'         => wpinv_clean($invoice->get_key()),
172 172
                 'MC_invoice_id'  => $invoice->get_id(),
173
-                'address1'       => wpinv_clean( $invoice->get_address() ),
174
-                'town'           => wpinv_clean( $invoice->get_city() ),
175
-                'region'         => wpinv_clean( $invoice->get_state() ),
176
-                'amountString'   => wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() ),
177
-                'countryString'  => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ),
178
-                'compName'       => wpinv_clean( $invoice->get_company() ),
173
+                'address1'       => wpinv_clean($invoice->get_address()),
174
+                'town'           => wpinv_clean($invoice->get_city()),
175
+                'region'         => wpinv_clean($invoice->get_state()),
176
+                'amountString'   => wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency()),
177
+                'countryString'  => wpinv_clean(wpinv_country_name($invoice->get_country())),
178
+                'compName'       => wpinv_clean($invoice->get_company()),
179 179
             ),
180 180
 			$invoice
181 181
 		);
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
 	 * @param  array $args Gateway args.
189 189
 	 * @return array
190 190
 	 */
191
-	public function hash_args( $args ) {
191
+	public function hash_args($args) {
192 192
 
193
-        $md5_secret = $this->get_option( 'md5_secret' );
193
+        $md5_secret = $this->get_option('md5_secret');
194 194
 
195 195
         // Abort if there is no secret.
196
-        if ( empty( $md5_secret ) ) {
196
+        if (empty($md5_secret)) {
197 197
             return $args;
198 198
         }
199 199
 
200 200
         // Hash the args.
201
-        $args['signature'] = md5( "$md5_secret:{$args['instId']}:{$args['amount']}:{$args['currency']}:{$args['cartId']}" );
201
+        $args['signature'] = md5("$md5_secret:{$args['instId']}:{$args['amount']}:{$args['currency']}:{$args['cartId']}");
202 202
 
203 203
         return $args;
204 204
     }
@@ -211,43 +211,43 @@  discard block
 block discarded – undo
211 211
 	public function verify_ipn() {
212 212
 
213 213
         // Validate the IPN.
214
-        if ( empty( $_POST ) || ! $this->validate_ipn() ) {
215
-		    wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) );
214
+        if (empty($_POST) || !$this->validate_ipn()) {
215
+		    wp_die('Worldpay IPN Request Failure', 'Worldpay IPN', array('response' => 500));
216 216
 		}
217 217
 
218 218
         // Process the IPN.
219
-        $posted  = wp_unslash( $_POST );
220
-        $invoice = wpinv_get_invoice( $posted['MC_invoice_id'] );
219
+        $posted  = wp_unslash($_POST);
220
+        $invoice = wpinv_get_invoice($posted['MC_invoice_id']);
221 221
 
222
-        if ( $invoice && $this->id == $invoice->get_gateway() ) {
222
+        if ($invoice && $this->id == $invoice->get_gateway()) {
223 223
 
224
-            wpinv_error_log( 'Found invoice #' . $invoice->get_number() );
225
-            wpinv_error_log( 'Payment status:' . $posted['transStatus'] );
224
+            wpinv_error_log('Found invoice #' . $invoice->get_number());
225
+            wpinv_error_log('Payment status:' . $posted['transStatus']);
226 226
 
227 227
             // Update the transaction id.
228
-            if ( ! empty( $posted['transId'] ) ) {
229
-                $invoice->set_transaction_id( wpinv_clean( $posted['transId'] ) );
228
+            if (!empty($posted['transId'])) {
229
+                $invoice->set_transaction_id(wpinv_clean($posted['transId']));
230 230
             }
231 231
 
232 232
              // Update the ip address.
233
-             if ( ! empty( $posted['ipAddress'] ) ) {
234
-                $invoice->set_ip( wpinv_clean( $posted['ipAddress'] ) );
233
+             if (!empty($posted['ipAddress'])) {
234
+                $invoice->set_ip(wpinv_clean($posted['ipAddress']));
235 235
             }
236 236
 
237
-            if ( $posted['transStatus'] == 'Y' ) {
238
-                $invoice->set_completed_date( date( 'Y-m-d H:i:s', $posted['transTime'] ) );
237
+            if ($posted['transStatus'] == 'Y') {
238
+                $invoice->set_completed_date(date('Y-m-d H:i:s', $posted['transTime']));
239 239
                 $invoice->mark_paid();
240 240
                 return;
241 241
             }
242 242
 
243
-            if ( $posted['transStatus'] == 'C' ) {
244
-                $invoice->set_status( 'wpi-failed' );
245
-                $invoice->add_note( __( 'Payment transaction failed while processing Worldpay payment.', 'invoicing' ), false, false, true );
243
+            if ($posted['transStatus'] == 'C') {
244
+                $invoice->set_status('wpi-failed');
245
+                $invoice->add_note(__('Payment transaction failed while processing Worldpay payment.', 'invoicing'), false, false, true);
246 246
                 $invoice->save();
247 247
                 return;
248 248
             }
249 249
 
250
-            wpinv_error_log( 'Aborting, Invalid transaction status:' . $posted['transStatus'] );
250
+            wpinv_error_log('Aborting, Invalid transaction status:' . $posted['transStatus']);
251 251
             $invoice->save();
252 252
 
253 253
         }
@@ -261,27 +261,27 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function validate_ipn() {
263 263
 
264
-        wpinv_error_log( 'Validating Worldpay IPN response' );
264
+        wpinv_error_log('Validating Worldpay IPN response');
265 265
 
266
-        $data = wp_unslash( $_POST );
266
+        $data = wp_unslash($_POST);
267 267
 
268 268
         // Verify installation.
269
-        if ( empty( $data['instId'] ) || $data['instId'] != wpinv_clean( $this->get_option( 'instId', '' ) ) ) {
270
-            wpinv_error_log( 'Received invalid installation ID from Worldpay IPN' );
269
+        if (empty($data['instId']) || $data['instId'] != wpinv_clean($this->get_option('instId', ''))) {
270
+            wpinv_error_log('Received invalid installation ID from Worldpay IPN');
271 271
             return false;
272 272
         }
273 273
 
274 274
         // Verify invoice.
275
-        if ( empty( $data['cartId'] ) || !  wpinv_get_id_by_invoice_number( $data['cartId'] ) ) {
276
-            wpinv_error_log( 'Received invalid invoice number from Worldpay IPN' );
275
+        if (empty($data['cartId']) || !wpinv_get_id_by_invoice_number($data['cartId'])) {
276
+            wpinv_error_log('Received invalid invoice number from Worldpay IPN');
277 277
             return false;
278 278
         }
279 279
         
280 280
         // (maybe) verify password.
281
-        $password = $this->get_option( 'callback_password' );
281
+        $password = $this->get_option('callback_password');
282 282
 
283
-        if ( ! empty( $password ) && ( empty( $data['callbackPW'] ) || $password != $data['callbackPW'] ) ) {
284
-            wpinv_error_log( 'Received invalid invoice number from Worldpay IPN' );
283
+        if (!empty($password) && (empty($data['callbackPW']) || $password != $data['callbackPW'])) {
284
+            wpinv_error_log('Received invalid invoice number from Worldpay IPN');
285 285
             return false;
286 286
         }
287 287
 
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
     /**
293 293
      * Displays a notice on the checkout page if sandbox is enabled.
294 294
      */
295
-    public function sandbox_notice( $description, $gateway ) {
296
-        if ( 'worldpay' == $gateway && wpinv_is_test_mode( 'worldpay' ) ) {
295
+    public function sandbox_notice($description, $gateway) {
296
+        if ('worldpay' == $gateway && wpinv_is_test_mode('worldpay')) {
297 297
             $description .= '<br>' . sprintf(
298
-                __( 'SANDBOX ENABLED. See the %sWorldpay Sandbox Testing Guide%s for more details.', 'invoicing' ),
298
+                __('SANDBOX ENABLED. See the %sWorldpay Sandbox Testing Guide%s for more details.', 'invoicing'),
299 299
                 '<a href="https://developer.worldpay.com/docs/wpg/directintegration/abouttesting">',
300 300
                 '</a>'
301 301
             );
@@ -309,43 +309,43 @@  discard block
 block discarded – undo
309 309
 	 * 
310 310
 	 * @param array $admin_settings
311 311
 	 */
312
-	public function admin_settings( $admin_settings ) {
312
+	public function admin_settings($admin_settings) {
313 313
 
314 314
         $currencies = sprintf(
315
-            __( 'Supported Currencies: %s', 'invoicing' ),
316
-            implode( ', ', $this->currencies )
315
+            __('Supported Currencies: %s', 'invoicing'),
316
+            implode(', ', $this->currencies)
317 317
         );
318 318
 
319 319
         $admin_settings['worldpay_active']['desc'] = $admin_settings['worldpay_active']['desc'] . " ($currencies)";
320
-        $admin_settings['worldpay_desc']['std']    = __( 'Pay securely via Worldpay using your PayPal account, credit or debit card.', 'invoicing' );
320
+        $admin_settings['worldpay_desc']['std']    = __('Pay securely via Worldpay using your PayPal account, credit or debit card.', 'invoicing');
321 321
 
322 322
         $admin_settings['worldpay_instId'] = array(
323 323
             'type' => 'text',
324 324
             'id'   => 'worldpay_instId',
325
-            'name' => __( 'Installation Id', 'invoicing' ),
326
-            'desc' => __( 'Your installation id. Ex: 211616', 'invoicing' ),
325
+            'name' => __('Installation Id', 'invoicing'),
326
+            'desc' => __('Your installation id. Ex: 211616', 'invoicing'),
327 327
         );
328 328
 
329 329
         $admin_settings['worldpay_md5_secret'] = array(
330 330
             'type' => 'text',
331 331
             'id'   => 'worldpay_md5_secret',
332
-            'name' => __( 'MD5 secret', 'invoicing' ),
333
-            'desc' => __( 'Optionally enter your MD5 secret here. Next, open your installation settings and ensure that your SignatureFields parameter is set to ', 'invoicing' ) . '<code>instId:amount:currency:cartId</code>',
332
+            'name' => __('MD5 secret', 'invoicing'),
333
+            'desc' => __('Optionally enter your MD5 secret here. Next, open your installation settings and ensure that your SignatureFields parameter is set to ', 'invoicing') . '<code>instId:amount:currency:cartId</code>',
334 334
         );
335 335
 
336 336
         $admin_settings['worldpay_callbackPW'] = array(
337 337
             'type' => 'text',
338 338
             'id'   => 'worldpay_callbackPW',
339
-            'name' => __( 'Payment Response password', 'invoicing' ),
340
-            'desc' => __( 'Recommended. Enter your WorldPay response password to validate payment notifications.', 'invoicing' ),
339
+            'name' => __('Payment Response password', 'invoicing'),
340
+            'desc' => __('Recommended. Enter your WorldPay response password to validate payment notifications.', 'invoicing'),
341 341
         );
342 342
 
343 343
         $admin_settings['worldpay_ipn_url'] = array(
344 344
             'type'     => 'ipn_url',
345 345
             'id'       => 'worldpay_ipn_url',
346
-            'name'     => __( 'Payment Response URL', 'invoicing' ),
346
+            'name'     => __('Payment Response URL', 'invoicing'),
347 347
             'std'      => $this->notify_url,
348
-            'desc'     => __( 'Login to your Worldpay Merchant Interface then enable Payment Response & Shopper Response. Next, go to the Payment Response URL field and enter the above URL.', 'invoicing' ),
348
+            'desc'     => __('Login to your Worldpay Merchant Interface then enable Payment Response & Shopper Response. Next, go to the Payment Response URL field and enter the above URL.', 'invoicing'),
349 349
             'custom'   => 'worldpay',
350 350
             'readonly' => true
351 351
         );
Please login to merge, or discard this patch.
includes/data/invoice-schema.php 1 patch
Spacing   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -9,632 +9,632 @@
 block discarded – undo
9 9
  * @version 1.0.19
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14 14
 return array(
15 15
 
16 16
 	'id'              => array(
17
-		'description' => __( 'Unique identifier for the invoice.', 'invoicing' ),
17
+		'description' => __('Unique identifier for the invoice.', 'invoicing'),
18 18
 		'type'        => 'integer',
19
-		'context'     => array( 'view', 'edit', 'embed' ),
19
+		'context'     => array('view', 'edit', 'embed'),
20 20
 		'readonly'    => true,
21 21
 	),
22 22
 
23 23
 	'parent_id'       => array(
24
-		'description' => __( 'Parent invoice ID.', 'invoicing' ),
24
+		'description' => __('Parent invoice ID.', 'invoicing'),
25 25
 		'type'        => 'integer',
26 26
 		'minimum'     => 0,
27 27
 		'default'     => 0,
28
-		'context'     => array( 'view', 'edit' ),
28
+		'context'     => array('view', 'edit'),
29 29
 	),
30 30
 
31 31
 	'key'			  => array(
32
-		'description' => __( 'A unique key for the invoice.', 'invoicing' ),
32
+		'description' => __('A unique key for the invoice.', 'invoicing'),
33 33
 		'type'        => 'string',
34
-		'context'     => array( 'view', 'edit' ),
34
+		'context'     => array('view', 'edit'),
35 35
 		'readonly'    => true,
36 36
 	),
37 37
 
38 38
 	'number'		  => array(
39
-		'description' => __( 'A unique number for the invoice.', 'invoicing' ),
39
+		'description' => __('A unique number for the invoice.', 'invoicing'),
40 40
 		'type'        => 'string',
41
-		'context'     => array( 'view', 'edit', 'embed' ),
41
+		'context'     => array('view', 'edit', 'embed'),
42 42
 	),
43 43
 
44 44
 	'type'			  => array(
45
-		'description' => __( 'Get the invoice type (e.g invoice, quote etc).', 'invoicing' ),
45
+		'description' => __('Get the invoice type (e.g invoice, quote etc).', 'invoicing'),
46 46
 		'type'        => 'string',
47
-		'context'     => array( 'view', 'edit', 'embed' ),
47
+		'context'     => array('view', 'edit', 'embed'),
48 48
 		'readonly'    => true,
49 49
 	),
50 50
 
51 51
 	'post_type'		  => array(
52
-		'description' => __( 'Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing' ),
52
+		'description' => __('Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing'),
53 53
 		'type'        => 'string',
54
-		'context'     => array( 'view', 'edit', 'embed' ),
54
+		'context'     => array('view', 'edit', 'embed'),
55 55
 		'readonly'    => true,
56 56
 	),
57 57
 
58 58
 	'version'         => array(
59
-		'description' => __( 'Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing' ),
59
+		'description' => __('Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing'),
60 60
 		'type'        => 'integer',
61
-		'context'     => array( 'view', 'edit' ),
61
+		'context'     => array('view', 'edit'),
62 62
 		'readonly'    => true,
63 63
 	),
64 64
 
65 65
 	'template'        => array(
66
-		'description' => __( 'The invoice template.', 'invoicing' ),
66
+		'description' => __('The invoice template.', 'invoicing'),
67 67
 		'type'        => 'string',
68 68
 		'default'     => 'quantity',
69
-		'enum'        => array( 'quantity', 'hours', 'amount' ),
70
-		'context'     => array( 'view', 'edit', 'embed' ),
69
+		'enum'        => array('quantity', 'hours', 'amount'),
70
+		'context'     => array('view', 'edit', 'embed'),
71 71
 	),
72 72
 
73 73
 	'status'          => array(
74
-		'description' => __( 'Invoice status.', 'invoicing' ),
74
+		'description' => __('Invoice status.', 'invoicing'),
75 75
 		'type'        => 'string',
76 76
 		'default'     => 'wpi-pending',
77
-		'enum'        => array_keys( wpinv_get_invoice_statuses( true ) ),
78
-		'context'     => array( 'view', 'edit', 'embed' ),
77
+		'enum'        => array_keys(wpinv_get_invoice_statuses(true)),
78
+		'context'     => array('view', 'edit', 'embed'),
79 79
 	),
80 80
 
81 81
 	'status_nicename' => array(
82
-		'description' => __( 'A human readable name for the invoice status.', 'invoicing' ),
82
+		'description' => __('A human readable name for the invoice status.', 'invoicing'),
83 83
 		'type'        => 'string',
84
-		'context'     => array( 'view', 'edit', 'embed' ),
84
+		'context'     => array('view', 'edit', 'embed'),
85 85
 		'readonly'    => true,
86 86
 	),
87 87
 
88 88
 	'currency'        => array(
89
-		'description' => __( 'The invoice currency in ISO format.', 'invoicing' ),
89
+		'description' => __('The invoice currency in ISO format.', 'invoicing'),
90 90
 		'type'        => 'string',
91 91
 		'default'     => wpinv_get_currency(),
92
-		'enum'        => array_keys( wpinv_get_currencies() ),
93
-		'context'     => array( 'view', 'edit', 'embed' ),
92
+		'enum'        => array_keys(wpinv_get_currencies()),
93
+		'context'     => array('view', 'edit', 'embed'),
94 94
 	),
95 95
 
96 96
 	'date_created'    => array(
97
-		'description' => __( "The date the invoice was created, in the site's timezone.", 'invoicing' ),
97
+		'description' => __("The date the invoice was created, in the site's timezone.", 'invoicing'),
98 98
 		'type'        => 'string',
99
-		'context'     => array( 'view', 'edit', 'embed' ),
99
+		'context'     => array('view', 'edit', 'embed'),
100 100
 	),
101 101
 
102 102
 	'date_created_gmt'    => array(
103
-		'description' => __( 'The GMT date the invoice was created.', 'invoicing' ),
103
+		'description' => __('The GMT date the invoice was created.', 'invoicing'),
104 104
 		'type'        => 'string',
105
-		'context'     => array( 'view', 'edit', 'embed' ),
105
+		'context'     => array('view', 'edit', 'embed'),
106 106
 		'readonly'    => true,
107 107
 	),
108 108
 
109 109
 	'date_modified'   => array(
110
-		'description' => __( "The date the invoice was last modified, in the site's timezone.", 'invoicing' ),
110
+		'description' => __("The date the invoice was last modified, in the site's timezone.", 'invoicing'),
111 111
 		'type'        => 'string',
112
-		'context'     => array( 'view', 'edit', 'embed' ),
112
+		'context'     => array('view', 'edit', 'embed'),
113 113
 		'readonly'    => true,
114 114
 	),
115 115
 
116 116
 	'date_modified_gmt'    => array(
117
-		'description' => __( 'The GMT date the invoice was last modified.', 'invoicing' ),
117
+		'description' => __('The GMT date the invoice was last modified.', 'invoicing'),
118 118
 		'type'        => 'string',
119
-		'context'     => array( 'view', 'edit', 'embed' ),
119
+		'context'     => array('view', 'edit', 'embed'),
120 120
 		'readonly'    => true,
121 121
 	),
122 122
 
123 123
 	'due_date'        => array(
124
-		'description' => __( "The invoice's due date, in the site's timezone.", 'invoicing' ),
124
+		'description' => __("The invoice's due date, in the site's timezone.", 'invoicing'),
125 125
 		'type'        => 'string',
126
-		'context'     => array( 'view', 'edit', 'embed' ),
126
+		'context'     => array('view', 'edit', 'embed'),
127 127
 	),
128 128
 
129 129
 	'due_date_gmt'    => array(
130
-		'description' => __( 'The GMT date the invoice is/was due.', 'invoicing' ),
130
+		'description' => __('The GMT date the invoice is/was due.', 'invoicing'),
131 131
 		'type'        => 'string',
132
-		'context'     => array( 'view', 'edit', 'embed' ),
132
+		'context'     => array('view', 'edit', 'embed'),
133 133
 		'readonly'    => true,
134 134
 	),
135 135
 
136 136
 	'completed_date'  => array(
137
-		'description' => __( "The date the invoice was paid, in the site's timezone.", 'invoicing' ),
137
+		'description' => __("The date the invoice was paid, in the site's timezone.", 'invoicing'),
138 138
 		'type'        => 'string',
139
-		'context'     => array( 'view', 'edit', 'embed' ),
139
+		'context'     => array('view', 'edit', 'embed'),
140 140
 		'readonly'    => true,
141 141
 	),
142 142
 
143 143
 	'completed_date_gmt'    => array(
144
-		'description' => __( 'The GMT date the invoice was paid.', 'invoicing' ),
144
+		'description' => __('The GMT date the invoice was paid.', 'invoicing'),
145 145
 		'type'        => 'string',
146
-		'context'     => array( 'view', 'edit', 'embed' ),
146
+		'context'     => array('view', 'edit', 'embed'),
147 147
 		'readonly'    => true,
148 148
 	),
149 149
 
150 150
 	'total_discount'   => array(
151
-		'description' => __( 'Total discount amount for the invoice.', 'invoicing' ),
151
+		'description' => __('Total discount amount for the invoice.', 'invoicing'),
152 152
 		'type'        => 'number',
153
-		'context'     => array( 'view', 'edit', 'embed' ),
153
+		'context'     => array('view', 'edit', 'embed'),
154 154
 		'readonly'    => true,
155 155
 	),
156 156
 
157 157
 	'total_tax'       => array(
158
-		'description' => __( 'Total tax amount for the invoice.', 'invoicing' ),
158
+		'description' => __('Total tax amount for the invoice.', 'invoicing'),
159 159
 		'type'        => 'number',
160
-		'context'     => array( 'view', 'edit', 'embed' ),
160
+		'context'     => array('view', 'edit', 'embed'),
161 161
 		'readonly'    => true,
162 162
 	),
163 163
 
164 164
 	'total_fees'      => array(
165
-		'description' => __( 'Total fees amount for the invoice.', 'invoicing' ),
165
+		'description' => __('Total fees amount for the invoice.', 'invoicing'),
166 166
 		'type'        => 'number',
167
-		'context'     => array( 'view', 'edit', 'embed' ),
167
+		'context'     => array('view', 'edit', 'embed'),
168 168
 		'readonly'    => true,
169 169
 	),
170 170
 
171 171
 	'subtotal'        => array(
172
-		'description' => __( 'Invoice subtotal.', 'invoicing' ),
172
+		'description' => __('Invoice subtotal.', 'invoicing'),
173 173
 		'type'        => 'number',
174
-		'context'     => array( 'view', 'edit', 'embed' ),
174
+		'context'     => array('view', 'edit', 'embed'),
175 175
 		'readonly'    => true,
176 176
 	),
177 177
 
178 178
 	'total'           => array(
179
-		'description' => __( 'Grand total.', 'invoicing' ),
179
+		'description' => __('Grand total.', 'invoicing'),
180 180
 		'type'        => 'number',
181
-		'context'     => array( 'view', 'edit', 'embed' ),
181
+		'context'     => array('view', 'edit', 'embed'),
182 182
 		'readonly'    => true,
183 183
 	),
184 184
 
185 185
 	'initial_total'   => array(
186
-		'description' => __( 'Initial total (for recurring invoices).', 'invoicing' ),
186
+		'description' => __('Initial total (for recurring invoices).', 'invoicing'),
187 187
 		'type'        => 'number',
188
-		'context'     => array( 'view', 'edit', 'embed' ),
188
+		'context'     => array('view', 'edit', 'embed'),
189 189
 		'readonly'    => true,
190 190
 	),
191 191
 
192 192
 	'recurring_total'  => array(
193
-		'description' => __( 'Recurring total (for recurring invoices).', 'invoicing' ),
193
+		'description' => __('Recurring total (for recurring invoices).', 'invoicing'),
194 194
 		'type'        => 'number',
195
-		'context'     => array( 'view', 'edit', 'embed' ),
195
+		'context'     => array('view', 'edit', 'embed'),
196 196
 		'readonly'    => true,
197 197
 	),
198 198
 
199 199
 	'totals'          => array(
200
-		'description' => __( 'Invoice totals.', 'invoicing' ),
200
+		'description' => __('Invoice totals.', 'invoicing'),
201 201
 		'type'        => 'object',
202
-		'context'     => array( 'view', 'edit', 'embed' ),
202
+		'context'     => array('view', 'edit', 'embed'),
203 203
 		'readonly'    => true,
204 204
 	),
205 205
 
206 206
 	'fees'            => array(
207
-		'description' => __( 'Invoice fees (Name => properties).', 'invoicing' ),
207
+		'description' => __('Invoice fees (Name => properties).', 'invoicing'),
208 208
 		'type'        => 'object',
209
-		'context'     => array( 'view', 'edit', 'embed' ),
209
+		'context'     => array('view', 'edit', 'embed'),
210 210
 		'items'       => array(
211 211
 			'type'                => 'object',
212
-			'required'            => array( 'amount' ),
212
+			'required'            => array('amount'),
213 213
 			'properties'          => array(
214 214
 				'amount'          => array(
215
-					'description' => __( 'Fee amount.', 'invoicing' ),
215
+					'description' => __('Fee amount.', 'invoicing'),
216 216
 					'type'        => 'string',
217
-					'context'     => array( 'view', 'edit', 'embed' ),
217
+					'context'     => array('view', 'edit', 'embed'),
218 218
 				),
219 219
 				'recurring'       => array(
220
-					'description' => __( 'Whether this is a recurring or one-time fee.', 'invoicing' ),
221
-					'type'        => array( 'boolean', 'integer' ),
222
-					'context'     => array( 'view', 'edit', 'embed' ),
220
+					'description' => __('Whether this is a recurring or one-time fee.', 'invoicing'),
221
+					'type'        => array('boolean', 'integer'),
222
+					'context'     => array('view', 'edit', 'embed'),
223 223
 				),
224 224
 			),
225 225
 		),
226 226
 	),
227 227
 
228 228
 	'discounts'       => array(
229
-		'description' => __( 'Invoice discounts (Name => properties).', 'invoicing' ),
229
+		'description' => __('Invoice discounts (Name => properties).', 'invoicing'),
230 230
 		'type'        => 'object',
231
-		'context'     => array( 'view', 'edit', 'embed' ),
231
+		'context'     => array('view', 'edit', 'embed'),
232 232
 		'items'       => array(
233 233
 			'type'                => 'object',
234
-			'required'            => array( 'amount' ),
234
+			'required'            => array('amount'),
235 235
 			'properties'          => array(
236 236
 				'amount'          => array(
237
-					'description' => __( 'Fee amount.', 'invoicing' ),
237
+					'description' => __('Fee amount.', 'invoicing'),
238 238
 					'type'        => 'string',
239
-					'context'     => array( 'view', 'edit', 'embed' ),
239
+					'context'     => array('view', 'edit', 'embed'),
240 240
 				),
241 241
 				'recurring'       => array(
242
-					'description' => __( 'Whether this is a recurring or one-time discount.', 'invoicing' ),
243
-					'type'        => array( 'boolean', 'integer' ),
244
-					'context'     => array( 'view', 'edit', 'embed' ),
242
+					'description' => __('Whether this is a recurring or one-time discount.', 'invoicing'),
243
+					'type'        => array('boolean', 'integer'),
244
+					'context'     => array('view', 'edit', 'embed'),
245 245
 				),
246 246
 			),
247 247
 		),
248 248
 	),
249 249
 
250 250
 	'taxes'           => array(
251
-		'description' => __( 'Invoice taxes (Name => properties).', 'invoicing' ),
251
+		'description' => __('Invoice taxes (Name => properties).', 'invoicing'),
252 252
 		'type'        => 'object',
253
-		'context'     => array( 'view', 'edit', 'embed' ),
253
+		'context'     => array('view', 'edit', 'embed'),
254 254
 		'items'       => array(
255 255
 			'type'                => 'object',
256
-			'required'            => array( 'amount' ),
256
+			'required'            => array('amount'),
257 257
 			'properties'          => array(
258 258
 				'amount'          => array(
259
-					'description' => __( 'Fee amount.', 'invoicing' ),
259
+					'description' => __('Fee amount.', 'invoicing'),
260 260
 					'type'        => 'string',
261
-					'context'     => array( 'view', 'edit', 'embed' ),
261
+					'context'     => array('view', 'edit', 'embed'),
262 262
 				),
263 263
 				'recurring'       => array(
264
-					'description' => __( 'Whether this is a recurring or one-time tax.', 'invoicing' ),
265
-					'type'        => array( 'boolean', 'integer' ),
266
-					'context'     => array( 'view', 'edit', 'embed' ),
264
+					'description' => __('Whether this is a recurring or one-time tax.', 'invoicing'),
265
+					'type'        => array('boolean', 'integer'),
266
+					'context'     => array('view', 'edit', 'embed'),
267 267
 				),
268 268
 			),
269 269
 		),
270 270
 	),
271 271
 
272 272
 	'items'           => array(
273
-		'description' => __( 'Invoice items.', 'invoicing' ),
273
+		'description' => __('Invoice items.', 'invoicing'),
274 274
 		'type'        => 'array',
275
-		'context'     => array( 'view', 'edit', 'embed' ),
275
+		'context'     => array('view', 'edit', 'embed'),
276 276
 		'items'       => array(
277 277
 			'type'                => 'object',
278
-			'required'            => array( 'item_id' ),
278
+			'required'            => array('item_id'),
279 279
 			'properties'          => array(
280 280
 				'item_id'         => array(
281
-					'description' => __( 'Item ID.', 'invoicing' ),
281
+					'description' => __('Item ID.', 'invoicing'),
282 282
 					'type'        => 'integer',
283
-					'context'     => array( 'view', 'edit', 'embed' ),
283
+					'context'     => array('view', 'edit', 'embed'),
284 284
 				),
285 285
 				'item_name'       => array(
286
-					'description' => __( 'Item Name.', 'invoicing' ),
286
+					'description' => __('Item Name.', 'invoicing'),
287 287
 					'type'        => 'string',
288
-					'context'     => array( 'view', 'edit', 'embed' ),
288
+					'context'     => array('view', 'edit', 'embed'),
289 289
 				),
290 290
 				'item_description' => array(
291
-					'description'  => __( 'Item Description.', 'invoicing' ),
291
+					'description'  => __('Item Description.', 'invoicing'),
292 292
 					'type'         => 'string',
293
-					'context'      => array( 'view', 'edit', 'embed' ),
293
+					'context'      => array('view', 'edit', 'embed'),
294 294
 				),
295 295
 				'item_price'      => array(
296
-					'description' => __( 'Item Price.', 'invoicing' ),
296
+					'description' => __('Item Price.', 'invoicing'),
297 297
 					'type'        => 'number',
298
-					'context'     => array( 'view', 'edit', 'embed' ),
298
+					'context'     => array('view', 'edit', 'embed'),
299 299
 				),
300 300
 				'quantity'        => array(
301
-					'description' => __( 'Item Quantity.', 'invoicing' ),
301
+					'description' => __('Item Quantity.', 'invoicing'),
302 302
 					'type'        => 'integer',
303
-					'context'     => array( 'view', 'edit', 'embed' ),
303
+					'context'     => array('view', 'edit', 'embed'),
304 304
 				),
305 305
 				'subtotal'        => array(
306
-					'description' => __( 'Item Subtotal.', 'invoicing' ),
306
+					'description' => __('Item Subtotal.', 'invoicing'),
307 307
 					'type'        => 'number',
308
-					'context'     => array( 'view', 'edit', 'embed' ),
308
+					'context'     => array('view', 'edit', 'embed'),
309 309
 					'readonly'    => true,
310 310
 				),
311 311
 				'meta'            => array(
312
-					'description' => __( 'Item Meta.', 'invoicing' ),
312
+					'description' => __('Item Meta.', 'invoicing'),
313 313
 					'type'        => 'object',
314
-					'context'     => array( 'view', 'edit', 'embed' ),
314
+					'context'     => array('view', 'edit', 'embed'),
315 315
 				),
316 316
 			),
317 317
 		),
318 318
 	),
319 319
 
320 320
 	'mode'			  => array(
321
-		'description' => __( 'The invoice transaction mode.', 'invoicing' ),
321
+		'description' => __('The invoice transaction mode.', 'invoicing'),
322 322
 		'type'        => 'string',
323
-		'context'     => array( 'view', 'edit', 'embed' ),
324
-		'enum'        => array( 'live', 'test' ),
323
+		'context'     => array('view', 'edit', 'embed'),
324
+		'enum'        => array('live', 'test'),
325 325
 		'readonly'    => true,
326 326
 	),
327 327
 	
328 328
 	'discount_code'   => array(
329
-		'description' => __( 'The discount code used on this invoice.', 'invoicing' ),
329
+		'description' => __('The discount code used on this invoice.', 'invoicing'),
330 330
 		'type'        => 'string',
331
-		'context'     => array( 'view', 'edit', 'embed' ),
331
+		'context'     => array('view', 'edit', 'embed'),
332 332
 	),
333 333
 
334 334
 	'gateway'         => array(
335
-		'description' => __( 'The gateway used to pay this invoice.', 'invoicing' ),
335
+		'description' => __('The gateway used to pay this invoice.', 'invoicing'),
336 336
 		'type'        => 'string',
337
-		'context'     => array( 'view', 'edit', 'embed' ),
337
+		'context'     => array('view', 'edit', 'embed'),
338 338
 	),
339 339
 
340 340
 	'gateway_title'   => array(
341
-		'description' => __( 'The title of the gateway used to pay this invoice.', 'invoicing' ),
341
+		'description' => __('The title of the gateway used to pay this invoice.', 'invoicing'),
342 342
 		'type'        => 'string',
343
-		'context'     => array( 'view', 'edit', 'embed' ),
343
+		'context'     => array('view', 'edit', 'embed'),
344 344
 		'readonly'    => true,
345 345
 	),
346 346
 
347 347
 	'transaction_id'  => array(
348
-		'description' => __( 'The transaction id for this invoice.', 'invoicing' ),
348
+		'description' => __('The transaction id for this invoice.', 'invoicing'),
349 349
 		'type'        => 'string',
350
-		'context'     => array( 'view', 'edit', 'embed' ),
350
+		'context'     => array('view', 'edit', 'embed'),
351 351
 	),
352 352
 	
353 353
 	'disable_taxes'   => array(
354
-		'description' => __( 'Whether or not taxes should be disabled for this invoice.', 'invoicing' ),
354
+		'description' => __('Whether or not taxes should be disabled for this invoice.', 'invoicing'),
355 355
 		'type'        => 'boolean ',
356
-		'context'     => array( 'view', 'edit', 'embed' ),
356
+		'context'     => array('view', 'edit', 'embed'),
357 357
 	),
358 358
 
359 359
 	'is_viewed'       => array(
360
-		'description' => __( 'Whether or not this invoice has been viewed by the user.', 'invoicing' ),
360
+		'description' => __('Whether or not this invoice has been viewed by the user.', 'invoicing'),
361 361
 		'type'        => 'boolean ',
362
-		'context'     => array( 'view', 'edit', 'embed' ),
362
+		'context'     => array('view', 'edit', 'embed'),
363 363
 		'readonly'    => true,
364 364
 	),
365 365
 
366 366
 	'email_cc'        => array(
367
-		'description' => __( 'A comma separated list of other emails that should receive communications for this invoice.', 'invoicing' ),
367
+		'description' => __('A comma separated list of other emails that should receive communications for this invoice.', 'invoicing'),
368 368
 		'type'        => 'string ',
369
-		'context'     => array( 'view', 'edit' ),
369
+		'context'     => array('view', 'edit'),
370 370
 	),
371 371
 
372 372
 	'subscription_id' => array(
373
-		'description' => __( 'The ID of the subscription associated with this invoice.', 'invoicing' ),
373
+		'description' => __('The ID of the subscription associated with this invoice.', 'invoicing'),
374 374
 		'type'        => 'string ',
375
-		'context'     => array( 'view', 'edit', 'embed' ),
375
+		'context'     => array('view', 'edit', 'embed'),
376 376
 		'readonly'    => true,
377 377
 	),
378 378
 
379 379
 	'subscription_name' => array(
380
-		'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ),
380
+		'description' => __('The name of the subscription associated with this invoice.', 'invoicing'),
381 381
 		'type'        => 'string ',
382
-		'context'     => array( 'view', 'edit', 'embed' ),
382
+		'context'     => array('view', 'edit', 'embed'),
383 383
 		'readonly'    => true,
384 384
 	),
385 385
 
386 386
 	'subscription_name' => array(
387
-		'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ),
387
+		'description' => __('The name of the subscription associated with this invoice.', 'invoicing'),
388 388
 		'type'        => 'string ',
389
-		'context'     => array( 'view', 'edit', 'embed' ),
389
+		'context'     => array('view', 'edit', 'embed'),
390 390
 		'readonly'    => true,
391 391
 	),
392 392
 
393 393
 	'is_parent'		  => array(
394
-		'description' => __( 'Whether or not this is a parent invoice.', 'invoicing' ),
394
+		'description' => __('Whether or not this is a parent invoice.', 'invoicing'),
395 395
 		'type'        => 'boolean',
396
-		'context'     => array( 'view', 'edit', 'embed' ),
396
+		'context'     => array('view', 'edit', 'embed'),
397 397
 		'readonly'    => true,
398 398
 	),
399 399
 
400 400
 	'is_renewal'      => array(
401
-		'description' => __( 'Whether or not this is a renewal invoice.', 'invoicing' ),
401
+		'description' => __('Whether or not this is a renewal invoice.', 'invoicing'),
402 402
 		'type'        => 'boolean',
403
-		'context'     => array( 'view', 'edit', 'embed' ),
403
+		'context'     => array('view', 'edit', 'embed'),
404 404
 		'readonly'    => true,
405 405
 	),
406 406
 
407 407
 	'is_recurring'    => array(
408
-		'description' => __( 'Whether or not this is a recurring invoice.', 'invoicing' ),
408
+		'description' => __('Whether or not this is a recurring invoice.', 'invoicing'),
409 409
 		'type'        => 'boolean',
410
-		'context'     => array( 'view', 'edit', 'embed' ),
410
+		'context'     => array('view', 'edit', 'embed'),
411 411
 		'readonly'    => true,
412 412
 	),
413 413
 
414 414
 	'is_free'         => array(
415
-		'description' => __( 'Whether or not this invoice is free.', 'invoicing' ),
415
+		'description' => __('Whether or not this invoice is free.', 'invoicing'),
416 416
 		'type'        => 'boolean',
417
-		'context'     => array( 'view', 'edit', 'embed' ),
417
+		'context'     => array('view', 'edit', 'embed'),
418 418
 		'readonly'    => true,
419 419
 	),
420 420
 
421 421
 	'is_paid'         => array(
422
-		'description' => __( 'Whether or not this invoice has been paid.', 'invoicing' ),
422
+		'description' => __('Whether or not this invoice has been paid.', 'invoicing'),
423 423
 		'type'        => 'boolean',
424
-		'context'     => array( 'view', 'edit', 'embed' ),
424
+		'context'     => array('view', 'edit', 'embed'),
425 425
 		'readonly'    => true,
426 426
 	),
427 427
 
428 428
 	'needs_payment'   => array(
429
-		'description' => __( 'Whether or not this invoice needs payment.', 'invoicing' ),
429
+		'description' => __('Whether or not this invoice needs payment.', 'invoicing'),
430 430
 		'type'        => 'boolean',
431
-		'context'     => array( 'view', 'edit', 'embed' ),
431
+		'context'     => array('view', 'edit', 'embed'),
432 432
 		'readonly'    => true,
433 433
 	),
434 434
 
435 435
 	'is_refunded'     => array(
436
-		'description' => __( 'Whether or not this invoice was refunded.', 'invoicing' ),
436
+		'description' => __('Whether or not this invoice was refunded.', 'invoicing'),
437 437
 		'type'        => 'boolean',
438
-		'context'     => array( 'view', 'edit', 'embed' ),
438
+		'context'     => array('view', 'edit', 'embed'),
439 439
 		'readonly'    => true,
440 440
 	),
441 441
 
442 442
 	'is_due'          => array(
443
-		'description' => __( 'Whether or not this invoice is due.', 'invoicing' ),
443
+		'description' => __('Whether or not this invoice is due.', 'invoicing'),
444 444
 		'type'        => 'boolean',
445
-		'context'     => array( 'view', 'edit', 'embed' ),
445
+		'context'     => array('view', 'edit', 'embed'),
446 446
 		'readonly'    => true,
447 447
 	),
448 448
 
449 449
 	'is_held'         => array(
450
-		'description' => __( 'Whether or not this invoice has been held for payment confirmation.', 'invoicing' ),
450
+		'description' => __('Whether or not this invoice has been held for payment confirmation.', 'invoicing'),
451 451
 		'type'        => 'boolean',
452
-		'context'     => array( 'view', 'edit', 'embed' ),
452
+		'context'     => array('view', 'edit', 'embed'),
453 453
 		'readonly'    => true,
454 454
 	),
455 455
 
456 456
 	'is_draft'        => array(
457
-		'description' => __( 'Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing' ),
457
+		'description' => __('Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing'),
458 458
 		'type'        => 'boolean',
459
-		'context'     => array( 'view', 'edit', 'embed' ),
459
+		'context'     => array('view', 'edit', 'embed'),
460 460
 		'readonly'    => true,
461 461
 	),
462 462
 
463 463
 	'path'			  => array(
464
-		'description' => __( 'The invoice path/slug/name.', 'invoicing' ),
464
+		'description' => __('The invoice path/slug/name.', 'invoicing'),
465 465
 		'type'        => 'string',
466
-		'context'     => array( 'view', 'edit', 'embed' ),
466
+		'context'     => array('view', 'edit', 'embed'),
467 467
 		'readonly'    => true,
468 468
 	),
469 469
 
470 470
 	'description'     => array(
471
-		'description' => __( 'The invoice description.', 'invoicing' ),
471
+		'description' => __('The invoice description.', 'invoicing'),
472 472
 		'type'        => 'string',
473
-		'context'     => array( 'view', 'edit', 'embed' ),
473
+		'context'     => array('view', 'edit', 'embed'),
474 474
 	),
475 475
 
476 476
 	'payment_form'    => array(
477
-		'description' => __( 'The id of the payment form used to pay for this invoice.', 'invoicing' ),
477
+		'description' => __('The id of the payment form used to pay for this invoice.', 'invoicing'),
478 478
 		'type'        => 'integer',
479
-		'context'     => array( 'view', 'edit' ),
479
+		'context'     => array('view', 'edit'),
480 480
 		'readonly'    => true,
481 481
 	),
482 482
 
483 483
 	'submission_id'   => array(
484
-		'description' => __( 'A uniques ID of the submission details used to pay for this invoice.', 'invoicing' ),
484
+		'description' => __('A uniques ID of the submission details used to pay for this invoice.', 'invoicing'),
485 485
 		'type'        => 'string',
486
-		'context'     => array( 'view', 'edit' ),
486
+		'context'     => array('view', 'edit'),
487 487
 		'readonly'    => true,
488 488
 	),
489 489
 
490 490
 	'customer_id'     => array(
491
-		'description' => __( 'The customer id.', 'invoicing' ),
491
+		'description' => __('The customer id.', 'invoicing'),
492 492
 		'type'        => 'integer',
493
-		'context'     => array( 'view', 'edit', 'embed' ),
493
+		'context'     => array('view', 'edit', 'embed'),
494 494
 	),
495 495
 
496 496
 	'customer_ip'     => array(
497
-		'description' => __( "The customer's ip address.", 'invoicing' ),
497
+		'description' => __("The customer's ip address.", 'invoicing'),
498 498
 		'type'        => 'string',
499 499
 		'format'      => 'ip',
500
-		'context'     => array( 'view', 'edit', 'embed' ),
500
+		'context'     => array('view', 'edit', 'embed'),
501 501
 	),
502 502
 
503 503
 	'first_name'     => array(
504
-		'description' => __( "The customer's first name.", 'invoicing' ),
504
+		'description' => __("The customer's first name.", 'invoicing'),
505 505
 		'type'        => 'string',
506
-		'context'     => array( 'view', 'edit', 'embed' ),
506
+		'context'     => array('view', 'edit', 'embed'),
507 507
 	),
508 508
 
509 509
 	'last_name'       => array(
510
-		'description' => __( "The customer's last name.", 'invoicing' ),
510
+		'description' => __("The customer's last name.", 'invoicing'),
511 511
 		'type'        => 'string',
512
-		'context'     => array( 'view', 'edit', 'embed' ),
512
+		'context'     => array('view', 'edit', 'embed'),
513 513
 	),
514 514
 	
515 515
 	'full_name'       => array(
516
-		'description' => __( "The customer's full name.", 'invoicing' ),
516
+		'description' => __("The customer's full name.", 'invoicing'),
517 517
 		'type'        => 'string',
518
-		'context'     => array( 'view', 'edit', 'embed' ),
518
+		'context'     => array('view', 'edit', 'embed'),
519 519
 		'readonly'    => true,
520 520
 	),
521 521
 
522 522
 	'phone_number'    => array(
523
-		'description' => __( "The customer's phone number.", 'invoicing' ),
523
+		'description' => __("The customer's phone number.", 'invoicing'),
524 524
 		'type'        => 'string',
525
-		'context'     => array( 'view', 'edit', 'embed' ),
525
+		'context'     => array('view', 'edit', 'embed'),
526 526
 	),
527 527
 
528 528
 	'email_address'   => array(
529
-		'description' => __( "The customer's email address.", 'invoicing' ),
529
+		'description' => __("The customer's email address.", 'invoicing'),
530 530
 		'type'        => 'string',
531
-		'context'     => array( 'view', 'edit', 'embed' ),
531
+		'context'     => array('view', 'edit', 'embed'),
532 532
 		'readonly'    => true,
533 533
 	),
534 534
 
535 535
 	'customer_country'   => array(
536
-		'description'    => __( "The customer's country.", 'invoicing' ),
536
+		'description'    => __("The customer's country.", 'invoicing'),
537 537
 		'type'           => 'string',
538
-		'context'        => array( 'view', 'edit', 'embed' ),
538
+		'context'        => array('view', 'edit', 'embed'),
539 539
 		'default'        => wpinv_get_default_country(),
540 540
 	),
541 541
 
542 542
 	'customer_state'     => array(
543
-		'description'    => __( "The customer's state.", 'invoicing' ),
543
+		'description'    => __("The customer's state.", 'invoicing'),
544 544
 		'type'           => 'string',
545
-		'context'        => array( 'view', 'edit', 'embed' ),
545
+		'context'        => array('view', 'edit', 'embed'),
546 546
 	),
547 547
 
548 548
 	'customer_city'      => array(
549
-		'description'    => __( "The customer's city.", 'invoicing' ),
549
+		'description'    => __("The customer's city.", 'invoicing'),
550 550
 		'type'           => 'string',
551
-		'context'        => array( 'view', 'edit', 'embed' ),
551
+		'context'        => array('view', 'edit', 'embed'),
552 552
 	),
553 553
 
554 554
 	'customer_zip'       => array(
555
-		'description'    => __( "The customer's zip/postal code.", 'invoicing' ),
555
+		'description'    => __("The customer's zip/postal code.", 'invoicing'),
556 556
 		'type'           => 'string',
557
-		'context'        => array( 'view', 'edit', 'embed' ),
557
+		'context'        => array('view', 'edit', 'embed'),
558 558
 	),
559 559
 
560 560
 	'customer_company'   => array(
561
-		'description'    => __( "The customer's company name.", 'invoicing' ),
561
+		'description'    => __("The customer's company name.", 'invoicing'),
562 562
 		'type'           => 'string',
563
-		'context'        => array( 'view', 'edit', 'embed' ),
563
+		'context'        => array('view', 'edit', 'embed'),
564 564
 	),
565 565
 
566 566
 	'vat_number'         => array(
567
-		'description'    => __( "The customer's VAT number.", 'invoicing' ),
567
+		'description'    => __("The customer's VAT number.", 'invoicing'),
568 568
 		'type'           => 'string',
569
-		'context'        => array( 'view', 'edit', 'embed' ),
569
+		'context'        => array('view', 'edit', 'embed'),
570 570
 	),
571 571
 
572 572
 	'vat_rate'           => array(
573
-		'description'    => __( "The customer's VAT rate.", 'invoicing' ),
573
+		'description'    => __("The customer's VAT rate.", 'invoicing'),
574 574
 		'type'           => 'number',
575
-		'context'        => array( 'view', 'edit', 'embed' ),
575
+		'context'        => array('view', 'edit', 'embed'),
576 576
 		'readonly'       => true,
577 577
 	),
578 578
 
579 579
 	'customer_address'   => array(
580
-		'description'    => __( "The customer's address.", 'invoicing' ),
580
+		'description'    => __("The customer's address.", 'invoicing'),
581 581
 		'type'           => 'string',
582
-		'context'        => array( 'view', 'edit', 'embed' ),
582
+		'context'        => array('view', 'edit', 'embed'),
583 583
 	),
584 584
 
585 585
 	'address_confirmed'  => array(
586
-		'description'    => __( "Whether or not the customer's address is confirmed.", 'invoicing' ),
586
+		'description'    => __("Whether or not the customer's address is confirmed.", 'invoicing'),
587 587
 		'type'           => 'boolean',
588
-		'context'        => array( 'view', 'edit', 'embed' ),
588
+		'context'        => array('view', 'edit', 'embed'),
589 589
 	),
590 590
 
591 591
 	'meta_data'       => array(
592
-		'description' => __( 'Invoice meta data.', 'invoicing' ),
592
+		'description' => __('Invoice meta data.', 'invoicing'),
593 593
 		'type'        => 'array',
594
-		'context'     => array( 'view', 'edit', 'embed' ),
594
+		'context'     => array('view', 'edit', 'embed'),
595 595
 		'items'       => array(
596 596
 			'type'                => 'object',
597 597
 			'properties'          => array(
598 598
 				'id'              => array(
599
-					'description' => __( 'Meta ID.', 'invoicing' ),
599
+					'description' => __('Meta ID.', 'invoicing'),
600 600
 					'type'        => 'string',
601
-					'context'     => array( 'view', 'edit', 'embed' ),
601
+					'context'     => array('view', 'edit', 'embed'),
602 602
 				),
603 603
 				'key'             => array(
604
-					'description' => __( 'Meta key.', 'invoicing' ),
604
+					'description' => __('Meta key.', 'invoicing'),
605 605
 					'type'        => 'string',
606
-					'context'     => array( 'view', 'edit', 'embed' ),
606
+					'context'     => array('view', 'edit', 'embed'),
607 607
 				),
608 608
 				'value'           => array(
609
-					'description' => __( 'Meta Value.', 'invoicing' ),
610
-					'type'        => array( 'string', 'array', 'object', 'integer', 'null' ),
611
-					'context'     => array( 'view', 'edit', 'embed' ),
609
+					'description' => __('Meta Value.', 'invoicing'),
610
+					'type'        => array('string', 'array', 'object', 'integer', 'null'),
611
+					'context'     => array('view', 'edit', 'embed'),
612 612
 				),
613 613
 			),
614 614
 		),
615 615
 	),
616 616
 
617 617
 	'view_url'        => array(
618
-		'description' => __( 'URL to the invoice.', 'invoicing' ),
618
+		'description' => __('URL to the invoice.', 'invoicing'),
619 619
 		'type'        => 'string',
620 620
 		'format'      => 'uri',
621
-		'context'     => array( 'view', 'edit', 'embed' ),
621
+		'context'     => array('view', 'edit', 'embed'),
622 622
 		'readonly'    => true,
623 623
 	),
624 624
 
625 625
 	'checkout_payment_url'         => array(
626
-		'description' => __( 'URL to the invoice checkout page.', 'invoicing' ),
626
+		'description' => __('URL to the invoice checkout page.', 'invoicing'),
627 627
 		'type'        => 'string',
628 628
 		'format'      => 'uri',
629
-		'context'     => array( 'view', 'edit', 'embed' ),
629
+		'context'     => array('view', 'edit', 'embed'),
630 630
 		'readonly'    => true,
631 631
 	),
632 632
 
633 633
 	'receipt_url'     => array(
634
-		'description' => __( 'URL to the invoice receipt page.', 'invoicing' ),
634
+		'description' => __('URL to the invoice receipt page.', 'invoicing'),
635 635
 		'type'        => 'string',
636 636
 		'format'      => 'uri',
637
-		'context'     => array( 'view', 'edit', 'embed' ),
637
+		'context'     => array('view', 'edit', 'embed'),
638 638
 		'readonly'    => true,
639 639
 	),
640 640
 
Please login to merge, or discard this patch.