@@ -1,34 +1,34 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // MUST have WordPress. |
3 | -if ( !defined( 'WPINC' ) ) { |
|
4 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
3 | +if (!defined('WPINC')) { |
|
4 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | class WPInv_Meta_Box_Billing_Details { |
8 | - public static function output( $post ) { |
|
8 | + public static function output($post) { |
|
9 | 9 | global $user_ID; |
10 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
11 | - $invoice = new WPInv_Invoice( $post_id ); |
|
10 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
11 | + $invoice = new WPInv_Invoice($post_id); |
|
12 | 12 | ?> |
13 | 13 | <div class="gdmbx2-wrap form-table"> |
14 | 14 | <div id="gdmbx2-metabox-wpinv_address" class="gdmbx2-metabox gdmbx-field-list wpinv-address gdmbx-row"> |
15 | 15 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-user-id table-layout"> |
16 | 16 | <div class="gdmbx-th"> |
17 | - <label for="post_author_override"><?php _e( 'Customer', 'invoicing' );?></label> |
|
17 | + <label for="post_author_override"><?php _e('Customer', 'invoicing'); ?></label> |
|
18 | 18 | </div> |
19 | 19 | <div class="gdmbx-td gdmbx-customer-div"> |
20 | - <?php wpinv_dropdown_users( array( |
|
20 | + <?php wpinv_dropdown_users(array( |
|
21 | 21 | 'name' => 'post_author_override', |
22 | 22 | 'selected' => empty($post->ID) ? $user_ID : $post->post_author, |
23 | 23 | 'include_selected' => true, |
24 | 24 | 'show' => 'user_email', |
25 | 25 | 'orderby' => 'user_email', |
26 | 26 | 'class' => 'gdmbx2-text-large' |
27 | - ) ); ?> |
|
27 | + )); ?> |
|
28 | 28 | </div> |
29 | 29 | </div> |
30 | 30 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-email table-layout" style="display:none"> |
31 | - <div class="gdmbx-th"><label for="wpinv_email"><?php _e( 'Email', 'invoicing' );?> <span class="required">*</span></label> |
|
31 | + <div class="gdmbx-th"><label for="wpinv_email"><?php _e('Email', 'invoicing'); ?> <span class="required">*</span></label> |
|
32 | 32 | </div> |
33 | 33 | <div class="gdmbx-td"> |
34 | 34 | <input type="hidden" id="wpinv_new_user" name="wpinv_new_user" value="" /> |
@@ -36,58 +36,58 @@ discard block |
||
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-btns table-layout"> |
39 | - <div class="gdmbx-th"><label><?php _e( 'Actions', 'invoicing' );?></label> |
|
39 | + <div class="gdmbx-th"><label><?php _e('Actions', 'invoicing'); ?></label> |
|
40 | 40 | </div> |
41 | - <?php if($invoice->has_status(array('auto-draft', 'wpi-pending', 'wpi-quote-pending'))){ ?> |
|
41 | + <?php if ($invoice->has_status(array('auto-draft', 'wpi-pending', 'wpi-quote-pending'))) { ?> |
|
42 | 42 | <div class="gdmbx-td"> |
43 | - <a id="wpinv-fill-user-details" class="button button-small button-secondary" title="<?php esc_attr_e( 'Fill User Details', 'invoicing' );?>" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-refresh"></i><?php _e( 'Fill User Details', 'invoicing' );?></a> |
|
44 | - <a class="wpinv-new-user button button-small button-secondary" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-plus"></i><?php _e( 'Add New User', 'invoicing' );?></a> |
|
45 | - <a style="display:none" class="wpinv-new-cancel button button-small button-secondary" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-close"></i><?php _e( 'Cancel', 'invoicing' );?> </a> |
|
43 | + <a id="wpinv-fill-user-details" class="button button-small button-secondary" title="<?php esc_attr_e('Fill User Details', 'invoicing'); ?>" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-refresh"></i><?php _e('Fill User Details', 'invoicing'); ?></a> |
|
44 | + <a class="wpinv-new-user button button-small button-secondary" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-plus"></i><?php _e('Add New User', 'invoicing'); ?></a> |
|
45 | + <a style="display:none" class="wpinv-new-cancel button button-small button-secondary" href="javascript:void(0)"><i aria-hidden="true" class="fa fa-close"></i><?php _e('Cancel', 'invoicing'); ?> </a> |
|
46 | 46 | </div> |
47 | 47 | <?php } ?> |
48 | 48 | </div> |
49 | 49 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-first-name table-layout"> |
50 | - <div class="gdmbx-th"><label for="wpinv_first_name"><?php _e( 'First Name', 'invoicing' );?></label></div> |
|
50 | + <div class="gdmbx-th"><label for="wpinv_first_name"><?php _e('First Name', 'invoicing'); ?></label></div> |
|
51 | 51 | <div class="gdmbx-td"> |
52 | - <input type="text" class="gdmbx2-text-large" name="wpinv_first_name" id="wpinv_first_name" value="<?php echo esc_attr( $invoice->first_name );?>" /> |
|
52 | + <input type="text" class="gdmbx2-text-large" name="wpinv_first_name" id="wpinv_first_name" value="<?php echo esc_attr($invoice->first_name); ?>" /> |
|
53 | 53 | </div> |
54 | 54 | </div> |
55 | 55 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-last-name table-layout"> |
56 | - <div class="gdmbx-th"><label for="wpinv_last_name"><?php _e( 'Last Name', 'invoicing' );?></label></div> |
|
56 | + <div class="gdmbx-th"><label for="wpinv_last_name"><?php _e('Last Name', 'invoicing'); ?></label></div> |
|
57 | 57 | <div class="gdmbx-td"> |
58 | - <input type="text" class="gdmbx2-text-large" name="wpinv_last_name" id="wpinv_last_name" value="<?php echo esc_attr( $invoice->last_name );?>" /> |
|
58 | + <input type="text" class="gdmbx2-text-large" name="wpinv_last_name" id="wpinv_last_name" value="<?php echo esc_attr($invoice->last_name); ?>" /> |
|
59 | 59 | </div> |
60 | 60 | </div> |
61 | 61 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-company table-layout"> |
62 | - <div class="gdmbx-th"><label for="wpinv_company"><?php _e( 'Company', 'invoicing' );?></label></div> |
|
62 | + <div class="gdmbx-th"><label for="wpinv_company"><?php _e('Company', 'invoicing'); ?></label></div> |
|
63 | 63 | <div class="gdmbx-td"> |
64 | - <input type="text" class="gdmbx2-text-large" name="wpinv_company" id="wpinv_company" value="<?php echo esc_attr( $invoice->company );?>" /> |
|
64 | + <input type="text" class="gdmbx2-text-large" name="wpinv_company" id="wpinv_company" value="<?php echo esc_attr($invoice->company); ?>" /> |
|
65 | 65 | </div> |
66 | 66 | </div> |
67 | 67 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-vat-number table-layout"> |
68 | - <div class="gdmbx-th"><label for="wpinv_vat_number"><?php _e( 'Vat Number', 'invoicing' );?></label></div> |
|
68 | + <div class="gdmbx-th"><label for="wpinv_vat_number"><?php _e('Vat Number', 'invoicing'); ?></label></div> |
|
69 | 69 | <div class="gdmbx-td"> |
70 | - <input type="text" class="gdmbx2-text-large" name="wpinv_vat_number" id="wpinv_vat_number" value="<?php echo esc_attr( $invoice->vat_number );?>" /> |
|
70 | + <input type="text" class="gdmbx2-text-large" name="wpinv_vat_number" id="wpinv_vat_number" value="<?php echo esc_attr($invoice->vat_number); ?>" /> |
|
71 | 71 | </div> |
72 | 72 | </div> |
73 | 73 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-address table-layout"> |
74 | - <div class="gdmbx-th"><label for="wpinv_address"><?php _e( 'Address', 'invoicing' );?></label></div> |
|
74 | + <div class="gdmbx-th"><label for="wpinv_address"><?php _e('Address', 'invoicing'); ?></label></div> |
|
75 | 75 | <div class="gdmbx-td"> |
76 | - <input type="text" class="gdmbx2-text-large" name="wpinv_address" id="wpinv_address" value="<?php echo esc_attr( $invoice->address );?>" /> |
|
76 | + <input type="text" class="gdmbx2-text-large" name="wpinv_address" id="wpinv_address" value="<?php echo esc_attr($invoice->address); ?>" /> |
|
77 | 77 | </div> |
78 | 78 | </div> |
79 | 79 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-city table-layout"> |
80 | - <div class="gdmbx-th"><label for="wpinv_city"><?php _e( 'City', 'invoicing' );?></label></div> |
|
80 | + <div class="gdmbx-th"><label for="wpinv_city"><?php _e('City', 'invoicing'); ?></label></div> |
|
81 | 81 | <div class="gdmbx-td"> |
82 | - <input type="text" class="gdmbx2-text-large" name="wpinv_city" id="wpinv_city" value="<?php echo esc_attr( $invoice->city );?>" /> |
|
82 | + <input type="text" class="gdmbx2-text-large" name="wpinv_city" id="wpinv_city" value="<?php echo esc_attr($invoice->city); ?>" /> |
|
83 | 83 | </div> |
84 | 84 | </div> |
85 | 85 | <div class="gdmbx-row gdmbx-type-select gdmbx-wpinv-country table-layout"> |
86 | - <div class="gdmbx-th"><label for="wpinv_country"><?php _e( 'Country', 'invoicing' );?> <span class="wpi-loader"><i class="fa fa-refresh fa-spin"></i></span></label></div> |
|
86 | + <div class="gdmbx-th"><label for="wpinv_country"><?php _e('Country', 'invoicing'); ?> <span class="wpi-loader"><i class="fa fa-refresh fa-spin"></i></span></label></div> |
|
87 | 87 | <div class="gdmbx-td"> |
88 | 88 | <?php |
89 | - echo wpinv_html_select( array( |
|
90 | - 'options' => array_merge( array( '' => __( 'Choose a country', 'invoicing' ) ), wpinv_get_country_list() ), |
|
89 | + echo wpinv_html_select(array( |
|
90 | + 'options' => array_merge(array('' => __('Choose a country', 'invoicing')), wpinv_get_country_list()), |
|
91 | 91 | 'name' => 'wpinv_country', |
92 | 92 | 'id' => 'wpinv_country', |
93 | 93 | 'selected' => $invoice->country, |
@@ -95,20 +95,20 @@ discard block |
||
95 | 95 | 'show_option_none' => false, |
96 | 96 | 'class' => 'gdmbx2-text-large', |
97 | 97 | 'chosen' => false, |
98 | - 'placeholder' => __( 'Choose a country', 'invoicing' ), |
|
98 | + 'placeholder' => __('Choose a country', 'invoicing'), |
|
99 | 99 | 'required' => false, |
100 | - ) ); |
|
100 | + )); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | </div> |
104 | 104 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-state table-layout"> |
105 | - <div class="gdmbx-th"><label for="wpinv_state"><?php _e( 'State', 'invoicing' );?></label></div> |
|
105 | + <div class="gdmbx-th"><label for="wpinv_state"><?php _e('State', 'invoicing'); ?></label></div> |
|
106 | 106 | <div class="gdmbx-td"> |
107 | 107 | <?php |
108 | - $states = wpinv_get_country_states( $invoice->country ); |
|
109 | - if( !empty( $states ) ) { |
|
110 | - echo wpinv_html_select( array( |
|
111 | - 'options' => array_merge( array( '' => __( 'Choose a state', 'invoicing' ) ), $states ), |
|
108 | + $states = wpinv_get_country_states($invoice->country); |
|
109 | + if (!empty($states)) { |
|
110 | + echo wpinv_html_select(array( |
|
111 | + 'options' => array_merge(array('' => __('Choose a state', 'invoicing')), $states), |
|
112 | 112 | 'name' => 'wpinv_state', |
113 | 113 | 'id' => 'wpinv_state', |
114 | 114 | 'selected' => $invoice->state, |
@@ -116,44 +116,44 @@ discard block |
||
116 | 116 | 'show_option_none' => false, |
117 | 117 | 'class' => 'gdmbx2-text-large', |
118 | 118 | 'chosen' => false, |
119 | - 'placeholder' => __( 'Choose a state', 'invoicing' ), |
|
119 | + 'placeholder' => __('Choose a state', 'invoicing'), |
|
120 | 120 | 'required' => false, |
121 | - ) ); |
|
121 | + )); |
|
122 | 122 | } else { |
123 | - echo wpinv_html_text( array( |
|
123 | + echo wpinv_html_text(array( |
|
124 | 124 | 'name' => 'wpinv_state', |
125 | - 'value' => ! empty( $invoice->state ) ? $invoice->state : '', |
|
125 | + 'value' => !empty($invoice->state) ? $invoice->state : '', |
|
126 | 126 | 'id' => 'wpinv_state', |
127 | 127 | 'class' => 'gdmbx2-text-large', |
128 | 128 | 'required' => false, |
129 | - ) ); |
|
129 | + )); |
|
130 | 130 | } |
131 | 131 | ?> |
132 | 132 | </div> |
133 | 133 | </div> |
134 | 134 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-zip table-layout"> |
135 | - <div class="gdmbx-th"><label for="wpinv_zip"><?php _e( 'Zipcode', 'invoicing' );?></label></div> |
|
135 | + <div class="gdmbx-th"><label for="wpinv_zip"><?php _e('Zipcode', 'invoicing'); ?></label></div> |
|
136 | 136 | <div class="gdmbx-td"> |
137 | - <input type="text" class="gdmbx2-text-large" name="wpinv_zip" id="wpinv_zip" value="<?php echo esc_attr( $invoice->zip );?>" /> |
|
137 | + <input type="text" class="gdmbx2-text-large" name="wpinv_zip" id="wpinv_zip" value="<?php echo esc_attr($invoice->zip); ?>" /> |
|
138 | 138 | </div> |
139 | 139 | </div> |
140 | 140 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-phone table-layout"> |
141 | - <div class="gdmbx-th"><label for="wpinv_phone"><?php _e( 'Phone', 'invoicing' );?></label></div> |
|
141 | + <div class="gdmbx-th"><label for="wpinv_phone"><?php _e('Phone', 'invoicing'); ?></label></div> |
|
142 | 142 | <div class="gdmbx-td"> |
143 | - <input type="text" class="gdmbx2-text-large" name="wpinv_phone" id="wpinv_phone" value="<?php echo esc_attr( $invoice->phone );?>" /> |
|
143 | + <input type="text" class="gdmbx2-text-large" name="wpinv_phone" id="wpinv_phone" value="<?php echo esc_attr($invoice->phone); ?>" /> |
|
144 | 144 | </div> |
145 | 145 | </div> |
146 | 146 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-ip table-layout"> |
147 | - <div class="gdmbx-th"><label for="wpinv_ip"><?php _e( 'IP Address', 'invoicing' );?><?php if ($invoice->ip) { ?> |
|
148 | - <a href="<?php echo admin_url( 'admin-ajax.php?action=wpinv_ip_geolocation&ip=' . $invoice->ip ); ?>" title="<?php esc_attr_e( 'View IP information', 'invoicing' );?>" target="_blank"><i class="fa fa-external-link" aria-hidden="true"></i></a> |
|
147 | + <div class="gdmbx-th"><label for="wpinv_ip"><?php _e('IP Address', 'invoicing'); ?><?php if ($invoice->ip) { ?> |
|
148 | + <a href="<?php echo admin_url('admin-ajax.php?action=wpinv_ip_geolocation&ip=' . $invoice->ip); ?>" title="<?php esc_attr_e('View IP information', 'invoicing'); ?>" target="_blank"><i class="fa fa-external-link" aria-hidden="true"></i></a> |
|
149 | 149 | <?php } ?></label></div> |
150 | 150 | <div class="gdmbx-td"> |
151 | - <input type="text" class="gdmbx2-text-large" value="<?php echo esc_attr( $invoice->ip );?>" readonly /> |
|
151 | + <input type="text" class="gdmbx2-text-large" value="<?php echo esc_attr($invoice->ip); ?>" readonly /> |
|
152 | 152 | </div> |
153 | 153 | </div> |
154 | 154 | </div> |
155 | 155 | </div> |
156 | -<?php wp_nonce_field( 'wpinv_save_invoice', 'wpinv_save_invoice' ) ;?> |
|
156 | +<?php wp_nonce_field('wpinv_save_invoice', 'wpinv_save_invoice'); ?> |
|
157 | 157 | <?php |
158 | 158 | } |
159 | 159 | } |
@@ -1,56 +1,56 @@ |
||
1 | 1 | <?php |
2 | -if ( !defined('ABSPATH') ) { |
|
2 | +if (!defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | -do_action( 'wpinv_invalid_invoice_before_display' ); ?><!DOCTYPE html> |
|
5 | +do_action('wpinv_invalid_invoice_before_display'); ?><!DOCTYPE html> |
|
6 | 6 | <html <?php language_attributes(); ?>> |
7 | 7 | <head> |
8 | 8 | <meta charset="UTF-8"> |
9 | 9 | <title><?php wp_title() ?></title> |
10 | - <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|
10 | + <meta charset="<?php bloginfo('charset'); ?>" /> |
|
11 | 11 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
12 | 12 | <meta name="robots" content="noindex,nofollow"> |
13 | - <?php do_action( 'wpinv_invalid_invoice_head' ); ?> |
|
13 | + <?php do_action('wpinv_invalid_invoice_head'); ?> |
|
14 | 14 | </head> |
15 | 15 | <body class="body wpinv wpinv-print wpinv-invalid-invoice"> |
16 | - <?php do_action( 'wpinv_invalid_invoice_body_start' ); ?> |
|
16 | + <?php do_action('wpinv_invalid_invoice_body_start'); ?> |
|
17 | 17 | <div class="container wpinv-wrap"> |
18 | 18 | <!-- ///// Start Header --> |
19 | 19 | <htmlpageheader name="wpinv-pdf-header"> |
20 | - <?php do_action( 'wpinv_invalid_invoice_before_header' ); ?> |
|
20 | + <?php do_action('wpinv_invalid_invoice_before_header'); ?> |
|
21 | 21 | <div class="row wpinv-header"> |
22 | 22 | <div class="col-xs-12 wpinv-business"> |
23 | - <a target="_blank" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
24 | - <?php if ( $logo = wpinv_get_business_logo() ) { ?> |
|
25 | - <img class="logo" src="<?php echo esc_url( $logo ); ?>"> |
|
23 | + <a target="_blank" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
24 | + <?php if ($logo = wpinv_get_business_logo()) { ?> |
|
25 | + <img class="logo" src="<?php echo esc_url($logo); ?>"> |
|
26 | 26 | <?php } else { ?> |
27 | - <h1><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
27 | + <h1><?php echo esc_html(wpinv_get_business_name()); ?></h1> |
|
28 | 28 | <?php } ?> |
29 | 29 | </a> |
30 | 30 | </div> |
31 | 31 | </div> |
32 | - <?php do_action( 'wpinv_invalid_invoice_after_header' ); ?> |
|
32 | + <?php do_action('wpinv_invalid_invoice_after_header'); ?> |
|
33 | 33 | </htmlpageheader> |
34 | 34 | <!-- End Header ///// --> |
35 | 35 | |
36 | - <?php do_action( 'wpinv_invalid_invoice_before_content' ); ?> |
|
36 | + <?php do_action('wpinv_invalid_invoice_before_content'); ?> |
|
37 | 37 | |
38 | - <?php do_action( 'wpinv_invalid_invoice_content' ); ?> |
|
38 | + <?php do_action('wpinv_invalid_invoice_content'); ?> |
|
39 | 39 | |
40 | - <?php do_action( 'wpinv_invalid_invoice_after_content' ); ?> |
|
40 | + <?php do_action('wpinv_invalid_invoice_after_content'); ?> |
|
41 | 41 | |
42 | 42 | <!-- ///// Start Footer --> |
43 | 43 | <htmlpagefooter name="wpinv-pdf-footer"> |
44 | - <?php do_action( 'wpinv_invalid_invoice_before_footer' ); ?> |
|
44 | + <?php do_action('wpinv_invalid_invoice_before_footer'); ?> |
|
45 | 45 | <div class="row wpinv-footer"> |
46 | 46 | <div class="col-sm-12"> |
47 | 47 | <div class="footer-text"><?php echo wpinv_get_business_footer(); ?></div> |
48 | 48 | </div> |
49 | 49 | </div> |
50 | - <?php do_action( 'wpinv_invalid_invoice_after_footer' ); ?> |
|
50 | + <?php do_action('wpinv_invalid_invoice_after_footer'); ?> |
|
51 | 51 | </htmlpagefooter> |
52 | 52 | <!-- End Footer ///// --> |
53 | 53 | </div> |
54 | - <?php do_action( 'wpinv_invalid_invoice_body_end' ); ?> |
|
54 | + <?php do_action('wpinv_invalid_invoice_body_end'); ?> |
|
55 | 55 | </body> |
56 | 56 | </html> |
57 | 57 | \ No newline at end of file |
@@ -10,19 +10,19 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // MUST have WordPress. |
13 | -if ( !defined( 'WPINC' ) ) { |
|
14 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
13 | +if (!defined('WPINC')) { |
|
14 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
15 | 15 | } |
16 | 16 | |
17 | -if ( !defined( 'WPINV_VERSION' ) ) { |
|
18 | - define( 'WPINV_VERSION', '1.0.0' ); |
|
17 | +if (!defined('WPINV_VERSION')) { |
|
18 | + define('WPINV_VERSION', '1.0.0'); |
|
19 | 19 | } |
20 | 20 | |
21 | -if ( !defined( 'WPINV_PLUGIN_FILE' ) ) { |
|
22 | - define( 'WPINV_PLUGIN_FILE', __FILE__ ); |
|
21 | +if (!defined('WPINV_PLUGIN_FILE')) { |
|
22 | + define('WPINV_PLUGIN_FILE', __FILE__); |
|
23 | 23 | } |
24 | 24 | |
25 | -require plugin_dir_path( __FILE__ ) . 'includes/class-wpinv.php'; |
|
25 | +require plugin_dir_path(__FILE__) . 'includes/class-wpinv.php'; |
|
26 | 26 | |
27 | 27 | function wpinv_run() { |
28 | 28 | global $invoicing; |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // MUST have WordPress. |
3 | -if ( !defined( 'WPINC' ) ) { |
|
4 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
3 | +if (!defined('WPINC')) { |
|
4 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | class WPInv_Meta_Box_Details { |
8 | - public static function output( $post ) { |
|
8 | + public static function output($post) { |
|
9 | 9 | $currency_symbol = wpinv_currency_symbol(); |
10 | 10 | $statuses = wpinv_get_invoice_statuses(); |
11 | 11 | |
12 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
13 | - $invoice = new WPInv_Invoice( $post_id ); |
|
12 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
13 | + $invoice = new WPInv_Invoice($post_id); |
|
14 | 14 | |
15 | - $status = $invoice->get_status( false ); // Current status |
|
15 | + $status = $invoice->get_status(false); // Current status |
|
16 | 16 | $discount = $invoice->get_discount(); |
17 | 17 | $discount_code = $discount > 0 ? $invoice->get_discount_code() : ''; |
18 | 18 | $invoice_number = $invoice->get_number(); |
19 | 19 | |
20 | 20 | $date_created = $invoice->get_created_date(); |
21 | - $datetime_created = strtotime( $date_created ); |
|
22 | - $date_created = $date_created != '' && $date_created != '0000-00-00 00:00:00' ? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $datetime_created ) : ''; |
|
21 | + $datetime_created = strtotime($date_created); |
|
22 | + $date_created = $date_created != '' && $date_created != '0000-00-00 00:00:00' ? date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $datetime_created) : ''; |
|
23 | 23 | $date_completed = $invoice->get_completed_date(); |
24 | - $date_completed = $date_completed != '' && $date_completed != '0000-00-00 00:00:00' ? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( $date_completed ) ) : 'n/a'; |
|
25 | - $title['status'] = __( 'Invoice Status:', 'invoicing' ); |
|
26 | - $title['number'] = __( 'Invoice Number:', 'invoicing' ); |
|
27 | - $mail_notice = esc_attr__( 'After saving invoice, this will send a copy of the invoice to the user’s email address.', 'invoicing' ); |
|
24 | + $date_completed = $date_completed != '' && $date_completed != '0000-00-00 00:00:00' ? date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($date_completed)) : 'n/a'; |
|
25 | + $title['status'] = __('Invoice Status:', 'invoicing'); |
|
26 | + $title['number'] = __('Invoice Number:', 'invoicing'); |
|
27 | + $mail_notice = esc_attr__('After saving invoice, this will send a copy of the invoice to the user’s email address.', 'invoicing'); |
|
28 | 28 | |
29 | 29 | $title = apply_filters('wpinv_details_metabox_titles', $title, $invoice); |
30 | 30 | $statuses = apply_filters('wpinv_invoice_statuses', $statuses, $invoice); |
@@ -34,29 +34,29 @@ discard block |
||
34 | 34 | <div class="gdmbx2-wrap form-table"> |
35 | 35 | <div class="gdmbx2-metabox gdmbx-field-list" id="gdmbx2-metabox-wpinv_details"> |
36 | 36 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-created"> |
37 | - <div class="gdmbx-th"><label><?php _e( 'Date Created:', 'invoicing' );?></label></div> |
|
38 | - <div class="gdmbx-td"><?php echo $date_created;?></div> |
|
37 | + <div class="gdmbx-th"><label><?php _e('Date Created:', 'invoicing'); ?></label></div> |
|
38 | + <div class="gdmbx-td"><?php echo $date_created; ?></div> |
|
39 | 39 | </div> |
40 | - <?php if ( $invoice->post_type == 'wpi_invoice' && wpinv_get_option( 'overdue_active' ) && ( $invoice->needs_payment() || $invoice->has_status( array( 'auto-draft' ) ) ) ) { ?> |
|
40 | + <?php if ($invoice->post_type == 'wpi_invoice' && wpinv_get_option('overdue_active') && ($invoice->needs_payment() || $invoice->has_status(array('auto-draft')))) { ?> |
|
41 | 41 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-overdue"> |
42 | - <div class="gdmbx-th"><label for="wpinv_due_date"><?php _e( 'Due Date:', 'invoicing' );?></label></div> |
|
42 | + <div class="gdmbx-th"><label for="wpinv_due_date"><?php _e('Due Date:', 'invoicing'); ?></label></div> |
|
43 | 43 | <div class="gdmbx-td"> |
44 | - <input type="text" placeholder="<?php esc_attr_e( 'Y-m-d', 'invoicing' );?>" value="<?php echo esc_attr( $invoice->get_due_date() );?>" id="wpinv_due_date" name="wpinv_due_date" class="regular-text wpiDatepicker" data-minDate="<?php echo esc_attr( date_i18n( 'Y-m-d', $datetime_created ) );?>" data-dateFormat="yy-mm-dd"> |
|
44 | + <input type="text" placeholder="<?php esc_attr_e('Y-m-d', 'invoicing'); ?>" value="<?php echo esc_attr($invoice->get_due_date()); ?>" id="wpinv_due_date" name="wpinv_due_date" class="regular-text wpiDatepicker" data-minDate="<?php echo esc_attr(date_i18n('Y-m-d', $datetime_created)); ?>" data-dateFormat="yy-mm-dd"> |
|
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | <?php } ?> |
48 | - <?php if ( $date_completed && $date_completed != 'n/a' ) { ?> |
|
48 | + <?php if ($date_completed && $date_completed != 'n/a') { ?> |
|
49 | 49 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-completed"> |
50 | - <div class="gdmbx-th"><label><?php _e( 'Payment Date:', 'invoicing' );?></label></div> |
|
51 | - <div class="gdmbx-td"><?php echo $date_completed;?></div> |
|
50 | + <div class="gdmbx-th"><label><?php _e('Payment Date:', 'invoicing'); ?></label></div> |
|
51 | + <div class="gdmbx-td"><?php echo $date_completed; ?></div> |
|
52 | 52 | </div> |
53 | 53 | <?php } ?> |
54 | 54 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-status"> |
55 | 55 | <div class="gdmbx-th"><label for="wpinv_status"><?php echo $title['status']; ?></label></div> |
56 | 56 | <div class="gdmbx-td"> |
57 | 57 | <select required="required" id="wpinv_status" name="wpinv_status" class="gdmbx2_select"> |
58 | - <?php foreach ( $statuses as $value => $label ) { ?> |
|
59 | - <option value="<?php echo $value;?>" <?php selected( $status, $value );?>><?php echo $label;?></option> |
|
58 | + <?php foreach ($statuses as $value => $label) { ?> |
|
59 | + <option value="<?php echo $value; ?>" <?php selected($status, $value); ?>><?php echo $label; ?></option> |
|
60 | 60 | <?php } ?> |
61 | 61 | </select> |
62 | 62 | </div> |
@@ -64,107 +64,107 @@ discard block |
||
64 | 64 | <div class="gdmbx-row gdmbx-type-text gdmbx2-id-wpinv-number table-layout"> |
65 | 65 | <div class="gdmbx-th"><label for="wpinv_number"><?php echo $title['number']; ?></label></div> |
66 | 66 | <div class="gdmbx-td"> |
67 | - <input type="text" value="<?php echo esc_attr( $invoice_number );?>" id="wpinv_number" name="wpinv_number" class="regular-text" readonly> |
|
67 | + <input type="text" value="<?php echo esc_attr($invoice_number); ?>" id="wpinv_number" name="wpinv_number" class="regular-text" readonly> |
|
68 | 68 | </div> |
69 | 69 | </div> |
70 | - <?php do_action( 'wpinv_meta_box_details_inner', $post_id ); ?> |
|
71 | - <?php if ( !( $is_paid = ( $invoice->is_paid() || $invoice->is_refunded() ) ) || $discount_code ) { ?> |
|
70 | + <?php do_action('wpinv_meta_box_details_inner', $post_id); ?> |
|
71 | + <?php if (!($is_paid = ($invoice->is_paid() || $invoice->is_refunded())) || $discount_code) { ?> |
|
72 | 72 | <div class="gdmbx-row gdmbx-type-text gdmbx2-id-wpinv-discount-code table-layout"> |
73 | - <div class="gdmbx-th"><label for="wpinv_discount_code"><?php _e( 'Discount Code:', 'invoicing' );?></label></div> |
|
73 | + <div class="gdmbx-th"><label for="wpinv_discount_code"><?php _e('Discount Code:', 'invoicing'); ?></label></div> |
|
74 | 74 | <div class="gdmbx-td"> |
75 | - <input type="text" value="<?php echo esc_attr( $discount_code ); ?>" id="wpinv_discount" class="medium-text" <?php echo ( $discount_code ? 'readonly' : '' ); ?> /><?php if ( !$is_paid ) { ?><input value="<?php echo esc_attr_e( 'Apply', 'invoicing' ); ?>" class="button button-small button-primary <?php echo ( $discount_code ? 'wpi-hide' : 'wpi-inlineb' ); ?>" id="wpinv-apply-code" type="button" /><input value="<?php echo esc_attr_e( 'Remove', 'invoicing' ); ?>" class="button button-small button-primary <?php echo ( $discount_code ? 'wpi-inlineb' : 'wpi-hide' ); ?>" id="wpinv-remove-code" type="button" /><?php } ?> |
|
75 | + <input type="text" value="<?php echo esc_attr($discount_code); ?>" id="wpinv_discount" class="medium-text" <?php echo ($discount_code ? 'readonly' : ''); ?> /><?php if (!$is_paid) { ?><input value="<?php echo esc_attr_e('Apply', 'invoicing'); ?>" class="button button-small button-primary <?php echo ($discount_code ? 'wpi-hide' : 'wpi-inlineb'); ?>" id="wpinv-apply-code" type="button" /><input value="<?php echo esc_attr_e('Remove', 'invoicing'); ?>" class="button button-small button-primary <?php echo ($discount_code ? 'wpi-inlineb' : 'wpi-hide'); ?>" id="wpinv-remove-code" type="button" /><?php } ?> |
|
76 | 76 | </div> |
77 | 77 | </div> |
78 | 78 | <?php } ?> |
79 | 79 | </div> |
80 | 80 | </div> |
81 | 81 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-save-send table-layout"> |
82 | - <p class="wpi-meta-row wpi-save-send"><label for="wpi_save_send"><?php echo sprintf(__( 'Send %s:', 'invoicing' ),$post_obj->labels->singular_name) ; ?></label> |
|
82 | + <p class="wpi-meta-row wpi-save-send"><label for="wpi_save_send"><?php echo sprintf(__('Send %s:', 'invoicing'), $post_obj->labels->singular_name); ?></label> |
|
83 | 83 | <select id="wpi_save_send" name="wpi_save_send"> |
84 | - <option value="1"><?php _e( 'Yes', 'invoicing' ); ?></option> |
|
85 | - <option value="" selected="selected"><?php _e( 'No', 'invoicing' ); ?></option> |
|
84 | + <option value="1"><?php _e('Yes', 'invoicing'); ?></option> |
|
85 | + <option value="" selected="selected"><?php _e('No', 'invoicing'); ?></option> |
|
86 | 86 | </select> |
87 | 87 | </p> |
88 | 88 | <p class="wpi-meta-row wpi-send-info"><?php echo $mail_notice; ?></p> |
89 | 89 | </div> |
90 | -<?php wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ;?> |
|
90 | +<?php wp_nonce_field('wpinv_details', 'wpinv_details_nonce'); ?> |
|
91 | 91 | <?php |
92 | 92 | } |
93 | 93 | |
94 | - public static function resend_invoice( $post ) { |
|
94 | + public static function resend_invoice($post) { |
|
95 | 95 | global $wpi_mb_invoice; |
96 | 96 | |
97 | - if ( empty( $wpi_mb_invoice ) ) { |
|
97 | + if (empty($wpi_mb_invoice)) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | |
101 | 101 | $text = array( |
102 | - 'message' => esc_attr__( 'This will send a copy of the invoice to the customer’s email address.', 'invoicing' ), |
|
103 | - 'button_text' => __( 'Resend Invoice', 'invoicing' ), |
|
102 | + 'message' => esc_attr__('This will send a copy of the invoice to the customer’s email address.', 'invoicing'), |
|
103 | + 'button_text' => __('Resend Invoice', 'invoicing'), |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $text = apply_filters('wpinv_resend_invoice_metabox_text', $text); |
107 | - do_action( 'wpinv_metabox_resend_invoice_before', $wpi_mb_invoice ); |
|
107 | + do_action('wpinv_metabox_resend_invoice_before', $wpi_mb_invoice); |
|
108 | 108 | |
109 | - if ( $email = $wpi_mb_invoice->get_email() ) { |
|
109 | + if ($email = $wpi_mb_invoice->get_email()) { |
|
110 | 110 | $email_actions = array(); |
111 | - $email_actions['email_url'] = add_query_arg( array( 'wpi_action' => 'send_invoice', 'invoice_id' => $post->ID ) ); |
|
112 | - $email_actions['reminder_url'] = add_query_arg( array( 'wpi_action' => 'send_reminder', 'invoice_id' => $post->ID ) ); |
|
111 | + $email_actions['email_url'] = add_query_arg(array('wpi_action' => 'send_invoice', 'invoice_id' => $post->ID)); |
|
112 | + $email_actions['reminder_url'] = add_query_arg(array('wpi_action' => 'send_reminder', 'invoice_id' => $post->ID)); |
|
113 | 113 | |
114 | - $email_actions = apply_filters('wpinv_resend_invoice_email_actions', $email_actions ); |
|
114 | + $email_actions = apply_filters('wpinv_resend_invoice_email_actions', $email_actions); |
|
115 | 115 | ?> |
116 | 116 | <p class="wpi-meta-row wpi-resend-info"><?php echo $text['message']; ?></p> |
117 | - <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo esc_url( $email_actions['email_url'] ); ?>" class="button button-secondary"><?php echo $text['button_text']; ?></a></p> |
|
118 | - <?php if ( wpinv_get_option( 'overdue_active' ) && "wpi_invoice" === $wpi_mb_invoice->post_type && $wpi_mb_invoice->needs_payment() && ( $due_date = $wpi_mb_invoice->get_due_date() ) ) { ?> |
|
119 | - <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e( 'Send overdue reminder notification to customer', 'invoicing' ); ?>" href="<?php echo esc_url( $email_actions['reminder_url'] ); ?>" class="button button-secondary"><?php esc_attr_e( 'Send Reminder', 'invoicing' ); ?></a></p> |
|
117 | + <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo esc_url($email_actions['email_url']); ?>" class="button button-secondary"><?php echo $text['button_text']; ?></a></p> |
|
118 | + <?php if (wpinv_get_option('overdue_active') && "wpi_invoice" === $wpi_mb_invoice->post_type && $wpi_mb_invoice->needs_payment() && ($due_date = $wpi_mb_invoice->get_due_date())) { ?> |
|
119 | + <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e('Send overdue reminder notification to customer', 'invoicing'); ?>" href="<?php echo esc_url($email_actions['reminder_url']); ?>" class="button button-secondary"><?php esc_attr_e('Send Reminder', 'invoicing'); ?></a></p> |
|
120 | 120 | <?php } ?> |
121 | 121 | <?php |
122 | 122 | } |
123 | 123 | |
124 | - do_action( 'wpinv_metabox_resend_invoice_after', $wpi_mb_invoice ); |
|
124 | + do_action('wpinv_metabox_resend_invoice_after', $wpi_mb_invoice); |
|
125 | 125 | } |
126 | 126 | |
127 | - public static function subscriptions( $post ) { |
|
127 | + public static function subscriptions($post) { |
|
128 | 128 | global $wpi_mb_invoice; |
129 | 129 | |
130 | 130 | $invoice = $wpi_mb_invoice; |
131 | 131 | |
132 | - if ( !empty( $invoice ) && $invoice->is_recurring() && $invoice->is_parent() ) { |
|
132 | + if (!empty($invoice) && $invoice->is_recurring() && $invoice->is_parent()) { |
|
133 | 133 | $payments = $invoice->get_child_payments(); |
134 | 134 | |
135 | 135 | $total_payments = (int)$invoice->get_total_payments(); |
136 | 136 | $subscription = $invoice->get_subscription_data(); |
137 | 137 | |
138 | - $billing_cycle = wpinv_get_billing_cycle( $subscription['initial_amount'], $subscription['recurring_amount'], $subscription['period'], $subscription['interval'], $subscription['bill_times'], $subscription['trial_period'], $subscription['trial_interval'], $invoice->get_currency() ); |
|
139 | - $times_billed = $total_payments . ' / ' . ( ( (int)$subscription['bill_times'] == 0 ) ? __( 'Until cancelled', 'invoicing' ) : $subscription['bill_times'] ); |
|
138 | + $billing_cycle = wpinv_get_billing_cycle($subscription['initial_amount'], $subscription['recurring_amount'], $subscription['period'], $subscription['interval'], $subscription['bill_times'], $subscription['trial_period'], $subscription['trial_interval'], $invoice->get_currency()); |
|
139 | + $times_billed = $total_payments . ' / ' . (((int)$subscription['bill_times'] == 0) ? __('Until cancelled', 'invoicing') : $subscription['bill_times']); |
|
140 | 140 | $subscription_status = $invoice->get_subscription_status(); |
141 | 141 | ?> |
142 | - <p class="wpi-meta-row wpi-sub-label"><?php _e( 'Recurring Payment', 'invoicing' );?></p> |
|
143 | - <?php if ( $subscription_id = $invoice->get_subscription_id() ) { ?> |
|
144 | - <p class="wpi-meta-row wpi-sub-id"><label><?php _e( 'Subscription ID:', 'invoicing' );?> </label><?php echo $subscription_id; ?></p> |
|
142 | + <p class="wpi-meta-row wpi-sub-label"><?php _e('Recurring Payment', 'invoicing'); ?></p> |
|
143 | + <?php if ($subscription_id = $invoice->get_subscription_id()) { ?> |
|
144 | + <p class="wpi-meta-row wpi-sub-id"><label><?php _e('Subscription ID:', 'invoicing'); ?> </label><?php echo $subscription_id; ?></p> |
|
145 | 145 | <?php } ?> |
146 | - <p class="wpi-meta-row wpi-bill-cycle"><label><?php _e( 'Billing Cycle:', 'invoicing' );?> </label><?php echo $billing_cycle; ?></p> |
|
147 | - <p class="wpi-meta-row wpi-billed-times"><label><?php _e( 'Times Billed:', 'invoicing' );?> </label><?php echo $times_billed; ?></p> |
|
148 | - <?php if ( !empty( $payments ) || $invoice->is_paid() ) { ?> |
|
149 | - <p class="wpi-meta-row wpi-start-date"><label><?php _e( 'Start Date:', 'invoicing' );?> </label><?php echo $invoice->get_subscription_start(); ?></p> |
|
150 | - <p class="wpi-meta-row wpi-end-date"><label><?php _e( 'Expiration Date:', 'invoicing' );?> </label><?php echo $invoice->get_subscription_end(); ?></p> |
|
151 | - <?php if ( $status_label = $invoice->get_subscription_status_label( $subscription_status ) ) { ?> |
|
152 | - <p class="wpi-meta-row wpi-sub-status"><label><?php _e( 'Subscription Status:', 'invoicing' );?> </label><?php echo $status_label; ?></p> |
|
146 | + <p class="wpi-meta-row wpi-bill-cycle"><label><?php _e('Billing Cycle:', 'invoicing'); ?> </label><?php echo $billing_cycle; ?></p> |
|
147 | + <p class="wpi-meta-row wpi-billed-times"><label><?php _e('Times Billed:', 'invoicing'); ?> </label><?php echo $times_billed; ?></p> |
|
148 | + <?php if (!empty($payments) || $invoice->is_paid()) { ?> |
|
149 | + <p class="wpi-meta-row wpi-start-date"><label><?php _e('Start Date:', 'invoicing'); ?> </label><?php echo $invoice->get_subscription_start(); ?></p> |
|
150 | + <p class="wpi-meta-row wpi-end-date"><label><?php _e('Expiration Date:', 'invoicing'); ?> </label><?php echo $invoice->get_subscription_end(); ?></p> |
|
151 | + <?php if ($status_label = $invoice->get_subscription_status_label($subscription_status)) { ?> |
|
152 | + <p class="wpi-meta-row wpi-sub-status"><label><?php _e('Subscription Status:', 'invoicing'); ?> </label><?php echo $status_label; ?></p> |
|
153 | 153 | <?php } ?> |
154 | - <?php if ( $subscription_status == 'trialing' && $trial_end_date = $invoice->get_trial_end_date() ) { ?> |
|
155 | - <p class="wpi-meta-row wpi-trial-date"><label><?php _e( 'Trial Until:', 'invoicing' );?> </label><?php echo $trial_end_date; ?></p> |
|
154 | + <?php if ($subscription_status == 'trialing' && $trial_end_date = $invoice->get_trial_end_date()) { ?> |
|
155 | + <p class="wpi-meta-row wpi-trial-date"><label><?php _e('Trial Until:', 'invoicing'); ?> </label><?php echo $trial_end_date; ?></p> |
|
156 | 156 | <?php } ?> |
157 | - <?php if ( $cancelled_date = $invoice->get_cancelled_date() ) { ?> |
|
158 | - <p class="wpi-meta-row wpi-cancel-date"><label><?php _e( 'Cancelled On:', 'invoicing' );?> </label><?php echo $cancelled_date; ?></p> |
|
157 | + <?php if ($cancelled_date = $invoice->get_cancelled_date()) { ?> |
|
158 | + <p class="wpi-meta-row wpi-cancel-date"><label><?php _e('Cancelled On:', 'invoicing'); ?> </label><?php echo $cancelled_date; ?></p> |
|
159 | 159 | <?php } ?> |
160 | - <?php if ( !empty( $payments ) ) { ?> |
|
161 | - <p><strong><?php _e( 'Renewal Payments:', 'invoicing' ); ?></strong></p> |
|
160 | + <?php if (!empty($payments)) { ?> |
|
161 | + <p><strong><?php _e('Renewal Payments:', 'invoicing'); ?></strong></p> |
|
162 | 162 | <ul id="wpi-sub-payments"> |
163 | - <?php foreach ( $payments as $invoice_id ) { ?> |
|
163 | + <?php foreach ($payments as $invoice_id) { ?> |
|
164 | 164 | <li> |
165 | - <a href="<?php echo esc_url( get_edit_post_link( $invoice_id ) ); ?>"><?php echo wpinv_get_invoice_number( $invoice_id ); ?></a> – |
|
166 | - <span><?php echo wpinv_get_invoice_date( $invoice_id ); ?> – </span> |
|
167 | - <span><?php echo wpinv_payment_total( $invoice_id, true ); ?></span> |
|
165 | + <a href="<?php echo esc_url(get_edit_post_link($invoice_id)); ?>"><?php echo wpinv_get_invoice_number($invoice_id); ?></a> – |
|
166 | + <span><?php echo wpinv_get_invoice_date($invoice_id); ?> – </span> |
|
167 | + <span><?php echo wpinv_payment_total($invoice_id, true); ?></span> |
|
168 | 168 | </li> |
169 | 169 | <?php } ?> |
170 | 170 | </ul> |
@@ -172,49 +172,49 @@ discard block |
||
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | - public static function renewals( $post ) { |
|
175 | + public static function renewals($post) { |
|
176 | 176 | global $wpi_mb_invoice; |
177 | 177 | |
178 | - if ( wpinv_is_subscription_payment( $wpi_mb_invoice ) ) { |
|
179 | - $parent_url = get_edit_post_link( $wpi_mb_invoice->parent_invoice ); |
|
180 | - $parent_id = wpinv_get_invoice_number( $wpi_mb_invoice->parent_invoice ); |
|
178 | + if (wpinv_is_subscription_payment($wpi_mb_invoice)) { |
|
179 | + $parent_url = get_edit_post_link($wpi_mb_invoice->parent_invoice); |
|
180 | + $parent_id = wpinv_get_invoice_number($wpi_mb_invoice->parent_invoice); |
|
181 | 181 | ?> |
182 | - <p class="wpi-meta-row wpi-sub-id"><label><?php _e( 'Subscription ID:', 'invoicing' );?> </label><?php echo $wpi_mb_invoice->get_subscription_id(); ?></p> |
|
183 | - <p class="wpi-meta-row wpi-parent-id"><label><?php _e( 'Parent Invoice:', 'invoicing' );?> </label><a href="<?php echo esc_url( $parent_url ); ?>"><?php echo $parent_id; ?></a></p> |
|
182 | + <p class="wpi-meta-row wpi-sub-id"><label><?php _e('Subscription ID:', 'invoicing'); ?> </label><?php echo $wpi_mb_invoice->get_subscription_id(); ?></p> |
|
183 | + <p class="wpi-meta-row wpi-parent-id"><label><?php _e('Parent Invoice:', 'invoicing'); ?> </label><a href="<?php echo esc_url($parent_url); ?>"><?php echo $parent_id; ?></a></p> |
|
184 | 184 | <?php |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - public static function payment_meta( $post ) { |
|
188 | + public static function payment_meta($post) { |
|
189 | 189 | global $wpi_mb_invoice; |
190 | 190 | |
191 | - $set_dateway = empty( $wpi_mb_invoice->gateway ) ? true : false; |
|
192 | - if ( !$set_dateway && !$wpi_mb_invoice->get_meta( '_wpinv_checkout', true ) && !$wpi_mb_invoice->is_paid() && !$wpi_mb_invoice->is_refunded() ) { |
|
191 | + $set_dateway = empty($wpi_mb_invoice->gateway) ? true : false; |
|
192 | + if (!$set_dateway && !$wpi_mb_invoice->get_meta('_wpinv_checkout', true) && !$wpi_mb_invoice->is_paid() && !$wpi_mb_invoice->is_refunded()) { |
|
193 | 193 | $set_dateway = true; |
194 | 194 | } |
195 | 195 | |
196 | 196 | ?> |
197 | 197 | <p class="wpi-meta-row"> |
198 | - <?php if ( $set_dateway ) { $gateways = wpinv_get_enabled_payment_gateways( true ); ?> |
|
199 | - <label for="wpinv_gateway"><?php _e( 'Gateway:', 'invoicing' ) ; ?></label> |
|
198 | + <?php if ($set_dateway) { $gateways = wpinv_get_enabled_payment_gateways(true); ?> |
|
199 | + <label for="wpinv_gateway"><?php _e('Gateway:', 'invoicing'); ?></label> |
|
200 | 200 | <select required="required" id="wpinv_gateway" name="wpinv_gateway"> |
201 | - <?php foreach ( $gateways as $name => $gateway ) { |
|
202 | - if ( $wpi_mb_invoice->is_recurring() && !wpinv_gateway_support_subscription( $name ) ) { |
|
201 | + <?php foreach ($gateways as $name => $gateway) { |
|
202 | + if ($wpi_mb_invoice->is_recurring() && !wpinv_gateway_support_subscription($name)) { |
|
203 | 203 | continue; |
204 | 204 | } |
205 | 205 | ?> |
206 | - <option value="<?php echo $name;?>" <?php selected( $wpi_mb_invoice->gateway, $name );?>><?php echo !empty( $gateway['admin_label'] ) ? $gateway['admin_label'] : $gateway['checkout_label']; ?></option> |
|
206 | + <option value="<?php echo $name; ?>" <?php selected($wpi_mb_invoice->gateway, $name); ?>><?php echo !empty($gateway['admin_label']) ? $gateway['admin_label'] : $gateway['checkout_label']; ?></option> |
|
207 | 207 | <?php } ?> |
208 | 208 | </select> |
209 | 209 | <?php } else { |
210 | - echo wp_sprintf( __( '<label>Gateway:</label> %s', 'invoicing' ), wpinv_get_gateway_checkout_label( $wpi_mb_invoice->gateway ) ); |
|
210 | + echo wp_sprintf(__('<label>Gateway:</label> %s', 'invoicing'), wpinv_get_gateway_checkout_label($wpi_mb_invoice->gateway)); |
|
211 | 211 | } ?> |
212 | 212 | </p> |
213 | - <?php if ( $key = $wpi_mb_invoice->get_key() ) { ?> |
|
214 | - <p class="wpi-meta-row"><?php echo wp_sprintf( __( '<label>Key:</label> %s', 'invoicing' ), $key ); ?></p> |
|
213 | + <?php if ($key = $wpi_mb_invoice->get_key()) { ?> |
|
214 | + <p class="wpi-meta-row"><?php echo wp_sprintf(__('<label>Key:</label> %s', 'invoicing'), $key); ?></p> |
|
215 | 215 | <?php } ?> |
216 | - <?php if ( $wpi_mb_invoice->is_paid() || $wpi_mb_invoice->is_refunded() ) { ?> |
|
217 | - <p class="wpi-meta-row"><?php echo wp_sprintf( __( '<label>Transaction ID:</label> %s', 'invoicing' ), wpinv_payment_link_transaction_id( $wpi_mb_invoice ) ); ?></p> |
|
216 | + <?php if ($wpi_mb_invoice->is_paid() || $wpi_mb_invoice->is_refunded()) { ?> |
|
217 | + <p class="wpi-meta-row"><?php echo wp_sprintf(__('<label>Transaction ID:</label> %s', 'invoicing'), wpinv_payment_link_transaction_id($wpi_mb_invoice)); ?></p> |
|
218 | 218 | <?php } ?> |
219 | 219 | <?php |
220 | 220 | } |
@@ -9,58 +9,58 @@ |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // If uninstall not called from WordPress, then exit. |
12 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
12 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
16 | 16 | global $wpdb, $wp_version; |
17 | 17 | |
18 | -$remove_data = get_option( 'wpinv_remove_data_on_invoice_unistall' ); |
|
18 | +$remove_data = get_option('wpinv_remove_data_on_invoice_unistall'); |
|
19 | 19 | |
20 | 20 | /* |
21 | 21 | * Only remove ALL product and page data if WPINV_REMOVE_ALL_DATA constant is set to true in user's |
22 | 22 | * wp-config.php. This is to prevent data loss when deleting the plugin from the backend |
23 | 23 | * and to ensure only the site owner can perform this action. |
24 | 24 | */ |
25 | -if ( defined( 'WPINV_REMOVE_ALL_DATA' ) ) { |
|
25 | +if (defined('WPINV_REMOVE_ALL_DATA')) { |
|
26 | 26 | $remove_data = true === WPINV_REMOVE_ALL_DATA ? true : false; |
27 | 27 | } |
28 | 28 | |
29 | -if ( $remove_data ) { |
|
29 | +if ($remove_data) { |
|
30 | 30 | // Load Invoicing file. |
31 | - include_once( 'invoicing.php' ); |
|
31 | + include_once('invoicing.php'); |
|
32 | 32 | |
33 | 33 | // Roles + caps. |
34 | - include_once( dirname( __FILE__ ) . '/includes/admin/install.php' ); |
|
34 | + include_once(dirname(__FILE__) . '/includes/admin/install.php'); |
|
35 | 35 | wpinv_remove_admin_caps(); |
36 | 36 | |
37 | - $settings = get_option( 'wpinv_settings' ); |
|
37 | + $settings = get_option('wpinv_settings'); |
|
38 | 38 | |
39 | 39 | // Delete pages. |
40 | - $wpi_pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page' ); |
|
41 | - foreach ( $wpi_pages as $page ) { |
|
42 | - if ( !empty( $page ) && !empty( $settings[ $page ] ) ) { |
|
43 | - wp_delete_post( $settings[ $page ], true ); |
|
40 | + $wpi_pages = array('checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page'); |
|
41 | + foreach ($wpi_pages as $page) { |
|
42 | + if (!empty($page) && !empty($settings[$page])) { |
|
43 | + wp_delete_post($settings[$page], true); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | 47 | // Delete posts + data. |
48 | - $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );" ); |
|
49 | - $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" ); |
|
48 | + $wpdb->query("DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );"); |
|
49 | + $wpdb->query("DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;"); |
|
50 | 50 | |
51 | 51 | // Delete comments. |
52 | - $wpdb->query( "DELETE FROM {$wpdb->comments} WHERE comment_type LIKE 'wpinv_note';" ); |
|
53 | - $wpdb->query( "DELETE meta FROM {$wpdb->commentmeta} meta LEFT JOIN {$wpdb->comments} comments ON comments.comment_ID = meta.comment_id WHERE comments.comment_ID IS NULL;" ); |
|
52 | + $wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_type LIKE 'wpinv_note';"); |
|
53 | + $wpdb->query("DELETE meta FROM {$wpdb->commentmeta} meta LEFT JOIN {$wpdb->comments} comments ON comments.comment_ID = meta.comment_id WHERE comments.comment_ID IS NULL;"); |
|
54 | 54 | |
55 | 55 | // Delete user meta. |
56 | - $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_invoice%' OR meta_key LIKE '%_wpi_item%' OR meta_key LIKE '%_wpi_discount%' OR meta_key LIKE '_wpi_stripe%' OR meta_key LIKE '%_wpi_quote%';" ); |
|
56 | + $wpdb->query("DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_invoice%' OR meta_key LIKE '%_wpi_item%' OR meta_key LIKE '%_wpi_discount%' OR meta_key LIKE '_wpi_stripe%' OR meta_key LIKE '%_wpi_quote%';"); |
|
57 | 57 | |
58 | 58 | // Cleanup Cron Schedule |
59 | - wp_clear_scheduled_hook( 'wp_session_garbage_collection' ); |
|
60 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' ); |
|
59 | + wp_clear_scheduled_hook('wp_session_garbage_collection'); |
|
60 | + wp_clear_scheduled_hook('wpinv_register_schedule_event_twicedaily'); |
|
61 | 61 | |
62 | 62 | // Delete options. |
63 | - $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv_%' OR option_name LIKE '_wpinv_%' OR option_name LIKE '\_transient\_wpinv\_%';" ); |
|
63 | + $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv_%' OR option_name LIKE '_wpinv_%' OR option_name LIKE '\_transient\_wpinv\_%';"); |
|
64 | 64 | |
65 | 65 | // Clear any cached data that has been removed |
66 | 66 | wp_cache_flush(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -function wpinv_get_subscriptions( $args = array() ) { |
|
3 | - if ( empty( $args['parent_invoice_id'] ) ) { |
|
2 | +function wpinv_get_subscriptions($args = array()) { |
|
3 | + if (empty($args['parent_invoice_id'])) { |
|
4 | 4 | return false; |
5 | 5 | } |
6 | 6 | |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | ); |
15 | 15 | |
16 | 16 | $args['post_parent'] = $args['parent_invoice_id']; |
17 | - $args = wp_parse_args( $args, $defaults ); |
|
17 | + $args = wp_parse_args($args, $defaults); |
|
18 | 18 | |
19 | - if( $args['numberposts'] < 1 ) { |
|
19 | + if ($args['numberposts'] < 1) { |
|
20 | 20 | $args['numberposts'] = 999999999999; |
21 | 21 | } |
22 | 22 | |
23 | - $posts = get_posts( $args ); |
|
23 | + $posts = get_posts($args); |
|
24 | 24 | $subscriptions = array(); |
25 | - if ( !empty( $posts ) ) { |
|
26 | - foreach ( $posts as $post ) { |
|
27 | - if ( !empty( $post->ID ) ) { |
|
28 | - $subscriptions[] = wpinv_get_invoice( $post->ID ); |
|
25 | + if (!empty($posts)) { |
|
26 | + foreach ($posts as $post) { |
|
27 | + if (!empty($post->ID)) { |
|
28 | + $subscriptions[] = wpinv_get_invoice($post->ID); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | } |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | |
34 | 34 | return $subscriptions; |
35 | 35 | } |
36 | -function wpinv_get_subscription( $id = 0, $by_profile_id = false ) { |
|
36 | +function wpinv_get_subscription($id = 0, $by_profile_id = false) { |
|
37 | 37 | global $wpdb; |
38 | 38 | |
39 | - if ( empty( $id ) ) { |
|
39 | + if (empty($id)) { |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 | |
43 | - $id = esc_sql( $id ); |
|
43 | + $id = esc_sql($id); |
|
44 | 44 | |
45 | - $invoice_id = $wpdb->get_var( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_profile_id' AND meta_value = '{$id}' LIMIT 1" ); |
|
45 | + $invoice_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_profile_id' AND meta_value = '{$id}' LIMIT 1"); |
|
46 | 46 | |
47 | - if ( $invoice_id != null ) { |
|
48 | - return wpinv_get_invoice( $invoice_id ); |
|
47 | + if ($invoice_id != null) { |
|
48 | + return wpinv_get_invoice($invoice_id); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | return false; |
@@ -55,47 +55,47 @@ discard block |
||
55 | 55 | * Records a new payment on the subscription |
56 | 56 | * |
57 | 57 | */ |
58 | -function wpinv_recurring_add_subscription_payment( $parent_invoice_id, $subscription_args = array() ) { |
|
59 | - $args = wp_parse_args( $subscription_args, array( |
|
58 | +function wpinv_recurring_add_subscription_payment($parent_invoice_id, $subscription_args = array()) { |
|
59 | + $args = wp_parse_args($subscription_args, array( |
|
60 | 60 | 'amount' => '', |
61 | 61 | 'transaction_id' => '', |
62 | 62 | 'gateway' => '' |
63 | - ) ); |
|
63 | + )); |
|
64 | 64 | |
65 | - if ( wpinv_payment_exists( $args['transaction_id'] ) ) { |
|
65 | + if (wpinv_payment_exists($args['transaction_id'])) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - $parent_invoice = wpinv_get_invoice( $parent_invoice_id ); |
|
70 | - if ( empty( $parent_invoice ) ) { |
|
69 | + $parent_invoice = wpinv_get_invoice($parent_invoice_id); |
|
70 | + if (empty($parent_invoice)) { |
|
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | 74 | $invoice = new WPInv_Invoice(); |
75 | - $invoice->set( 'post_type', 'wpi_invoice' ); |
|
76 | - $invoice->set( 'parent_invoice', $parent_invoice_id ); |
|
77 | - $invoice->set( 'currency', $parent_invoice->get_currency() ); |
|
78 | - $invoice->set( 'transaction_id', $args['transaction_id'] ); |
|
79 | - $invoice->set( 'key', $parent_invoice->generate_key() ); |
|
80 | - $invoice->set( 'ip', $parent_invoice->ip ); |
|
81 | - $invoice->set( 'user_id', $parent_invoice->get_user_id() ); |
|
82 | - $invoice->set( 'first_name', $parent_invoice->get_first_name() ); |
|
83 | - $invoice->set( 'last_name', $parent_invoice->get_last_name() ); |
|
84 | - $invoice->set( 'phone', $parent_invoice->phone ); |
|
85 | - $invoice->set( 'address', $parent_invoice->address ); |
|
86 | - $invoice->set( 'city', $parent_invoice->city ); |
|
87 | - $invoice->set( 'country', $parent_invoice->country ); |
|
88 | - $invoice->set( 'state', $parent_invoice->state ); |
|
89 | - $invoice->set( 'zip', $parent_invoice->zip ); |
|
90 | - $invoice->set( 'company', $parent_invoice->company ); |
|
91 | - $invoice->set( 'vat_number', $parent_invoice->vat_number ); |
|
92 | - $invoice->set( 'vat_rate', $parent_invoice->vat_rate ); |
|
93 | - $invoice->set( 'adddress_confirmed', $parent_invoice->adddress_confirmed ); |
|
94 | - |
|
95 | - if ( empty( $args['gateway'] ) ) { |
|
96 | - $invoice->set( 'gateway', $parent_invoice->get_gateway() ); |
|
75 | + $invoice->set('post_type', 'wpi_invoice'); |
|
76 | + $invoice->set('parent_invoice', $parent_invoice_id); |
|
77 | + $invoice->set('currency', $parent_invoice->get_currency()); |
|
78 | + $invoice->set('transaction_id', $args['transaction_id']); |
|
79 | + $invoice->set('key', $parent_invoice->generate_key()); |
|
80 | + $invoice->set('ip', $parent_invoice->ip); |
|
81 | + $invoice->set('user_id', $parent_invoice->get_user_id()); |
|
82 | + $invoice->set('first_name', $parent_invoice->get_first_name()); |
|
83 | + $invoice->set('last_name', $parent_invoice->get_last_name()); |
|
84 | + $invoice->set('phone', $parent_invoice->phone); |
|
85 | + $invoice->set('address', $parent_invoice->address); |
|
86 | + $invoice->set('city', $parent_invoice->city); |
|
87 | + $invoice->set('country', $parent_invoice->country); |
|
88 | + $invoice->set('state', $parent_invoice->state); |
|
89 | + $invoice->set('zip', $parent_invoice->zip); |
|
90 | + $invoice->set('company', $parent_invoice->company); |
|
91 | + $invoice->set('vat_number', $parent_invoice->vat_number); |
|
92 | + $invoice->set('vat_rate', $parent_invoice->vat_rate); |
|
93 | + $invoice->set('adddress_confirmed', $parent_invoice->adddress_confirmed); |
|
94 | + |
|
95 | + if (empty($args['gateway'])) { |
|
96 | + $invoice->set('gateway', $parent_invoice->get_gateway()); |
|
97 | 97 | } else { |
98 | - $invoice->set( 'gateway', $args['gateway'] ); |
|
98 | + $invoice->set('gateway', $args['gateway']); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $recurring_details = $parent_invoice->get_recurring_details(); |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | // increase the earnings for each item in the subscription |
104 | 104 | $items = $recurring_details['cart_details']; |
105 | 105 | |
106 | - if ( $items ) { |
|
106 | + if ($items) { |
|
107 | 107 | $add_items = array(); |
108 | 108 | $cart_details = array(); |
109 | 109 | |
110 | - foreach ( $items as $item ) { |
|
110 | + foreach ($items as $item) { |
|
111 | 111 | $add_item = array(); |
112 | 112 | $add_item['id'] = $item['id']; |
113 | 113 | $add_item['quantity'] = $item['quantity']; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | break; |
118 | 118 | } |
119 | 119 | |
120 | - $invoice->set( 'items', $add_items ); |
|
120 | + $invoice->set('items', $add_items); |
|
121 | 121 | $invoice->cart_details = $cart_details; |
122 | 122 | } |
123 | 123 | |
@@ -127,277 +127,277 @@ discard block |
||
127 | 127 | $tax = $recurring_details['tax']; |
128 | 128 | $discount = $recurring_details['discount']; |
129 | 129 | |
130 | - if ( $discount > 0 ) { |
|
131 | - $invoice->set( 'discount_code', $parent_invoice->discount_code ); |
|
130 | + if ($discount > 0) { |
|
131 | + $invoice->set('discount_code', $parent_invoice->discount_code); |
|
132 | 132 | } |
133 | 133 | |
134 | - $invoice->subtotal = wpinv_round_amount( $subtotal ); |
|
135 | - $invoice->tax = wpinv_round_amount( $tax ); |
|
136 | - $invoice->discount = wpinv_round_amount( $discount ); |
|
137 | - $invoice->total = wpinv_round_amount( $total ); |
|
134 | + $invoice->subtotal = wpinv_round_amount($subtotal); |
|
135 | + $invoice->tax = wpinv_round_amount($tax); |
|
136 | + $invoice->discount = wpinv_round_amount($discount); |
|
137 | + $invoice->total = wpinv_round_amount($total); |
|
138 | 138 | $invoice->save(); |
139 | 139 | |
140 | - wpinv_update_payment_status( $invoice->ID, 'publish' ); |
|
140 | + wpinv_update_payment_status($invoice->ID, 'publish'); |
|
141 | 141 | sleep(1); |
142 | - wpinv_update_payment_status( $invoice->ID, 'wpi-renewal' ); |
|
142 | + wpinv_update_payment_status($invoice->ID, 'wpi-renewal'); |
|
143 | 143 | |
144 | - $invoice = wpinv_get_invoice( $invoice->ID ); |
|
144 | + $invoice = wpinv_get_invoice($invoice->ID); |
|
145 | 145 | |
146 | - $subscription_data = wpinv_payment_subscription_data( $parent_invoice ); |
|
146 | + $subscription_data = wpinv_payment_subscription_data($parent_invoice); |
|
147 | 147 | $subscription_data['recurring_amount'] = $invoice->get_total(); |
148 | - $subscription_data['created'] = current_time( 'mysql', 0 ); |
|
149 | - $subscription_data['expiration'] = $invoice->get_new_expiration( $subscription_data['item_id'] ); |
|
148 | + $subscription_data['created'] = current_time('mysql', 0); |
|
149 | + $subscription_data['expiration'] = $invoice->get_new_expiration($subscription_data['item_id']); |
|
150 | 150 | |
151 | 151 | // Retrieve pending subscription from database and update it's status to active and set proper profile ID |
152 | - $invoice->update_subscription( $subscription_data ); |
|
152 | + $invoice->update_subscription($subscription_data); |
|
153 | 153 | |
154 | - do_action( 'wpinv_recurring_add_subscription_payment', $invoice, $parent_invoice, $subscription_args ); |
|
155 | - do_action( 'wpinv_recurring_record_payment', $invoice->ID, $parent_invoice_id, $subscription_args ); |
|
154 | + do_action('wpinv_recurring_add_subscription_payment', $invoice, $parent_invoice, $subscription_args); |
|
155 | + do_action('wpinv_recurring_record_payment', $invoice->ID, $parent_invoice_id, $subscription_args); |
|
156 | 156 | |
157 | 157 | return $invoice; |
158 | 158 | } |
159 | 159 | |
160 | -function wpinv_payment_exists( $txn_id = '' ) { |
|
160 | +function wpinv_payment_exists($txn_id = '') { |
|
161 | 161 | global $wpdb; |
162 | 162 | |
163 | - if ( empty( $txn_id ) ) { |
|
163 | + if (empty($txn_id)) { |
|
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | |
167 | - $txn_id = esc_sql( $txn_id ); |
|
167 | + $txn_id = esc_sql($txn_id); |
|
168 | 168 | |
169 | - $invoice = $wpdb->get_var( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = '{$txn_id}' LIMIT 1" ); |
|
169 | + $invoice = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = '{$txn_id}' LIMIT 1"); |
|
170 | 170 | |
171 | - if ( $invoice != null ) { |
|
171 | + if ($invoice != null) { |
|
172 | 172 | return true; |
173 | 173 | } |
174 | 174 | |
175 | 175 | return false; |
176 | 176 | } |
177 | 177 | |
178 | -function wpinv_is_subscription_payment( $invoice = '' ) { |
|
179 | - if ( empty( $invoice ) ) { |
|
178 | +function wpinv_is_subscription_payment($invoice = '') { |
|
179 | + if (empty($invoice)) { |
|
180 | 180 | return false; |
181 | 181 | } |
182 | 182 | |
183 | - if ( !is_object( $invoice ) && is_scalar( $invoice ) ) { |
|
184 | - $invoice = wpinv_get_invoice( $invoice ); |
|
183 | + if (!is_object($invoice) && is_scalar($invoice)) { |
|
184 | + $invoice = wpinv_get_invoice($invoice); |
|
185 | 185 | } |
186 | 186 | |
187 | - if ( empty( $invoice ) ) { |
|
187 | + if (empty($invoice)) { |
|
188 | 188 | return false; |
189 | 189 | } |
190 | 190 | |
191 | - if ( $invoice->is_renewal() ) { |
|
191 | + if ($invoice->is_renewal()) { |
|
192 | 192 | return true; |
193 | 193 | } |
194 | 194 | |
195 | 195 | return false; |
196 | 196 | } |
197 | 197 | |
198 | -function wpinv_payment_subscription_data( $invoice = '' ) { |
|
199 | - if ( empty( $invoice ) ) { |
|
198 | +function wpinv_payment_subscription_data($invoice = '') { |
|
199 | + if (empty($invoice)) { |
|
200 | 200 | return false; |
201 | 201 | } |
202 | 202 | |
203 | - if ( !is_object( $invoice ) && is_scalar( $invoice ) ) { |
|
204 | - $invoice = wpinv_get_invoice( $invoice ); |
|
203 | + if (!is_object($invoice) && is_scalar($invoice)) { |
|
204 | + $invoice = wpinv_get_invoice($invoice); |
|
205 | 205 | } |
206 | 206 | |
207 | - if ( empty( $invoice ) ) { |
|
207 | + if (empty($invoice)) { |
|
208 | 208 | return false; |
209 | 209 | } |
210 | 210 | |
211 | 211 | return $invoice->get_subscription_data(); |
212 | 212 | } |
213 | 213 | |
214 | -function wpinv_payment_link_transaction_id( $invoice = '' ) { |
|
215 | - if ( empty( $invoice ) ) { |
|
214 | +function wpinv_payment_link_transaction_id($invoice = '') { |
|
215 | + if (empty($invoice)) { |
|
216 | 216 | return false; |
217 | 217 | } |
218 | 218 | |
219 | - if ( !is_object( $invoice ) && is_scalar( $invoice ) ) { |
|
220 | - $invoice = wpinv_get_invoice( $invoice ); |
|
219 | + if (!is_object($invoice) && is_scalar($invoice)) { |
|
220 | + $invoice = wpinv_get_invoice($invoice); |
|
221 | 221 | } |
222 | 222 | |
223 | - if ( empty( $invoice ) ) { |
|
223 | + if (empty($invoice)) { |
|
224 | 224 | return false; |
225 | 225 | } |
226 | 226 | |
227 | - return apply_filters( 'wpinv_payment_details_transaction_id-' . $invoice->gateway, $invoice->get_transaction_id(), $invoice->ID, $invoice ); |
|
227 | + return apply_filters('wpinv_payment_details_transaction_id-' . $invoice->gateway, $invoice->get_transaction_id(), $invoice->ID, $invoice); |
|
228 | 228 | } |
229 | 229 | |
230 | -function wpinv_get_pretty_subscription_period( $period ) { |
|
230 | +function wpinv_get_pretty_subscription_period($period) { |
|
231 | 231 | $frequency = ''; |
232 | 232 | //Format period details |
233 | - switch ( $period ) { |
|
233 | + switch ($period) { |
|
234 | 234 | case 'D' : |
235 | 235 | case 'day' : |
236 | - $frequency = __( 'Daily', 'invoicing' ); |
|
236 | + $frequency = __('Daily', 'invoicing'); |
|
237 | 237 | break; |
238 | 238 | case 'W' : |
239 | 239 | case 'week' : |
240 | - $frequency = __( 'Weekly', 'invoicing' ); |
|
240 | + $frequency = __('Weekly', 'invoicing'); |
|
241 | 241 | break; |
242 | 242 | case 'M' : |
243 | 243 | case 'month' : |
244 | - $frequency = __( 'Monthly', 'invoicing' ); |
|
244 | + $frequency = __('Monthly', 'invoicing'); |
|
245 | 245 | break; |
246 | 246 | case 'Y' : |
247 | 247 | case 'year' : |
248 | - $frequency = __( 'Yearly', 'invoicing' ); |
|
248 | + $frequency = __('Yearly', 'invoicing'); |
|
249 | 249 | break; |
250 | 250 | default : |
251 | - $frequency = apply_filters( 'wpinv_pretty_subscription_period', $frequency, $period ); |
|
251 | + $frequency = apply_filters('wpinv_pretty_subscription_period', $frequency, $period); |
|
252 | 252 | break; |
253 | 253 | } |
254 | 254 | |
255 | 255 | return $frequency; |
256 | 256 | } |
257 | 257 | |
258 | -function wpinv_get_pretty_subscription_period_name( $period ) { |
|
258 | +function wpinv_get_pretty_subscription_period_name($period) { |
|
259 | 259 | $frequency = ''; |
260 | 260 | //Format period details |
261 | - switch ( $period ) { |
|
261 | + switch ($period) { |
|
262 | 262 | case 'D' : |
263 | 263 | case 'day' : |
264 | - $frequency = __( 'Day', 'invoicing' ); |
|
264 | + $frequency = __('Day', 'invoicing'); |
|
265 | 265 | break; |
266 | 266 | case 'W' : |
267 | 267 | case 'week' : |
268 | - $frequency = __( 'Week', 'invoicing' ); |
|
268 | + $frequency = __('Week', 'invoicing'); |
|
269 | 269 | break; |
270 | 270 | case 'M' : |
271 | 271 | case 'month' : |
272 | - $frequency = __( 'Month', 'invoicing' ); |
|
272 | + $frequency = __('Month', 'invoicing'); |
|
273 | 273 | break; |
274 | 274 | case 'Y' : |
275 | 275 | case 'year' : |
276 | - $frequency = __( 'Year', 'invoicing' ); |
|
276 | + $frequency = __('Year', 'invoicing'); |
|
277 | 277 | break; |
278 | 278 | default : |
279 | - $frequency = apply_filters( 'wpinv_pretty_subscription_period_name', $frequency, $period ); |
|
279 | + $frequency = apply_filters('wpinv_pretty_subscription_period_name', $frequency, $period); |
|
280 | 280 | break; |
281 | 281 | } |
282 | 282 | |
283 | 283 | return $frequency; |
284 | 284 | } |
285 | 285 | |
286 | -function wpinv_subscription_initial_payment_desc( $amount, $period, $interval, $trial_period = '', $trial_interval = 0 ) { |
|
286 | +function wpinv_subscription_initial_payment_desc($amount, $period, $interval, $trial_period = '', $trial_interval = 0) { |
|
287 | 287 | $interval = (int)$interval > 0 ? (int)$interval : 1; |
288 | 288 | |
289 | - if ( $trial_interval > 0 && !empty( $trial_period ) ) { |
|
290 | - $amount = __( 'Free', 'invoicing' ); |
|
289 | + if ($trial_interval > 0 && !empty($trial_period)) { |
|
290 | + $amount = __('Free', 'invoicing'); |
|
291 | 291 | $interval = $trial_interval; |
292 | 292 | $period = $trial_period; |
293 | 293 | } |
294 | 294 | |
295 | 295 | $description = ''; |
296 | - switch ( $period ) { |
|
296 | + switch ($period) { |
|
297 | 297 | case 'D' : |
298 | 298 | case 'day' : |
299 | - $description = wp_sprintf( _n( '%s for the first day.', '%s for the first %d days.', $interval, 'invoicing' ), $amount, $interval ); |
|
299 | + $description = wp_sprintf(_n('%s for the first day.', '%s for the first %d days.', $interval, 'invoicing'), $amount, $interval); |
|
300 | 300 | break; |
301 | 301 | case 'W' : |
302 | 302 | case 'week' : |
303 | - $description = wp_sprintf( _n( '%s for the first week.', '%s for the first %d weeks.', $interval, 'invoicing' ), $amount, $interval ); |
|
303 | + $description = wp_sprintf(_n('%s for the first week.', '%s for the first %d weeks.', $interval, 'invoicing'), $amount, $interval); |
|
304 | 304 | break; |
305 | 305 | case 'M' : |
306 | 306 | case 'month' : |
307 | - $description = wp_sprintf( _n( '%s for the first month.', '%s for the first %d months.', $interval, 'invoicing' ), $amount, $interval ); |
|
307 | + $description = wp_sprintf(_n('%s for the first month.', '%s for the first %d months.', $interval, 'invoicing'), $amount, $interval); |
|
308 | 308 | break; |
309 | 309 | case 'Y' : |
310 | 310 | case 'year' : |
311 | - $description = wp_sprintf( _n( '%s for the first year.', '%s for the first %d years.', $interval, 'invoicing' ), $amount, $interval ); |
|
311 | + $description = wp_sprintf(_n('%s for the first year.', '%s for the first %d years.', $interval, 'invoicing'), $amount, $interval); |
|
312 | 312 | break; |
313 | 313 | } |
314 | 314 | |
315 | - return apply_filters( 'wpinv_subscription_initial_payment_desc', $description, $amount, $period, $interval, $trial_period, $trial_interval ); |
|
315 | + return apply_filters('wpinv_subscription_initial_payment_desc', $description, $amount, $period, $interval, $trial_period, $trial_interval); |
|
316 | 316 | } |
317 | 317 | |
318 | -function wpinv_subscription_recurring_payment_desc( $amount, $period, $interval, $bill_times = 0, $trial_period = '', $trial_interval = 0 ) { |
|
318 | +function wpinv_subscription_recurring_payment_desc($amount, $period, $interval, $bill_times = 0, $trial_period = '', $trial_interval = 0) { |
|
319 | 319 | $interval = (int)$interval > 0 ? (int)$interval : 1; |
320 | 320 | $bill_times = (int)$bill_times > 0 ? (int)$bill_times : 0; |
321 | 321 | |
322 | 322 | $description = ''; |
323 | - switch ( $period ) { |
|
323 | + switch ($period) { |
|
324 | 324 | case 'D' : |
325 | 325 | case 'day' : |
326 | - if ( (int)$bill_times > 0 ) { |
|
327 | - if ( $interval > 1 ) { |
|
328 | - if ( $bill_times > 1 ) { |
|
329 | - $description = wp_sprintf( __( '%s for each %d days, for %d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
326 | + if ((int)$bill_times > 0) { |
|
327 | + if ($interval > 1) { |
|
328 | + if ($bill_times > 1) { |
|
329 | + $description = wp_sprintf(__('%s for each %d days, for %d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
330 | 330 | } else { |
331 | - $description = wp_sprintf( __( '%s for %d days.', 'invoicing' ), $amount, $interval ); |
|
331 | + $description = wp_sprintf(__('%s for %d days.', 'invoicing'), $amount, $interval); |
|
332 | 332 | } |
333 | 333 | } else { |
334 | - $description = wp_sprintf( _n( '%s for one day.', '%s for each day, for %d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
334 | + $description = wp_sprintf(_n('%s for one day.', '%s for each day, for %d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
335 | 335 | } |
336 | 336 | } else { |
337 | - $description = wp_sprintf( _n( '%s for each day.', '%s for each %d days.', $interval, 'invoicing'), $amount, $interval ); |
|
337 | + $description = wp_sprintf(_n('%s for each day.', '%s for each %d days.', $interval, 'invoicing'), $amount, $interval); |
|
338 | 338 | } |
339 | 339 | break; |
340 | 340 | case 'W' : |
341 | 341 | case 'week' : |
342 | - if ( (int)$bill_times > 0 ) { |
|
343 | - if ( $interval > 1 ) { |
|
344 | - if ( $bill_times > 1 ) { |
|
345 | - $description = wp_sprintf( __( '%s for each %d weeks, for %d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
342 | + if ((int)$bill_times > 0) { |
|
343 | + if ($interval > 1) { |
|
344 | + if ($bill_times > 1) { |
|
345 | + $description = wp_sprintf(__('%s for each %d weeks, for %d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
346 | 346 | } else { |
347 | - $description = wp_sprintf( __( '%s for %d weeks.', 'invoicing' ), $amount, $interval ); |
|
347 | + $description = wp_sprintf(__('%s for %d weeks.', 'invoicing'), $amount, $interval); |
|
348 | 348 | } |
349 | 349 | } else { |
350 | - $description = wp_sprintf( _n( '%s for one week.', '%s for each week, for %d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
350 | + $description = wp_sprintf(_n('%s for one week.', '%s for each week, for %d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
351 | 351 | } |
352 | 352 | } else { |
353 | - $description = wp_sprintf( _n( '%s for each week.', '%s for each %d weeks.', $interval, 'invoicing' ), $amount, $interval ); |
|
353 | + $description = wp_sprintf(_n('%s for each week.', '%s for each %d weeks.', $interval, 'invoicing'), $amount, $interval); |
|
354 | 354 | } |
355 | 355 | break; |
356 | 356 | case 'M' : |
357 | 357 | case 'month' : |
358 | - if ( (int)$bill_times > 0 ) { |
|
359 | - if ( $interval > 1 ) { |
|
360 | - if ( $bill_times > 1 ) { |
|
361 | - $description = wp_sprintf( __( '%s for each %d months, for %d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
358 | + if ((int)$bill_times > 0) { |
|
359 | + if ($interval > 1) { |
|
360 | + if ($bill_times > 1) { |
|
361 | + $description = wp_sprintf(__('%s for each %d months, for %d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
362 | 362 | } else { |
363 | - $description = wp_sprintf( __( '%s for %d months.', 'invoicing' ), $amount, $interval ); |
|
363 | + $description = wp_sprintf(__('%s for %d months.', 'invoicing'), $amount, $interval); |
|
364 | 364 | } |
365 | 365 | } else { |
366 | - $description = wp_sprintf( _n( '%s for one month.', '%s for each month, for %d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
366 | + $description = wp_sprintf(_n('%s for one month.', '%s for each month, for %d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
367 | 367 | } |
368 | 368 | } else { |
369 | - $description = wp_sprintf( _n( '%s for each month.', '%s for each %d months.', $interval, 'invoicing' ), $amount, $interval ); |
|
369 | + $description = wp_sprintf(_n('%s for each month.', '%s for each %d months.', $interval, 'invoicing'), $amount, $interval); |
|
370 | 370 | } |
371 | 371 | break; |
372 | 372 | case 'Y' : |
373 | 373 | case 'year' : |
374 | - if ( (int)$bill_times > 0 ) { |
|
375 | - if ( $interval > 1 ) { |
|
376 | - if ( $bill_times > 1 ) { |
|
377 | - $description = wp_sprintf( __( '%s for each %d years, for %d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
374 | + if ((int)$bill_times > 0) { |
|
375 | + if ($interval > 1) { |
|
376 | + if ($bill_times > 1) { |
|
377 | + $description = wp_sprintf(__('%s for each %d years, for %d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
378 | 378 | } else { |
379 | - $description = wp_sprintf( __( '%s for %d years.', 'invoicing'), $amount, $interval ); |
|
379 | + $description = wp_sprintf(__('%s for %d years.', 'invoicing'), $amount, $interval); |
|
380 | 380 | } |
381 | 381 | } else { |
382 | - $description = wp_sprintf( _n( '%s for one year.', '%s for each year, for %d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
382 | + $description = wp_sprintf(_n('%s for one year.', '%s for each year, for %d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
383 | 383 | } |
384 | 384 | } else { |
385 | - $description = wp_sprintf( _n( '%s for each year.', '%s for each %d years.', $interval, 'invoicing' ), $amount, $interval ); |
|
385 | + $description = wp_sprintf(_n('%s for each year.', '%s for each %d years.', $interval, 'invoicing'), $amount, $interval); |
|
386 | 386 | } |
387 | 387 | break; |
388 | 388 | } |
389 | 389 | |
390 | - return apply_filters( 'wpinv_subscription_recurring_payment_desc', $description, $amount, $period, $interval, $bill_times, $trial_period, $trial_interval ); |
|
390 | + return apply_filters('wpinv_subscription_recurring_payment_desc', $description, $amount, $period, $interval, $bill_times, $trial_period, $trial_interval); |
|
391 | 391 | } |
392 | 392 | |
393 | -function wpinv_subscription_payment_desc( $invoice ) { |
|
394 | - if ( empty( $invoice ) ) { |
|
393 | +function wpinv_subscription_payment_desc($invoice) { |
|
394 | + if (empty($invoice)) { |
|
395 | 395 | return NULL; |
396 | 396 | } |
397 | 397 | |
398 | 398 | $description = ''; |
399 | - if ( $invoice->is_parent() && $item = $invoice->get_recurring( true ) ) { |
|
400 | - if ( $item->has_free_trial() ) { |
|
399 | + if ($invoice->is_parent() && $item = $invoice->get_recurring(true)) { |
|
400 | + if ($item->has_free_trial()) { |
|
401 | 401 | $trial_period = $item->get_trial_period(); |
402 | 402 | $trial_interval = $item->get_trial_interval(); |
403 | 403 | } else { |
@@ -405,45 +405,45 @@ discard block |
||
405 | 405 | $trial_interval = 0; |
406 | 406 | } |
407 | 407 | |
408 | - $description = wpinv_get_billing_cycle( $invoice->get_total(), $invoice->get_recurring_details( 'total' ), $item->get_recurring_period(), $item->get_recurring_interval(), $item->get_recurring_limit(), $trial_period, $trial_interval, $invoice->get_currency() ); |
|
408 | + $description = wpinv_get_billing_cycle($invoice->get_total(), $invoice->get_recurring_details('total'), $item->get_recurring_period(), $item->get_recurring_interval(), $item->get_recurring_limit(), $trial_period, $trial_interval, $invoice->get_currency()); |
|
409 | 409 | } |
410 | 410 | |
411 | - return apply_filters( 'wpinv_subscription_payment_desc', $description, $invoice ); |
|
411 | + return apply_filters('wpinv_subscription_payment_desc', $description, $invoice); |
|
412 | 412 | } |
413 | 413 | |
414 | -function wpinv_get_billing_cycle( $initial, $recurring, $period, $interval, $bill_times, $trial_period = '', $trial_interval = 0, $currency = '' ) { |
|
415 | - $initial_total = wpinv_round_amount( $initial ); |
|
416 | - $recurring_total = wpinv_round_amount( $recurring ); |
|
414 | +function wpinv_get_billing_cycle($initial, $recurring, $period, $interval, $bill_times, $trial_period = '', $trial_interval = 0, $currency = '') { |
|
415 | + $initial_total = wpinv_round_amount($initial); |
|
416 | + $recurring_total = wpinv_round_amount($recurring); |
|
417 | 417 | |
418 | - if ( $trial_interval > 0 && !empty( $trial_period ) ) { |
|
418 | + if ($trial_interval > 0 && !empty($trial_period)) { |
|
419 | 419 | // Free trial |
420 | 420 | } else { |
421 | - if ( $bill_times == 1 ) { |
|
421 | + if ($bill_times == 1) { |
|
422 | 422 | $recurring_total = $initial_total; |
423 | - } else if ( $bill_times > 1 && $initial_total != $recurring_total ) { |
|
423 | + } else if ($bill_times > 1 && $initial_total != $recurring_total) { |
|
424 | 424 | $bill_times--; |
425 | 425 | } |
426 | 426 | } |
427 | 427 | |
428 | - $initial_amount = wpinv_price( wpinv_format_amount( $initial_total ), $currency ); |
|
429 | - $recurring_amount = wpinv_price( wpinv_format_amount( $recurring_total ), $currency ); |
|
428 | + $initial_amount = wpinv_price(wpinv_format_amount($initial_total), $currency); |
|
429 | + $recurring_amount = wpinv_price(wpinv_format_amount($recurring_total), $currency); |
|
430 | 430 | |
431 | - $recurring = wpinv_subscription_recurring_payment_desc( $recurring_amount, $period, $interval, $bill_times, $trial_period, $trial_interval ); |
|
431 | + $recurring = wpinv_subscription_recurring_payment_desc($recurring_amount, $period, $interval, $bill_times, $trial_period, $trial_interval); |
|
432 | 432 | |
433 | - if ( $initial_total != $recurring_total ) { |
|
434 | - $initial = wpinv_subscription_initial_payment_desc( $initial_amount, $period, $interval, $trial_period, $trial_interval ); |
|
433 | + if ($initial_total != $recurring_total) { |
|
434 | + $initial = wpinv_subscription_initial_payment_desc($initial_amount, $period, $interval, $trial_period, $trial_interval); |
|
435 | 435 | |
436 | - $description = wp_sprintf( __( '%s Then %s', 'invoicing' ), $initial, $recurring ); |
|
436 | + $description = wp_sprintf(__('%s Then %s', 'invoicing'), $initial, $recurring); |
|
437 | 437 | } else { |
438 | 438 | $description = $recurring; |
439 | 439 | } |
440 | 440 | |
441 | - return apply_filters( 'wpinv_get_billing_cycle', $description, $initial, $recurring, $period, $interval, $bill_times, $trial_period, $trial_interval, $currency ); |
|
441 | + return apply_filters('wpinv_get_billing_cycle', $description, $initial, $recurring, $period, $interval, $bill_times, $trial_period, $trial_interval, $currency); |
|
442 | 442 | } |
443 | 443 | |
444 | -function wpinv_recurring_send_payment_failed( $invoice ) { |
|
445 | - if ( !empty( $invoice->ID ) ) { |
|
446 | - wpinv_failed_invoice_notification( $invoice->ID ); |
|
444 | +function wpinv_recurring_send_payment_failed($invoice) { |
|
445 | + if (!empty($invoice->ID)) { |
|
446 | + wpinv_failed_invoice_notification($invoice->ID); |
|
447 | 447 | } |
448 | 448 | } |
449 | -add_action( 'wpinv_recurring_payment_failed', 'wpinv_recurring_send_payment_failed', 10, 1 ); |
|
450 | 449 | \ No newline at end of file |
450 | +add_action('wpinv_recurring_payment_failed', 'wpinv_recurring_send_payment_failed', 10, 1); |
|
451 | 451 | \ No newline at end of file |