Passed
Push — master ( 517e64...4acfb0 )
by Brian
04:55
created
templates/subscriptions/subscription-details.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
  * @var WPInv_Subscriptions_Widget $widget
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14
-do_action( 'getpaid_single_subscription_before_notices', $subscription );
14
+do_action('getpaid_single_subscription_before_notices', $subscription);
15 15
 
16 16
 // Display errors and notices.
17 17
 wpinv_print_errors();
18 18
 
19
-do_action( 'getpaid_before_single_subscription', $subscription );
19
+do_action('getpaid_before_single_subscription', $subscription);
20 20
 
21 21
 ?>
22 22
 
@@ -28,44 +28,44 @@  discard block
 block discarded – undo
28 28
 
29 29
 </style>
30 30
 
31
-<h2 class="mb-1 h4"><?php _e( 'Subscription Details', 'invoicing' ); ?></h2>
31
+<h2 class="mb-1 h4"><?php _e('Subscription Details', 'invoicing'); ?></h2>
32 32
 <table class="table table-bordered">
33 33
 	<tbody>
34 34
 
35
-		<?php foreach ( $widget->get_single_subscription_columns( $subscription ) as $key => $label ) : ?>
35
+		<?php foreach ($widget->get_single_subscription_columns($subscription) as $key => $label) : ?>
36 36
 
37
-			<tr class="getpaid-subscription-meta-<?php echo sanitize_html_class( $key ); ?>">
37
+			<tr class="getpaid-subscription-meta-<?php echo sanitize_html_class($key); ?>">
38 38
 
39 39
 				<th class="w-25 font-weight-bold">
40
-					<?php echo sanitize_text_field( $label ); ?>
40
+					<?php echo sanitize_text_field($label); ?>
41 41
 				</th>
42 42
 
43 43
 				<td class="w-75">
44 44
 					<?php
45 45
 
46
-						switch ( $key ) {
46
+						switch ($key) {
47 47
 
48 48
 							case 'status':
49
-								echo sanitize_text_field( $subscription->get_status_label() );
49
+								echo sanitize_text_field($subscription->get_status_label());
50 50
 								break;
51 51
 
52 52
 							case 'start_date':
53
-								echo sanitize_text_field( getpaid_format_date_value( $subscription->get_date_created() ) );
53
+								echo sanitize_text_field(getpaid_format_date_value($subscription->get_date_created()));
54 54
 								break;
55 55
 
56 56
 							case 'expiry_date':
57
-								echo sanitize_text_field( getpaid_format_date_value( $subscription->get_next_renewal_date() ) );
57
+								echo sanitize_text_field(getpaid_format_date_value($subscription->get_next_renewal_date()));
58 58
 								break;
59 59
 
60 60
 							case 'initial_amount':
61
-								echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() );
61
+								echo wpinv_price($subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency());
62 62
 
63
-								if ( $subscription->has_trial_period() ) {
63
+								if ($subscription->has_trial_period()) {
64 64
 
65 65
 									echo "<small class='text-muted'>&nbsp;";
66 66
 									printf(
67
-										_x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ),
68
-										sanitize_text_field( $subscription->get_trial_period() )
67
+										_x('( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing'),
68
+										sanitize_text_field($subscription->get_trial_period())
69 69
 									);
70 70
 									echo '</small>';
71 71
 
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
 								break;
75 75
 
76 76
 							case 'recurring_amount':
77
-								$frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
78
-								$amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
79
-								echo strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" );
77
+								$frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), '');
78
+								$amount    = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency());
79
+								echo strtolower("<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>");
80 80
 								break;
81 81
 
82 82
 							case 'item':
83
-								$item = get_post( $subscription->get_product_id() );
83
+								$item = get_post($subscription->get_product_id());
84 84
 
85
-								if ( ! empty( $item ) ) {
86
-									echo esc_html( get_the_title( $item ) );
85
+								if (!empty($item)) {
86
+									echo esc_html(get_the_title($item));
87 87
 								} else {
88
-									echo sprintf( __( 'Item #%s', 'invoicing' ), $subscription->get_product_id() );
88
+									echo sprintf(__('Item #%s', 'invoicing'), $subscription->get_product_id());
89 89
 								}
90 90
 
91 91
 								break;
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 							case 'payments':
94 94
 
95 95
 								$max_activations = (int) $subscription->get_bill_times();
96
-								echo (int) $subscription->get_times_billed() . ' / ' . ( empty( $max_activations ) ? "&infin;" : $max_activations );
96
+								echo (int) $subscription->get_times_billed() . ' / ' . (empty($max_activations) ? "&infin;" : $max_activations);
97 97
 
98 98
 								break;
99 99
 
100 100
 						}
101
-						do_action( "getpaid_render_single_subscription_column_$key", $subscription );
101
+						do_action("getpaid_render_single_subscription_column_$key", $subscription);
102 102
 
103 103
 					?>
104 104
 				</td>
@@ -110,24 +110,24 @@  discard block
 block discarded – undo
110 110
 	</tbody>
111 111
 </table>
112 112
 
113
-<h2 class='mt-5 mb-1 h4'><?php _e( 'Subscription Invoices', 'invoicing' ); ?></h2>
113
+<h2 class='mt-5 mb-1 h4'><?php _e('Subscription Invoices', 'invoicing'); ?></h2>
114 114
 
115
-<?php echo getpaid_admin_subscription_invoice_details_metabox( $subscription ); ?>
115
+<?php echo getpaid_admin_subscription_invoice_details_metabox($subscription); ?>
116 116
 
117 117
 <span class="form-text">
118 118
 
119 119
 	<?php
120
-		if ( $subscription->can_cancel() ) {
120
+		if ($subscription->can_cancel()) {
121 121
 			printf(
122 122
 				'<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a>&nbsp;&nbsp;',
123
-				esc_url( $subscription->get_cancel_url() ),
124
-				esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ),
125
-				__( 'Cancel Subscription', 'invoicing' )
123
+				esc_url($subscription->get_cancel_url()),
124
+				esc_attr__('Are you sure you want to cancel this subscription?', 'invoicing'),
125
+				__('Cancel Subscription', 'invoicing')
126 126
 			);
127 127
 		}
128 128
 
129
-		do_action( 'getpaid-single-subscription-page-actions', $subscription );
129
+		do_action('getpaid-single-subscription-page-actions', $subscription);
130 130
 	?>
131 131
 
132
-	<a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a>
132
+	<a href="<?php echo esc_url(getpaid_get_tab_url('gp-subscriptions', get_permalink((int) wpinv_get_option('invoice_subscription_page')))); ?>" class="btn btn-secondary btn-sm"><?php _e('Go Back', 'invoicing'); ?></a>
133 133
 </span>
134 134
\ No newline at end of file
Please login to merge, or discard this patch.
templates/subscriptions/subscriptions-table-row.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,45 +9,45 @@
 block discarded – undo
9 9
  * @var WPInv_Subscriptions_Widget $widget
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14
-foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) :
14
+foreach (array_keys($widget->get_subscriptions_table_columns()) as $column) :
15 15
 
16
-	$class = sanitize_html_class( $column );
16
+	$class = sanitize_html_class($column);
17 17
 	echo "<td class='getpaid-subscriptions-table-column-$class'>";
18 18
 
