@@ -7,26 +7,26 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | - <?php do_action( 'getpaid_before_invoice_details_main', $invoice ); ?> |
|
14 | + <?php do_action('getpaid_before_invoice_details_main', $invoice); ?> |
|
15 | 15 | |
16 | 16 | <div class="getpaid-invoice-details mt-3 mb-3"> |
17 | 17 | <div class="row"> |
18 | 18 | |
19 | 19 | <div class="col-12 col-sm-6"> |
20 | - <?php do_action( 'getpaid_invoice_details_left', $invoice ); ?> |
|
20 | + <?php do_action('getpaid_invoice_details_left', $invoice); ?> |
|
21 | 21 | </div> |
22 | 22 | |
23 | 23 | <div class="col-12 col-sm-6"> |
24 | - <?php do_action( 'getpaid_invoice_details_right', $invoice ); ?> |
|
24 | + <?php do_action('getpaid_invoice_details_right', $invoice); ?> |
|
25 | 25 | </div> |
26 | 26 | |
27 | 27 | </div> |
28 | 28 | </div> |
29 | 29 | |
30 | - <?php do_action( 'getpaid_after_invoice_details_main', $invoice ); ?> |
|
30 | + <?php do_action('getpaid_after_invoice_details_main', $invoice); ?> |
|
31 | 31 | |
32 | 32 | <?php |
@@ -7,13 +7,13 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $text ) ) { |
|
13 | - $text = __( 'Total to pay:', 'invoicing' ); |
|
12 | +if (empty($text)) { |
|
13 | + $text = __('Total to pay:', 'invoicing'); |
|
14 | 14 | } |
15 | 15 | ?> |
16 | 16 | <div class="form-group mt-4"> |
17 | - <strong><?php echo sanitize_text_field( $text ); ?></strong> |
|
17 | + <strong><?php echo sanitize_text_field($text); ?></strong> |
|
18 | 18 | <span class="getpaid-checkout-total-payable"></span> |
19 | 19 | </div> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * @deprecated |
247 | 247 | */ |
248 | 248 | function wpinv_get_payment_key( $invoice = 0 ) { |
249 | - $invoice = new WPInv_Invoice( $invoice ); |
|
249 | + $invoice = new WPInv_Invoice( $invoice ); |
|
250 | 250 | return $invoice->get_key(); |
251 | 251 | } |
252 | 252 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | * @deprecated |
425 | 425 | */ |
426 | 426 | function wpinv_get_checkout_session() { |
427 | - return false; |
|
427 | + return false; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | /** |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Invoicing |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @deprecated |
@@ -19,48 +19,48 @@ discard block |
||
19 | 19 | * @deprecated |
20 | 20 | */ |
21 | 21 | function wpinv_get_invoice_cart() { |
22 | - return wpinv_get_invoice( getpaid_get_current_invoice_id() ); |
|
22 | + return wpinv_get_invoice(getpaid_get_current_invoice_id()); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @deprecated |
27 | 27 | */ |
28 | -function wpinv_get_invoice_description( $invoice ) { |
|
29 | - $invoice = new WPInv_Invoice( $invoice ); |
|
28 | +function wpinv_get_invoice_description($invoice) { |
|
29 | + $invoice = new WPInv_Invoice($invoice); |
|
30 | 30 | return $invoice->get_description(); |
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @deprecated |
35 | 35 | */ |
36 | -function wpinv_get_invoice_currency_code( $invoice ) { |
|
37 | - $invoice = new WPInv_Invoice( $invoice ); |
|
36 | +function wpinv_get_invoice_currency_code($invoice) { |
|
37 | + $invoice = new WPInv_Invoice($invoice); |
|
38 | 38 | return $invoice->get_currency(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @deprecated |
43 | 43 | */ |
44 | -function wpinv_get_payment_user_email( $invoice ) { |
|
45 | - $invoice = new WPInv_Invoice( $invoice ); |
|
44 | +function wpinv_get_payment_user_email($invoice) { |
|
45 | + $invoice = new WPInv_Invoice($invoice); |
|
46 | 46 | return $invoice->get_email(); |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @deprecated |
51 | 51 | */ |
52 | -function wpinv_get_user_id( $invoice ) { |
|
53 | - $invoice = new WPInv_Invoice( $invoice ); |
|
52 | +function wpinv_get_user_id($invoice) { |
|
53 | + $invoice = new WPInv_Invoice($invoice); |
|
54 | 54 | return $invoice->get_user_id(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @deprecated |
59 | 59 | */ |
60 | -function wpinv_get_invoice_status( $invoice, $return_label = false ) { |
|
61 | - $invoice = new WPInv_Invoice( $invoice ); |
|
60 | +function wpinv_get_invoice_status($invoice, $return_label = false) { |
|
61 | + $invoice = new WPInv_Invoice($invoice); |
|
62 | 62 | |
63 | - if ( $return_label ) { |
|
63 | + if ($return_label) { |
|
64 | 64 | return $invoice->get_status_nicename(); |
65 | 65 | } |
66 | 66 | |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * @deprecated |
72 | 72 | */ |
73 | -function wpinv_get_payment_gateway( $invoice, $return_label = false ) { |
|
74 | - $invoice = new WPInv_Invoice( $invoice ); |
|
73 | +function wpinv_get_payment_gateway($invoice, $return_label = false) { |
|
74 | + $invoice = new WPInv_Invoice($invoice); |
|
75 | 75 | |
76 | - if ( $return_label ) { |
|
76 | + if ($return_label) { |
|
77 | 77 | return $invoice->get_gateway_title(); |
78 | 78 | } |
79 | 79 | |
@@ -83,75 +83,75 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * @deprecated |
85 | 85 | */ |
86 | -function wpinv_get_payment_gateway_name( $invoice ) { |
|
87 | - return wpinv_get_payment_gateway( $invoice, true ); |
|
86 | +function wpinv_get_payment_gateway_name($invoice) { |
|
87 | + return wpinv_get_payment_gateway($invoice, true); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @deprecated |
92 | 92 | */ |
93 | -function wpinv_get_payment_transaction_id( $invoice ) { |
|
94 | - $invoice = new WPInv_Invoice( $invoice ); |
|
93 | +function wpinv_get_payment_transaction_id($invoice) { |
|
94 | + $invoice = new WPInv_Invoice($invoice); |
|
95 | 95 | return $invoice->get_transaction_id(); |
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * @deprecated |
100 | 100 | */ |
101 | -function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) { |
|
102 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
103 | - return $invoice->get_meta( $meta_key, $single ); |
|
101 | +function wpinv_get_invoice_meta($invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true) { |
|
102 | + $invoice = new WPInv_Invoice($invoice_id); |
|
103 | + return $invoice->get_meta($meta_key, $single); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | 107 | * @deprecated |
108 | 108 | */ |
109 | -function wpinv_update_invoice_meta( $invoice_id = 0, $meta_key = '', $meta_value = '' ) { |
|
110 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
111 | - return $invoice->update_meta_data( $meta_key, $meta_value ); |
|
109 | +function wpinv_update_invoice_meta($invoice_id = 0, $meta_key = '', $meta_value = '') { |
|
110 | + $invoice = new WPInv_Invoice($invoice_id); |
|
111 | + return $invoice->update_meta_data($meta_key, $meta_value); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | 115 | * @deprecated |
116 | 116 | */ |
117 | -function wpinv_get_items( $invoice = 0 ) { |
|
118 | - $invoice = new WPInv_Invoice( $invoice ); |
|
117 | +function wpinv_get_items($invoice = 0) { |
|
118 | + $invoice = new WPInv_Invoice($invoice); |
|
119 | 119 | return $invoice->get_items(); |
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | 123 | * @deprecated |
124 | 124 | */ |
125 | -function wpinv_get_fees( $invoice = 0 ) { |
|
126 | - $invoice = new WPInv_Invoice( $invoice ); |
|
125 | +function wpinv_get_fees($invoice = 0) { |
|
126 | + $invoice = new WPInv_Invoice($invoice); |
|
127 | 127 | return $invoice->get_fees(); |
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | 131 | * @deprecated |
132 | 132 | */ |
133 | -function wpinv_get_invoice_ip( $invoice ) { |
|
134 | - $invoice = new WPInv_Invoice( $invoice ); |
|
133 | +function wpinv_get_invoice_ip($invoice) { |
|
134 | + $invoice = new WPInv_Invoice($invoice); |
|
135 | 135 | return $invoice->get_ip(); |
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | 139 | * @deprecated |
140 | 140 | */ |
141 | -function wpinv_get_invoice_user_info( $invoice ) { |
|
142 | - $invoice = new WPInv_Invoice( $invoice ); |
|
141 | +function wpinv_get_invoice_user_info($invoice) { |
|
142 | + $invoice = new WPInv_Invoice($invoice); |
|
143 | 143 | return $invoice->get_user_info(); |
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | 147 | * @deprecated |
148 | 148 | */ |
149 | -function wpinv_subtotal( $invoice = 0, $currency = false ) { |
|
150 | - $invoice = new WPInv_Invoice( $invoice ); |
|
149 | +function wpinv_subtotal($invoice = 0, $currency = false) { |
|
150 | + $invoice = new WPInv_Invoice($invoice); |
|
151 | 151 | $subtotal = $invoice->get_subtotal(); |
152 | 152 | |
153 | - if ( $currency ) { |
|
154 | - return wpinv_price( $subtotal, $invoice->get_currency() ); |
|
153 | + if ($currency) { |
|
154 | + return wpinv_price($subtotal, $invoice->get_currency()); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return $subtotal; |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | /** |
161 | 161 | * @deprecated |
162 | 162 | */ |
163 | -function wpinv_tax( $invoice = 0, $currency = false ) { |
|
164 | - $invoice = new WPInv_Invoice( $invoice ); |
|
163 | +function wpinv_tax($invoice = 0, $currency = false) { |
|
164 | + $invoice = new WPInv_Invoice($invoice); |
|
165 | 165 | $tax = $invoice->get_total_tax(); |
166 | 166 | |
167 | - if ( $currency ) { |
|
168 | - return wpinv_price( $tax, $invoice->get_currency() ); |
|
167 | + if ($currency) { |
|
168 | + return wpinv_price($tax, $invoice->get_currency()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $tax; |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | /** |
175 | 175 | * @deprecated |
176 | 176 | */ |
177 | -function wpinv_discount( $invoice = 0, $currency = false, $deprecated ) { |
|
178 | - $invoice = new WPInv_Invoice( $invoice ); |
|
177 | +function wpinv_discount($invoice = 0, $currency = false, $deprecated) { |
|
178 | + $invoice = new WPInv_Invoice($invoice); |
|
179 | 179 | $discount = $invoice->get_total_discount(); |
180 | 180 | |
181 | - if ( $currency ) { |
|
182 | - return wpinv_price( $discount, $invoice->get_currency() ); |
|
181 | + if ($currency) { |
|
182 | + return wpinv_price($discount, $invoice->get_currency()); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | return $discount; |
@@ -188,20 +188,20 @@ discard block |
||
188 | 188 | /** |
189 | 189 | * @deprecated |
190 | 190 | */ |
191 | -function wpinv_discount_code( $invoice = 0 ) { |
|
192 | - $invoice = new WPInv_Invoice( $invoice ); |
|
191 | +function wpinv_discount_code($invoice = 0) { |
|
192 | + $invoice = new WPInv_Invoice($invoice); |
|
193 | 193 | return $invoice->get_discount_code(); |
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
197 | 197 | * @deprecated |
198 | 198 | */ |
199 | -function wpinv_payment_total( $invoice = 0, $currency = false ) { |
|
200 | - $invoice = new WPInv_Invoice( $invoice ); |
|
199 | +function wpinv_payment_total($invoice = 0, $currency = false) { |
|
200 | + $invoice = new WPInv_Invoice($invoice); |
|
201 | 201 | $total = $invoice->get_total(); |
202 | 202 | |
203 | - if ( $currency ) { |
|
204 | - return wpinv_price( $total, $invoice->get_currency() ); |
|
203 | + if ($currency) { |
|
204 | + return wpinv_price($total, $invoice->get_currency()); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | return $total; |
@@ -210,51 +210,51 @@ discard block |
||
210 | 210 | /** |
211 | 211 | * @deprecated |
212 | 212 | */ |
213 | -function wpinv_get_date_created( $invoice = 0, $format = '' ) { |
|
214 | - $invoice = new WPInv_Invoice( $invoice ); |
|
213 | +function wpinv_get_date_created($invoice = 0, $format = '') { |
|
214 | + $invoice = new WPInv_Invoice($invoice); |
|
215 | 215 | |
216 | - $format = ! empty( $format ) ? $format : get_option( 'date_format' ); |
|
216 | + $format = !empty($format) ? $format : get_option('date_format'); |
|
217 | 217 | $date_created = $invoice->get_created_date(); |
218 | 218 | |
219 | - return empty( $date_created ) ? date_i18n( $format, strtotime( $date_created ) ) : ''; |
|
219 | + return empty($date_created) ? date_i18n($format, strtotime($date_created)) : ''; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
223 | 223 | * @deprecated |
224 | 224 | */ |
225 | -function wpinv_get_invoice_date( $invoice = 0, $format = '' ) { |
|
226 | - wpinv_get_date_created( $invoice, $format ); |
|
225 | +function wpinv_get_invoice_date($invoice = 0, $format = '') { |
|
226 | + wpinv_get_date_created($invoice, $format); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
230 | 230 | * @deprecated |
231 | 231 | */ |
232 | -function wpinv_get_invoice_vat_number( $invoice = 0 ) { |
|
233 | - $invoice = new WPInv_Invoice( $invoice ); |
|
232 | +function wpinv_get_invoice_vat_number($invoice = 0) { |
|
233 | + $invoice = new WPInv_Invoice($invoice); |
|
234 | 234 | return $invoice->get_vat_number(); |
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
238 | 238 | * @deprecated |
239 | 239 | */ |
240 | -function wpinv_insert_payment_note( $invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false ) { |
|
241 | - $invoice = new WPInv_Invoice( $invoice ); |
|
242 | - return $invoice->add_note( $note, $user_type, $added_by_user, $system ); |
|
240 | +function wpinv_insert_payment_note($invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false) { |
|
241 | + $invoice = new WPInv_Invoice($invoice); |
|
242 | + return $invoice->add_note($note, $user_type, $added_by_user, $system); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
246 | 246 | * @deprecated |
247 | 247 | */ |
248 | -function wpinv_get_payment_key( $invoice = 0 ) { |
|
249 | - $invoice = new WPInv_Invoice( $invoice ); |
|
248 | +function wpinv_get_payment_key($invoice = 0) { |
|
249 | + $invoice = new WPInv_Invoice($invoice); |
|
250 | 250 | return $invoice->get_key(); |
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
254 | 254 | * @deprecated |
255 | 255 | */ |
256 | -function wpinv_get_invoice_number( $invoice = 0 ) { |
|
257 | - $invoice = new WPInv_Invoice( $invoice ); |
|
256 | +function wpinv_get_invoice_number($invoice = 0) { |
|
257 | + $invoice = new WPInv_Invoice($invoice); |
|
258 | 258 | return $invoice->get_number(); |
259 | 259 | } |
260 | 260 | |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | /** |
402 | 402 | * @deprecated |
403 | 403 | */ |
404 | -function wpinv_update_payment_status( $invoice, $new_status = 'publish' ) { |
|
405 | - $invoice = new WPInv_Invoice( $invoice ); |
|
406 | - return $invoice->update_status( $new_status ); |
|
404 | +function wpinv_update_payment_status($invoice, $new_status = 'publish') { |
|
405 | + $invoice = new WPInv_Invoice($invoice); |
|
406 | + return $invoice->update_status($new_status); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | /** |
@@ -456,22 +456,22 @@ discard block |
||
456 | 456 | /** |
457 | 457 | * @deprecated |
458 | 458 | */ |
459 | -function wpinv_set_payment_transaction_id( $invoice_id = 0, $transaction_id = '' ) { |
|
459 | +function wpinv_set_payment_transaction_id($invoice_id = 0, $transaction_id = '') { |
|
460 | 460 | |
461 | 461 | // Fetch the invoice. |
462 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
462 | + $invoice = new WPInv_Invoice($invoice_id); |
|
463 | 463 | |
464 | - if ( 0 == $invoice->get_id() ) { |
|
464 | + if (0 == $invoice->get_id()) { |
|
465 | 465 | return false; |
466 | 466 | } |
467 | 467 | |
468 | 468 | // Prepare the transaction id. |
469 | - if ( empty( $transaction_id ) ) { |
|
469 | + if (empty($transaction_id)) { |
|
470 | 470 | $transaction_id = $invoice_id; |
471 | 471 | } |
472 | 472 | |
473 | 473 | // Set the transaction id; |
474 | - $invoice->set_transaction_id( apply_filters( 'wpinv_set_payment_transaction_id', $transaction_id, $invoice ) ); |
|
474 | + $invoice->set_transaction_id(apply_filters('wpinv_set_payment_transaction_id', $transaction_id, $invoice)); |
|
475 | 475 | |
476 | 476 | // Save the invoice. |
477 | 477 | return $invoice->save(); |
@@ -484,12 +484,12 @@ discard block |
||
484 | 484 | * @param WPInv_Invoice $invoice |
485 | 485 | * @param string $gateway |
486 | 486 | */ |
487 | -function wpinv_send_to_gateway( $gateway, $invoice ) { |
|
487 | +function wpinv_send_to_gateway($gateway, $invoice) { |
|
488 | 488 | |
489 | 489 | $payment_data = array( |
490 | 490 | 'invoice_id' => $invoice->get_id(), |
491 | 491 | 'items' => $invoice->get_cart_details(), |
492 | - 'cart_discounts' => array( $invoice->get_discount_code() ), |
|
492 | + 'cart_discounts' => array($invoice->get_discount_code()), |
|
493 | 493 | 'fees' => $invoice->get_total_fees(), |
494 | 494 | 'subtotal' => $invoice->get_subtotal(), |
495 | 495 | 'discount' => $invoice->get_total_discount(), |
@@ -497,16 +497,16 @@ discard block |
||
497 | 497 | 'price' => $invoice->get_total(), |
498 | 498 | 'invoice_key' => $invoice->get_key(), |
499 | 499 | 'user_email' => $invoice->get_email(), |
500 | - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), |
|
500 | + 'date' => date('Y-m-d H:i:s', current_time('timestamp')), |
|
501 | 501 | 'user_info' => $invoice->get_user_info(), |
502 | - 'post_data' => stripslashes_deep( $_POST ), |
|
502 | + 'post_data' => stripslashes_deep($_POST), |
|
503 | 503 | 'cart_details' => $invoice->get_cart_details(), |
504 | 504 | 'gateway' => $gateway, |
505 | 505 | 'card_info' => array(), |
506 | 506 | 'gateway_nonce' => wp_create_nonce('wpi-gateway'), |
507 | 507 | ); |
508 | 508 | |
509 | - do_action( 'wpinv_gateway_' . $gateway, $payment_data ); |
|
509 | + do_action('wpinv_gateway_' . $gateway, $payment_data); |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | /** |
@@ -519,10 +519,10 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * @deprecated |
521 | 521 | */ |
522 | -function wpinv_die( $message = '', $title = '', $status = 400 ) { |
|
523 | - add_filter( 'wp_die_ajax_handler', 'wpinv_die_handler', 10, 3 ); |
|
524 | - add_filter( 'wp_die_handler', 'wpinv_die_handler', 10, 3 ); |
|
525 | - wp_die( $message, $title, array( 'response' => $status )); |
|
522 | +function wpinv_die($message = '', $title = '', $status = 400) { |
|
523 | + add_filter('wp_die_ajax_handler', 'wpinv_die_handler', 10, 3); |
|
524 | + add_filter('wp_die_handler', 'wpinv_die_handler', 10, 3); |
|
525 | + wp_die($message, $title, array('response' => $status)); |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | /** |
@@ -640,14 +640,14 @@ discard block |
||
640 | 640 | /** |
641 | 641 | * @deprecated |
642 | 642 | */ |
643 | -function wpinv_invoice_status_label( $status, $status_display = '' ) { |
|
644 | - return empty( $status_display ) ? sanitize_text_field( $status ) : sanitize_text_field( $status_display ); |
|
643 | +function wpinv_invoice_status_label($status, $status_display = '') { |
|
644 | + return empty($status_display) ? sanitize_text_field($status) : sanitize_text_field($status_display); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | /** |
648 | 648 | * @deprecated |
649 | 649 | */ |
650 | -function wpinv_clean_invoice_number( $number ) { |
|
650 | +function wpinv_clean_invoice_number($number) { |
|
651 | 651 | return $number; |
652 | 652 | } |
653 | 653 | |
@@ -852,12 +852,12 @@ discard block |
||
852 | 852 | /** |
853 | 853 | * @deprecated |
854 | 854 | */ |
855 | -function wpinv_item_show_price( $item_id = 0, $echo = true ) { |
|
855 | +function wpinv_item_show_price($item_id = 0, $echo = true) { |
|
856 | 856 | |
857 | - if ( $echo ) { |
|
858 | - echo wpinv_item_price( $item_id ); |
|
857 | + if ($echo) { |
|
858 | + echo wpinv_item_price($item_id); |
|
859 | 859 | } else { |
860 | - return wpinv_item_price( $item_id ); |
|
860 | + return wpinv_item_price($item_id); |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @package Invoicing/data |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | return array( |
12 | 12 | "AD" => "AD\d{3}", |
@@ -44,15 +44,15 @@ |
||
44 | 44 | parent::__construct( $options ); |
45 | 45 | } |
46 | 46 | |
47 | - /** |
|
48 | - * The Super block output function. |
|
49 | - * |
|
50 | - * @param array $args |
|
51 | - * @param array $widget_args |
|
52 | - * @param string $content |
|
53 | - * |
|
54 | - * @return mixed|string|bool |
|
55 | - */ |
|
47 | + /** |
|
48 | + * The Super block output function. |
|
49 | + * |
|
50 | + * @param array $args |
|
51 | + * @param array $widget_args |
|
52 | + * @param string $content |
|
53 | + * |
|
54 | + * @return mixed|string|bool |
|
55 | + */ |
|
56 | 56 | public function output( $args = array(), $widget_args = array(), $content = '' ) { |
57 | 57 | return getpaid_invoice_history(); |
58 | 58 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if (!defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | 'block-keywords'=> "['invoicing','history']", |
23 | 23 | 'class_name' => __CLASS__, |
24 | 24 | 'base_id' => 'wpinv_history', |
25 | - 'name' => __('GetPaid > Invoice History','invoicing'), |
|
25 | + 'name' => __('GetPaid > Invoice History', 'invoicing'), |
|
26 | 26 | 'widget_ops' => array( |
27 | 27 | 'classname' => 'wpinv-history-class bsui', |
28 | - 'description' => esc_html__('Displays invoice history.','invoicing'), |
|
28 | + 'description' => esc_html__('Displays invoice history.', 'invoicing'), |
|
29 | 29 | ), |
30 | 30 | 'arguments' => array( |
31 | 31 | 'title' => array( |
32 | - 'title' => __( 'Widget title', 'invoicing' ), |
|
33 | - 'desc' => __( 'Enter widget title.', 'invoicing' ), |
|
32 | + 'title' => __('Widget title', 'invoicing'), |
|
33 | + 'desc' => __('Enter widget title.', 'invoicing'), |
|
34 | 34 | 'type' => 'text', |
35 | 35 | 'desc_tip' => true, |
36 | 36 | 'default' => '', |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ); |
42 | 42 | |
43 | 43 | |
44 | - parent::__construct( $options ); |
|
44 | + parent::__construct($options); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @return mixed|string|bool |
55 | 55 | */ |
56 | - public function output( $args = array(), $widget_args = array(), $content = '' ) { |
|
56 | + public function output($args = array(), $widget_args = array(), $content = '') { |
|
57 | 57 | return getpaid_invoice_history(); |
58 | 58 | } |
59 | 59 |
@@ -44,15 +44,15 @@ |
||
44 | 44 | parent::__construct( $options ); |
45 | 45 | } |
46 | 46 | |
47 | - /** |
|
48 | - * The Super block output function. |
|
49 | - * |
|
50 | - * @param array $args |
|
51 | - * @param array $widget_args |
|
52 | - * @param string $content |
|
53 | - * |
|
54 | - * @return mixed|string|bool |
|
55 | - */ |
|
47 | + /** |
|
48 | + * The Super block output function. |
|
49 | + * |
|
50 | + * @param array $args |
|
51 | + * @param array $widget_args |
|
52 | + * @param string $content |
|
53 | + * |
|
54 | + * @return mixed|string|bool |
|
55 | + */ |
|
56 | 56 | public function output( $args = array(), $widget_args = array(), $content = '' ) { |
57 | 57 | return wpinv_payment_receipt(); |
58 | 58 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if (!defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | 'block-keywords'=> "['invoicing','receipt']", |
23 | 23 | 'class_name' => __CLASS__, |
24 | 24 | 'base_id' => 'wpinv_receipt', |
25 | - 'name' => __('GetPaid > Invoice Receipt','invoicing'), |
|
25 | + 'name' => __('GetPaid > Invoice Receipt', 'invoicing'), |
|
26 | 26 | 'widget_ops' => array( |
27 | 27 | 'classname' => 'wpinv-receipt-class bsui', |
28 | - 'description' => esc_html__('Displays invoice receipt after checkout.','invoicing'), |
|
28 | + 'description' => esc_html__('Displays invoice receipt after checkout.', 'invoicing'), |
|
29 | 29 | ), |
30 | 30 | 'arguments' => array( |
31 | 31 | 'title' => array( |
32 | - 'title' => __( 'Widget title', 'invoicing' ), |
|
33 | - 'desc' => __( 'Enter widget title.', 'invoicing' ), |
|
32 | + 'title' => __('Widget title', 'invoicing'), |
|
33 | + 'desc' => __('Enter widget title.', 'invoicing'), |
|
34 | 34 | 'type' => 'text', |
35 | 35 | 'desc_tip' => true, |
36 | 36 | 'default' => '', |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ); |
42 | 42 | |
43 | 43 | |
44 | - parent::__construct( $options ); |
|
44 | + parent::__construct($options); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @return mixed|string|bool |
55 | 55 | */ |
56 | - public function output( $args = array(), $widget_args = array(), $content = '' ) { |
|
56 | + public function output($args = array(), $widget_args = array(), $content = '') { |
|
57 | 57 | return wpinv_payment_receipt(); |
58 | 58 | } |
59 | 59 |
@@ -13,65 +13,65 @@ discard block |
||
13 | 13 | class GetPaid_Worldpay_Gateway extends GetPaid_Payment_Gateway { |
14 | 14 | |
15 | 15 | /** |
16 | - * Payment method id. |
|
17 | - * |
|
18 | - * @var string |
|
19 | - */ |
|
16 | + * Payment method id. |
|
17 | + * |
|
18 | + * @var string |
|
19 | + */ |
|
20 | 20 | public $id = 'worldpay'; |
21 | 21 | |
22 | 22 | /** |
23 | - * Payment method order. |
|
24 | - * |
|
25 | - * @var int |
|
26 | - */ |
|
23 | + * Payment method order. |
|
24 | + * |
|
25 | + * @var int |
|
26 | + */ |
|
27 | 27 | public $order = 5; |
28 | 28 | |
29 | 29 | /** |
30 | - * Endpoint for requests from Worldpay. |
|
31 | - * |
|
32 | - * @var string |
|
33 | - */ |
|
34 | - protected $notify_url; |
|
35 | - |
|
36 | - /** |
|
37 | - * Endpoint for requests to Worldpay. |
|
38 | - * |
|
39 | - * @var string |
|
40 | - */ |
|
30 | + * Endpoint for requests from Worldpay. |
|
31 | + * |
|
32 | + * @var string |
|
33 | + */ |
|
34 | + protected $notify_url; |
|
35 | + |
|
36 | + /** |
|
37 | + * Endpoint for requests to Worldpay. |
|
38 | + * |
|
39 | + * @var string |
|
40 | + */ |
|
41 | 41 | protected $endpoint; |
42 | 42 | |
43 | 43 | /** |
44 | - * An array of features that this gateway supports. |
|
45 | - * |
|
46 | - * @var array |
|
47 | - */ |
|
44 | + * An array of features that this gateway supports. |
|
45 | + * |
|
46 | + * @var array |
|
47 | + */ |
|
48 | 48 | protected $supports = array( 'sandbox' ); |
49 | 49 | |
50 | 50 | /** |
51 | - * Currencies this gateway is allowed for. |
|
52 | - * |
|
53 | - * @var array |
|
54 | - */ |
|
55 | - public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' ); |
|
51 | + * Currencies this gateway is allowed for. |
|
52 | + * |
|
53 | + * @var array |
|
54 | + */ |
|
55 | + public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' ); |
|
56 | 56 | |
57 | 57 | /** |
58 | - * URL to view a transaction. |
|
59 | - * |
|
60 | - * @var string |
|
61 | - */ |
|
58 | + * URL to view a transaction. |
|
59 | + * |
|
60 | + * @var string |
|
61 | + */ |
|
62 | 62 | public $view_transaction_url = 'https://www.{sandbox}paypal.com/activity/payment/%s'; |
63 | 63 | |
64 | 64 | /** |
65 | - * URL to view a subscription. |
|
66 | - * |
|
67 | - * @var string |
|
68 | - */ |
|
69 | - public $view_subscription_url = 'https://www.{sandbox}paypal.com/cgi-bin/webscr?cmd=_profile-recurring-payments&encrypted_profile_id=%s'; |
|
65 | + * URL to view a subscription. |
|
66 | + * |
|
67 | + * @var string |
|
68 | + */ |
|
69 | + public $view_subscription_url = 'https://www.{sandbox}paypal.com/cgi-bin/webscr?cmd=_profile-recurring-payments&encrypted_profile_id=%s'; |
|
70 | 70 | |
71 | 71 | /** |
72 | - * Class constructor. |
|
73 | - */ |
|
74 | - public function __construct() { |
|
72 | + * Class constructor. |
|
73 | + */ |
|
74 | + public function __construct() { |
|
75 | 75 | |
76 | 76 | $this->method_title = __( 'Worldpay', 'invoicing' ); |
77 | 77 | $this->title = __( 'Worldpay - Credit Card / Debit Card', 'invoicing' ); |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Process Payment. |
|
89 | - * |
|
90 | - * |
|
91 | - * @param WPInv_Invoice $invoice Invoice. |
|
92 | - * @param array $submission_data Posted checkout fields. |
|
93 | - * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
|
94 | - * @return array |
|
95 | - */ |
|
96 | - public function process_payment( $invoice, $submission_data, $submission ) { |
|
88 | + * Process Payment. |
|
89 | + * |
|
90 | + * |
|
91 | + * @param WPInv_Invoice $invoice Invoice. |
|
92 | + * @param array $submission_data Posted checkout fields. |
|
93 | + * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
|
94 | + * @return array |
|
95 | + */ |
|
96 | + public function process_payment( $invoice, $submission_data, $submission ) { |
|
97 | 97 | |
98 | 98 | // Get redirect url. |
99 | 99 | $worldpay_redirect = esc_url( $this->get_request_url( $invoice ) ); |
@@ -128,31 +128,31 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * Get the Worldpay request URL for an invoice. |
|
132 | - * |
|
133 | - * @param WPInv_Invoice $invoice Invoice object. |
|
134 | - * @return string |
|
135 | - */ |
|
136 | - public function get_request_url( $invoice ) { |
|
131 | + * Get the Worldpay request URL for an invoice. |
|
132 | + * |
|
133 | + * @param WPInv_Invoice $invoice Invoice object. |
|
134 | + * @return string |
|
135 | + */ |
|
136 | + public function get_request_url( $invoice ) { |
|
137 | 137 | |
138 | 138 | // Endpoint for this request |
139 | - $this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase'; |
|
139 | + $this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase'; |
|
140 | 140 | |
141 | 141 | return $this->endpoint; |
142 | 142 | |
143 | - } |
|
143 | + } |
|
144 | 144 | |
145 | 145 | /** |
146 | - * Get Worldpay Args for passing to Worldpay. |
|
147 | - * |
|
148 | - * @param WPInv_Invoice $invoice Invoice object. |
|
149 | - * @return array |
|
150 | - */ |
|
151 | - protected function get_worldpay_args( $invoice ) { |
|
152 | - |
|
153 | - return apply_filters( |
|
154 | - 'getpaid_worldpay_args', |
|
155 | - array( |
|
146 | + * Get Worldpay Args for passing to Worldpay. |
|
147 | + * |
|
148 | + * @param WPInv_Invoice $invoice Invoice object. |
|
149 | + * @return array |
|
150 | + */ |
|
151 | + protected function get_worldpay_args( $invoice ) { |
|
152 | + |
|
153 | + return apply_filters( |
|
154 | + 'getpaid_worldpay_args', |
|
155 | + array( |
|
156 | 156 | 'amount' => wpinv_sanitize_amount( $invoice->get_total() ), // mandatory |
157 | 157 | 'cartId' => wpinv_clean( $invoice->get_number() ), // mandatory reference for the item purchased |
158 | 158 | 'currency' => wpinv_clean( $invoice->get_currency() ), // mandatory |
@@ -177,18 +177,18 @@ discard block |
||
177 | 177 | 'countryString' => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ), |
178 | 178 | 'compName' => wpinv_clean( $invoice->get_company() ), |
179 | 179 | ), |
180 | - $invoice |
|
181 | - ); |
|
180 | + $invoice |
|
181 | + ); |
|
182 | 182 | |
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | - * Secures worldpay args with an md5 hash. |
|
187 | - * |
|
188 | - * @param array $args Gateway args. |
|
189 | - * @return array |
|
190 | - */ |
|
191 | - public function hash_args( $args ) { |
|
186 | + * Secures worldpay args with an md5 hash. |
|
187 | + * |
|
188 | + * @param array $args Gateway args. |
|
189 | + * @return array |
|
190 | + */ |
|
191 | + public function hash_args( $args ) { |
|
192 | 192 | |
193 | 193 | $md5_secret = $this->get_option( 'md5_secret' ); |
194 | 194 | |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
207 | - * Processes ipns and marks payments as complete. |
|
208 | - * |
|
209 | - * @return void |
|
210 | - */ |
|
211 | - public function verify_ipn() { |
|
207 | + * Processes ipns and marks payments as complete. |
|
208 | + * |
|
209 | + * @return void |
|
210 | + */ |
|
211 | + public function verify_ipn() { |
|
212 | 212 | |
213 | 213 | // Validate the IPN. |
214 | 214 | if ( empty( $_POST ) || ! $this->validate_ipn() ) { |
215 | - wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) ); |
|
216 | - } |
|
215 | + wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) ); |
|
216 | + } |
|
217 | 217 | |
218 | 218 | // Process the IPN. |
219 | 219 | $posted = wp_unslash( $_POST ); |
@@ -229,8 +229,8 @@ discard block |
||
229 | 229 | $invoice->set_transaction_id( wpinv_clean( $posted['transId'] ) ); |
230 | 230 | } |
231 | 231 | |
232 | - // Update the ip address. |
|
233 | - if ( ! empty( $posted['ipAddress'] ) ) { |
|
232 | + // Update the ip address. |
|
233 | + if ( ! empty( $posted['ipAddress'] ) ) { |
|
234 | 234 | $invoice->set_ip( wpinv_clean( $posted['ipAddress'] ) ); |
235 | 235 | } |
236 | 236 | |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
260 | - * Check Worldpay IPN validity. |
|
261 | - */ |
|
262 | - public function validate_ipn() { |
|
260 | + * Check Worldpay IPN validity. |
|
261 | + */ |
|
262 | + public function validate_ipn() { |
|
263 | 263 | |
264 | 264 | wpinv_error_log( 'Validating Worldpay IPN response' ); |
265 | 265 | |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
308 | - * Filters the gateway settings. |
|
309 | - * |
|
310 | - * @param array $admin_settings |
|
311 | - */ |
|
312 | - public function admin_settings( $admin_settings ) { |
|
308 | + * Filters the gateway settings. |
|
309 | + * |
|
310 | + * @param array $admin_settings |
|
311 | + */ |
|
312 | + public function admin_settings( $admin_settings ) { |
|
313 | 313 | |
314 | 314 | $currencies = sprintf( |
315 | 315 | __( 'Supported Currencies: %s', 'invoicing' ), |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'readonly' => true |
351 | 351 | ); |
352 | 352 | |
353 | - return $admin_settings; |
|
354 | - } |
|
353 | + return $admin_settings; |
|
354 | + } |
|
355 | 355 | |
356 | 356 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | */ |
6 | 6 | |
7 | -defined( 'ABSPATH' ) || exit; |
|
7 | +defined('ABSPATH') || exit; |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Worldpay Payment Gateway class. |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @var array |
47 | 47 | */ |
48 | - protected $supports = array( 'sandbox' ); |
|
48 | + protected $supports = array('sandbox'); |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Currencies this gateway is allowed for. |
52 | 52 | * |
53 | 53 | * @var array |
54 | 54 | */ |
55 | - public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' ); |
|
55 | + public $currencies = array('AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR'); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * URL to view a transaction. |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __construct() { |
75 | 75 | |
76 | - $this->method_title = __( 'Worldpay', 'invoicing' ); |
|
77 | - $this->title = __( 'Worldpay - Credit Card / Debit Card', 'invoicing' ); |
|
78 | - $this->checkout_button_text = __( 'Proceed to Worldpay', 'invoicing' ); |
|
79 | - $this->notify_url = wpinv_get_ipn_url( $this->id ); |
|
76 | + $this->method_title = __('Worldpay', 'invoicing'); |
|
77 | + $this->title = __('Worldpay - Credit Card / Debit Card', 'invoicing'); |
|
78 | + $this->checkout_button_text = __('Proceed to Worldpay', 'invoicing'); |
|
79 | + $this->notify_url = wpinv_get_ipn_url($this->id); |
|
80 | 80 | |
81 | - add_filter( 'wpinv_gateway_description', array( $this, 'sandbox_notice' ), 10, 2 ); |
|
82 | - add_filter( 'getpaid_worldpay_args', array( $this, 'hash_args' ) ); |
|
81 | + add_filter('wpinv_gateway_description', array($this, 'sandbox_notice'), 10, 2); |
|
82 | + add_filter('getpaid_worldpay_args', array($this, 'hash_args')); |
|
83 | 83 | |
84 | 84 | parent::__construct(); |
85 | 85 | } |
@@ -93,24 +93,24 @@ discard block |
||
93 | 93 | * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
94 | 94 | * @return array |
95 | 95 | */ |
96 | - public function process_payment( $invoice, $submission_data, $submission ) { |
|
96 | + public function process_payment($invoice, $submission_data, $submission) { |
|
97 | 97 | |
98 | 98 | // Get redirect url. |
99 | - $worldpay_redirect = esc_url( $this->get_request_url( $invoice ) ); |
|
99 | + $worldpay_redirect = esc_url($this->get_request_url($invoice)); |
|
100 | 100 | |
101 | 101 | // Get submission args. |
102 | - $worldpay_args = $this->get_worldpay_args( $invoice ); |
|
102 | + $worldpay_args = $this->get_worldpay_args($invoice); |
|
103 | 103 | |
104 | 104 | $form = "<form action='$worldpay_redirect' name='wpi_worldpay_form' method='POST'>"; |
105 | 105 | |
106 | - foreach ( $worldpay_args as $key => $value ) { |
|
106 | + foreach ($worldpay_args as $key => $value) { |
|
107 | 107 | |
108 | - if ( false === $value || '' === trim( $value ) ) { |
|
108 | + if (false === $value || '' === trim($value)) { |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
112 | - $value = esc_attr( $value ); |
|
113 | - $key = wpinv_clean( $key ); |
|
112 | + $value = esc_attr($value); |
|
113 | + $key = wpinv_clean($key); |
|
114 | 114 | $form .= "<input type='hidden' name='$key' value='$value'>"; |
115 | 115 | } |
116 | 116 | |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | * @param WPInv_Invoice $invoice Invoice object. |
134 | 134 | * @return string |
135 | 135 | */ |
136 | - public function get_request_url( $invoice ) { |
|
136 | + public function get_request_url($invoice) { |
|
137 | 137 | |
138 | 138 | // Endpoint for this request |
139 | - $this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase'; |
|
139 | + $this->endpoint = $this->is_sandbox($invoice) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase'; |
|
140 | 140 | |
141 | 141 | return $this->endpoint; |
142 | 142 | |
@@ -148,34 +148,34 @@ discard block |
||
148 | 148 | * @param WPInv_Invoice $invoice Invoice object. |
149 | 149 | * @return array |
150 | 150 | */ |
151 | - protected function get_worldpay_args( $invoice ) { |
|
151 | + protected function get_worldpay_args($invoice) { |
|
152 | 152 | |
153 | 153 | return apply_filters( |
154 | 154 | 'getpaid_worldpay_args', |
155 | 155 | array( |
156 | - 'amount' => wpinv_sanitize_amount( $invoice->get_total() ), // mandatory |
|
157 | - 'cartId' => wpinv_clean( $invoice->get_number() ), // mandatory reference for the item purchased |
|
158 | - 'currency' => wpinv_clean( $invoice->get_currency() ), // mandatory |
|
159 | - 'instId' => wpinv_clean( $this->get_option( 'instId', '' ) ), // mandatory |
|
160 | - 'testMode' => $this->is_sandbox( $invoice ) ? 100 : 0, // mandatory |
|
161 | - 'name' => wpinv_clean( $invoice->get_full_name() ), |
|
162 | - 'address' => wpinv_clean( $invoice->get_address() ), |
|
163 | - 'postcode' => wpinv_clean( $invoice->get_zip() ), |
|
164 | - 'tel' => wpinv_clean( $invoice->get_phone() ), |
|
165 | - 'email' => sanitize_email( $invoice->get_email() ), |
|
166 | - 'country' => wpinv_clean( $invoice->get_country() ), |
|
167 | - 'desc' => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ), |
|
168 | - 'MC_description' => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ), |
|
169 | - 'MC_callback' => esc_url_raw( $this->notify_url ), |
|
170 | - 'resultfile' => esc_url_raw( $this->get_return_url( $invoice ) ), |
|
171 | - 'MC_key' => wpinv_clean( $invoice->get_key() ), |
|
156 | + 'amount' => wpinv_sanitize_amount($invoice->get_total()), // mandatory |
|
157 | + 'cartId' => wpinv_clean($invoice->get_number()), // mandatory reference for the item purchased |
|
158 | + 'currency' => wpinv_clean($invoice->get_currency()), // mandatory |
|
159 | + 'instId' => wpinv_clean($this->get_option('instId', '')), // mandatory |
|
160 | + 'testMode' => $this->is_sandbox($invoice) ? 100 : 0, // mandatory |
|
161 | + 'name' => wpinv_clean($invoice->get_full_name()), |
|
162 | + 'address' => wpinv_clean($invoice->get_address()), |
|
163 | + 'postcode' => wpinv_clean($invoice->get_zip()), |
|
164 | + 'tel' => wpinv_clean($invoice->get_phone()), |
|
165 | + 'email' => sanitize_email($invoice->get_email()), |
|
166 | + 'country' => wpinv_clean($invoice->get_country()), |
|
167 | + 'desc' => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())), |
|
168 | + 'MC_description' => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())), |
|
169 | + 'MC_callback' => esc_url_raw($this->notify_url), |
|
170 | + 'resultfile' => esc_url_raw($this->get_return_url($invoice)), |
|
171 | + 'MC_key' => wpinv_clean($invoice->get_key()), |
|
172 | 172 | 'MC_invoice_id' => $invoice->get_id(), |
173 | - 'address1' => wpinv_clean( $invoice->get_address() ), |
|
174 | - 'town' => wpinv_clean( $invoice->get_city() ), |
|
175 | - 'region' => wpinv_clean( $invoice->get_state() ), |
|
176 | - 'amountString' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ), |
|
177 | - 'countryString' => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ), |
|
178 | - 'compName' => wpinv_clean( $invoice->get_company() ), |
|
173 | + 'address1' => wpinv_clean($invoice->get_address()), |
|
174 | + 'town' => wpinv_clean($invoice->get_city()), |
|
175 | + 'region' => wpinv_clean($invoice->get_state()), |
|
176 | + 'amountString' => wpinv_price($invoice->get_total(), $invoice->get_currency()), |
|
177 | + 'countryString' => wpinv_clean(wpinv_country_name($invoice->get_country())), |
|
178 | + 'compName' => wpinv_clean($invoice->get_company()), |
|
179 | 179 | ), |
180 | 180 | $invoice |
181 | 181 | ); |
@@ -188,17 +188,17 @@ discard block |
||
188 | 188 | * @param array $args Gateway args. |
189 | 189 | * @return array |
190 | 190 | */ |
191 | - public function hash_args( $args ) { |
|
191 | + public function hash_args($args) { |
|
192 | 192 | |
193 | - $md5_secret = $this->get_option( 'md5_secret' ); |
|
193 | + $md5_secret = $this->get_option('md5_secret'); |
|
194 | 194 | |
195 | 195 | // Abort if there is no secret. |
196 | - if ( empty( $md5_secret ) ) { |
|
196 | + if (empty($md5_secret)) { |
|
197 | 197 | return $args; |
198 | 198 | } |
199 | 199 | |
200 | 200 | // Hash the args. |
201 | - $args['signature'] = md5( "$md5_secret:{$args['instId']}:{$args['amount']}:{$args['currency']}:{$args['cartId']}" ); |
|
201 | + $args['signature'] = md5("$md5_secret:{$args['instId']}:{$args['amount']}:{$args['currency']}:{$args['cartId']}"); |
|
202 | 202 | |
203 | 203 | return $args; |
204 | 204 | } |
@@ -211,43 +211,43 @@ discard block |
||
211 | 211 | public function verify_ipn() { |
212 | 212 | |
213 | 213 | // Validate the IPN. |
214 | - if ( empty( $_POST ) || ! $this->validate_ipn() ) { |
|
215 | - wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) ); |
|
214 | + if (empty($_POST) || !$this->validate_ipn()) { |
|
215 | + wp_die('Worldpay IPN Request Failure', 'Worldpay IPN', array('response' => 500)); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | // Process the IPN. |
219 | - $posted = wp_unslash( $_POST ); |
|
220 | - $invoice = wpinv_get_invoice( $posted['MC_invoice_id'] ); |
|
219 | + $posted = wp_unslash($_POST); |
|
220 | + $invoice = wpinv_get_invoice($posted['MC_invoice_id']); |
|
221 | 221 | |
222 | - if ( $invoice && $this->id == $invoice->get_gateway() ) { |
|
222 | + if ($invoice && $this->id == $invoice->get_gateway()) { |
|
223 | 223 | |
224 | - wpinv_error_log( 'Found invoice #' . $invoice->get_number() ); |
|
225 | - wpinv_error_log( 'Payment status:' . $posted['transStatus'] ); |
|
224 | + wpinv_error_log('Found invoice #' . $invoice->get_number()); |
|
225 | + wpinv_error_log('Payment status:' . $posted['transStatus']); |
|
226 | 226 | |
227 | 227 | // Update the transaction id. |
228 | - if ( ! empty( $posted['transId'] ) ) { |
|
229 | - $invoice->set_transaction_id( wpinv_clean( $posted['transId'] ) ); |
|
228 | + if (!empty($posted['transId'])) { |
|
229 | + $invoice->set_transaction_id(wpinv_clean($posted['transId'])); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | // Update the ip address. |
233 | - if ( ! empty( $posted['ipAddress'] ) ) { |
|
234 | - $invoice->set_ip( wpinv_clean( $posted['ipAddress'] ) ); |
|
233 | + if (!empty($posted['ipAddress'])) { |
|
234 | + $invoice->set_ip(wpinv_clean($posted['ipAddress'])); |
|
235 | 235 | } |
236 | 236 | |
237 | - if ( $posted['transStatus'] == 'Y' ) { |
|
238 | - $invoice->set_completed_date( date( 'Y-m-d H:i:s', $posted['transTime'] ) ); |
|
237 | + if ($posted['transStatus'] == 'Y') { |
|
238 | + $invoice->set_completed_date(date('Y-m-d H:i:s', $posted['transTime'])); |
|
239 | 239 | $invoice->mark_paid(); |
240 | 240 | return; |
241 | 241 | } |
242 | 242 | |
243 | - if ( $posted['transStatus'] == 'C' ) { |
|
244 | - $invoice->set_status( 'wpi-failed' ); |
|
245 | - $invoice->add_note( __( 'Payment transaction failed while processing Worldpay payment.', 'invoicing' ), false, false, true ); |
|
243 | + if ($posted['transStatus'] == 'C') { |
|
244 | + $invoice->set_status('wpi-failed'); |
|
245 | + $invoice->add_note(__('Payment transaction failed while processing Worldpay payment.', 'invoicing'), false, false, true); |
|
246 | 246 | $invoice->save(); |
247 | 247 | return; |
248 | 248 | } |
249 | 249 | |
250 | - wpinv_error_log( 'Aborting, Invalid transaction status:' . $posted['transStatus'] ); |
|
250 | + wpinv_error_log('Aborting, Invalid transaction status:' . $posted['transStatus']); |
|
251 | 251 | $invoice->save(); |
252 | 252 | |
253 | 253 | } |
@@ -261,27 +261,27 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function validate_ipn() { |
263 | 263 | |
264 | - wpinv_error_log( 'Validating Worldpay IPN response' ); |
|
264 | + wpinv_error_log('Validating Worldpay IPN response'); |
|
265 | 265 | |
266 | - $data = wp_unslash( $_POST ); |
|
266 | + $data = wp_unslash($_POST); |
|
267 | 267 | |
268 | 268 | // Verify installation. |
269 | - if ( empty( $data['instId'] ) || $data['instId'] != wpinv_clean( $this->get_option( 'instId', '' ) ) ) { |
|
270 | - wpinv_error_log( 'Received invalid installation ID from Worldpay IPN' ); |
|
269 | + if (empty($data['instId']) || $data['instId'] != wpinv_clean($this->get_option('instId', ''))) { |
|
270 | + wpinv_error_log('Received invalid installation ID from Worldpay IPN'); |
|
271 | 271 | return false; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // Verify invoice. |
275 | - if ( empty( $data['cartId'] ) || ! wpinv_get_id_by_invoice_number( $data['cartId'] ) ) { |
|
276 | - wpinv_error_log( 'Received invalid invoice number from Worldpay IPN' ); |
|
275 | + if (empty($data['cartId']) || !wpinv_get_id_by_invoice_number($data['cartId'])) { |
|
276 | + wpinv_error_log('Received invalid invoice number from Worldpay IPN'); |
|
277 | 277 | return false; |
278 | 278 | } |
279 | 279 | |
280 | 280 | // (maybe) verify password. |
281 | - $password = $this->get_option( 'callback_password' ); |
|
281 | + $password = $this->get_option('callback_password'); |
|
282 | 282 | |
283 | - if ( ! empty( $password ) && ( empty( $data['callbackPW'] ) || $password != $data['callbackPW'] ) ) { |
|
284 | - wpinv_error_log( 'Received invalid invoice number from Worldpay IPN' ); |
|
283 | + if (!empty($password) && (empty($data['callbackPW']) || $password != $data['callbackPW'])) { |
|
284 | + wpinv_error_log('Received invalid invoice number from Worldpay IPN'); |
|
285 | 285 | return false; |
286 | 286 | } |
287 | 287 | |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | /** |
293 | 293 | * Displays a notice on the checkout page if sandbox is enabled. |
294 | 294 | */ |
295 | - public function sandbox_notice( $description, $gateway ) { |
|
296 | - if ( 'worldpay' == $gateway && wpinv_is_test_mode( 'worldpay' ) ) { |
|
295 | + public function sandbox_notice($description, $gateway) { |
|
296 | + if ('worldpay' == $gateway && wpinv_is_test_mode('worldpay')) { |
|
297 | 297 | $description .= '<br>' . sprintf( |
298 | - __( 'SANDBOX ENABLED. See the %sWorldpay Sandbox Testing Guide%s for more details.', 'invoicing' ), |
|
298 | + __('SANDBOX ENABLED. See the %sWorldpay Sandbox Testing Guide%s for more details.', 'invoicing'), |
|
299 | 299 | '<a href="https://developer.worldpay.com/docs/wpg/directintegration/abouttesting">', |
300 | 300 | '</a>' |
301 | 301 | ); |
@@ -309,43 +309,43 @@ discard block |
||
309 | 309 | * |
310 | 310 | * @param array $admin_settings |
311 | 311 | */ |
312 | - public function admin_settings( $admin_settings ) { |
|
312 | + public function admin_settings($admin_settings) { |
|
313 | 313 | |
314 | 314 | $currencies = sprintf( |
315 | - __( 'Supported Currencies: %s', 'invoicing' ), |
|
316 | - implode( ', ', $this->currencies ) |
|
315 | + __('Supported Currencies: %s', 'invoicing'), |
|
316 | + implode(', ', $this->currencies) |
|
317 | 317 | ); |
318 | 318 | |
319 | 319 | $admin_settings['worldpay_active']['desc'] = $admin_settings['worldpay_active']['desc'] . " ($currencies)"; |
320 | - $admin_settings['worldpay_desc']['std'] = __( 'Pay securely via Worldpay using your PayPal account, credit or debit card.', 'invoicing' ); |
|
320 | + $admin_settings['worldpay_desc']['std'] = __('Pay securely via Worldpay using your PayPal account, credit or debit card.', 'invoicing'); |
|
321 | 321 | |
322 | 322 | $admin_settings['worldpay_instId'] = array( |
323 | 323 | 'type' => 'text', |
324 | 324 | 'id' => 'worldpay_instId', |
325 | - 'name' => __( 'Installation Id', 'invoicing' ), |
|
326 | - 'desc' => __( 'Your installation id. Ex: 211616', 'invoicing' ), |
|
325 | + 'name' => __('Installation Id', 'invoicing'), |
|
326 | + 'desc' => __('Your installation id. Ex: 211616', 'invoicing'), |
|
327 | 327 | ); |
328 | 328 | |
329 | 329 | $admin_settings['worldpay_md5_secret'] = array( |
330 | 330 | 'type' => 'text', |
331 | 331 | 'id' => 'worldpay_md5_secret', |
332 | - 'name' => __( 'MD5 secret', 'invoicing' ), |
|
333 | - 'desc' => __( 'Optionally enter your MD5 secret here. Next, open your installation settings and ensure that your SignatureFields parameter is set to ', 'invoicing' ) . '<code>instId:amount:currency:cartId</code>', |
|
332 | + 'name' => __('MD5 secret', 'invoicing'), |
|
333 | + 'desc' => __('Optionally enter your MD5 secret here. Next, open your installation settings and ensure that your SignatureFields parameter is set to ', 'invoicing') . '<code>instId:amount:currency:cartId</code>', |
|
334 | 334 | ); |
335 | 335 | |
336 | 336 | $admin_settings['worldpay_callbackPW'] = array( |
337 | 337 | 'type' => 'text', |
338 | 338 | 'id' => 'worldpay_callbackPW', |
339 | - 'name' => __( 'Payment Response password', 'invoicing' ), |
|
340 | - 'desc' => __( 'Recommended. Enter your WorldPay response password to validate payment notifications.', 'invoicing' ), |
|
339 | + 'name' => __('Payment Response password', 'invoicing'), |
|
340 | + 'desc' => __('Recommended. Enter your WorldPay response password to validate payment notifications.', 'invoicing'), |
|
341 | 341 | ); |
342 | 342 | |
343 | 343 | $admin_settings['worldpay_ipn_url'] = array( |
344 | 344 | 'type' => 'ipn_url', |
345 | 345 | 'id' => 'worldpay_ipn_url', |
346 | - 'name' => __( 'Payment Response URL', 'invoicing' ), |
|
346 | + 'name' => __('Payment Response URL', 'invoicing'), |
|
347 | 347 | 'std' => $this->notify_url, |
348 | - 'desc' => __( 'Login to your Worldpay Merchant Interface then enable Payment Response & Shopper Response. Next, go to the Payment Response URL field and enter the above URL.', 'invoicing' ), |
|
348 | + 'desc' => __('Login to your Worldpay Merchant Interface then enable Payment Response & Shopper Response. Next, go to the Payment Response URL field and enter the above URL.', 'invoicing'), |
|
349 | 349 | 'custom' => 'worldpay', |
350 | 350 | 'readonly' => true |
351 | 351 | ); |
@@ -13,629 +13,629 @@ |
||
13 | 13 | |
14 | 14 | return array( |
15 | 15 | |
16 | - 'id' => array( |
|
17 | - 'description' => __( 'Unique identifier for the invoice.', 'invoicing' ), |
|
18 | - 'type' => 'integer', |
|
19 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
20 | - 'readonly' => true, |
|
21 | - ), |
|
22 | - |
|
23 | - 'parent_id' => array( |
|
24 | - 'description' => __( 'Parent invoice ID.', 'invoicing' ), |
|
25 | - 'type' => 'integer', |
|
26 | - 'minimum' => 0, |
|
27 | - 'default' => 0, |
|
28 | - 'context' => array( 'view', 'edit' ), |
|
29 | - ), |
|
30 | - |
|
31 | - 'key' => array( |
|
32 | - 'description' => __( 'A unique key for the invoice.', 'invoicing' ), |
|
33 | - 'type' => 'string', |
|
34 | - 'context' => array( 'view', 'edit' ), |
|
35 | - 'readonly' => true, |
|
36 | - ), |
|
37 | - |
|
38 | - 'number' => array( |
|
39 | - 'description' => __( 'A unique number for the invoice.', 'invoicing' ), |
|
40 | - 'type' => 'string', |
|
41 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
42 | - ), |
|
43 | - |
|
44 | - 'type' => array( |
|
45 | - 'description' => __( 'Get the invoice type (e.g invoice, quote etc).', 'invoicing' ), |
|
46 | - 'type' => 'string', |
|
47 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
48 | - 'readonly' => true, |
|
49 | - ), |
|
50 | - |
|
51 | - 'post_type' => array( |
|
52 | - 'description' => __( 'Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing' ), |
|
53 | - 'type' => 'string', |
|
54 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
55 | - 'readonly' => true, |
|
56 | - ), |
|
57 | - |
|
58 | - 'version' => array( |
|
59 | - 'description' => __( 'Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing' ), |
|
60 | - 'type' => 'integer', |
|
61 | - 'context' => array( 'view', 'edit' ), |
|
62 | - 'readonly' => true, |
|
63 | - ), |
|
64 | - |
|
65 | - 'template' => array( |
|
66 | - 'description' => __( 'The invoice template.', 'invoicing' ), |
|
67 | - 'type' => 'string', |
|
68 | - 'default' => 'quantity', |
|
69 | - 'enum' => array( 'quantity', 'hours', 'amount' ), |
|
70 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
71 | - ), |
|
72 | - |
|
73 | - 'status' => array( |
|
74 | - 'description' => __( 'Invoice status.', 'invoicing' ), |
|
75 | - 'type' => 'string', |
|
76 | - 'default' => 'wpi-pending', |
|
77 | - 'enum' => array_keys( wpinv_get_invoice_statuses( true ) ), |
|
78 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
79 | - ), |
|
80 | - |
|
81 | - 'status_nicename' => array( |
|
82 | - 'description' => __( 'A human readable name for the invoice status.', 'invoicing' ), |
|
83 | - 'type' => 'string', |
|
84 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
85 | - 'readonly' => true, |
|
86 | - ), |
|
87 | - |
|
88 | - 'currency' => array( |
|
89 | - 'description' => __( 'The invoice currency in ISO format.', 'invoicing' ), |
|
90 | - 'type' => 'string', |
|
91 | - 'default' => wpinv_get_currency(), |
|
92 | - 'enum' => array_keys( wpinv_get_currencies() ), |
|
93 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
94 | - ), |
|
95 | - |
|
96 | - 'date_created' => array( |
|
97 | - 'description' => __( "The date the invoice was created, in the site's timezone.", 'invoicing' ), |
|
98 | - 'type' => 'string', |
|
99 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
100 | - ), |
|
101 | - |
|
102 | - 'date_created_gmt' => array( |
|
103 | - 'description' => __( 'The GMT date the invoice was created.', 'invoicing' ), |
|
104 | - 'type' => 'string', |
|
105 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
106 | - 'readonly' => true, |
|
107 | - ), |
|
108 | - |
|
109 | - 'date_modified' => array( |
|
110 | - 'description' => __( "The date the invoice was last modified, in the site's timezone.", 'invoicing' ), |
|
111 | - 'type' => 'string', |
|
112 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
113 | - 'readonly' => true, |
|
114 | - ), |
|
115 | - |
|
116 | - 'date_modified_gmt' => array( |
|
117 | - 'description' => __( 'The GMT date the invoice was last modified.', 'invoicing' ), |
|
118 | - 'type' => 'string', |
|
119 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
120 | - 'readonly' => true, |
|
121 | - ), |
|
122 | - |
|
123 | - 'due_date' => array( |
|
124 | - 'description' => __( "The invoice's due date, in the site's timezone.", 'invoicing' ), |
|
125 | - 'type' => 'string', |
|
126 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
127 | - ), |
|
128 | - |
|
129 | - 'due_date_gmt' => array( |
|
130 | - 'description' => __( 'The GMT date the invoice is/was due.', 'invoicing' ), |
|
131 | - 'type' => 'string', |
|
132 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
133 | - 'readonly' => true, |
|
134 | - ), |
|
135 | - |
|
136 | - 'completed_date' => array( |
|
137 | - 'description' => __( "The date the invoice was paid, in the site's timezone.", 'invoicing' ), |
|
138 | - 'type' => 'string', |
|
139 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
140 | - 'readonly' => true, |
|
141 | - ), |
|
142 | - |
|
143 | - 'completed_date_gmt' => array( |
|
144 | - 'description' => __( 'The GMT date the invoice was paid.', 'invoicing' ), |
|
145 | - 'type' => 'string', |
|
146 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
147 | - 'readonly' => true, |
|
148 | - ), |
|
149 | - |
|
150 | - 'total_discount' => array( |
|
151 | - 'description' => __( 'Total discount amount for the invoice.', 'invoicing' ), |
|
152 | - 'type' => 'number', |
|
153 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
154 | - 'readonly' => true, |
|
155 | - ), |
|
156 | - |
|
157 | - 'total_tax' => array( |
|
158 | - 'description' => __( 'Total tax amount for the invoice.', 'invoicing' ), |
|
159 | - 'type' => 'number', |
|
160 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
161 | - 'readonly' => true, |
|
162 | - ), |
|
163 | - |
|
164 | - 'total_fees' => array( |
|
165 | - 'description' => __( 'Total fees amount for the invoice.', 'invoicing' ), |
|
166 | - 'type' => 'number', |
|
167 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
168 | - 'readonly' => true, |
|
169 | - ), |
|
170 | - |
|
171 | - 'subtotal' => array( |
|
172 | - 'description' => __( 'Invoice subtotal.', 'invoicing' ), |
|
173 | - 'type' => 'number', |
|
174 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
175 | - 'readonly' => true, |
|
176 | - ), |
|
177 | - |
|
178 | - 'total' => array( |
|
179 | - 'description' => __( 'Grand total.', 'invoicing' ), |
|
180 | - 'type' => 'number', |
|
181 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
182 | - 'readonly' => true, |
|
183 | - ), |
|
184 | - |
|
185 | - 'initial_total' => array( |
|
186 | - 'description' => __( 'Initial total (for recurring invoices).', 'invoicing' ), |
|
187 | - 'type' => 'number', |
|
188 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
189 | - 'readonly' => true, |
|
190 | - ), |
|
191 | - |
|
192 | - 'recurring_total' => array( |
|
193 | - 'description' => __( 'Recurring total (for recurring invoices).', 'invoicing' ), |
|
194 | - 'type' => 'number', |
|
195 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
196 | - 'readonly' => true, |
|
197 | - ), |
|
198 | - |
|
199 | - 'totals' => array( |
|
200 | - 'description' => __( 'Invoice totals.', 'invoicing' ), |
|
201 | - 'type' => 'object', |
|
202 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
203 | - 'readonly' => true, |
|
204 | - ), |
|
205 | - |
|
206 | - 'fees' => array( |
|
207 | - 'description' => __( 'Invoice fees (Name => properties).', 'invoicing' ), |
|
208 | - 'type' => 'object', |
|
209 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
210 | - 'items' => array( |
|
211 | - 'type' => 'object', |
|
212 | - 'required' => array( 'amount' ), |
|
213 | - 'properties' => array( |
|
214 | - 'amount' => array( |
|
215 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
216 | - 'type' => 'string', |
|
217 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
218 | - ), |
|
219 | - 'recurring' => array( |
|
220 | - 'description' => __( 'Whether this is a recurring or one-time fee.', 'invoicing' ), |
|
221 | - 'type' => array( 'boolean', 'integer' ), |
|
222 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
223 | - ), |
|
224 | - ), |
|
225 | - ), |
|
226 | - ), |
|
227 | - |
|
228 | - 'discounts' => array( |
|
229 | - 'description' => __( 'Invoice discounts (Name => properties).', 'invoicing' ), |
|
230 | - 'type' => 'object', |
|
231 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
232 | - 'items' => array( |
|
233 | - 'type' => 'object', |
|
234 | - 'required' => array( 'amount' ), |
|
235 | - 'properties' => array( |
|
236 | - 'amount' => array( |
|
237 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
238 | - 'type' => 'string', |
|
239 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
240 | - ), |
|
241 | - 'recurring' => array( |
|
242 | - 'description' => __( 'Whether this is a recurring or one-time discount.', 'invoicing' ), |
|
243 | - 'type' => array( 'boolean', 'integer' ), |
|
244 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
245 | - ), |
|
246 | - ), |
|
247 | - ), |
|
248 | - ), |
|
249 | - |
|
250 | - 'taxes' => array( |
|
251 | - 'description' => __( 'Invoice taxes (Name => properties).', 'invoicing' ), |
|
252 | - 'type' => 'object', |
|
253 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
254 | - 'items' => array( |
|
255 | - 'type' => 'object', |
|
256 | - 'required' => array( 'amount' ), |
|
257 | - 'properties' => array( |
|
258 | - 'amount' => array( |
|
259 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
260 | - 'type' => 'string', |
|
261 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
262 | - ), |
|
263 | - 'recurring' => array( |
|
264 | - 'description' => __( 'Whether this is a recurring or one-time tax.', 'invoicing' ), |
|
265 | - 'type' => array( 'boolean', 'integer' ), |
|
266 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
267 | - ), |
|
268 | - ), |
|
269 | - ), |
|
270 | - ), |
|
271 | - |
|
272 | - 'items' => array( |
|
273 | - 'description' => __( 'Invoice items.', 'invoicing' ), |
|
274 | - 'type' => 'array', |
|
275 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
276 | - 'items' => array( |
|
277 | - 'type' => 'object', |
|
278 | - 'required' => array( 'item_id' ), |
|
279 | - 'properties' => array( |
|
280 | - 'item_id' => array( |
|
281 | - 'description' => __( 'Item ID.', 'invoicing' ), |
|
282 | - 'type' => 'integer', |
|
283 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
284 | - ), |
|
285 | - 'item_name' => array( |
|
286 | - 'description' => __( 'Item Name.', 'invoicing' ), |
|
287 | - 'type' => 'string', |
|
288 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
289 | - ), |
|
290 | - 'item_description' => array( |
|
291 | - 'description' => __( 'Item Description.', 'invoicing' ), |
|
292 | - 'type' => 'string', |
|
293 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
294 | - ), |
|
295 | - 'item_price' => array( |
|
296 | - 'description' => __( 'Item Price.', 'invoicing' ), |
|
297 | - 'type' => 'number', |
|
298 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
299 | - ), |
|
300 | - 'quantity' => array( |
|
301 | - 'description' => __( 'Item Quantity.', 'invoicing' ), |
|
302 | - 'type' => 'integer', |
|
303 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
304 | - ), |
|
305 | - 'subtotal' => array( |
|
306 | - 'description' => __( 'Item Subtotal.', 'invoicing' ), |
|
307 | - 'type' => 'number', |
|
308 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
309 | - 'readonly' => true, |
|
310 | - ), |
|
311 | - 'meta' => array( |
|
312 | - 'description' => __( 'Item Meta.', 'invoicing' ), |
|
313 | - 'type' => 'object', |
|
314 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
315 | - ), |
|
316 | - ), |
|
317 | - ), |
|
318 | - ), |
|
319 | - |
|
320 | - 'mode' => array( |
|
321 | - 'description' => __( 'The invoice transaction mode.', 'invoicing' ), |
|
322 | - 'type' => 'string', |
|
323 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
324 | - 'enum' => array( 'live', 'test' ), |
|
325 | - 'readonly' => true, |
|
326 | - ), |
|
16 | + 'id' => array( |
|
17 | + 'description' => __( 'Unique identifier for the invoice.', 'invoicing' ), |
|
18 | + 'type' => 'integer', |
|
19 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
20 | + 'readonly' => true, |
|
21 | + ), |
|
22 | + |
|
23 | + 'parent_id' => array( |
|
24 | + 'description' => __( 'Parent invoice ID.', 'invoicing' ), |
|
25 | + 'type' => 'integer', |
|
26 | + 'minimum' => 0, |
|
27 | + 'default' => 0, |
|
28 | + 'context' => array( 'view', 'edit' ), |
|
29 | + ), |
|
30 | + |
|
31 | + 'key' => array( |
|
32 | + 'description' => __( 'A unique key for the invoice.', 'invoicing' ), |
|
33 | + 'type' => 'string', |
|
34 | + 'context' => array( 'view', 'edit' ), |
|
35 | + 'readonly' => true, |
|
36 | + ), |
|
37 | + |
|
38 | + 'number' => array( |
|
39 | + 'description' => __( 'A unique number for the invoice.', 'invoicing' ), |
|
40 | + 'type' => 'string', |
|
41 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
42 | + ), |
|
43 | + |
|
44 | + 'type' => array( |
|
45 | + 'description' => __( 'Get the invoice type (e.g invoice, quote etc).', 'invoicing' ), |
|
46 | + 'type' => 'string', |
|
47 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
48 | + 'readonly' => true, |
|
49 | + ), |
|
50 | + |
|
51 | + 'post_type' => array( |
|
52 | + 'description' => __( 'Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing' ), |
|
53 | + 'type' => 'string', |
|
54 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
55 | + 'readonly' => true, |
|
56 | + ), |
|
57 | + |
|
58 | + 'version' => array( |
|
59 | + 'description' => __( 'Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing' ), |
|
60 | + 'type' => 'integer', |
|
61 | + 'context' => array( 'view', 'edit' ), |
|
62 | + 'readonly' => true, |
|
63 | + ), |
|
64 | + |
|
65 | + 'template' => array( |
|
66 | + 'description' => __( 'The invoice template.', 'invoicing' ), |
|
67 | + 'type' => 'string', |
|
68 | + 'default' => 'quantity', |
|
69 | + 'enum' => array( 'quantity', 'hours', 'amount' ), |
|
70 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
71 | + ), |
|
72 | + |
|
73 | + 'status' => array( |
|
74 | + 'description' => __( 'Invoice status.', 'invoicing' ), |
|
75 | + 'type' => 'string', |
|
76 | + 'default' => 'wpi-pending', |
|
77 | + 'enum' => array_keys( wpinv_get_invoice_statuses( true ) ), |
|
78 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
79 | + ), |
|
80 | + |
|
81 | + 'status_nicename' => array( |
|
82 | + 'description' => __( 'A human readable name for the invoice status.', 'invoicing' ), |
|
83 | + 'type' => 'string', |
|
84 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
85 | + 'readonly' => true, |
|
86 | + ), |
|
87 | + |
|
88 | + 'currency' => array( |
|
89 | + 'description' => __( 'The invoice currency in ISO format.', 'invoicing' ), |
|
90 | + 'type' => 'string', |
|
91 | + 'default' => wpinv_get_currency(), |
|
92 | + 'enum' => array_keys( wpinv_get_currencies() ), |
|
93 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
94 | + ), |
|
95 | + |
|
96 | + 'date_created' => array( |
|
97 | + 'description' => __( "The date the invoice was created, in the site's timezone.", 'invoicing' ), |
|
98 | + 'type' => 'string', |
|
99 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
100 | + ), |
|
101 | + |
|
102 | + 'date_created_gmt' => array( |
|
103 | + 'description' => __( 'The GMT date the invoice was created.', 'invoicing' ), |
|
104 | + 'type' => 'string', |
|
105 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
106 | + 'readonly' => true, |
|
107 | + ), |
|
108 | + |
|
109 | + 'date_modified' => array( |
|
110 | + 'description' => __( "The date the invoice was last modified, in the site's timezone.", 'invoicing' ), |
|
111 | + 'type' => 'string', |
|
112 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
113 | + 'readonly' => true, |
|
114 | + ), |
|
115 | + |
|
116 | + 'date_modified_gmt' => array( |
|
117 | + 'description' => __( 'The GMT date the invoice was last modified.', 'invoicing' ), |
|
118 | + 'type' => 'string', |
|
119 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
120 | + 'readonly' => true, |
|
121 | + ), |
|
122 | + |
|
123 | + 'due_date' => array( |
|
124 | + 'description' => __( "The invoice's due date, in the site's timezone.", 'invoicing' ), |
|
125 | + 'type' => 'string', |
|
126 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
127 | + ), |
|
128 | + |
|
129 | + 'due_date_gmt' => array( |
|
130 | + 'description' => __( 'The GMT date the invoice is/was due.', 'invoicing' ), |
|
131 | + 'type' => 'string', |
|
132 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
133 | + 'readonly' => true, |
|
134 | + ), |
|
135 | + |
|
136 | + 'completed_date' => array( |
|
137 | + 'description' => __( "The date the invoice was paid, in the site's timezone.", 'invoicing' ), |
|
138 | + 'type' => 'string', |
|
139 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
140 | + 'readonly' => true, |
|
141 | + ), |
|
142 | + |
|
143 | + 'completed_date_gmt' => array( |
|
144 | + 'description' => __( 'The GMT date the invoice was paid.', 'invoicing' ), |
|
145 | + 'type' => 'string', |
|
146 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
147 | + 'readonly' => true, |
|
148 | + ), |
|
149 | + |
|
150 | + 'total_discount' => array( |
|
151 | + 'description' => __( 'Total discount amount for the invoice.', 'invoicing' ), |
|
152 | + 'type' => 'number', |
|
153 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
154 | + 'readonly' => true, |
|
155 | + ), |
|
156 | + |
|
157 | + 'total_tax' => array( |
|
158 | + 'description' => __( 'Total tax amount for the invoice.', 'invoicing' ), |
|
159 | + 'type' => 'number', |
|
160 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
161 | + 'readonly' => true, |
|
162 | + ), |
|
163 | + |
|
164 | + 'total_fees' => array( |
|
165 | + 'description' => __( 'Total fees amount for the invoice.', 'invoicing' ), |
|
166 | + 'type' => 'number', |
|
167 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
168 | + 'readonly' => true, |
|
169 | + ), |
|
170 | + |
|
171 | + 'subtotal' => array( |
|
172 | + 'description' => __( 'Invoice subtotal.', 'invoicing' ), |
|
173 | + 'type' => 'number', |
|
174 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
175 | + 'readonly' => true, |
|
176 | + ), |
|
177 | + |
|
178 | + 'total' => array( |
|
179 | + 'description' => __( 'Grand total.', 'invoicing' ), |
|
180 | + 'type' => 'number', |
|
181 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
182 | + 'readonly' => true, |
|
183 | + ), |
|
184 | + |
|
185 | + 'initial_total' => array( |
|
186 | + 'description' => __( 'Initial total (for recurring invoices).', 'invoicing' ), |
|
187 | + 'type' => 'number', |
|
188 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
189 | + 'readonly' => true, |
|
190 | + ), |
|
191 | + |
|
192 | + 'recurring_total' => array( |
|
193 | + 'description' => __( 'Recurring total (for recurring invoices).', 'invoicing' ), |
|
194 | + 'type' => 'number', |
|
195 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
196 | + 'readonly' => true, |
|
197 | + ), |
|
198 | + |
|
199 | + 'totals' => array( |
|
200 | + 'description' => __( 'Invoice totals.', 'invoicing' ), |
|
201 | + 'type' => 'object', |
|
202 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
203 | + 'readonly' => true, |
|
204 | + ), |
|
205 | + |
|
206 | + 'fees' => array( |
|
207 | + 'description' => __( 'Invoice fees (Name => properties).', 'invoicing' ), |
|
208 | + 'type' => 'object', |
|
209 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
210 | + 'items' => array( |
|
211 | + 'type' => 'object', |
|
212 | + 'required' => array( 'amount' ), |
|
213 | + 'properties' => array( |
|
214 | + 'amount' => array( |
|
215 | + 'description' => __( 'Fee amount.', 'invoicing' ), |
|
216 | + 'type' => 'string', |
|
217 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
218 | + ), |
|
219 | + 'recurring' => array( |
|
220 | + 'description' => __( 'Whether this is a recurring or one-time fee.', 'invoicing' ), |
|
221 | + 'type' => array( 'boolean', 'integer' ), |
|
222 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
223 | + ), |
|
224 | + ), |
|
225 | + ), |
|
226 | + ), |
|
227 | + |
|
228 | + 'discounts' => array( |
|
229 | + 'description' => __( 'Invoice discounts (Name => properties).', 'invoicing' ), |
|
230 | + 'type' => 'object', |
|
231 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
232 | + 'items' => array( |
|
233 | + 'type' => 'object', |
|
234 | + 'required' => array( 'amount' ), |
|
235 | + 'properties' => array( |
|
236 | + 'amount' => array( |
|
237 | + 'description' => __( 'Fee amount.', 'invoicing' ), |
|
238 | + 'type' => 'string', |
|
239 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
240 | + ), |
|
241 | + 'recurring' => array( |
|
242 | + 'description' => __( 'Whether this is a recurring or one-time discount.', 'invoicing' ), |
|
243 | + 'type' => array( 'boolean', 'integer' ), |
|
244 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
245 | + ), |
|
246 | + ), |
|
247 | + ), |
|
248 | + ), |
|
249 | + |
|
250 | + 'taxes' => array( |
|
251 | + 'description' => __( 'Invoice taxes (Name => properties).', 'invoicing' ), |
|
252 | + 'type' => 'object', |
|
253 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
254 | + 'items' => array( |
|
255 | + 'type' => 'object', |
|
256 | + 'required' => array( 'amount' ), |
|
257 | + 'properties' => array( |
|
258 | + 'amount' => array( |
|
259 | + 'description' => __( 'Fee amount.', 'invoicing' ), |
|
260 | + 'type' => 'string', |
|
261 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
262 | + ), |
|
263 | + 'recurring' => array( |
|
264 | + 'description' => __( 'Whether this is a recurring or one-time tax.', 'invoicing' ), |
|
265 | + 'type' => array( 'boolean', 'integer' ), |
|
266 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
267 | + ), |
|
268 | + ), |
|
269 | + ), |
|
270 | + ), |
|
271 | + |
|
272 | + 'items' => array( |
|
273 | + 'description' => __( 'Invoice items.', 'invoicing' ), |
|
274 | + 'type' => 'array', |
|
275 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
276 | + 'items' => array( |
|
277 | + 'type' => 'object', |
|
278 | + 'required' => array( 'item_id' ), |
|
279 | + 'properties' => array( |
|
280 | + 'item_id' => array( |
|
281 | + 'description' => __( 'Item ID.', 'invoicing' ), |
|
282 | + 'type' => 'integer', |
|
283 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
284 | + ), |
|
285 | + 'item_name' => array( |
|
286 | + 'description' => __( 'Item Name.', 'invoicing' ), |
|
287 | + 'type' => 'string', |
|
288 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
289 | + ), |
|
290 | + 'item_description' => array( |
|
291 | + 'description' => __( 'Item Description.', 'invoicing' ), |
|
292 | + 'type' => 'string', |
|
293 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
294 | + ), |
|
295 | + 'item_price' => array( |
|
296 | + 'description' => __( 'Item Price.', 'invoicing' ), |
|
297 | + 'type' => 'number', |
|
298 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
299 | + ), |
|
300 | + 'quantity' => array( |
|
301 | + 'description' => __( 'Item Quantity.', 'invoicing' ), |
|
302 | + 'type' => 'integer', |
|
303 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
304 | + ), |
|
305 | + 'subtotal' => array( |
|
306 | + 'description' => __( 'Item Subtotal.', 'invoicing' ), |
|
307 | + 'type' => 'number', |
|
308 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
309 | + 'readonly' => true, |
|
310 | + ), |
|
311 | + 'meta' => array( |
|
312 | + 'description' => __( 'Item Meta.', 'invoicing' ), |
|
313 | + 'type' => 'object', |
|
314 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
315 | + ), |
|
316 | + ), |
|
317 | + ), |
|
318 | + ), |
|
319 | + |
|
320 | + 'mode' => array( |
|
321 | + 'description' => __( 'The invoice transaction mode.', 'invoicing' ), |
|
322 | + 'type' => 'string', |
|
323 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
324 | + 'enum' => array( 'live', 'test' ), |
|
325 | + 'readonly' => true, |
|
326 | + ), |
|
327 | 327 | |
328 | - 'discount_code' => array( |
|
329 | - 'description' => __( 'The discount code used on this invoice.', 'invoicing' ), |
|
330 | - 'type' => 'string', |
|
331 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
332 | - ), |
|
333 | - |
|
334 | - 'gateway' => array( |
|
335 | - 'description' => __( 'The gateway used to pay this invoice.', 'invoicing' ), |
|
336 | - 'type' => 'string', |
|
337 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
338 | - ), |
|
339 | - |
|
340 | - 'gateway_title' => array( |
|
341 | - 'description' => __( 'The title of the gateway used to pay this invoice.', 'invoicing' ), |
|
342 | - 'type' => 'string', |
|
343 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
344 | - 'readonly' => true, |
|
345 | - ), |
|
346 | - |
|
347 | - 'transaction_id' => array( |
|
348 | - 'description' => __( 'The transaction id for this invoice.', 'invoicing' ), |
|
349 | - 'type' => 'string', |
|
350 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
351 | - ), |
|
328 | + 'discount_code' => array( |
|
329 | + 'description' => __( 'The discount code used on this invoice.', 'invoicing' ), |
|
330 | + 'type' => 'string', |
|
331 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
332 | + ), |
|
333 | + |
|
334 | + 'gateway' => array( |
|
335 | + 'description' => __( 'The gateway used to pay this invoice.', 'invoicing' ), |
|
336 | + 'type' => 'string', |
|
337 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
338 | + ), |
|
339 | + |
|
340 | + 'gateway_title' => array( |
|
341 | + 'description' => __( 'The title of the gateway used to pay this invoice.', 'invoicing' ), |
|
342 | + 'type' => 'string', |
|
343 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
344 | + 'readonly' => true, |
|
345 | + ), |
|
346 | + |
|
347 | + 'transaction_id' => array( |
|
348 | + 'description' => __( 'The transaction id for this invoice.', 'invoicing' ), |
|
349 | + 'type' => 'string', |
|
350 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
351 | + ), |
|
352 | 352 | |
353 | - 'disable_taxes' => array( |
|
354 | - 'description' => __( 'Whether or not taxes should be disabled for this invoice.', 'invoicing' ), |
|
355 | - 'type' => 'boolean ', |
|
356 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
357 | - ), |
|
358 | - |
|
359 | - 'is_viewed' => array( |
|
360 | - 'description' => __( 'Whether or not this invoice has been viewed by the user.', 'invoicing' ), |
|
361 | - 'type' => 'boolean ', |
|
362 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
363 | - 'readonly' => true, |
|
364 | - ), |
|
365 | - |
|
366 | - 'email_cc' => array( |
|
367 | - 'description' => __( 'A comma separated list of other emails that should receive communications for this invoice.', 'invoicing' ), |
|
368 | - 'type' => 'string ', |
|
369 | - 'context' => array( 'view', 'edit' ), |
|
370 | - ), |
|
371 | - |
|
372 | - 'subscription_id' => array( |
|
373 | - 'description' => __( 'The ID of the subscription associated with this invoice.', 'invoicing' ), |
|
374 | - 'type' => 'string ', |
|
375 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
376 | - 'readonly' => true, |
|
377 | - ), |
|
378 | - |
|
379 | - 'subscription_name' => array( |
|
380 | - 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
381 | - 'type' => 'string ', |
|
382 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
383 | - 'readonly' => true, |
|
384 | - ), |
|
385 | - |
|
386 | - 'subscription_name' => array( |
|
387 | - 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
388 | - 'type' => 'string ', |
|
389 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
390 | - 'readonly' => true, |
|
391 | - ), |
|
392 | - |
|
393 | - 'is_parent' => array( |
|
394 | - 'description' => __( 'Whether or not this is a parent invoice.', 'invoicing' ), |
|
395 | - 'type' => 'boolean', |
|
396 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
397 | - 'readonly' => true, |
|
398 | - ), |
|
399 | - |
|
400 | - 'is_renewal' => array( |
|
401 | - 'description' => __( 'Whether or not this is a renewal invoice.', 'invoicing' ), |
|
402 | - 'type' => 'boolean', |
|
403 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
404 | - 'readonly' => true, |
|
405 | - ), |
|
406 | - |
|
407 | - 'is_recurring' => array( |
|
408 | - 'description' => __( 'Whether or not this is a recurring invoice.', 'invoicing' ), |
|
409 | - 'type' => 'boolean', |
|
410 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
411 | - 'readonly' => true, |
|
412 | - ), |
|
413 | - |
|
414 | - 'is_free' => array( |
|
415 | - 'description' => __( 'Whether or not this invoice is free.', 'invoicing' ), |
|
416 | - 'type' => 'boolean', |
|
417 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
418 | - 'readonly' => true, |
|
419 | - ), |
|
420 | - |
|
421 | - 'is_paid' => array( |
|
422 | - 'description' => __( 'Whether or not this invoice has been paid.', 'invoicing' ), |
|
423 | - 'type' => 'boolean', |
|
424 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
425 | - 'readonly' => true, |
|
426 | - ), |
|
427 | - |
|
428 | - 'needs_payment' => array( |
|
429 | - 'description' => __( 'Whether or not this invoice needs payment.', 'invoicing' ), |
|
430 | - 'type' => 'boolean', |
|
431 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
432 | - 'readonly' => true, |
|
433 | - ), |
|
434 | - |
|
435 | - 'is_refunded' => array( |
|
436 | - 'description' => __( 'Whether or not this invoice was refunded.', 'invoicing' ), |
|
437 | - 'type' => 'boolean', |
|
438 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
439 | - 'readonly' => true, |
|
440 | - ), |
|
441 | - |
|
442 | - 'is_due' => array( |
|
443 | - 'description' => __( 'Whether or not this invoice is due.', 'invoicing' ), |
|
444 | - 'type' => 'boolean', |
|
445 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
446 | - 'readonly' => true, |
|
447 | - ), |
|
448 | - |
|
449 | - 'is_held' => array( |
|
450 | - 'description' => __( 'Whether or not this invoice has been held for payment confirmation.', 'invoicing' ), |
|
451 | - 'type' => 'boolean', |
|
452 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
453 | - 'readonly' => true, |
|
454 | - ), |
|
455 | - |
|
456 | - 'is_draft' => array( |
|
457 | - 'description' => __( 'Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing' ), |
|
458 | - 'type' => 'boolean', |
|
459 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
460 | - 'readonly' => true, |
|
461 | - ), |
|
462 | - |
|
463 | - 'path' => array( |
|
464 | - 'description' => __( 'The invoice path/slug/name.', 'invoicing' ), |
|
465 | - 'type' => 'string', |
|
466 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
467 | - 'readonly' => true, |
|
468 | - ), |
|
469 | - |
|
470 | - 'description' => array( |
|
471 | - 'description' => __( 'The invoice description.', 'invoicing' ), |
|
472 | - 'type' => 'string', |
|
473 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
474 | - ), |
|
475 | - |
|
476 | - 'payment_form' => array( |
|
477 | - 'description' => __( 'The id of the payment form used to pay for this invoice.', 'invoicing' ), |
|
478 | - 'type' => 'integer', |
|
479 | - 'context' => array( 'view', 'edit' ), |
|
480 | - 'readonly' => true, |
|
481 | - ), |
|
482 | - |
|
483 | - 'submission_id' => array( |
|
484 | - 'description' => __( 'A uniques ID of the submission details used to pay for this invoice.', 'invoicing' ), |
|
485 | - 'type' => 'string', |
|
486 | - 'context' => array( 'view', 'edit' ), |
|
487 | - 'readonly' => true, |
|
488 | - ), |
|
489 | - |
|
490 | - 'customer_id' => array( |
|
491 | - 'description' => __( 'The customer id.', 'invoicing' ), |
|
492 | - 'type' => 'integer', |
|
493 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
494 | - ), |
|
495 | - |
|
496 | - 'customer_ip' => array( |
|
497 | - 'description' => __( "The customer's ip address.", 'invoicing' ), |
|
498 | - 'type' => 'string', |
|
499 | - 'format' => 'ip', |
|
500 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
501 | - ), |
|
502 | - |
|
503 | - 'first_name' => array( |
|
504 | - 'description' => __( "The customer's first name.", 'invoicing' ), |
|
505 | - 'type' => 'string', |
|
506 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
507 | - ), |
|
508 | - |
|
509 | - 'last_name' => array( |
|
510 | - 'description' => __( "The customer's last name.", 'invoicing' ), |
|
511 | - 'type' => 'string', |
|
512 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
513 | - ), |
|
353 | + 'disable_taxes' => array( |
|
354 | + 'description' => __( 'Whether or not taxes should be disabled for this invoice.', 'invoicing' ), |
|
355 | + 'type' => 'boolean ', |
|
356 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
357 | + ), |
|
358 | + |
|
359 | + 'is_viewed' => array( |
|
360 | + 'description' => __( 'Whether or not this invoice has been viewed by the user.', 'invoicing' ), |
|
361 | + 'type' => 'boolean ', |
|
362 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
363 | + 'readonly' => true, |
|
364 | + ), |
|
365 | + |
|
366 | + 'email_cc' => array( |
|
367 | + 'description' => __( 'A comma separated list of other emails that should receive communications for this invoice.', 'invoicing' ), |
|
368 | + 'type' => 'string ', |
|
369 | + 'context' => array( 'view', 'edit' ), |
|
370 | + ), |
|
371 | + |
|
372 | + 'subscription_id' => array( |
|
373 | + 'description' => __( 'The ID of the subscription associated with this invoice.', 'invoicing' ), |
|
374 | + 'type' => 'string ', |
|
375 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
376 | + 'readonly' => true, |
|
377 | + ), |
|
378 | + |
|
379 | + 'subscription_name' => array( |
|
380 | + 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
381 | + 'type' => 'string ', |
|
382 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
383 | + 'readonly' => true, |
|
384 | + ), |
|
385 | + |
|
386 | + 'subscription_name' => array( |
|
387 | + 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
388 | + 'type' => 'string ', |
|
389 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
390 | + 'readonly' => true, |
|
391 | + ), |
|
392 | + |
|
393 | + 'is_parent' => array( |
|
394 | + 'description' => __( 'Whether or not this is a parent invoice.', 'invoicing' ), |
|
395 | + 'type' => 'boolean', |
|
396 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
397 | + 'readonly' => true, |
|
398 | + ), |
|
399 | + |
|
400 | + 'is_renewal' => array( |
|
401 | + 'description' => __( 'Whether or not this is a renewal invoice.', 'invoicing' ), |
|
402 | + 'type' => 'boolean', |
|
403 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
404 | + 'readonly' => true, |
|
405 | + ), |
|
406 | + |
|
407 | + 'is_recurring' => array( |
|
408 | + 'description' => __( 'Whether or not this is a recurring invoice.', 'invoicing' ), |
|
409 | + 'type' => 'boolean', |
|
410 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
411 | + 'readonly' => true, |
|
412 | + ), |
|
413 | + |
|
414 | + 'is_free' => array( |
|
415 | + 'description' => __( 'Whether or not this invoice is free.', 'invoicing' ), |
|
416 | + 'type' => 'boolean', |
|
417 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
418 | + 'readonly' => true, |
|
419 | + ), |
|
420 | + |
|
421 | + 'is_paid' => array( |
|
422 | + 'description' => __( 'Whether or not this invoice has been paid.', 'invoicing' ), |
|
423 | + 'type' => 'boolean', |
|
424 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
425 | + 'readonly' => true, |
|
426 | + ), |
|
427 | + |
|
428 | + 'needs_payment' => array( |
|
429 | + 'description' => __( 'Whether or not this invoice needs payment.', 'invoicing' ), |
|
430 | + 'type' => 'boolean', |
|
431 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
432 | + 'readonly' => true, |
|
433 | + ), |
|
434 | + |
|
435 | + 'is_refunded' => array( |
|
436 | + 'description' => __( 'Whether or not this invoice was refunded.', 'invoicing' ), |
|
437 | + 'type' => 'boolean', |
|
438 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
439 | + 'readonly' => true, |
|
440 | + ), |
|
441 | + |
|
442 | + 'is_due' => array( |
|
443 | + 'description' => __( 'Whether or not this invoice is due.', 'invoicing' ), |
|
444 | + 'type' => 'boolean', |
|
445 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
446 | + 'readonly' => true, |
|
447 | + ), |
|
448 | + |
|
449 | + 'is_held' => array( |
|
450 | + 'description' => __( 'Whether or not this invoice has been held for payment confirmation.', 'invoicing' ), |
|
451 | + 'type' => 'boolean', |
|
452 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
453 | + 'readonly' => true, |
|
454 | + ), |
|
455 | + |
|
456 | + 'is_draft' => array( |
|
457 | + 'description' => __( 'Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing' ), |
|
458 | + 'type' => 'boolean', |
|
459 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
460 | + 'readonly' => true, |
|
461 | + ), |
|
462 | + |
|
463 | + 'path' => array( |
|
464 | + 'description' => __( 'The invoice path/slug/name.', 'invoicing' ), |
|
465 | + 'type' => 'string', |
|
466 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
467 | + 'readonly' => true, |
|
468 | + ), |
|
469 | + |
|
470 | + 'description' => array( |
|
471 | + 'description' => __( 'The invoice description.', 'invoicing' ), |
|
472 | + 'type' => 'string', |
|
473 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
474 | + ), |
|
475 | + |
|
476 | + 'payment_form' => array( |
|
477 | + 'description' => __( 'The id of the payment form used to pay for this invoice.', 'invoicing' ), |
|
478 | + 'type' => 'integer', |
|
479 | + 'context' => array( 'view', 'edit' ), |
|
480 | + 'readonly' => true, |
|
481 | + ), |
|
482 | + |
|
483 | + 'submission_id' => array( |
|
484 | + 'description' => __( 'A uniques ID of the submission details used to pay for this invoice.', 'invoicing' ), |
|
485 | + 'type' => 'string', |
|
486 | + 'context' => array( 'view', 'edit' ), |
|
487 | + 'readonly' => true, |
|
488 | + ), |
|
489 | + |
|
490 | + 'customer_id' => array( |
|
491 | + 'description' => __( 'The customer id.', 'invoicing' ), |
|
492 | + 'type' => 'integer', |
|
493 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
494 | + ), |
|
495 | + |
|
496 | + 'customer_ip' => array( |
|
497 | + 'description' => __( "The customer's ip address.", 'invoicing' ), |
|
498 | + 'type' => 'string', |
|
499 | + 'format' => 'ip', |
|
500 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
501 | + ), |
|
502 | + |
|
503 | + 'first_name' => array( |
|
504 | + 'description' => __( "The customer's first name.", 'invoicing' ), |
|
505 | + 'type' => 'string', |
|
506 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
507 | + ), |
|
508 | + |
|
509 | + 'last_name' => array( |
|
510 | + 'description' => __( "The customer's last name.", 'invoicing' ), |
|
511 | + 'type' => 'string', |
|
512 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
513 | + ), |
|
514 | 514 | |
515 | - 'full_name' => array( |
|
516 | - 'description' => __( "The customer's full name.", 'invoicing' ), |
|
517 | - 'type' => 'string', |
|
518 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
519 | - 'readonly' => true, |
|
520 | - ), |
|
521 | - |
|
522 | - 'phone_number' => array( |
|
523 | - 'description' => __( "The customer's phone number.", 'invoicing' ), |
|
524 | - 'type' => 'string', |
|
525 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
526 | - ), |
|
527 | - |
|
528 | - 'email_address' => array( |
|
529 | - 'description' => __( "The customer's email address.", 'invoicing' ), |
|
530 | - 'type' => 'string', |
|
531 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
532 | - 'readonly' => true, |
|
533 | - ), |
|
534 | - |
|
535 | - 'customer_country' => array( |
|
536 | - 'description' => __( "The customer's country.", 'invoicing' ), |
|
537 | - 'type' => 'string', |
|
538 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
539 | - 'default' => wpinv_get_default_country(), |
|
540 | - ), |
|
541 | - |
|
542 | - 'customer_state' => array( |
|
543 | - 'description' => __( "The customer's state.", 'invoicing' ), |
|
544 | - 'type' => 'string', |
|
545 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
546 | - ), |
|
547 | - |
|
548 | - 'customer_city' => array( |
|
549 | - 'description' => __( "The customer's city.", 'invoicing' ), |
|
550 | - 'type' => 'string', |
|
551 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
552 | - ), |
|
553 | - |
|
554 | - 'customer_zip' => array( |
|
555 | - 'description' => __( "The customer's zip/postal code.", 'invoicing' ), |
|
556 | - 'type' => 'string', |
|
557 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
558 | - ), |
|
559 | - |
|
560 | - 'customer_company' => array( |
|
561 | - 'description' => __( "The customer's company name.", 'invoicing' ), |
|
562 | - 'type' => 'string', |
|
563 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
564 | - ), |
|
565 | - |
|
566 | - 'vat_number' => array( |
|
567 | - 'description' => __( "The customer's VAT number.", 'invoicing' ), |
|
568 | - 'type' => 'string', |
|
569 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
570 | - ), |
|
571 | - |
|
572 | - 'vat_rate' => array( |
|
573 | - 'description' => __( "The customer's VAT rate.", 'invoicing' ), |
|
574 | - 'type' => 'number', |
|
575 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
576 | - 'readonly' => true, |
|
577 | - ), |
|
578 | - |
|
579 | - 'customer_address' => array( |
|
580 | - 'description' => __( "The customer's address.", 'invoicing' ), |
|
581 | - 'type' => 'string', |
|
582 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
583 | - ), |
|
584 | - |
|
585 | - 'address_confirmed' => array( |
|
586 | - 'description' => __( "Whether or not the customer's address is confirmed.", 'invoicing' ), |
|
587 | - 'type' => 'boolean', |
|
588 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
589 | - ), |
|
590 | - |
|
591 | - 'meta_data' => array( |
|
592 | - 'description' => __( 'Invoice meta data.', 'invoicing' ), |
|
593 | - 'type' => 'array', |
|
594 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
595 | - 'items' => array( |
|
596 | - 'type' => 'object', |
|
597 | - 'properties' => array( |
|
598 | - 'id' => array( |
|
599 | - 'description' => __( 'Meta ID.', 'invoicing' ), |
|
600 | - 'type' => 'string', |
|
601 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
602 | - ), |
|
603 | - 'key' => array( |
|
604 | - 'description' => __( 'Meta key.', 'invoicing' ), |
|
605 | - 'type' => 'string', |
|
606 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
607 | - ), |
|
608 | - 'value' => array( |
|
609 | - 'description' => __( 'Meta Value.', 'invoicing' ), |
|
610 | - 'type' => array( 'string', 'array', 'object', 'integer', 'null' ), |
|
611 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
612 | - ), |
|
613 | - ), |
|
614 | - ), |
|
615 | - ), |
|
616 | - |
|
617 | - 'view_url' => array( |
|
618 | - 'description' => __( 'URL to the invoice.', 'invoicing' ), |
|
619 | - 'type' => 'string', |
|
620 | - 'format' => 'uri', |
|
621 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
622 | - 'readonly' => true, |
|
623 | - ), |
|
624 | - |
|
625 | - 'checkout_payment_url' => array( |
|
626 | - 'description' => __( 'URL to the invoice checkout page.', 'invoicing' ), |
|
627 | - 'type' => 'string', |
|
628 | - 'format' => 'uri', |
|
629 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
630 | - 'readonly' => true, |
|
631 | - ), |
|
632 | - |
|
633 | - 'receipt_url' => array( |
|
634 | - 'description' => __( 'URL to the invoice receipt page.', 'invoicing' ), |
|
635 | - 'type' => 'string', |
|
636 | - 'format' => 'uri', |
|
637 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
638 | - 'readonly' => true, |
|
639 | - ), |
|
515 | + 'full_name' => array( |
|
516 | + 'description' => __( "The customer's full name.", 'invoicing' ), |
|
517 | + 'type' => 'string', |
|
518 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
519 | + 'readonly' => true, |
|
520 | + ), |
|
521 | + |
|
522 | + 'phone_number' => array( |
|
523 | + 'description' => __( "The customer's phone number.", 'invoicing' ), |
|
524 | + 'type' => 'string', |
|
525 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
526 | + ), |
|
527 | + |
|
528 | + 'email_address' => array( |
|
529 | + 'description' => __( "The customer's email address.", 'invoicing' ), |
|
530 | + 'type' => 'string', |
|
531 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
532 | + 'readonly' => true, |
|
533 | + ), |
|
534 | + |
|
535 | + 'customer_country' => array( |
|
536 | + 'description' => __( "The customer's country.", 'invoicing' ), |
|
537 | + 'type' => 'string', |
|
538 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
539 | + 'default' => wpinv_get_default_country(), |
|
540 | + ), |
|
541 | + |
|
542 | + 'customer_state' => array( |
|
543 | + 'description' => __( "The customer's state.", 'invoicing' ), |
|
544 | + 'type' => 'string', |
|
545 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
546 | + ), |
|
547 | + |
|
548 | + 'customer_city' => array( |
|
549 | + 'description' => __( "The customer's city.", 'invoicing' ), |
|
550 | + 'type' => 'string', |
|
551 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
552 | + ), |
|
553 | + |
|
554 | + 'customer_zip' => array( |
|
555 | + 'description' => __( "The customer's zip/postal code.", 'invoicing' ), |
|
556 | + 'type' => 'string', |
|
557 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
558 | + ), |
|
559 | + |
|
560 | + 'customer_company' => array( |
|
561 | + 'description' => __( "The customer's company name.", 'invoicing' ), |
|
562 | + 'type' => 'string', |
|
563 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
564 | + ), |
|
565 | + |
|
566 | + 'vat_number' => array( |
|
567 | + 'description' => __( "The customer's VAT number.", 'invoicing' ), |
|
568 | + 'type' => 'string', |
|
569 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
570 | + ), |
|
571 | + |
|
572 | + 'vat_rate' => array( |
|
573 | + 'description' => __( "The customer's VAT rate.", 'invoicing' ), |
|
574 | + 'type' => 'number', |
|
575 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
576 | + 'readonly' => true, |
|
577 | + ), |
|
578 | + |
|
579 | + 'customer_address' => array( |
|
580 | + 'description' => __( "The customer's address.", 'invoicing' ), |
|
581 | + 'type' => 'string', |
|
582 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
583 | + ), |
|
584 | + |
|
585 | + 'address_confirmed' => array( |
|
586 | + 'description' => __( "Whether or not the customer's address is confirmed.", 'invoicing' ), |
|
587 | + 'type' => 'boolean', |
|
588 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
589 | + ), |
|
590 | + |
|
591 | + 'meta_data' => array( |
|
592 | + 'description' => __( 'Invoice meta data.', 'invoicing' ), |
|
593 | + 'type' => 'array', |
|
594 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
595 | + 'items' => array( |
|
596 | + 'type' => 'object', |
|
597 | + 'properties' => array( |
|
598 | + 'id' => array( |
|
599 | + 'description' => __( 'Meta ID.', 'invoicing' ), |
|
600 | + 'type' => 'string', |
|
601 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
602 | + ), |
|
603 | + 'key' => array( |
|
604 | + 'description' => __( 'Meta key.', 'invoicing' ), |
|
605 | + 'type' => 'string', |
|
606 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
607 | + ), |
|
608 | + 'value' => array( |
|
609 | + 'description' => __( 'Meta Value.', 'invoicing' ), |
|
610 | + 'type' => array( 'string', 'array', 'object', 'integer', 'null' ), |
|
611 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
612 | + ), |
|
613 | + ), |
|
614 | + ), |
|
615 | + ), |
|
616 | + |
|
617 | + 'view_url' => array( |
|
618 | + 'description' => __( 'URL to the invoice.', 'invoicing' ), |
|
619 | + 'type' => 'string', |
|
620 | + 'format' => 'uri', |
|
621 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
622 | + 'readonly' => true, |
|
623 | + ), |
|
624 | + |
|
625 | + 'checkout_payment_url' => array( |
|
626 | + 'description' => __( 'URL to the invoice checkout page.', 'invoicing' ), |
|
627 | + 'type' => 'string', |
|
628 | + 'format' => 'uri', |
|
629 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
630 | + 'readonly' => true, |
|
631 | + ), |
|
632 | + |
|
633 | + 'receipt_url' => array( |
|
634 | + 'description' => __( 'URL to the invoice receipt page.', 'invoicing' ), |
|
635 | + 'type' => 'string', |
|
636 | + 'format' => 'uri', |
|
637 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
638 | + 'readonly' => true, |
|
639 | + ), |
|
640 | 640 | |
641 | 641 | ); |
@@ -9,632 +9,632 @@ |
||
9 | 9 | * @version 1.0.19 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | 14 | return array( |
15 | 15 | |
16 | 16 | 'id' => array( |
17 | - 'description' => __( 'Unique identifier for the invoice.', 'invoicing' ), |
|
17 | + 'description' => __('Unique identifier for the invoice.', 'invoicing'), |
|
18 | 18 | 'type' => 'integer', |
19 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
19 | + 'context' => array('view', 'edit', 'embed'), |
|
20 | 20 | 'readonly' => true, |
21 | 21 | ), |
22 | 22 | |
23 | 23 | 'parent_id' => array( |
24 | - 'description' => __( 'Parent invoice ID.', 'invoicing' ), |
|
24 | + 'description' => __('Parent invoice ID.', 'invoicing'), |
|
25 | 25 | 'type' => 'integer', |
26 | 26 | 'minimum' => 0, |
27 | 27 | 'default' => 0, |
28 | - 'context' => array( 'view', 'edit' ), |
|
28 | + 'context' => array('view', 'edit'), |
|
29 | 29 | ), |
30 | 30 | |
31 | 31 | 'key' => array( |
32 | - 'description' => __( 'A unique key for the invoice.', 'invoicing' ), |
|
32 | + 'description' => __('A unique key for the invoice.', 'invoicing'), |
|
33 | 33 | 'type' => 'string', |
34 | - 'context' => array( 'view', 'edit' ), |
|
34 | + 'context' => array('view', 'edit'), |
|
35 | 35 | 'readonly' => true, |
36 | 36 | ), |
37 | 37 | |
38 | 38 | 'number' => array( |
39 | - 'description' => __( 'A unique number for the invoice.', 'invoicing' ), |
|
39 | + 'description' => __('A unique number for the invoice.', 'invoicing'), |
|
40 | 40 | 'type' => 'string', |
41 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
41 | + 'context' => array('view', 'edit', 'embed'), |
|
42 | 42 | ), |
43 | 43 | |
44 | 44 | 'type' => array( |
45 | - 'description' => __( 'Get the invoice type (e.g invoice, quote etc).', 'invoicing' ), |
|
45 | + 'description' => __('Get the invoice type (e.g invoice, quote etc).', 'invoicing'), |
|
46 | 46 | 'type' => 'string', |
47 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
47 | + 'context' => array('view', 'edit', 'embed'), |
|
48 | 48 | 'readonly' => true, |
49 | 49 | ), |
50 | 50 | |
51 | 51 | 'post_type' => array( |
52 | - 'description' => __( 'Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing' ), |
|
52 | + 'description' => __('Get the invoice post type (e.g wpi_invoice, wpi_quote etc).', 'invoicing'), |
|
53 | 53 | 'type' => 'string', |
54 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
54 | + 'context' => array('view', 'edit', 'embed'), |
|
55 | 55 | 'readonly' => true, |
56 | 56 | ), |
57 | 57 | |
58 | 58 | 'version' => array( |
59 | - 'description' => __( 'Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing' ), |
|
59 | + 'description' => __('Version of GetPaid/Invoicing which last updated the invoice.', 'invoicing'), |
|
60 | 60 | 'type' => 'integer', |
61 | - 'context' => array( 'view', 'edit' ), |
|
61 | + 'context' => array('view', 'edit'), |
|
62 | 62 | 'readonly' => true, |
63 | 63 | ), |
64 | 64 | |
65 | 65 | 'template' => array( |
66 | - 'description' => __( 'The invoice template.', 'invoicing' ), |
|
66 | + 'description' => __('The invoice template.', 'invoicing'), |
|
67 | 67 | 'type' => 'string', |
68 | 68 | 'default' => 'quantity', |
69 | - 'enum' => array( 'quantity', 'hours', 'amount' ), |
|
70 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
69 | + 'enum' => array('quantity', 'hours', 'amount'), |
|
70 | + 'context' => array('view', 'edit', 'embed'), |
|
71 | 71 | ), |
72 | 72 | |
73 | 73 | 'status' => array( |
74 | - 'description' => __( 'Invoice status.', 'invoicing' ), |
|
74 | + 'description' => __('Invoice status.', 'invoicing'), |
|
75 | 75 | 'type' => 'string', |
76 | 76 | 'default' => 'wpi-pending', |
77 | - 'enum' => array_keys( wpinv_get_invoice_statuses( true ) ), |
|
78 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
77 | + 'enum' => array_keys(wpinv_get_invoice_statuses(true)), |
|
78 | + 'context' => array('view', 'edit', 'embed'), |
|
79 | 79 | ), |
80 | 80 | |
81 | 81 | 'status_nicename' => array( |
82 | - 'description' => __( 'A human readable name for the invoice status.', 'invoicing' ), |
|
82 | + 'description' => __('A human readable name for the invoice status.', 'invoicing'), |
|
83 | 83 | 'type' => 'string', |
84 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
84 | + 'context' => array('view', 'edit', 'embed'), |
|
85 | 85 | 'readonly' => true, |
86 | 86 | ), |
87 | 87 | |
88 | 88 | 'currency' => array( |
89 | - 'description' => __( 'The invoice currency in ISO format.', 'invoicing' ), |
|
89 | + 'description' => __('The invoice currency in ISO format.', 'invoicing'), |
|
90 | 90 | 'type' => 'string', |
91 | 91 | 'default' => wpinv_get_currency(), |
92 | - 'enum' => array_keys( wpinv_get_currencies() ), |
|
93 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
92 | + 'enum' => array_keys(wpinv_get_currencies()), |
|
93 | + 'context' => array('view', 'edit', 'embed'), |
|
94 | 94 | ), |
95 | 95 | |
96 | 96 | 'date_created' => array( |
97 | - 'description' => __( "The date the invoice was created, in the site's timezone.", 'invoicing' ), |
|
97 | + 'description' => __("The date the invoice was created, in the site's timezone.", 'invoicing'), |
|
98 | 98 | 'type' => 'string', |
99 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
99 | + 'context' => array('view', 'edit', 'embed'), |
|
100 | 100 | ), |
101 | 101 | |
102 | 102 | 'date_created_gmt' => array( |
103 | - 'description' => __( 'The GMT date the invoice was created.', 'invoicing' ), |
|
103 | + 'description' => __('The GMT date the invoice was created.', 'invoicing'), |
|
104 | 104 | 'type' => 'string', |
105 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
105 | + 'context' => array('view', 'edit', 'embed'), |
|
106 | 106 | 'readonly' => true, |
107 | 107 | ), |
108 | 108 | |
109 | 109 | 'date_modified' => array( |
110 | - 'description' => __( "The date the invoice was last modified, in the site's timezone.", 'invoicing' ), |
|
110 | + 'description' => __("The date the invoice was last modified, in the site's timezone.", 'invoicing'), |
|
111 | 111 | 'type' => 'string', |
112 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
112 | + 'context' => array('view', 'edit', 'embed'), |
|
113 | 113 | 'readonly' => true, |
114 | 114 | ), |
115 | 115 | |
116 | 116 | 'date_modified_gmt' => array( |
117 | - 'description' => __( 'The GMT date the invoice was last modified.', 'invoicing' ), |
|
117 | + 'description' => __('The GMT date the invoice was last modified.', 'invoicing'), |
|
118 | 118 | 'type' => 'string', |
119 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
119 | + 'context' => array('view', 'edit', 'embed'), |
|
120 | 120 | 'readonly' => true, |
121 | 121 | ), |
122 | 122 | |
123 | 123 | 'due_date' => array( |
124 | - 'description' => __( "The invoice's due date, in the site's timezone.", 'invoicing' ), |
|
124 | + 'description' => __("The invoice's due date, in the site's timezone.", 'invoicing'), |
|
125 | 125 | 'type' => 'string', |
126 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
126 | + 'context' => array('view', 'edit', 'embed'), |
|
127 | 127 | ), |
128 | 128 | |
129 | 129 | 'due_date_gmt' => array( |
130 | - 'description' => __( 'The GMT date the invoice is/was due.', 'invoicing' ), |
|
130 | + 'description' => __('The GMT date the invoice is/was due.', 'invoicing'), |
|
131 | 131 | 'type' => 'string', |
132 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
132 | + 'context' => array('view', 'edit', 'embed'), |
|
133 | 133 | 'readonly' => true, |
134 | 134 | ), |
135 | 135 | |
136 | 136 | 'completed_date' => array( |
137 | - 'description' => __( "The date the invoice was paid, in the site's timezone.", 'invoicing' ), |
|
137 | + 'description' => __("The date the invoice was paid, in the site's timezone.", 'invoicing'), |
|
138 | 138 | 'type' => 'string', |
139 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
139 | + 'context' => array('view', 'edit', 'embed'), |
|
140 | 140 | 'readonly' => true, |
141 | 141 | ), |
142 | 142 | |
143 | 143 | 'completed_date_gmt' => array( |
144 | - 'description' => __( 'The GMT date the invoice was paid.', 'invoicing' ), |
|
144 | + 'description' => __('The GMT date the invoice was paid.', 'invoicing'), |
|
145 | 145 | 'type' => 'string', |
146 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
146 | + 'context' => array('view', 'edit', 'embed'), |
|
147 | 147 | 'readonly' => true, |
148 | 148 | ), |
149 | 149 | |
150 | 150 | 'total_discount' => array( |
151 | - 'description' => __( 'Total discount amount for the invoice.', 'invoicing' ), |
|
151 | + 'description' => __('Total discount amount for the invoice.', 'invoicing'), |
|
152 | 152 | 'type' => 'number', |
153 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
153 | + 'context' => array('view', 'edit', 'embed'), |
|
154 | 154 | 'readonly' => true, |
155 | 155 | ), |
156 | 156 | |
157 | 157 | 'total_tax' => array( |
158 | - 'description' => __( 'Total tax amount for the invoice.', 'invoicing' ), |
|
158 | + 'description' => __('Total tax amount for the invoice.', 'invoicing'), |
|
159 | 159 | 'type' => 'number', |
160 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
160 | + 'context' => array('view', 'edit', 'embed'), |
|
161 | 161 | 'readonly' => true, |
162 | 162 | ), |
163 | 163 | |
164 | 164 | 'total_fees' => array( |
165 | - 'description' => __( 'Total fees amount for the invoice.', 'invoicing' ), |
|
165 | + 'description' => __('Total fees amount for the invoice.', 'invoicing'), |
|
166 | 166 | 'type' => 'number', |
167 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
167 | + 'context' => array('view', 'edit', 'embed'), |
|
168 | 168 | 'readonly' => true, |
169 | 169 | ), |
170 | 170 | |
171 | 171 | 'subtotal' => array( |
172 | - 'description' => __( 'Invoice subtotal.', 'invoicing' ), |
|
172 | + 'description' => __('Invoice subtotal.', 'invoicing'), |
|
173 | 173 | 'type' => 'number', |
174 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
174 | + 'context' => array('view', 'edit', 'embed'), |
|
175 | 175 | 'readonly' => true, |
176 | 176 | ), |
177 | 177 | |
178 | 178 | 'total' => array( |
179 | - 'description' => __( 'Grand total.', 'invoicing' ), |
|
179 | + 'description' => __('Grand total.', 'invoicing'), |
|
180 | 180 | 'type' => 'number', |
181 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
181 | + 'context' => array('view', 'edit', 'embed'), |
|
182 | 182 | 'readonly' => true, |
183 | 183 | ), |
184 | 184 | |
185 | 185 | 'initial_total' => array( |
186 | - 'description' => __( 'Initial total (for recurring invoices).', 'invoicing' ), |
|
186 | + 'description' => __('Initial total (for recurring invoices).', 'invoicing'), |
|
187 | 187 | 'type' => 'number', |
188 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
188 | + 'context' => array('view', 'edit', 'embed'), |
|
189 | 189 | 'readonly' => true, |
190 | 190 | ), |
191 | 191 | |
192 | 192 | 'recurring_total' => array( |
193 | - 'description' => __( 'Recurring total (for recurring invoices).', 'invoicing' ), |
|
193 | + 'description' => __('Recurring total (for recurring invoices).', 'invoicing'), |
|
194 | 194 | 'type' => 'number', |
195 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
195 | + 'context' => array('view', 'edit', 'embed'), |
|
196 | 196 | 'readonly' => true, |
197 | 197 | ), |
198 | 198 | |
199 | 199 | 'totals' => array( |
200 | - 'description' => __( 'Invoice totals.', 'invoicing' ), |
|
200 | + 'description' => __('Invoice totals.', 'invoicing'), |
|
201 | 201 | 'type' => 'object', |
202 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
202 | + 'context' => array('view', 'edit', 'embed'), |
|
203 | 203 | 'readonly' => true, |
204 | 204 | ), |
205 | 205 | |
206 | 206 | 'fees' => array( |
207 | - 'description' => __( 'Invoice fees (Name => properties).', 'invoicing' ), |
|
207 | + 'description' => __('Invoice fees (Name => properties).', 'invoicing'), |
|
208 | 208 | 'type' => 'object', |
209 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
209 | + 'context' => array('view', 'edit', 'embed'), |
|
210 | 210 | 'items' => array( |
211 | 211 | 'type' => 'object', |
212 | - 'required' => array( 'amount' ), |
|
212 | + 'required' => array('amount'), |
|
213 | 213 | 'properties' => array( |
214 | 214 | 'amount' => array( |
215 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
215 | + 'description' => __('Fee amount.', 'invoicing'), |
|
216 | 216 | 'type' => 'string', |
217 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
217 | + 'context' => array('view', 'edit', 'embed'), |
|
218 | 218 | ), |
219 | 219 | 'recurring' => array( |
220 | - 'description' => __( 'Whether this is a recurring or one-time fee.', 'invoicing' ), |
|
221 | - 'type' => array( 'boolean', 'integer' ), |
|
222 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
220 | + 'description' => __('Whether this is a recurring or one-time fee.', 'invoicing'), |
|
221 | + 'type' => array('boolean', 'integer'), |
|
222 | + 'context' => array('view', 'edit', 'embed'), |
|
223 | 223 | ), |
224 | 224 | ), |
225 | 225 | ), |
226 | 226 | ), |
227 | 227 | |
228 | 228 | 'discounts' => array( |
229 | - 'description' => __( 'Invoice discounts (Name => properties).', 'invoicing' ), |
|
229 | + 'description' => __('Invoice discounts (Name => properties).', 'invoicing'), |
|
230 | 230 | 'type' => 'object', |
231 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
231 | + 'context' => array('view', 'edit', 'embed'), |
|
232 | 232 | 'items' => array( |
233 | 233 | 'type' => 'object', |
234 | - 'required' => array( 'amount' ), |
|
234 | + 'required' => array('amount'), |
|
235 | 235 | 'properties' => array( |
236 | 236 | 'amount' => array( |
237 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
237 | + 'description' => __('Fee amount.', 'invoicing'), |
|
238 | 238 | 'type' => 'string', |
239 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
239 | + 'context' => array('view', 'edit', 'embed'), |
|
240 | 240 | ), |
241 | 241 | 'recurring' => array( |
242 | - 'description' => __( 'Whether this is a recurring or one-time discount.', 'invoicing' ), |
|
243 | - 'type' => array( 'boolean', 'integer' ), |
|
244 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
242 | + 'description' => __('Whether this is a recurring or one-time discount.', 'invoicing'), |
|
243 | + 'type' => array('boolean', 'integer'), |
|
244 | + 'context' => array('view', 'edit', 'embed'), |
|
245 | 245 | ), |
246 | 246 | ), |
247 | 247 | ), |
248 | 248 | ), |
249 | 249 | |
250 | 250 | 'taxes' => array( |
251 | - 'description' => __( 'Invoice taxes (Name => properties).', 'invoicing' ), |
|
251 | + 'description' => __('Invoice taxes (Name => properties).', 'invoicing'), |
|
252 | 252 | 'type' => 'object', |
253 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
253 | + 'context' => array('view', 'edit', 'embed'), |
|
254 | 254 | 'items' => array( |
255 | 255 | 'type' => 'object', |
256 | - 'required' => array( 'amount' ), |
|
256 | + 'required' => array('amount'), |
|
257 | 257 | 'properties' => array( |
258 | 258 | 'amount' => array( |
259 | - 'description' => __( 'Fee amount.', 'invoicing' ), |
|
259 | + 'description' => __('Fee amount.', 'invoicing'), |
|
260 | 260 | 'type' => 'string', |
261 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
261 | + 'context' => array('view', 'edit', 'embed'), |
|
262 | 262 | ), |
263 | 263 | 'recurring' => array( |
264 | - 'description' => __( 'Whether this is a recurring or one-time tax.', 'invoicing' ), |
|
265 | - 'type' => array( 'boolean', 'integer' ), |
|
266 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
264 | + 'description' => __('Whether this is a recurring or one-time tax.', 'invoicing'), |
|
265 | + 'type' => array('boolean', 'integer'), |
|
266 | + 'context' => array('view', 'edit', 'embed'), |
|
267 | 267 | ), |
268 | 268 | ), |
269 | 269 | ), |
270 | 270 | ), |
271 | 271 | |
272 | 272 | 'items' => array( |
273 | - 'description' => __( 'Invoice items.', 'invoicing' ), |
|
273 | + 'description' => __('Invoice items.', 'invoicing'), |
|
274 | 274 | 'type' => 'array', |
275 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
275 | + 'context' => array('view', 'edit', 'embed'), |
|
276 | 276 | 'items' => array( |
277 | 277 | 'type' => 'object', |
278 | - 'required' => array( 'item_id' ), |
|
278 | + 'required' => array('item_id'), |
|
279 | 279 | 'properties' => array( |
280 | 280 | 'item_id' => array( |
281 | - 'description' => __( 'Item ID.', 'invoicing' ), |
|
281 | + 'description' => __('Item ID.', 'invoicing'), |
|
282 | 282 | 'type' => 'integer', |
283 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
283 | + 'context' => array('view', 'edit', 'embed'), |
|
284 | 284 | ), |
285 | 285 | 'item_name' => array( |
286 | - 'description' => __( 'Item Name.', 'invoicing' ), |
|
286 | + 'description' => __('Item Name.', 'invoicing'), |
|
287 | 287 | 'type' => 'string', |
288 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
288 | + 'context' => array('view', 'edit', 'embed'), |
|
289 | 289 | ), |
290 | 290 | 'item_description' => array( |
291 | - 'description' => __( 'Item Description.', 'invoicing' ), |
|
291 | + 'description' => __('Item Description.', 'invoicing'), |
|
292 | 292 | 'type' => 'string', |
293 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
293 | + 'context' => array('view', 'edit', 'embed'), |
|
294 | 294 | ), |
295 | 295 | 'item_price' => array( |
296 | - 'description' => __( 'Item Price.', 'invoicing' ), |
|
296 | + 'description' => __('Item Price.', 'invoicing'), |
|
297 | 297 | 'type' => 'number', |
298 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
298 | + 'context' => array('view', 'edit', 'embed'), |
|
299 | 299 | ), |
300 | 300 | 'quantity' => array( |
301 | - 'description' => __( 'Item Quantity.', 'invoicing' ), |
|
301 | + 'description' => __('Item Quantity.', 'invoicing'), |
|
302 | 302 | 'type' => 'integer', |
303 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
303 | + 'context' => array('view', 'edit', 'embed'), |
|
304 | 304 | ), |
305 | 305 | 'subtotal' => array( |
306 | - 'description' => __( 'Item Subtotal.', 'invoicing' ), |
|
306 | + 'description' => __('Item Subtotal.', 'invoicing'), |
|
307 | 307 | 'type' => 'number', |
308 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
308 | + 'context' => array('view', 'edit', 'embed'), |
|
309 | 309 | 'readonly' => true, |
310 | 310 | ), |
311 | 311 | 'meta' => array( |
312 | - 'description' => __( 'Item Meta.', 'invoicing' ), |
|
312 | + 'description' => __('Item Meta.', 'invoicing'), |
|
313 | 313 | 'type' => 'object', |
314 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
314 | + 'context' => array('view', 'edit', 'embed'), |
|
315 | 315 | ), |
316 | 316 | ), |
317 | 317 | ), |
318 | 318 | ), |
319 | 319 | |
320 | 320 | 'mode' => array( |
321 | - 'description' => __( 'The invoice transaction mode.', 'invoicing' ), |
|
321 | + 'description' => __('The invoice transaction mode.', 'invoicing'), |
|
322 | 322 | 'type' => 'string', |
323 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
324 | - 'enum' => array( 'live', 'test' ), |
|
323 | + 'context' => array('view', 'edit', 'embed'), |
|
324 | + 'enum' => array('live', 'test'), |
|
325 | 325 | 'readonly' => true, |
326 | 326 | ), |
327 | 327 | |
328 | 328 | 'discount_code' => array( |
329 | - 'description' => __( 'The discount code used on this invoice.', 'invoicing' ), |
|
329 | + 'description' => __('The discount code used on this invoice.', 'invoicing'), |
|
330 | 330 | 'type' => 'string', |
331 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
331 | + 'context' => array('view', 'edit', 'embed'), |
|
332 | 332 | ), |
333 | 333 | |
334 | 334 | 'gateway' => array( |
335 | - 'description' => __( 'The gateway used to pay this invoice.', 'invoicing' ), |
|
335 | + 'description' => __('The gateway used to pay this invoice.', 'invoicing'), |
|
336 | 336 | 'type' => 'string', |
337 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
337 | + 'context' => array('view', 'edit', 'embed'), |
|
338 | 338 | ), |
339 | 339 | |
340 | 340 | 'gateway_title' => array( |
341 | - 'description' => __( 'The title of the gateway used to pay this invoice.', 'invoicing' ), |
|
341 | + 'description' => __('The title of the gateway used to pay this invoice.', 'invoicing'), |
|
342 | 342 | 'type' => 'string', |
343 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
343 | + 'context' => array('view', 'edit', 'embed'), |
|
344 | 344 | 'readonly' => true, |
345 | 345 | ), |
346 | 346 | |
347 | 347 | 'transaction_id' => array( |
348 | - 'description' => __( 'The transaction id for this invoice.', 'invoicing' ), |
|
348 | + 'description' => __('The transaction id for this invoice.', 'invoicing'), |
|
349 | 349 | 'type' => 'string', |
350 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
350 | + 'context' => array('view', 'edit', 'embed'), |
|
351 | 351 | ), |
352 | 352 | |
353 | 353 | 'disable_taxes' => array( |
354 | - 'description' => __( 'Whether or not taxes should be disabled for this invoice.', 'invoicing' ), |
|
354 | + 'description' => __('Whether or not taxes should be disabled for this invoice.', 'invoicing'), |
|
355 | 355 | 'type' => 'boolean ', |
356 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
356 | + 'context' => array('view', 'edit', 'embed'), |
|
357 | 357 | ), |
358 | 358 | |
359 | 359 | 'is_viewed' => array( |
360 | - 'description' => __( 'Whether or not this invoice has been viewed by the user.', 'invoicing' ), |
|
360 | + 'description' => __('Whether or not this invoice has been viewed by the user.', 'invoicing'), |
|
361 | 361 | 'type' => 'boolean ', |
362 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
362 | + 'context' => array('view', 'edit', 'embed'), |
|
363 | 363 | 'readonly' => true, |
364 | 364 | ), |
365 | 365 | |
366 | 366 | 'email_cc' => array( |
367 | - 'description' => __( 'A comma separated list of other emails that should receive communications for this invoice.', 'invoicing' ), |
|
367 | + 'description' => __('A comma separated list of other emails that should receive communications for this invoice.', 'invoicing'), |
|
368 | 368 | 'type' => 'string ', |
369 | - 'context' => array( 'view', 'edit' ), |
|
369 | + 'context' => array('view', 'edit'), |
|
370 | 370 | ), |
371 | 371 | |
372 | 372 | 'subscription_id' => array( |
373 | - 'description' => __( 'The ID of the subscription associated with this invoice.', 'invoicing' ), |
|
373 | + 'description' => __('The ID of the subscription associated with this invoice.', 'invoicing'), |
|
374 | 374 | 'type' => 'string ', |
375 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
375 | + 'context' => array('view', 'edit', 'embed'), |
|
376 | 376 | 'readonly' => true, |
377 | 377 | ), |
378 | 378 | |
379 | 379 | 'subscription_name' => array( |
380 | - 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
380 | + 'description' => __('The name of the subscription associated with this invoice.', 'invoicing'), |
|
381 | 381 | 'type' => 'string ', |
382 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
382 | + 'context' => array('view', 'edit', 'embed'), |
|
383 | 383 | 'readonly' => true, |
384 | 384 | ), |
385 | 385 | |
386 | 386 | 'subscription_name' => array( |
387 | - 'description' => __( 'The name of the subscription associated with this invoice.', 'invoicing' ), |
|
387 | + 'description' => __('The name of the subscription associated with this invoice.', 'invoicing'), |
|
388 | 388 | 'type' => 'string ', |
389 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
389 | + 'context' => array('view', 'edit', 'embed'), |
|
390 | 390 | 'readonly' => true, |
391 | 391 | ), |
392 | 392 | |
393 | 393 | 'is_parent' => array( |
394 | - 'description' => __( 'Whether or not this is a parent invoice.', 'invoicing' ), |
|
394 | + 'description' => __('Whether or not this is a parent invoice.', 'invoicing'), |
|
395 | 395 | 'type' => 'boolean', |
396 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
396 | + 'context' => array('view', 'edit', 'embed'), |
|
397 | 397 | 'readonly' => true, |
398 | 398 | ), |
399 | 399 | |
400 | 400 | 'is_renewal' => array( |
401 | - 'description' => __( 'Whether or not this is a renewal invoice.', 'invoicing' ), |
|
401 | + 'description' => __('Whether or not this is a renewal invoice.', 'invoicing'), |
|
402 | 402 | 'type' => 'boolean', |
403 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
403 | + 'context' => array('view', 'edit', 'embed'), |
|
404 | 404 | 'readonly' => true, |
405 | 405 | ), |
406 | 406 | |
407 | 407 | 'is_recurring' => array( |
408 | - 'description' => __( 'Whether or not this is a recurring invoice.', 'invoicing' ), |
|
408 | + 'description' => __('Whether or not this is a recurring invoice.', 'invoicing'), |
|
409 | 409 | 'type' => 'boolean', |
410 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
410 | + 'context' => array('view', 'edit', 'embed'), |
|
411 | 411 | 'readonly' => true, |
412 | 412 | ), |
413 | 413 | |
414 | 414 | 'is_free' => array( |
415 | - 'description' => __( 'Whether or not this invoice is free.', 'invoicing' ), |
|
415 | + 'description' => __('Whether or not this invoice is free.', 'invoicing'), |
|
416 | 416 | 'type' => 'boolean', |
417 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
417 | + 'context' => array('view', 'edit', 'embed'), |
|
418 | 418 | 'readonly' => true, |
419 | 419 | ), |
420 | 420 | |
421 | 421 | 'is_paid' => array( |
422 | - 'description' => __( 'Whether or not this invoice has been paid.', 'invoicing' ), |
|
422 | + 'description' => __('Whether or not this invoice has been paid.', 'invoicing'), |
|
423 | 423 | 'type' => 'boolean', |
424 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
424 | + 'context' => array('view', 'edit', 'embed'), |
|
425 | 425 | 'readonly' => true, |
426 | 426 | ), |
427 | 427 | |
428 | 428 | 'needs_payment' => array( |
429 | - 'description' => __( 'Whether or not this invoice needs payment.', 'invoicing' ), |
|
429 | + 'description' => __('Whether or not this invoice needs payment.', 'invoicing'), |
|
430 | 430 | 'type' => 'boolean', |
431 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
431 | + 'context' => array('view', 'edit', 'embed'), |
|
432 | 432 | 'readonly' => true, |
433 | 433 | ), |
434 | 434 | |
435 | 435 | 'is_refunded' => array( |
436 | - 'description' => __( 'Whether or not this invoice was refunded.', 'invoicing' ), |
|
436 | + 'description' => __('Whether or not this invoice was refunded.', 'invoicing'), |
|
437 | 437 | 'type' => 'boolean', |
438 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
438 | + 'context' => array('view', 'edit', 'embed'), |
|
439 | 439 | 'readonly' => true, |
440 | 440 | ), |
441 | 441 | |
442 | 442 | 'is_due' => array( |
443 | - 'description' => __( 'Whether or not this invoice is due.', 'invoicing' ), |
|
443 | + 'description' => __('Whether or not this invoice is due.', 'invoicing'), |
|
444 | 444 | 'type' => 'boolean', |
445 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
445 | + 'context' => array('view', 'edit', 'embed'), |
|
446 | 446 | 'readonly' => true, |
447 | 447 | ), |
448 | 448 | |
449 | 449 | 'is_held' => array( |
450 | - 'description' => __( 'Whether or not this invoice has been held for payment confirmation.', 'invoicing' ), |
|
450 | + 'description' => __('Whether or not this invoice has been held for payment confirmation.', 'invoicing'), |
|
451 | 451 | 'type' => 'boolean', |
452 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
452 | + 'context' => array('view', 'edit', 'embed'), |
|
453 | 453 | 'readonly' => true, |
454 | 454 | ), |
455 | 455 | |
456 | 456 | 'is_draft' => array( |
457 | - 'description' => __( 'Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing' ), |
|
457 | + 'description' => __('Whether or not this invoice is marked as draft (cannot be viewed on the frontend).', 'invoicing'), |
|
458 | 458 | 'type' => 'boolean', |
459 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
459 | + 'context' => array('view', 'edit', 'embed'), |
|
460 | 460 | 'readonly' => true, |
461 | 461 | ), |
462 | 462 | |
463 | 463 | 'path' => array( |
464 | - 'description' => __( 'The invoice path/slug/name.', 'invoicing' ), |
|
464 | + 'description' => __('The invoice path/slug/name.', 'invoicing'), |
|
465 | 465 | 'type' => 'string', |
466 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
466 | + 'context' => array('view', 'edit', 'embed'), |
|
467 | 467 | 'readonly' => true, |
468 | 468 | ), |
469 | 469 | |
470 | 470 | 'description' => array( |
471 | - 'description' => __( 'The invoice description.', 'invoicing' ), |
|
471 | + 'description' => __('The invoice description.', 'invoicing'), |
|
472 | 472 | 'type' => 'string', |
473 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
473 | + 'context' => array('view', 'edit', 'embed'), |
|
474 | 474 | ), |
475 | 475 | |
476 | 476 | 'payment_form' => array( |
477 | - 'description' => __( 'The id of the payment form used to pay for this invoice.', 'invoicing' ), |
|
477 | + 'description' => __('The id of the payment form used to pay for this invoice.', 'invoicing'), |
|
478 | 478 | 'type' => 'integer', |
479 | - 'context' => array( 'view', 'edit' ), |
|
479 | + 'context' => array('view', 'edit'), |
|
480 | 480 | 'readonly' => true, |
481 | 481 | ), |
482 | 482 | |
483 | 483 | 'submission_id' => array( |
484 | - 'description' => __( 'A uniques ID of the submission details used to pay for this invoice.', 'invoicing' ), |
|
484 | + 'description' => __('A uniques ID of the submission details used to pay for this invoice.', 'invoicing'), |
|
485 | 485 | 'type' => 'string', |
486 | - 'context' => array( 'view', 'edit' ), |
|
486 | + 'context' => array('view', 'edit'), |
|
487 | 487 | 'readonly' => true, |
488 | 488 | ), |
489 | 489 | |
490 | 490 | 'customer_id' => array( |
491 | - 'description' => __( 'The customer id.', 'invoicing' ), |
|
491 | + 'description' => __('The customer id.', 'invoicing'), |
|
492 | 492 | 'type' => 'integer', |
493 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
493 | + 'context' => array('view', 'edit', 'embed'), |
|
494 | 494 | ), |
495 | 495 | |
496 | 496 | 'customer_ip' => array( |
497 | - 'description' => __( "The customer's ip address.", 'invoicing' ), |
|
497 | + 'description' => __("The customer's ip address.", 'invoicing'), |
|
498 | 498 | 'type' => 'string', |
499 | 499 | 'format' => 'ip', |
500 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
500 | + 'context' => array('view', 'edit', 'embed'), |
|
501 | 501 | ), |
502 | 502 | |
503 | 503 | 'first_name' => array( |
504 | - 'description' => __( "The customer's first name.", 'invoicing' ), |
|
504 | + 'description' => __("The customer's first name.", 'invoicing'), |
|
505 | 505 | 'type' => 'string', |
506 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
506 | + 'context' => array('view', 'edit', 'embed'), |
|
507 | 507 | ), |
508 | 508 | |
509 | 509 | 'last_name' => array( |
510 | - 'description' => __( "The customer's last name.", 'invoicing' ), |
|
510 | + 'description' => __("The customer's last name.", 'invoicing'), |
|
511 | 511 | 'type' => 'string', |
512 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
512 | + 'context' => array('view', 'edit', 'embed'), |
|
513 | 513 | ), |
514 | 514 | |
515 | 515 | 'full_name' => array( |
516 | - 'description' => __( "The customer's full name.", 'invoicing' ), |
|
516 | + 'description' => __("The customer's full name.", 'invoicing'), |
|
517 | 517 | 'type' => 'string', |
518 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
518 | + 'context' => array('view', 'edit', 'embed'), |
|
519 | 519 | 'readonly' => true, |
520 | 520 | ), |
521 | 521 | |
522 | 522 | 'phone_number' => array( |
523 | - 'description' => __( "The customer's phone number.", 'invoicing' ), |
|
523 | + 'description' => __("The customer's phone number.", 'invoicing'), |
|
524 | 524 | 'type' => 'string', |
525 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
525 | + 'context' => array('view', 'edit', 'embed'), |
|
526 | 526 | ), |
527 | 527 | |
528 | 528 | 'email_address' => array( |
529 | - 'description' => __( "The customer's email address.", 'invoicing' ), |
|
529 | + 'description' => __("The customer's email address.", 'invoicing'), |
|
530 | 530 | 'type' => 'string', |
531 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
531 | + 'context' => array('view', 'edit', 'embed'), |
|
532 | 532 | 'readonly' => true, |
533 | 533 | ), |
534 | 534 | |
535 | 535 | 'customer_country' => array( |
536 | - 'description' => __( "The customer's country.", 'invoicing' ), |
|
536 | + 'description' => __("The customer's country.", 'invoicing'), |
|
537 | 537 | 'type' => 'string', |
538 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
538 | + 'context' => array('view', 'edit', 'embed'), |
|
539 | 539 | 'default' => wpinv_get_default_country(), |
540 | 540 | ), |
541 | 541 | |
542 | 542 | 'customer_state' => array( |
543 | - 'description' => __( "The customer's state.", 'invoicing' ), |
|
543 | + 'description' => __("The customer's state.", 'invoicing'), |
|
544 | 544 | 'type' => 'string', |
545 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
545 | + 'context' => array('view', 'edit', 'embed'), |
|
546 | 546 | ), |
547 | 547 | |
548 | 548 | 'customer_city' => array( |
549 | - 'description' => __( "The customer's city.", 'invoicing' ), |
|
549 | + 'description' => __("The customer's city.", 'invoicing'), |
|
550 | 550 | 'type' => 'string', |
551 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
551 | + 'context' => array('view', 'edit', 'embed'), |
|
552 | 552 | ), |
553 | 553 | |
554 | 554 | 'customer_zip' => array( |
555 | - 'description' => __( "The customer's zip/postal code.", 'invoicing' ), |
|
555 | + 'description' => __("The customer's zip/postal code.", 'invoicing'), |
|
556 | 556 | 'type' => 'string', |
557 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
557 | + 'context' => array('view', 'edit', 'embed'), |
|
558 | 558 | ), |
559 | 559 | |
560 | 560 | 'customer_company' => array( |
561 | - 'description' => __( "The customer's company name.", 'invoicing' ), |
|
561 | + 'description' => __("The customer's company name.", 'invoicing'), |
|
562 | 562 | 'type' => 'string', |
563 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
563 | + 'context' => array('view', 'edit', 'embed'), |
|
564 | 564 | ), |
565 | 565 | |
566 | 566 | 'vat_number' => array( |
567 | - 'description' => __( "The customer's VAT number.", 'invoicing' ), |
|
567 | + 'description' => __("The customer's VAT number.", 'invoicing'), |
|
568 | 568 | 'type' => 'string', |
569 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
569 | + 'context' => array('view', 'edit', 'embed'), |
|
570 | 570 | ), |
571 | 571 | |
572 | 572 | 'vat_rate' => array( |
573 | - 'description' => __( "The customer's VAT rate.", 'invoicing' ), |
|
573 | + 'description' => __("The customer's VAT rate.", 'invoicing'), |
|
574 | 574 | 'type' => 'number', |
575 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
575 | + 'context' => array('view', 'edit', 'embed'), |
|
576 | 576 | 'readonly' => true, |
577 | 577 | ), |
578 | 578 | |
579 | 579 | 'customer_address' => array( |
580 | - 'description' => __( "The customer's address.", 'invoicing' ), |
|
580 | + 'description' => __("The customer's address.", 'invoicing'), |
|
581 | 581 | 'type' => 'string', |
582 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
582 | + 'context' => array('view', 'edit', 'embed'), |
|
583 | 583 | ), |
584 | 584 | |
585 | 585 | 'address_confirmed' => array( |
586 | - 'description' => __( "Whether or not the customer's address is confirmed.", 'invoicing' ), |
|
586 | + 'description' => __("Whether or not the customer's address is confirmed.", 'invoicing'), |
|
587 | 587 | 'type' => 'boolean', |
588 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
588 | + 'context' => array('view', 'edit', 'embed'), |
|
589 | 589 | ), |
590 | 590 | |
591 | 591 | 'meta_data' => array( |
592 | - 'description' => __( 'Invoice meta data.', 'invoicing' ), |
|
592 | + 'description' => __('Invoice meta data.', 'invoicing'), |
|
593 | 593 | 'type' => 'array', |
594 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
594 | + 'context' => array('view', 'edit', 'embed'), |
|
595 | 595 | 'items' => array( |
596 | 596 | 'type' => 'object', |
597 | 597 | 'properties' => array( |
598 | 598 | 'id' => array( |
599 | - 'description' => __( 'Meta ID.', 'invoicing' ), |
|
599 | + 'description' => __('Meta ID.', 'invoicing'), |
|
600 | 600 | 'type' => 'string', |
601 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
601 | + 'context' => array('view', 'edit', 'embed'), |
|
602 | 602 | ), |
603 | 603 | 'key' => array( |
604 | - 'description' => __( 'Meta key.', 'invoicing' ), |
|
604 | + 'description' => __('Meta key.', 'invoicing'), |
|
605 | 605 | 'type' => 'string', |
606 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
606 | + 'context' => array('view', 'edit', 'embed'), |
|
607 | 607 | ), |
608 | 608 | 'value' => array( |
609 | - 'description' => __( 'Meta Value.', 'invoicing' ), |
|
610 | - 'type' => array( 'string', 'array', 'object', 'integer', 'null' ), |
|
611 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
609 | + 'description' => __('Meta Value.', 'invoicing'), |
|
610 | + 'type' => array('string', 'array', 'object', 'integer', 'null'), |
|
611 | + 'context' => array('view', 'edit', 'embed'), |
|
612 | 612 | ), |
613 | 613 | ), |
614 | 614 | ), |
615 | 615 | ), |
616 | 616 | |
617 | 617 | 'view_url' => array( |
618 | - 'description' => __( 'URL to the invoice.', 'invoicing' ), |
|
618 | + 'description' => __('URL to the invoice.', 'invoicing'), |
|
619 | 619 | 'type' => 'string', |
620 | 620 | 'format' => 'uri', |
621 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
621 | + 'context' => array('view', 'edit', 'embed'), |
|
622 | 622 | 'readonly' => true, |
623 | 623 | ), |
624 | 624 | |
625 | 625 | 'checkout_payment_url' => array( |
626 | - 'description' => __( 'URL to the invoice checkout page.', 'invoicing' ), |
|
626 | + 'description' => __('URL to the invoice checkout page.', 'invoicing'), |
|
627 | 627 | 'type' => 'string', |
628 | 628 | 'format' => 'uri', |
629 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
629 | + 'context' => array('view', 'edit', 'embed'), |
|
630 | 630 | 'readonly' => true, |
631 | 631 | ), |
632 | 632 | |
633 | 633 | 'receipt_url' => array( |
634 | - 'description' => __( 'URL to the invoice receipt page.', 'invoicing' ), |
|
634 | + 'description' => __('URL to the invoice receipt page.', 'invoicing'), |
|
635 | 635 | 'type' => 'string', |
636 | 636 | 'format' => 'uri', |
637 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
637 | + 'context' => array('view', 'edit', 'embed'), |
|
638 | 638 | 'readonly' => true, |
639 | 639 | ), |
640 | 640 |
@@ -11,166 +11,166 @@ |
||
11 | 11 | defined( 'ABSPATH' ) || exit; |
12 | 12 | |
13 | 13 | return array( |
14 | - 'AED' => 'د.إ', |
|
15 | - 'AFN' => '؋', |
|
16 | - 'ALL' => 'L', |
|
17 | - 'AMD' => 'AMD', |
|
18 | - 'ANG' => 'ƒ', |
|
19 | - 'AOA' => 'Kz', |
|
20 | - 'ARS' => '$', |
|
21 | - 'AUD' => '$', |
|
22 | - 'AWG' => 'ƒ', |
|
23 | - 'AZN' => 'AZN', |
|
24 | - 'BAM' => 'KM', |
|
25 | - 'BBD' => '$', |
|
26 | - 'BDT' => '৳', |
|
27 | - 'BGN' => 'лв.', |
|
28 | - 'BHD' => '.د.ب', |
|
29 | - 'BIF' => 'Fr', |
|
30 | - 'BMD' => '$', |
|
31 | - 'BND' => '$', |
|
32 | - 'BOB' => 'Bs.', |
|
33 | - 'BRL' => 'R$', |
|
34 | - 'BSD' => '$', |
|
35 | - 'BTC' => '฿', |
|
36 | - 'BTN' => 'Nu.', |
|
37 | - 'BWP' => 'P', |
|
38 | - 'BYN' => 'Br', |
|
39 | - 'BZD' => '$', |
|
40 | - 'CAD' => '$', |
|
41 | - 'CDF' => 'Fr', |
|
42 | - 'CHF' => 'CHF', |
|
43 | - 'CLP' => '$', |
|
44 | - 'CNY' => '¥', |
|
45 | - 'COP' => '$', |
|
46 | - 'CRC' => '₡', |
|
47 | - 'CUC' => '$', |
|
48 | - 'CUP' => '$', |
|
49 | - 'CVE' => '$', |
|
50 | - 'CZK' => 'Kč', |
|
51 | - 'DJF' => 'Fr', |
|
52 | - 'DKK' => 'DKK', |
|
53 | - 'DOP' => 'RD$', |
|
54 | - 'DZD' => 'د.ج', |
|
55 | - 'EGP' => 'EGP', |
|
56 | - 'ERN' => 'Nfk', |
|
57 | - 'ETB' => 'Br', |
|
58 | - 'EUR' => '€', |
|
59 | - 'FJD' => '$', |
|
60 | - 'FKP' => '£', |
|
61 | - 'GBP' => '£', |
|
62 | - 'GEL' => 'ლ', |
|
63 | - 'GGP' => '£', |
|
64 | - 'GHS' => '₵', |
|
65 | - 'GIP' => '£', |
|
66 | - 'GMD' => 'D', |
|
67 | - 'GNF' => 'Fr', |
|
68 | - 'GTQ' => 'Q', |
|
69 | - 'GYD' => '$', |
|
70 | - 'HKD' => '$', |
|
71 | - 'HNL' => 'L', |
|
72 | - 'HRK' => 'Kn', |
|
73 | - 'HTG' => 'G', |
|
74 | - 'HUF' => 'Ft', |
|
75 | - 'IDR' => 'Rp', |
|
76 | - 'ILS' => '₪', |
|
77 | - 'IMP' => '£', |
|
78 | - 'INR' => '₹', |
|
79 | - 'IQD' => 'ع.د', |
|
80 | - 'IRR' => '﷼', |
|
81 | - 'IRT' => 'تومان', |
|
82 | - 'ISK' => 'kr.', |
|
83 | - 'JEP' => '£', |
|
84 | - 'JMD' => '$', |
|
85 | - 'JOD' => 'د.ا', |
|
86 | - 'JPY' => '¥', |
|
87 | - 'KES' => 'KSh', |
|
88 | - 'KGS' => 'сом', |
|
89 | - 'KHR' => '៛', |
|
90 | - 'KMF' => 'Fr', |
|
91 | - 'KPW' => '₩', |
|
92 | - 'KRW' => '₩', |
|
93 | - 'KWD' => 'د.ك', |
|
94 | - 'KYD' => '$', |
|
95 | - 'KZT' => 'KZT', |
|
96 | - 'LAK' => '₭', |
|
97 | - 'LBP' => 'ل.ل', |
|
98 | - 'LKR' => 'රු', |
|
99 | - 'LRD' => '$', |
|
100 | - 'LSL' => 'L', |
|
101 | - 'LYD' => 'ل.د', |
|
102 | - 'MAD' => 'د.م.', |
|
103 | - 'MDL' => 'MDL', |
|
104 | - 'MGA' => 'Ar', |
|
105 | - 'MKD' => 'ден', |
|
106 | - 'MMK' => 'Ks', |
|
107 | - 'MNT' => '₮', |
|
108 | - 'MOP' => 'P', |
|
109 | - 'MRO' => 'UM', |
|
110 | - 'MUR' => '₨', |
|
111 | - 'MVR' => '.ރ', |
|
112 | - 'MWK' => 'MK', |
|
113 | - 'MXN' => '$', |
|
114 | - 'MYR' => 'RM', |
|
115 | - 'MZN' => 'MT', |
|
116 | - 'NAD' => '$', |
|
117 | - 'NGN' => '₦', |
|
118 | - 'NIO' => 'C$', |
|
119 | - 'NOK' => 'kr', |
|
120 | - 'NPR' => '₨', |
|
121 | - 'NZD' => '$', |
|
122 | - 'OMR' => 'ر.ع.', |
|
123 | - 'PAB' => 'B/.', |
|
124 | - 'PEN' => 'S/.', |
|
125 | - 'PGK' => 'K', |
|
126 | - 'PHP' => '₱', |
|
127 | - 'PKR' => '₨', |
|
128 | - 'PLN' => 'zł', |
|
129 | - 'PRB' => 'р.', |
|
130 | - 'PYG' => '₲', |
|
131 | - 'QAR' => 'ر.ق', |
|
132 | - 'RMB' => '¥', |
|
133 | - 'RON' => 'lei', |
|
134 | - 'RSD' => 'дин.', |
|
135 | - 'RUB' => '₽', |
|
136 | - 'RWF' => 'Fr', |
|
137 | - 'SAR' => 'ر.س', |
|
138 | - 'SBD' => '$', |
|
139 | - 'SCR' => '₨', |
|
140 | - 'SDG' => 'ج.س.', |
|
141 | - 'SEK' => 'kr', |
|
142 | - 'SGD' => '$', |
|
143 | - 'SHP' => '£', |
|
144 | - 'SLL' => 'Le', |
|
145 | - 'SOS' => 'Sh', |
|
146 | - 'SRD' => '$', |
|
147 | - 'SSP' => '£', |
|
148 | - 'STD' => 'Db', |
|
149 | - 'SYP' => 'ل.س', |
|
150 | - 'SZL' => 'L', |
|
151 | - 'THB' => '฿', |
|
152 | - 'TJS' => 'ЅМ', |
|
153 | - 'TMT' => 'm', |
|
154 | - 'TND' => 'د.ت', |
|
155 | - 'TOP' => 'T$', |
|
156 | - 'TRY' => '₺', |
|
157 | - 'TTD' => '$', |
|
158 | - 'TWD' => 'NT$', |
|
159 | - 'TZS' => 'Sh', |
|
160 | - 'UAH' => '₴', |
|
161 | - 'UGX' => 'UGX', |
|
162 | - 'USD' => '$', |
|
163 | - 'UYU' => '$', |
|
164 | - 'UZS' => 'UZS', |
|
165 | - 'VEF' => 'Bs.', |
|
166 | - 'VND' => '₫', |
|
167 | - 'VUV' => 'Vt', |
|
168 | - 'WST' => 'T', |
|
169 | - 'XAF' => 'Fr', |
|
170 | - 'XCD' => '$', |
|
171 | - 'XOF' => 'Fr', |
|
172 | - 'XPF' => 'Fr', |
|
173 | - 'YER' => '﷼', |
|
174 | - 'ZAR' => 'R', |
|
175 | - 'ZMW' => 'ZK', |
|
14 | + 'AED' => 'د.إ', |
|
15 | + 'AFN' => '؋', |
|
16 | + 'ALL' => 'L', |
|
17 | + 'AMD' => 'AMD', |
|
18 | + 'ANG' => 'ƒ', |
|
19 | + 'AOA' => 'Kz', |
|
20 | + 'ARS' => '$', |
|
21 | + 'AUD' => '$', |
|
22 | + 'AWG' => 'ƒ', |
|
23 | + 'AZN' => 'AZN', |
|
24 | + 'BAM' => 'KM', |
|
25 | + 'BBD' => '$', |
|
26 | + 'BDT' => '৳', |
|
27 | + 'BGN' => 'лв.', |
|
28 | + 'BHD' => '.د.ب', |
|
29 | + 'BIF' => 'Fr', |
|
30 | + 'BMD' => '$', |
|
31 | + 'BND' => '$', |
|
32 | + 'BOB' => 'Bs.', |
|
33 | + 'BRL' => 'R$', |
|
34 | + 'BSD' => '$', |
|
35 | + 'BTC' => '฿', |
|
36 | + 'BTN' => 'Nu.', |
|
37 | + 'BWP' => 'P', |
|
38 | + 'BYN' => 'Br', |
|
39 | + 'BZD' => '$', |
|
40 | + 'CAD' => '$', |
|
41 | + 'CDF' => 'Fr', |
|
42 | + 'CHF' => 'CHF', |
|
43 | + 'CLP' => '$', |
|
44 | + 'CNY' => '¥', |
|
45 | + 'COP' => '$', |
|
46 | + 'CRC' => '₡', |
|
47 | + 'CUC' => '$', |
|
48 | + 'CUP' => '$', |
|
49 | + 'CVE' => '$', |
|
50 | + 'CZK' => 'Kč', |
|
51 | + 'DJF' => 'Fr', |
|
52 | + 'DKK' => 'DKK', |
|
53 | + 'DOP' => 'RD$', |
|
54 | + 'DZD' => 'د.ج', |
|
55 | + 'EGP' => 'EGP', |
|
56 | + 'ERN' => 'Nfk', |
|
57 | + 'ETB' => 'Br', |
|
58 | + 'EUR' => '€', |
|
59 | + 'FJD' => '$', |
|
60 | + 'FKP' => '£', |
|
61 | + 'GBP' => '£', |
|
62 | + 'GEL' => 'ლ', |
|
63 | + 'GGP' => '£', |
|
64 | + 'GHS' => '₵', |
|
65 | + 'GIP' => '£', |
|
66 | + 'GMD' => 'D', |
|
67 | + 'GNF' => 'Fr', |
|
68 | + 'GTQ' => 'Q', |
|
69 | + 'GYD' => '$', |
|
70 | + 'HKD' => '$', |
|
71 | + 'HNL' => 'L', |
|
72 | + 'HRK' => 'Kn', |
|
73 | + 'HTG' => 'G', |
|
74 | + 'HUF' => 'Ft', |
|
75 | + 'IDR' => 'Rp', |
|
76 | + 'ILS' => '₪', |
|
77 | + 'IMP' => '£', |
|
78 | + 'INR' => '₹', |
|
79 | + 'IQD' => 'ع.د', |
|
80 | + 'IRR' => '﷼', |
|
81 | + 'IRT' => 'تومان', |
|
82 | + 'ISK' => 'kr.', |
|
83 | + 'JEP' => '£', |
|
84 | + 'JMD' => '$', |
|
85 | + 'JOD' => 'د.ا', |
|
86 | + 'JPY' => '¥', |
|
87 | + 'KES' => 'KSh', |
|
88 | + 'KGS' => 'сом', |
|
89 | + 'KHR' => '៛', |
|
90 | + 'KMF' => 'Fr', |
|
91 | + 'KPW' => '₩', |
|
92 | + 'KRW' => '₩', |
|
93 | + 'KWD' => 'د.ك', |
|
94 | + 'KYD' => '$', |
|
95 | + 'KZT' => 'KZT', |
|
96 | + 'LAK' => '₭', |
|
97 | + 'LBP' => 'ل.ل', |
|
98 | + 'LKR' => 'රු', |
|
99 | + 'LRD' => '$', |
|
100 | + 'LSL' => 'L', |
|
101 | + 'LYD' => 'ل.د', |
|
102 | + 'MAD' => 'د.م.', |
|
103 | + 'MDL' => 'MDL', |
|
104 | + 'MGA' => 'Ar', |
|
105 | + 'MKD' => 'ден', |
|
106 | + 'MMK' => 'Ks', |
|
107 | + 'MNT' => '₮', |
|
108 | + 'MOP' => 'P', |
|
109 | + 'MRO' => 'UM', |
|
110 | + 'MUR' => '₨', |
|
111 | + 'MVR' => '.ރ', |
|
112 | + 'MWK' => 'MK', |
|
113 | + 'MXN' => '$', |
|
114 | + 'MYR' => 'RM', |
|
115 | + 'MZN' => 'MT', |
|
116 | + 'NAD' => '$', |
|
117 | + 'NGN' => '₦', |
|
118 | + 'NIO' => 'C$', |
|
119 | + 'NOK' => 'kr', |
|
120 | + 'NPR' => '₨', |
|
121 | + 'NZD' => '$', |
|
122 | + 'OMR' => 'ر.ع.', |
|
123 | + 'PAB' => 'B/.', |
|
124 | + 'PEN' => 'S/.', |
|
125 | + 'PGK' => 'K', |
|
126 | + 'PHP' => '₱', |
|
127 | + 'PKR' => '₨', |
|
128 | + 'PLN' => 'zł', |
|
129 | + 'PRB' => 'р.', |
|
130 | + 'PYG' => '₲', |
|
131 | + 'QAR' => 'ر.ق', |
|
132 | + 'RMB' => '¥', |
|
133 | + 'RON' => 'lei', |
|
134 | + 'RSD' => 'дин.', |
|
135 | + 'RUB' => '₽', |
|
136 | + 'RWF' => 'Fr', |
|
137 | + 'SAR' => 'ر.س', |
|
138 | + 'SBD' => '$', |
|
139 | + 'SCR' => '₨', |
|
140 | + 'SDG' => 'ج.س.', |
|
141 | + 'SEK' => 'kr', |
|
142 | + 'SGD' => '$', |
|
143 | + 'SHP' => '£', |
|
144 | + 'SLL' => 'Le', |
|
145 | + 'SOS' => 'Sh', |
|
146 | + 'SRD' => '$', |
|
147 | + 'SSP' => '£', |
|
148 | + 'STD' => 'Db', |
|
149 | + 'SYP' => 'ل.س', |
|
150 | + 'SZL' => 'L', |
|
151 | + 'THB' => '฿', |
|
152 | + 'TJS' => 'ЅМ', |
|
153 | + 'TMT' => 'm', |
|
154 | + 'TND' => 'د.ت', |
|
155 | + 'TOP' => 'T$', |
|
156 | + 'TRY' => '₺', |
|
157 | + 'TTD' => '$', |
|
158 | + 'TWD' => 'NT$', |
|
159 | + 'TZS' => 'Sh', |
|
160 | + 'UAH' => '₴', |
|
161 | + 'UGX' => 'UGX', |
|
162 | + 'USD' => '$', |
|
163 | + 'UYU' => '$', |
|
164 | + 'UZS' => 'UZS', |
|
165 | + 'VEF' => 'Bs.', |
|
166 | + 'VND' => '₫', |
|
167 | + 'VUV' => 'Vt', |
|
168 | + 'WST' => 'T', |
|
169 | + 'XAF' => 'Fr', |
|
170 | + 'XCD' => '$', |
|
171 | + 'XOF' => 'Fr', |
|
172 | + 'XPF' => 'Fr', |
|
173 | + 'YER' => '﷼', |
|
174 | + 'ZAR' => 'R', |
|
175 | + 'ZMW' => 'ZK', |
|
176 | 176 | ); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @version 1.0.19 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | return array( |
14 | 14 | 'AED' => 'د.إ', |