@@ -7,55 +7,55 @@ discard block |
||
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 | -$invoice = new WPInv_Invoice( $invoice ); |
|
13 | +$invoice = new WPInv_Invoice($invoice); |
|
14 | 14 | |
15 | 15 | // @deprecated |
16 | -do_action( 'wpinv_success_content_before', $invoice ); |
|
17 | -do_action( 'wpinv_before_receipt', $invoice ); |
|
16 | +do_action('wpinv_success_content_before', $invoice); |
|
17 | +do_action('wpinv_before_receipt', $invoice); |
|
18 | 18 | |
19 | 19 | wpinv_print_errors(); |
20 | 20 | |
21 | 21 | // Prepare header text. |
22 | -if ( $invoice->is_paid() ) { |
|
22 | +if ($invoice->is_paid()) { |
|
23 | 23 | |
24 | 24 | $alert = aui()->alert( |
25 | 25 | array( |
26 | 26 | 'type' => 'success', |
27 | - 'content' => __( 'Thank you for your payment!', 'invoicing' ), |
|
27 | + 'content' => __('Thank you for your payment!', 'invoicing'), |
|
28 | 28 | ) |
29 | 29 | ); |
30 | 30 | |
31 | -} else if ( $invoice->is_refunded() ) { |
|
31 | +} else if ($invoice->is_refunded()) { |
|
32 | 32 | |
33 | 33 | $alert = aui()->alert( |
34 | 34 | array( |
35 | 35 | 'type' => 'info', |
36 | - 'content' => __( 'This invoice was refunded.', 'invoicing' ), |
|
36 | + 'content' => __('This invoice was refunded.', 'invoicing'), |
|
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | -} else if ( $invoice->is_held() ) { |
|
40 | +} else if ($invoice->is_held()) { |
|
41 | 41 | |
42 | 42 | $alert = aui()->alert( |
43 | 43 | array( |
44 | 44 | 'type' => 'info', |
45 | - 'content' => __( 'This invoice will be processed as soon we verify your payment.', 'invoicing' ), |
|
45 | + 'content' => __('This invoice will be processed as soon we verify your payment.', 'invoicing'), |
|
46 | 46 | ) |
47 | 47 | ); |
48 | 48 | |
49 | -} else if ( $invoice->needs_payment() ) { |
|
49 | +} else if ($invoice->needs_payment()) { |
|
50 | 50 | |
51 | - if ( $invoice->is_due() ) { |
|
51 | + if ($invoice->is_due()) { |
|
52 | 52 | |
53 | 53 | $alert = aui()->alert( |
54 | 54 | array( |
55 | 55 | 'type' => 'danger', |
56 | 56 | 'content' => sprintf( |
57 | - __( 'This invoice was due on %.', 'invoicing' ), |
|
58 | - getpaid_format_date_value( $invoice->get_due_date() ) |
|
57 | + __('This invoice was due on %.', 'invoicing'), |
|
58 | + getpaid_format_date_value($invoice->get_due_date()) |
|
59 | 59 | ), |
60 | 60 | ) |
61 | 61 | ); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $alert = aui()->alert( |
66 | 66 | array( |
67 | 67 | 'type' => 'warning', |
68 | - 'content' => __( 'This invoice needs payment.', 'invoicing' ), |
|
68 | + 'content' => __('This invoice needs payment.', 'invoicing'), |
|
69 | 69 | ) |
70 | 70 | ); |
71 | 71 | |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | |
81 | 81 | 'pay' => array( |
82 | 82 | 'url' => $invoice->get_checkout_payment_url(), |
83 | - 'name' => __( 'Pay For Invoice', 'invoicing' ), |
|
83 | + 'name' => __('Pay For Invoice', 'invoicing'), |
|
84 | 84 | 'class' => 'btn-success', |
85 | 85 | ), |
86 | 86 | |
87 | 87 | 'view' => array( |
88 | 88 | 'url' => $invoice->get_view_url(), |
89 | - 'name' => __( 'View Invoice', 'invoicing' ), |
|
89 | + 'name' => __('View Invoice', 'invoicing'), |
|
90 | 90 | 'class' => 'btn-primary', |
91 | 91 | ), |
92 | 92 | |
93 | 93 | 'history' => array( |
94 | 94 | 'url' => wpinv_get_history_page_uri(), |
95 | - 'name' => __( 'Invoice History', 'invoicing' ), |
|
95 | + 'name' => __('Invoice History', 'invoicing'), |
|
96 | 96 | 'class' => 'btn-warning', |
97 | 97 | ), |
98 | 98 | |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | |
102 | 102 | ); |
103 | 103 | |
104 | -if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $actions['pay'] ) ) { |
|
105 | - unset( $actions['pay'] ); |
|
104 | +if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($actions['pay'])) { |
|
105 | + unset($actions['pay']); |
|
106 | 106 | } |
107 | 107 | |
108 | -if ( ! is_user_logged_in() && isset( $actions['history'] ) ) { |
|
109 | - unset( $actions['history'] ); |
|
108 | +if (!is_user_logged_in() && isset($actions['history'])) { |
|
109 | + unset($actions['history']); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | ?> |
@@ -115,19 +115,19 @@ discard block |
||
115 | 115 | |
116 | 116 | <?php |
117 | 117 | |
118 | - do_action( 'wpinv_receipt_start', $invoice ); |
|
118 | + do_action('wpinv_receipt_start', $invoice); |
|
119 | 119 | |
120 | - if ( ! empty( $actions ) ) { |
|
120 | + if (!empty($actions)) { |
|
121 | 121 | |
122 | 122 | echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
123 | 123 | |
124 | - foreach ( $actions as $key => $action ) { |
|
124 | + foreach ($actions as $key => $action) { |
|
125 | 125 | |
126 | - $key = sanitize_html_class( $key ); |
|
127 | - $class = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] ); |
|
128 | - $url = empty( $action['url'] ) ? '#' : esc_url( $action['url'] ); |
|
129 | - $attrs = empty( $action['attrs'] ) ? '' : $action['attrs']; |
|
130 | - $anchor = sanitize_text_field( $action['name'] ); |
|
126 | + $key = sanitize_html_class($key); |
|
127 | + $class = empty($action['class']) ? 'btn-dark' : sanitize_html_class($action['class']); |
|
128 | + $url = empty($action['url']) ? '#' : esc_url($action['url']); |
|
129 | + $attrs = empty($action['attrs']) ? '' : $action['attrs']; |
|
130 | + $anchor = sanitize_text_field($action['name']); |
|
131 | 131 | |
132 | 132 | echo "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>"; |
133 | 133 | } |
@@ -143,21 +143,21 @@ discard block |
||
143 | 143 | <div class="wpinv-receipt-details"> |
144 | 144 | |
145 | 145 | <h4 class="wpinv-details-t mb-3 mt-3"> |
146 | - <?php echo apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?> |
|
146 | + <?php echo apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice); ?> |
|
147 | 147 | </h4> |
148 | 148 | |
149 | - <?php getpaid_invoice_meta( $invoice ); ?> |
|
149 | + <?php getpaid_invoice_meta($invoice); ?> |
|
150 | 150 | |
151 | 151 | </div> |
152 | 152 | |
153 | - <?php echo getpaid_display_invoice_subscriptions( $invoice ); ?> |
|
153 | + <?php echo getpaid_display_invoice_subscriptions($invoice); ?> |
|
154 | 154 | |
155 | - <?php do_action( 'wpinv_receipt_end', $invoice ); ?> |
|
155 | + <?php do_action('wpinv_receipt_end', $invoice); ?> |
|
156 | 156 | |
157 | 157 | </div> |
158 | 158 | |
159 | 159 | <?php |
160 | 160 | |
161 | 161 | // @deprecated |
162 | -do_action( 'wpinv_success_content_after', $invoice ); |
|
163 | -do_action( 'wpinv_after_receipt', $invoice ); |
|
162 | +do_action('wpinv_success_content_after', $invoice); |
|
163 | +do_action('wpinv_after_receipt', $invoice); |