19
-		do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription );
19
+		do_action("getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription);
20 20
 
21
-		switch( $column ) :
21
+		switch ($column) :
22 22
 
23 23
 			case 'subscription':
24 24
 				$subscription_id = (int) $subscription->get_id();
25
-				$url             = esc_url( $subscription->get_view_url() );
25
+				$url             = esc_url($subscription->get_view_url());
26 26
 				$id_label        = sprintf(
27
-					esc_attr_x( '#%s', 'subscription id', 'invoicing' ),
27
+					esc_attr_x('#%s', 'subscription id', 'invoicing'),
28 28
 					$subscription->get_id()
29 29
 				);
30
-				echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription );
30
+				echo $widget->add_row_actions("<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription);
31 31
 				break;
32 32
 
33 33
 			case 'status':
34
-				echo sanitize_text_field( $subscription->get_status_label() );
34
+				echo sanitize_text_field($subscription->get_status_label());
35 35
 				break;
36 36
 
37 37
 			case 'renewal-date':
38
-				$renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() );
39
-				echo $subscription->is_active() ? sanitize_text_field( $renewal ) : "&mdash;";
38
+				$renewal = getpaid_format_date_value($subscription->get_next_renewal_date());
39
+				echo $subscription->is_active() ? sanitize_text_field($renewal) : "&mdash;";
40 40
 				break;
41 41
 
42 42
 			case 'amount':
43
-				$frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
44
-				$amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
45
-				echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" );
43
+				$frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), '');
44
+				$amount    = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency());
45
+				echo wp_kses_post("<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>");
46 46
 				break;
47 47
 
48 48
 		endswitch;
49 49
 
50
-		do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription );
50
+		do_action("getpaid_subscriptions_frontend_subscription_table_$column", $subscription);
51 51
 
52 52
 	echo '</td>';
53 53
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-item-details.php 1 patch
Spacing   +87 added lines, -87 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,27 +21,27 @@  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 item.
27
-        $item = new WPInv_Item( $post );
27
+        $item = new WPInv_Item($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
30
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
31 31
 
32 32
         // Set the currency position.
33 33
         $position = wpinv_currency_position();
34 34
 
35
-        if ( $position == 'left_space' ) {
35
+        if ($position == 'left_space') {
36 36
             $position = 'left';
37 37
         }
38 38
 
39
-        if ( $position == 'right_space' ) {
39
+        if ($position == 'right_space') {
40 40
             $position = 'right';
41 41
         }
42 42
 
43 43
         ?>
44
-        <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr( $item->get_type( 'edit' ) ); ?>" />
44
+        <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr($item->get_type('edit')); ?>" />
45 45
         <style>
46 46
             #poststuff .input-group-text,
47 47
             #poststuff .form-control {
@@ -55,21 +55,21 @@  discard block
 block discarded – undo
55 55
         </style>
56 56
         <div class='bsui' style='max-width: 600px;padding-top: 10px;'>
57 57
 
58
-            <?php do_action( 'wpinv_item_details_metabox_before_price', $item ); ?>
58
+            <?php do_action('wpinv_item_details_metabox_before_price', $item); ?>
59 59
             <div class="form-group row">
60
-                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _e( 'Item Price', 'invoicing' )?></span></label>
60
+                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _e('Item Price', 'invoicing')?></span></label>
61 61
                 <div class="col-sm-8">
62 62
                     <div class="row">
63 63
                         <div class="col-sm-4 getpaid-price-input">
64 64
                             <div class="input-group input-group-sm">
65
-                                <?php if( 'left' == $position ) : ?>
65
+                                <?php if ('left' == $position) : ?>
66 66
                                 <div class="input-group-prepend">
67 67
                                     <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
68 68
                                 </div>
69 69
                                 <?php endif; ?>
70
-                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr( $item->get_price( 'edit' ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control">
70
+                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr($item->get_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
71 71
 
72
-                                <?php if( 'left' != $position ) : ?>
72
+                                <?php if ('left' != $position) : ?>
73 73
                                 <div class="input-group-append">
74 74
                                     <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
75 75
                                 </div>
@@ -83,25 +83,25 @@  discard block
 block discarded – undo
83 83
                                     array(
84 84
                                         'id'               => 'wpinv_recurring_interval',
85 85
                                         'name'             => 'wpinv_recurring_interval',
86
-                                        'label'            => __( 'Interval', 'invoicing' ),
87
-                                        'placeholder'      => __( 'Select Interval', 'invoicing' ),
88
-                                        'value'            => $item->get_recurring_interval( 'edit' ),
86
+                                        'label'            => __('Interval', 'invoicing'),
87
+                                        'placeholder'      => __('Select Interval', 'invoicing'),
88
+                                        'value'            => $item->get_recurring_interval('edit'),
89 89
                                         'select2'          => true,
90 90
                                         'data-allow-clear' => 'false',
91 91
                                         'options'          => array(
92
-                                            '1'  => __( 'every', 'invoicing' ),
93
-                                            '2'  => __( 'every 2nd', 'invoicing' ),
94
-                                            '3'  => __( 'every 3rd', 'invoicing' ),
95
-                                            '4'  => __( 'every 4th', 'invoicing' ),
96
-                                            '5'  => __( 'every 5th', 'invoicing' ),
97
-                                            '6'  => __( 'every 6th', 'invoicing' ),
98
-                                            '8'  => __( 'every 8th', 'invoicing' ),
99
-                                            '9'  => __( 'every 9th', 'invoicing' ),
100
-                                            '10' => __( 'every 10th', 'invoicing' ),
101
-                                            '11' => __( 'every 11th', 'invoicing' ),
102
-                                            '12' => __( 'every 12th', 'invoicing' ),
103
-                                            '13' => __( 'every 13th', 'invoicing' ),
104
-                                            '14' => __( 'every 14th', 'invoicing' ),
92
+                                            '1'  => __('every', 'invoicing'),
93
+                                            '2'  => __('every 2nd', 'invoicing'),
94
+                                            '3'  => __('every 3rd', 'invoicing'),
95
+                                            '4'  => __('every 4th', 'invoicing'),
96
+                                            '5'  => __('every 5th', 'invoicing'),
97
+                                            '6'  => __('every 6th', 'invoicing'),
98
+                                            '8'  => __('every 8th', 'invoicing'),
99
+                                            '9'  => __('every 9th', 'invoicing'),
100
+                                            '10' => __('every 10th', 'invoicing'),
101
+                                            '11' => __('every 11th', 'invoicing'),
102
+                                            '12' => __('every 12th', 'invoicing'),
103
+                                            '13' => __('every 13th', 'invoicing'),
104
+                                            '14' => __('every 14th', 'invoicing'),
105 105
                                         )
106 106
                                     )
107 107
                                 );
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
                                     array(
114 114
                                         'id'               => 'wpinv_recurring_period',
115 115
                                         'name'             => 'wpinv_recurring_period',
116
-                                        'label'            => __( 'Period', 'invoicing' ),
117
-                                        'placeholder'      => __( 'Select Period', 'invoicing' ),
118
-                                        'value'            => $item->get_recurring_period( 'edit' ),
116
+                                        'label'            => __('Period', 'invoicing'),
117
+                                        'placeholder'      => __('Select Period', 'invoicing'),
118
+                                        'value'            => $item->get_recurring_period('edit'),
119 119
                                         'select2'          => true,
120 120
                                         'data-allow-clear' => 'false',
121 121
                                         'options'     => array(
122
-                                            'D'  => __( 'day', 'invoicing' ),
123
-                                            'W'  => __( 'week', 'invoicing' ),
124
-                                            'M'  => __( 'month', 'invoicing' ),
125
-                                            'Y'  => __( 'year', 'invoicing' ),
122
+                                            'D'  => __('day', 'invoicing'),
123
+                                            'W'  => __('week', 'invoicing'),
124
+                                            'M'  => __('month', 'invoicing'),
125
+                                            'Y'  => __('year', 'invoicing'),
126 126
                                         )
127 127
                                     )
128 128
                                 );
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
                             <?php
135 135
 
136 136
                                 // Dynamic pricing.
137
-                                if( $item->supports_dynamic_pricing() ) {
137
+                                if ($item->supports_dynamic_pricing()) {
138 138
 
139
-                                    do_action( 'wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item );
139
+                                    do_action('wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item);
140 140
 
141 141
                                     // NYP toggle.
142 142
                                     echo aui()->input(
@@ -144,31 +144,31 @@  discard block
 block discarded – undo
144 144
                                             'id'          => 'wpinv_name_your_price',
145 145
                                             'name'        => 'wpinv_name_your_price',
146 146
                                             'type'        => 'checkbox',
147
-                                            'label'       => apply_filters( 'wpinv_name_your_price_toggle_text', __( 'Let customers name their price', 'invoicing' ) ),
147
+                                            'label'       => apply_filters('wpinv_name_your_price_toggle_text', __('Let customers name their price', 'invoicing')),
148 148
                                             'value'       => '1',
149 149
                                             'checked'     => $item->user_can_set_their_price(),
150 150
                                             'no_wrap'     => true,
151 151
                                         )
152 152
                                     );
153 153
 
154
-                                    do_action( 'wpinv_item_details_metabox_dynamic_pricing_checkbox', $item );
154
+                                    do_action('wpinv_item_details_metabox_dynamic_pricing_checkbox', $item);
155 155
 
156 156
                                 }
157 157
 
158 158
                                 // Subscriptions.
159
-                                do_action( 'wpinv_item_details_metabox_before_subscription_checkbox', $item );
159
+                                do_action('wpinv_item_details_metabox_before_subscription_checkbox', $item);
160 160
                                 echo aui()->input(
161 161
                                     array(
162 162
                                         'id'          => 'wpinv_is_recurring',
163 163
                                         'name'        => 'wpinv_is_recurring',
164 164
                                         'type'        => 'checkbox',
165
-                                        'label'       => apply_filters( 'wpinv_is_recurring_toggle_text', __( 'Charge customers a recurring amount for this item', 'invoicing' ) ),
165
+                                        'label'       => apply_filters('wpinv_is_recurring_toggle_text', __('Charge customers a recurring amount for this item', 'invoicing')),
166 166
                                         'value'       => '1',
167 167
                                         'checked'     => $item->is_recurring(),
168 168
                                         'no_wrap'     => true,
169 169
                                     )
170 170
                                 );
171
-                                do_action( 'wpinv_item_details_metabox_subscription_checkbox', $item );
171
+                                do_action('wpinv_item_details_metabox_subscription_checkbox', $item);
172 172
 
173 173
                             ?>
174 174
                             <div class="wpinv_show_if_recurring">
@@ -178,30 +178,30 @@  discard block
 block discarded – undo
178 178
                     </div>
179 179
                 </div>
180 180
                 <div class="col-sm-1 pt-2 pl-0">
181
-                    <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e( 'Set the subscription price, billing interval and period.', 'invoicing' ); ?>"></span>
181
+                    <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e('Set the subscription price, billing interval and period.', 'invoicing'); ?>"></span>
182 182
                 </div>
183 183
             </div>
184
-            <?php do_action( 'wpinv_item_details_metabox_after_price', $item ); ?>
184
+            <?php do_action('wpinv_item_details_metabox_after_price', $item); ?>
185 185
 
186
-            <?php if( $item->supports_dynamic_pricing() ) : ?>
187
-                <?php do_action( 'wpinv_item_details_metabox_before_minimum_price', $item ); ?>
186
+            <?php if ($item->supports_dynamic_pricing()) : ?>
187
+                <?php do_action('wpinv_item_details_metabox_before_minimum_price', $item); ?>
188 188
                 <div class="wpinv_show_if_dynamic wpinv_minimum_price">
189 189
 
190 190
                     <div class="form-group row">
191 191
                         <label for="wpinv_minimum_price" class="col-sm-3 col-form-label">
192
-                            <?php _e( 'Minimum Price', 'invoicing' );?>
192
+                            <?php _e('Minimum Price', 'invoicing'); ?>
193 193
                         </label>
194 194
                         <div class="col-sm-8">
195 195
                             <div class="input-group input-group-sm">
196
-                                <?php if( 'left' == $position ) : ?>
196
+                                <?php if ('left' == $position) : ?>
197 197
                                     <div class="input-group-prepend">
198 198
                                         <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
199 199
                                     </div>
200 200
                                 <?php endif; ?>
201 201
 
202
-                                <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr( $item->get_minimum_price( 'edit' ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control">
202
+                                <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr($item->get_minimum_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
203 203
 
204
-                                <?php if( 'left' != $position ) : ?>
204
+                                <?php if ('left' != $position) : ?>
205 205
                                     <div class="input-group-append">
206 206
                                         <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
207 207
                                     </div>
@@ -210,45 +210,45 @@  discard block
 block discarded – undo
210 210
                         </div>
211 211
 
212 212
                         <div class="col-sm-1 pt-2 pl-0">
213
-                            <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the minimum amount that users are allowed to set', 'invoicing' ); ?>"></span>
213
+                            <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the minimum amount that users are allowed to set', 'invoicing'); ?>"></span>
214 214
                         </div>
215 215
                     </div>
216 216
 
217 217
                 </div>
218
-                <?php do_action( 'wpinv_item_details_metabox_minimum_price', $item ); ?>
218
+                <?php do_action('wpinv_item_details_metabox_minimum_price', $item); ?>
219 219
             <?php endif; ?>
220 220
 
221
-            <?php do_action( 'wpinv_item_details_metabox_before_maximum_renewals', $item ); ?>
221
+            <?php do_action('wpinv_item_details_metabox_before_maximum_renewals', $item); ?>
222 222
             <div class="wpinv_show_if_recurring wpinv_maximum_renewals">
223 223
 
224 224
                 <div class="form-group row">
225 225
                     <label for="wpinv_recurring_limit" class="col-sm-3 col-form-label">
226
-                        <?php _e( 'Maximum Renewals', 'invoicing' );?>
226
+                        <?php _e('Maximum Renewals', 'invoicing'); ?>
227 227
                     </label>
228 228
                     <div class="col-sm-8">
229
-                        <input type="number" value="<?php echo esc_attr( $item->get_recurring_limit( 'edit' ) ); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" />
229
+                        <input type="number" value="<?php echo esc_attr($item->get_recurring_limit('edit')); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" />
230 230
                     </div>
231 231
                     <div class="col-sm-1 pt-2 pl-0">
232
-                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing' ); ?>"></span>
232
+                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing'); ?>"></span>
233 233
                     </div>
234 234
                 </div>
235 235
 
236 236
             </div>
237
-            <?php do_action( 'wpinv_item_details_metabox_maximum_renewals', $item ); ?>
237
+            <?php do_action('wpinv_item_details_metabox_maximum_renewals', $item); ?>
238 238
 
239
-            <?php do_action( 'wpinv_item_details_metabox_before_free_trial', $item ); ?>
239
+            <?php do_action('wpinv_item_details_metabox_before_free_trial', $item); ?>
240 240
             <div class="wpinv_show_if_recurring wpinv_free_trial">
241 241
 
242 242
                 <div class="form-group row">
243
-                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e( 'Free Trial', 'invoicing' )?></label>
243
+                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e('Free Trial', 'invoicing')?></label>
244 244
 
245 245
                     <div class="col-sm-8">
246 246
                         <div class="row">
247 247
                             <div class="col-sm-6">
248
-                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval( 'edit' ) : 0;?>
248
+                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval('edit') : 0; ?>
249 249
 
250 250
                                 <div>
251
-                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr( $value ); ?>" >
251
+                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr($value); ?>" >
252 252
                                 </div>
253 253
                             </div>
254 254
                             <div class="col-sm-6">
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
                                         array(
258 258
                                             'id'               => 'wpinv_trial_period',
259 259
                                             'name'             => 'wpinv_trial_period',
260
-                                            'label'            => __( 'Trial Period', 'invoicing' ),
261
-                                            'placeholder'      => __( 'Trial Period', 'invoicing' ),
262
-                                            'value'            => $item->get_trial_period( 'edit' ),
260
+                                            'label'            => __('Trial Period', 'invoicing'),
261
+                                            'placeholder'      => __('Trial Period', 'invoicing'),
262
+                                            'value'            => $item->get_trial_period('edit'),
263 263
                                             'select2'          => true,
264 264
                                             'data-allow-clear' => 'false',
265 265
                                             'no_wrap'          => true,
266 266
                                             'options'          => array(
267
-                                                'D'  => __( 'day(s)', 'invoicing' ),
268
-                                                'W'  => __( 'week(s)', 'invoicing' ),
269
-                                                'M'  => __( 'month(s)', 'invoicing' ),
270
-                                                'Y'  => __( 'year(s)', 'invoicing' ),
267
+                                                'D'  => __('day(s)', 'invoicing'),
268
+                                                'W'  => __('week(s)', 'invoicing'),
269
+                                                'M'  => __('month(s)', 'invoicing'),
270
+                                                'Y'  => __('year(s)', 'invoicing'),
271 271
                                             )
272 272
                                         )
273 273
                                     );
@@ -278,15 +278,15 @@  discard block
 block discarded – undo
278 278
                     </div>
279 279
 
280 280
                     <div class="col-sm-1 pt-2 pl-0">
281
-                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'An optional period of time to wait before charging the first recurring payment.', 'invoicing' ); ?>"></span>
281
+                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('An optional period of time to wait before charging the first recurring payment.', 'invoicing'); ?>"></span>
282 282
                     </div>
283 283
 
284 284
                 </div>
285 285
 
286 286
             </div>
287
-            <?php do_action( 'wpinv_item_details_metabox__free_trial', $item ); ?>
287
+            <?php do_action('wpinv_item_details_metabox__free_trial', $item); ?>
288 288
 
289
-            <?php do_action( 'wpinv_item_details_metabox_item_details', $item ); ?>
289
+            <?php do_action('wpinv_item_details_metabox_item_details', $item); ?>
290 290
         </div>
291 291
         <?php
292 292
 
@@ -297,31 +297,31 @@  discard block
 block discarded – undo
297 297
 	 *
298 298
 	 * @param int $post_id
299 299
 	 */
300
-	public static function save( $post_id ) {
300
+	public static function save($post_id) {
301 301
 
302 302
         // Prepare the item.
303
-        $item = new WPInv_Item( $post_id );
303
+        $item = new WPInv_Item($post_id);
304 304
 
305 305
         // Load new data.
306 306
         $item->set_props(
307 307
 			array(
308
-				'price'                => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null,
309
-				'vat_rule'             => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null,
310
-				'vat_class'            => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null,
311
-				'type'                 => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null,
312
-				'is_dynamic_pricing'   => isset( $_POST['wpinv_name_your_price'] ),
313
-                'minimum_price'        => isset( $_POST['wpinv_minimum_price'] ) ? (float) $_POST['wpinv_minimum_price'] : null,
314
-				'is_recurring'         => isset( $_POST['wpinv_is_recurring'] ),
315
-				'recurring_period'     => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null,
316
-				'recurring_interval'   => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null,
317
-				'recurring_limit'      => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null,
318
-				'is_free_trial'        => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null,
319
-				'trial_period'         => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null,
320
-				'trial_interval'       => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null,
308
+				'price'                => isset($_POST['wpinv_item_price']) ? (float) $_POST['wpinv_item_price'] : null,
309
+				'vat_rule'             => isset($_POST['wpinv_vat_rules']) ? wpinv_clean($_POST['wpinv_vat_rules']) : null,
310
+				'vat_class'            => isset($_POST['wpinv_vat_class']) ? wpinv_clean($_POST['wpinv_vat_class']) : null,
311
+				'type'                 => isset($_POST['wpinv_item_type']) ? wpinv_clean($_POST['wpinv_item_type']) : null,
312
+				'is_dynamic_pricing'   => isset($_POST['wpinv_name_your_price']),
313
+                'minimum_price'        => isset($_POST['wpinv_minimum_price']) ? (float) $_POST['wpinv_minimum_price'] : null,
314
+				'is_recurring'         => isset($_POST['wpinv_is_recurring']),
315
+				'recurring_period'     => isset($_POST['wpinv_recurring_period']) ? wpinv_clean($_POST['wpinv_recurring_period']) : null,
316
+				'recurring_interval'   => isset($_POST['wpinv_recurring_interval']) ? (int) $_POST['wpinv_recurring_interval'] : null,
317
+				'recurring_limit'      => isset($_POST['wpinv_recurring_limit']) ? (int) $_POST['wpinv_recurring_limit'] : null,
318
+				'is_free_trial'        => isset($_POST['wpinv_trial_interval']) ? (0 != (int) $_POST['wpinv_trial_interval']) : null,
319
+				'trial_period'         => isset($_POST['wpinv_trial_period']) ? wpinv_clean($_POST['wpinv_trial_period']) : null,
320
+				'trial_interval'       => isset($_POST['wpinv_trial_interval']) ? (int) $_POST['wpinv_trial_interval'] : null,
321 321
 			)
322 322
         );
323 323
 
324 324
 		$item->save();
325
-		do_action( 'getpaid_item_metabox_save', $post_id, $item );
325
+		do_action('getpaid_item_metabox_save', $post_id, $item);
326 326
 	}
327 327
 }
Please login to merge, or discard this patch.
templates/payment-forms/cart-totals.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  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
-		'fees'     => __( 'Fee', 'invoicing' ),
19
-		'discount' => __( 'Discount', 'invoicing' ),
20
-		'total'    => __( 'Total', 'invoicing' ),
16
+		'subtotal' => __('Subtotal', 'invoicing'),
17
+		'tax'      => __('Tax', 'invoicing'),
18
+		'fees'     => __('Fee', 'invoicing'),
19
+		'discount' => __('Discount', 'invoicing'),
20
+		'total'    => __('Total', 'invoicing'),
21 21
 	),
22 22
 	$form
23 23
 );
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 $currency = $form->get_currency();
26 26
 $country  = wpinv_get_default_country();
27 27
 
28
-if ( ! empty( $form->invoice ) ) {
29
-	$country  = $form->invoice->get_country();
28
+if (!empty($form->invoice)) {
29
+	$country = $form->invoice->get_country();
30 30
 }
31 31
 
32
-if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) {
33
-	unset( $totals['tax'] );
32
+if (!wpinv_use_taxes() && isset($totals['tax'])) {
33
+	unset($totals['tax']);
34 34
 }
35 35
 
36
-do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals );
36
+do_action('getpaid_before_payment_form_cart_totals', $form, $totals);
37 37
 
38 38
 ?>
39 39
 <style>
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
 	<div class="row">
48 48
 		<div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0">
49 49
 
50
-			<?php foreach ( $totals as $key => $label ) : ?>
50
+			<?php foreach ($totals as $key => $label) : ?>
51 51
 
52
-				<div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr( $key ); ?> font-weight-bold py-2 px-3 <?php echo 'total' == $key ? 'bg-light' : 'border-bottom' ?>">
52
+				<div class="getpaid-form-cart-totals-col getpaid-form-cart-totals-<?php echo esc_attr($key); ?> font-weight-bold py-2 px-3 <?php echo 'total' == $key ? 'bg-light' : 'border-bottom' ?>">
53 53
 
54 54
 					<div class="form-row">
55 55
 
56 56
 						<div class="col-8 pl-sm-0 getpaid-payment-form-line-totals-label">
57
-							<?php echo sanitize_text_field( $label ); ?>
57
+							<?php echo sanitize_text_field($label); ?>
58 58
 						</div>
59 59
 
60
-						<div class="col-4 getpaid-payment-form-line-totals-value getpaid-form-cart-totals-total-<?php echo esc_attr( $key ); ?>">
60
+						<div class="col-4 getpaid-payment-form-line-totals-value getpaid-form-cart-totals-total-<?php echo esc_attr($key); ?>">
61 61
 
62 62
 							<?php
63 63
 
64 64
 								// Total tax.
65
-								if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) {
66
-									echo wpinv_price( 0, $currency );
65
+								if (in_array($key, array('tax', 'discount', 'subtotal', 'total', 'fees'))) {
66
+									echo wpinv_price(0, $currency);
67 67
 								}
68 68
 
69
-								do_action( "getpaid_payment_form_cart_totals_$key", $form );
69
+								do_action("getpaid_payment_form_cart_totals_$key", $form);
70 70
 							?>
71 71
 
72 72
 						</div>
@@ -82,4 +82,4 @@  discard block
 block discarded – undo
82 82
 </div>
83 83
 
84 84
 <?php
85
-do_action(  'getpaid_payment_form_cart_totals', $form, $totals );
85
+do_action('getpaid_payment_form_cart_totals', $form, $totals);
Please login to merge, or discard this patch.
templates/payment-forms/cart.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  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
 // Cart table columns.
13 13
 $columns = array(
14
-    'name'     => __( 'Item', 'invoicing' ),
15
-    'price'    => __( 'Price', 'invoicing' ),
16
-    'quantity' => __( 'Quantity', 'invoicing' ),
17
-    'subtotal' => __( 'Subtotal', 'invoicing' ),
14
+    'name'     => __('Item', 'invoicing'),
15
+    'price'    => __('Price', 'invoicing'),
16
+    'quantity' => __('Quantity', 'invoicing'),
17
+    'subtotal' => __('Subtotal', 'invoicing'),
18 18
 );
19 19
 
20
-if ( ! empty( $form->invoice ) ) {
21
-    $columns = getpaid_invoice_item_columns( $form->invoice );
20
+if (!empty($form->invoice)) {
21
+    $columns = getpaid_invoice_item_columns($form->invoice);
22 22
 }
23 23
 
24
-$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form );
24
+$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form);
25 25
 
26
-do_action( 'getpaid_before_payment_form_cart', $form );
26
+do_action('getpaid_before_payment_form_cart', $form);
27 27
 
28 28
 ?>
29 29
     <div class="getpaid-payment-form-items-cart border form-group">
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 
32 32
         <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3">
33 33
             <div class="form-row">
34
-                <?php foreach ( $columns as $key => $label ) : ?>
35
-                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo sanitize_html_class( $key ); ?>">
36
-                        <?php echo sanitize_text_field( $label ); ?>
34
+                <?php foreach ($columns as $key => $label) : ?>
35
+                    <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo sanitize_html_class($key); ?>">
36
+                        <?php echo sanitize_text_field($label); ?>
37 37
                     </div>
38 38
                 <?php endforeach; ?>
39 39
             </div>
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
         <?php
43 43
 
44 44
             // Display the item totals.
45
-            foreach ( $form->get_items() as $item ) {
46
-                wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) );
45
+            foreach ($form->get_items() as $item) {
46
+                wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns'));
47 47
             }
48 48
 
49 49
             // Display the cart totals.
50
-            wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) );
50
+            wpinv_get_template('payment-forms/cart-totals.php', compact('form'));
51 51
 
52 52
         ?>
53 53
     </div>
54 54
 
55 55
 <?php 
56 56
 
57
-do_action( 'getpaid_after_payment_form_cart', $form );
57
+do_action('getpaid_after_payment_form_cart', $form);
Please login to merge, or discard this patch.
includes/class-wpinv-privacy.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Privacy/GDPR related functionality which ties into WordPress functionality.
4 4
  */
5 5
 
6
-defined( 'ABSPATH' ) || exit;
6
+defined('ABSPATH') || exit;
7 7
 
8 8
 /**
9 9
  * WPInv_Privacy Class.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $this->init();
27 27
 
28 28
         // This hook registers Invoicing data exporters.
29
-        $this->add_exporter( 'wpinv-customer-invoices', __( 'Customer Invoices', 'invoicing' ), array( 'WPInv_Privacy_Exporters', 'customer_invoice_data_exporter' ) );
29
+        $this->add_exporter('wpinv-customer-invoices', __('Customer Invoices', 'invoicing'), array('WPInv_Privacy_Exporters', 'customer_invoice_data_exporter'));
30 30
     }
31 31
 
32 32
     /**
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
     public function get_privacy_message() {
38 38
 
39 39
         $content = '<div class="wp-suggested-text">' .
40
-                   '<h2>' . __( 'Invoices and checkout', 'invoicing' ) . '</h2>' .
41
-                   '<p class="privacy-policy-tutorial">' . __( 'Example privacy texts.', 'invoicing' ) . '</p>' .
42
-                   '<p>' . __( 'We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing' ) . '</p>' .
43
-                   '<p>' . __( 'Handling this data also allows us to:', 'invoicing' ) . '</p>' .
40
+                   '<h2>' . __('Invoices and checkout', 'invoicing') . '</h2>' .
41
+                   '<p class="privacy-policy-tutorial">' . __('Example privacy texts.', 'invoicing') . '</p>' .
42
+                   '<p>' . __('We collect information about you during the checkout process on our site. This information may include, but is not limited to, your name, email address, phone number, address, IP and any other details that might be requested from you for the purpose of processing your payment and retaining your invoice details for legal reasons.', 'invoicing') . '</p>' .
43
+                   '<p>' . __('Handling this data also allows us to:', 'invoicing') . '</p>' .
44 44
                    '<ul>' .
45
-                   '<li>' . __( '- Send you important account/invoice/service information.', 'invoicing' ) . '</li>' .
46
-                   '<li>' . __( '- Estimate taxes based on your location.', 'invoicing' ) . '</li>' .
47
-                   '<li>' . __( '- Respond to your queries or complaints.', 'invoicing' ) . '</li>' .
48
-                   '<li>' . __( '- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' .
49
-                   '<li>' . __( '- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing' ) . '</li>' .
50
-                   '<li>' . __( '- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing' ) . '</li>' .
45
+                   '<li>' . __('- Send you important account/invoice/service information.', 'invoicing') . '</li>' .
46
+                   '<li>' . __('- Estimate taxes based on your location.', 'invoicing') . '</li>' .
47
+                   '<li>' . __('- Respond to your queries or complaints.', 'invoicing') . '</li>' .
48
+                   '<li>' . __('- Process payments and to prevent fraudulent transactions. We do this on the basis of our legitimate business interests.', 'invoicing') . '</li>' .
49
+                   '<li>' . __('- Retain historical payment and invoice history. We do this on the basis of legal obligations.', 'invoicing') . '</li>' .
50
+                   '<li>' . __('- Set up and administer your account, provide technical and/or customer support, and to verify your identity. We do this on the basis of our legitimate business interests.', 'invoicing') . '</li>' .
51 51
                    '</ul>' .
52
-                   '<p>' . __( 'In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing' ) . '</p>' .
53
-                   '<h2>' . __( 'What we share with others', 'invoicing' ) . '</h2>' .
54
-                   '<p>' . __( 'We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing' ) . '</p>' .
55
-                   '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing' ) . '</p>' .
56
-                   '<p>' . __( 'We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing' ) . '</p>' .
57
-                   '<p>' . __( 'Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing' ) . '</p>' .
52
+                   '<p>' . __('In addition to collecting information at checkout we may also use and store your contact details when manually creating invoices for require payments relating to prior contractual agreements or agreed terms.', 'invoicing') . '</p>' .
53
+                   '<h2>' . __('What we share with others', 'invoicing') . '</h2>' .
54
+                   '<p>' . __('We share information with third parties who help us provide our payment and invoicing services to you; for example --', 'invoicing') . '</p>' .
55
+                   '<p class="privacy-policy-tutorial">' . __('In this subsection you should list which third party payment processors you’re using to take payments since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal.', 'invoicing') . '</p>' .
56
+                   '<p>' . __('We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information.', 'invoicing') . '</p>' .
57
+                   '<p>' . __('Please see the <a href="https://www.paypal.com/us/webapps/mpp/ua/privacy-full">PayPal Privacy Policy</a> for more details.', 'invoicing') . '</p>' .
58 58
                    '</div>';
59 59
 
60
-        return apply_filters( 'wpinv_privacy_policy_content', $content );
60
+        return apply_filters('wpinv_privacy_policy_content', $content);
61 61
     }
62 62
 
63 63
 }
Please login to merge, or discard this patch.
includes/class-wpinv-privacy-exporters.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Personal data exporters.
4 4
  */
5 5
 
6
-defined( 'ABSPATH' ) || exit;
6
+defined('ABSPATH') || exit;
7 7
 
8 8
 /**
9 9
  * WPInv_Privacy_Exporters Class.
@@ -17,39 +17,39 @@  discard block
 block discarded – undo
17 17
      * @param int    $page  Page.
18 18
      * @return array An array of invoice data in name value pairs
19 19
      */
20
-    public static function customer_invoice_data_exporter( $email_address, $page ) {
20
+    public static function customer_invoice_data_exporter($email_address, $page) {
21 21
         $done           = false;
22 22
         $page           = (int) $page;
23 23
         $data_to_export = array();
24 24
 
25
-        $user           = get_user_by( 'email', $email_address );
26
-        if ( ! $user instanceof WP_User ) {
25
+        $user           = get_user_by('email', $email_address);
26
+        if (!$user instanceof WP_User) {
27 27
             return array(
28 28
                 'data' => $data_to_export,
29 29
                 'done' => true,
30 30
             );
31 31
         }
32 32
 
33
-        $args    = array(
34
-            'limit'    => get_option( 'posts_per_page' ),
33
+        $args = array(
34
+            'limit'    => get_option('posts_per_page'),
35 35
             'page'     => $page,
36 36
             'user'     => $user->ID,
37 37
             'paginate' => false,
38 38
         );
39 39
 
40
-        $invoices = wpinv_get_invoices( $args );
40
+        $invoices = wpinv_get_invoices($args);
41 41
 
42
-        if ( 0 < count( $invoices ) ) {
43
-            foreach ( $invoices as $invoice ) {
42
+        if (0 < count($invoices)) {
43
+            foreach ($invoices as $invoice) {
44 44
                 $data_to_export[] = array(
45 45
                     'group_id'          => 'customer_invoices',
46
-                    'group_label'       => __( 'GetPaid: Invoices', 'invoicing' ),
47
-                    'group_description' => __( 'Customer invoices.', 'invoicing' ),
46
+                    'group_label'       => __('GetPaid: Invoices', 'invoicing'),
47
+                    'group_description' => __('Customer invoices.', 'invoicing'),
48 48
                     'item_id'           => "wpinv-{$invoice->get_id()}",
49
-                    'data'              => self::get_customer_invoice_data( $invoice ),
49
+                    'data'              => self::get_customer_invoice_data($invoice),
50 50
                 );
51 51
             }
52
-            $done = get_option( 'posts_per_page' ) > count( $invoices );
52
+            $done = get_option('posts_per_page') > count($invoices);
53 53
         } else {
54 54
             $done = true;
55 55
         }
@@ -67,116 +67,116 @@  discard block
 block discarded – undo
67 67
      * @param WPInv_Invoice $invoice invoice object.
68 68
      * @return array
69 69
      */
70
-    public static function get_customer_invoice_data( $invoice ) {
70
+    public static function get_customer_invoice_data($invoice) {
71 71
 
72 72
         // Prepare basic properties.
73 73
         $props_to_export = array(
74 74
             'number'               => array(
75
-                'name' => __( 'Invoice Number', 'invoicing' ),
75
+                'name' => __('Invoice Number', 'invoicing'),
76 76
                 'value' => $invoice->get_number(),
77 77
             ),
78 78
             'created_date'         => array(
79
-                'name' => __( 'Created Date', 'invoicing' ),
79
+                'name' => __('Created Date', 'invoicing'),
80 80
                 'value' => $invoice->get_date_created(),
81 81
             ),
82 82
             'due_date'         => array(
83
-                'name' => __( 'Due Date', 'invoicing' ),
83
+                'name' => __('Due Date', 'invoicing'),
84 84
                 'value' => $invoice->get_due_date(),
85 85
             ),
86 86
             'items'                => array(
87
-                'name' => __( 'Invoice Items', 'invoicing' ),
88
-                'value' => self::process_invoice_items( $invoice ),
87
+                'name' => __('Invoice Items', 'invoicing'),
88
+                'value' => self::process_invoice_items($invoice),
89 89
             ),
90 90
             'discount'                => array(
91
-                'name' => __( 'Invoice Discount', 'invoicing' ),
92
-                'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ),
91
+                'name' => __('Invoice Discount', 'invoicing'),
92
+                'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()),
93 93
             ),
94 94
             'total'                => array(
95
-                'name' => __( 'Invoice Total', 'invoicing' ),
96
-                'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ),
95
+                'name' => __('Invoice Total', 'invoicing'),
96
+                'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()),
97 97
             ),
98 98
             'status'               => array(
99
-                'name' => __( 'Invoice Status', 'invoicing' ),
99
+                'name' => __('Invoice Status', 'invoicing'),
100 100
                 'value' => $invoice->get_status_nicename(),
101 101
             ),
102 102
             'first_name'           => array(
103
-                'name' => __( 'First Name', 'invoicing' ),
103
+                'name' => __('First Name', 'invoicing'),
104 104
                 'value' => $invoice->get_first_name(),
105 105
             ),
106 106
             'last_name'           => array(
107
-                'name' => __( 'Last Name', 'invoicing' ),
107
+                'name' => __('Last Name', 'invoicing'),
108 108
                 'value' => $invoice->get_last_name(),
109 109
             ),
110 110
             'email'           => array(
111
-                'name' => __( 'Email Address', 'invoicing' ),
111
+                'name' => __('Email Address', 'invoicing'),
112 112
                 'value' => $invoice->get_email(),
113 113
             ),
114 114
             'company'           => array(
115
-                'name' => __( 'Company', 'invoicing' ),
115
+                'name' => __('Company', 'invoicing'),
116 116
                 'value' => $invoice->get_company(),
117 117
             ),
118 118
             'phone'           => array(
119
-                'name' => __( 'Phone Number', 'invoicing' ),
119
+                'name' => __('Phone Number', 'invoicing'),
120 120
                 'value' => $invoice->get_phone(),
121 121
             ),
122 122
             'address'           => array(
123
-                'name' => __( 'Address', 'invoicing' ),
123
+                'name' => __('Address', 'invoicing'),
124 124
                 'value' => $invoice->get_address(),
125 125
             ),
126 126
             'city'           => array(
127
-                'name' => __( 'City', 'invoicing' ),
127
+                'name' => __('City', 'invoicing'),
128 128
                 'value' => $invoice->get_city(),
129 129
             ),
130 130
             'state'           => array(
131
-                'name' => __( 'State', 'invoicing' ),
131
+                'name' => __('State', 'invoicing'),
132 132
                 'value' => $invoice->get_state(),
133 133
             ),
134 134
             'zip'           => array(
135
-                'name' => __( 'Zip', 'invoicing' ),
135
+                'name' => __('Zip', 'invoicing'),
136 136
                 'value' => $invoice->get_zip(),
137 137
             ),
138 138
             'vat_number'    => array(
139
-                'name' => __( 'VAT Number', 'invoicing' ),
139
+                'name' => __('VAT Number', 'invoicing'),
140 140
                 'value' => $invoice->get_vat_number(),
141 141
             ),
142 142
             'description'   => array(
143
-                'name' => __( 'Description', 'invoicing' ),
143
+                'name' => __('Description', 'invoicing'),
144 144
                 'value' => $invoice->get_description(),
145 145
             ), 
146 146
         );
147 147
 
148 148
         // In case the invoice is paid, add the payment date and gateway.
149
-        if ( $invoice->is_paid() ) {
149
+        if ($invoice->is_paid()) {
150 150
 
151 151
             $props_to_export['completed_date'] = array(
152
-                'name' => __( 'Completed Date', 'invoicing' ),
152
+                'name' => __('Completed Date', 'invoicing'),
153 153
                 'value' => $invoice->get_completed_date(),
154 154
             );
155 155
 
156 156
             $props_to_export['gateway'] = array(
157
-                'name' => __( 'Paid Via', 'invoicing' ),
157
+                'name' => __('Paid Via', 'invoicing'),
158 158
                 'value' => $invoice->get_gateway(),
159 159
             );
160 160
 
161 161
         }
162 162
 
163 163
         // Maybe add subscription details.
164
-        $props_to_export = self::process_subscription( $invoice, $props_to_export );
164
+        $props_to_export = self::process_subscription($invoice, $props_to_export);
165 165
 
166 166
         // Add the ip address.
167 167
         $props_to_export['ip'] = array(
168
-            'name' => __( 'IP Address', 'invoicing' ),
168
+            'name' => __('IP Address', 'invoicing'),
169 169
             'value' => $invoice->get_ip(),
170 170
         );
171 171
 
172 172
         // Add the invoice url.
173 173
         $props_to_export['view_url'] = array(
174
-            'name' => __( 'Invoice URL', 'invoicing' ),
174
+            'name' => __('Invoice URL', 'invoicing'),
175 175
             'value' => $invoice->get_view_url(),
176 176
         );
177 177
 
178 178
         // Return the values.
179
-        return apply_filters( 'getpaid_privacy_export_invoice_personal_data', array_values( $props_to_export ), $invoice );
179
+        return apply_filters('getpaid_privacy_export_invoice_personal_data', array_values($props_to_export), $invoice);
180 180
 
181 181
     }
182 182
 
@@ -188,40 +188,40 @@  discard block
 block discarded – undo
188 188
      * @param array $props invoice props.
189 189
      * @return array
190 190
      */
191
-    public static function process_subscription( $invoice, $props ) {
191
+    public static function process_subscription($invoice, $props) {
192 192
 
193
-        $subscription = wpinv_get_subscription( $invoice );
194
-        if ( ! empty( $subscription ) ) {
193
+        $subscription = wpinv_get_subscription($invoice);
194
+        if (!empty($subscription)) {
195 195
 
196
-            $frequency    = getpaid_get_subscription_period_label( $subscription->get_period(),$subscription->get_frequency() );
197
-            $period       = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ) . ' / ' . $frequency;
198
-            $initial_amt  = wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() );
199
-            $bill_times   = $subscription->get_times_billed() . ' / ' . ( ( $subscription->get_bill_times() == 0 ) ? __( 'Until Cancelled', 'invoicing' ) : $subscription->get_bill_times() );
200
-            $renewal_date = getpaid_format_date_value( $subscription->get_expiration() );
196
+            $frequency    = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency());
197
+            $period       = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()) . ' / ' . $frequency;
198
+            $initial_amt  = wpinv_price($subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency());
199
+            $bill_times   = $subscription->get_times_billed() . ' / ' . (($subscription->get_bill_times() == 0) ? __('Until Cancelled', 'invoicing') : $subscription->get_bill_times());
200
+            $renewal_date = getpaid_format_date_value($subscription->get_expiration());
201 201
 
202 202
             // Billing cycle.
203 203
             $props['period'] = array(
204
-                'name' => __( 'Billing Cycle', 'invoicing' ),
204
+                'name' => __('Billing Cycle', 'invoicing'),
205 205
                 'value' => $period,
206 206
             );
207 207
 
208 208
             // Initial amount.
209 209
             $props['initial_amount'] = array(
210
-                'name' => __( 'Initial Amount', 'invoicing' ),
210
+                'name' => __('Initial Amount', 'invoicing'),
211 211
                 'value' => $initial_amt,
212 212
             );
213 213
 
214 214
             // Bill times.
215 215
             $props['bill_times'] = array(
216
-                'name' => __( 'Times Billed', 'invoicing' ),
216
+                'name' => __('Times Billed', 'invoicing'),
217 217
                 'value' => $bill_times,
218 218
             );
219 219
 
220 220
             // Add expiry date.
221
-            if ( $subscription->is_active() ) {
221
+            if ($subscription->is_active()) {
222 222
 
223 223
                 $props['renewal_date'] = array(
224
-                    'name' => __( 'Expires', 'invoicing' ),
224
+                    'name' => __('Expires', 'invoicing'),
225 225
                     'value' => $renewal_date,
226 226
                 );
227 227
 
@@ -240,19 +240,19 @@  discard block
 block discarded – undo
240 240
      * @param WPInv_Invoice $invoice invoice object.
241 241
      * @return array
242 242
      */
243
-    public static function process_invoice_items( $invoice ) {
243
+    public static function process_invoice_items($invoice) {
244 244
 
245 245
         $item_names = array();
246
-        foreach ( $invoice->get_items() as $cart_item ) {
246
+        foreach ($invoice->get_items() as $cart_item) {
247 247
             $item_names[] = sprintf(
248 248
                 '%s x %s - %s',
249 249
                 $cart_item->get_name(),
250 250
                 $cart_item->get_quantity(),
251
-                wpinv_price( $invoice->is_renewal() ? $cart_item->get_recurring_sub_total() : $cart_item->get_sub_total(), $invoice->get_currency() )
251
+                wpinv_price($invoice->is_renewal() ? $cart_item->get_recurring_sub_total() : $cart_item->get_sub_total(), $invoice->get_currency())
252 252
             );
253 253
         }
254 254
 
255
-        return implode( ', ', $item_names );
255
+        return implode(', ', $item_names);
256 256
 
257 257
     }
258 258
 
Please login to merge, or discard this patch.
templates/wpinv-invalid-access.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  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
 // Fetch the invoice.
13
-if ( empty( $invoice ) ) {
14
-    $invoice = new WPInv_Invoice( $GLOBALS['post'] );
13
+if (empty($invoice)) {
14
+    $invoice = new WPInv_Invoice($GLOBALS['post']);
15 15
 }
16 16
 
17 17
 ?><!DOCTYPE html>
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 
22 22
     <head>
23 23
 
24
-		<meta charset="<?php bloginfo( 'charset' ); ?>">
24
+		<meta charset="<?php bloginfo('charset'); ?>">
25 25
         <meta name="viewport" content="width=device-width, initial-scale=1.0" >
26 26
 
27 27
         <meta name="robots" content="noindex,nofollow">
28 28
 
29 29
 		<link rel="profile" href="https://gmpg.org/xfn/11">
30 30
 
31
-        <title><?php _e( 'Invalid Access', 'invoicing' ); ?></title>
31
+        <title><?php _e('Invalid Access', 'invoicing'); ?></title>
32 32
 
33
-        <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?>
33
+        <?php do_action('wpinv_invoice_print_head', $invoice); ?>
34 34
 
35 35
     </head>
36 36
 
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 
40 40
         <?php
41 41
 
42
-            if ( ! $invoice->exists() || $invoice->is_draft() ) {
43
-                $error = __( 'This invoice was deleted or is not visible.', 'invoicing' );
42
+            if (!$invoice->exists() || $invoice->is_draft()) {
43
+                $error = __('This invoice was deleted or is not visible.', 'invoicing');
44 44
             } else {
45 45
 
46 46
                 $user_id = get_current_user_id();
47
-                if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) {
48
-                    $error  = __( 'You must be logged in to view this invoice.', 'invoicing' );
47
+                if (wpinv_require_login_to_checkout() && empty($user_id)) {
48
+                    $error  = __('You must be logged in to view this invoice.', 'invoicing');
49 49
                     $error .= sprintf(
50 50
                         ' <a href="%s">%s</a>',
51
-                        wp_login_url( $invoice->get_view_url() ),
52
-                        __( 'Login.', 'invoicing' )
51
+                        wp_login_url($invoice->get_view_url()),
52
+                        __('Login.', 'invoicing')
53 53
                     );
54 54
                 } else {
55
-                    $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' );
55
+                    $error = __('This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing');
56 56
                 }
57 57
 
58 58
             }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         <div class="container">
63 63
             <div class="alert alert-danger m-5" role="alert">
64
-                <h4 class="alert-heading"><?php _e( 'Access Denied', 'invoicing' ); ?></h4>
64
+                <h4 class="alert-heading"><?php _e('Access Denied', 'invoicing'); ?></h4>
65 65
                 <p><?php echo $error; ?></p>
66 66
             </div>
67 67
         </div>
Please login to merge, or discard this patch.
includes/payments/class-getpaid-payment-form-submission-fees.php 1 patch
Spacing   +24 added lines, -24 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
  * Payment form submission fees class
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param GetPaid_Payment_Form_Submission $submission
31 31
 	 */
32
-	public function __construct( $submission ) {
32
+	public function __construct($submission) {
33 33
 
34 34
 		// Process any existing invoice fees.
35
-		if ( $submission->has_invoice() ) {
35
+		if ($submission->has_invoice()) {
36 36
 			$this->fees = $submission->get_invoice()->get_fees();
37 37
 		}
38 38
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 		$data         = $submission->get_data();
41 41
 		$payment_form = $submission->get_payment_form();
42 42
 
43
-		foreach ( $payment_form->get_elements() as $element ) {
43
+		foreach ($payment_form->get_elements() as $element) {
44 44
 
45
-			if ( 'price_input' == $element['type'] ) {
46
-				$this->process_price_input( $element, $data, $submission );
45
+			if ('price_input' == $element['type']) {
46
+				$this->process_price_input($element, $data, $submission);
47 47
 			}
48 48
 
49
-			if ( 'price_select' == $element['type'] ) {
50
-				$this->process_price_select( $element, $data );
49
+			if ('price_select' == $element['type']) {
50
+				$this->process_price_select($element, $data);
51 51
 			}
52 52
 
53 53
 		}
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 	 * @param array $data
62 62
 	 * @param GetPaid_Payment_Form_Submission $submission
63 63
 	 */
64
-	public function process_price_input( $element, $data, $submission ) {
64
+	public function process_price_input($element, $data, $submission) {
65 65
 
66 66
 		// Abort if not passed.
67
-		if ( empty( $data[ $element['id'] ] ) ) {
67
+		if (empty($data[$element['id']])) {
68 68
 			return;
69 69
 		}
70 70
 
71
-		$amount  = (float) wpinv_sanitize_amount( $data[ $element['id'] ] );
72
-		$minimum = empty( $element['minimum'] ) ? 0 : (float) wpinv_sanitize_amount( $element['minimum'] );
71
+		$amount  = (float) wpinv_sanitize_amount($data[$element['id']]);
72
+		$minimum = empty($element['minimum']) ? 0 : (float) wpinv_sanitize_amount($element['minimum']);
73 73
 
74
-		if ( $amount < $minimum ) {
75
-			throw new Exception( sprintf( __( 'The minimum allowed amount is %s', 'invoicing' ), wpinv_price( $minimum, $submission->get_currency() ) ) );
74
+		if ($amount < $minimum) {
75
+			throw new Exception(sprintf(__('The minimum allowed amount is %s', 'invoicing'), wpinv_price($minimum, $submission->get_currency())));
76 76
 		}
77 77
 
78
-		$this->fees[ $element['label'] ] = array(
78
+		$this->fees[$element['label']] = array(
79 79
 			'name'          => $element['label'],
80 80
 			'initial_fee'   => $amount,
81 81
 			'recurring_fee' => 0,
@@ -89,27 +89,27 @@  discard block
 block discarded – undo
89 89
 	 * @param array $element
90 90
 	 * @param array $data
91 91
 	 */
92
-	public function process_price_select( $element, $data ) {
92
+	public function process_price_select($element, $data) {
93 93
 
94 94
 		// Abort if not passed.
95
-		if ( empty( $data[ $element['id'] ] ) ) {
95
+		if (empty($data[$element['id']])) {
96 96
 			return;
97 97
 		}
98 98
 
99
-		$options  = getpaid_convert_price_string_to_options( $element['options'] );
100
-		$selected = wpinv_parse_list( $data[ $element['id'] ] );
99
+		$options  = getpaid_convert_price_string_to_options($element['options']);
100
+		$selected = wpinv_parse_list($data[$element['id']]);
101 101
 		$total    = 0;
102 102
 
103
-		foreach ( $selected as $price ) {
103
+		foreach ($selected as $price) {
104 104
 
105
-			if ( ! isset( $options[ $price ] ) ) {
106
-				throw new Exception( __( 'You have selected an invalid amount', 'invoicing' ) );
105
+			if (!isset($options[$price])) {
106
+				throw new Exception(__('You have selected an invalid amount', 'invoicing'));
107 107
 			}
108 108
 
109
-			$total += (float) wpinv_sanitize_amount( $price );
109
+			$total += (float) wpinv_sanitize_amount($price);
110 110
 		}
111 111
 
112
-		$this->fees[ $element['label'] ] = array(
112
+		$this->fees[$element['label']] = array(
113 113
 			'name'          => $element['label'],
114 114
 			'initial_fee'   => $total,
115 115
 			'recurring_fee' => 0,
Please login to merge, or discard this patch.