@@ -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}", |
@@ -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 | |
@@ -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 | |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 10 | +if (!defined('ABSPATH')) { |
|
| 11 | 11 | exit; // Exit if accessed directly |
| 12 | 12 | } |
| 13 | 13 | |
@@ -21,51 +21,51 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param WP_Post $post |
| 23 | 23 | */ |
| 24 | - public static function output( $post ) { |
|
| 24 | + public static function output($post) { |
|
| 25 | 25 | |
| 26 | 26 | // Prepare the invoice. |
| 27 | - $invoice = new WPInv_Invoice( $post ); |
|
| 27 | + $invoice = new WPInv_Invoice($post); |
|
| 28 | 28 | |
| 29 | 29 | // Invoice items. |
| 30 | 30 | $items = $invoice->get_items(); |
| 31 | 31 | |
| 32 | 32 | // New item url. |
| 33 | - $new_item = admin_url( 'post-new.php?post_type=wpi_item' ); |
|
| 33 | + $new_item = admin_url('post-new.php?post_type=wpi_item'); |
|
| 34 | 34 | |
| 35 | 35 | // Totals. |
| 36 | - $total = wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() ); |
|
| 36 | + $total = wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency()); |
|
| 37 | 37 | |
| 38 | - if ( $invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total() ) { |
|
| 39 | - $recurring_total = wpinv_price( wpinv_format_amount( $invoice->get_recurring_total() ), $invoice->get_currency() ); |
|
| 40 | - $total .= '<small class="form-text text-muted">' . sprintf( __( 'Recurring Price: %s', 'invoicing' ), $recurring_total ) . '</small>'; |
|
| 38 | + if ($invoice->is_recurring() && $invoice->is_parent() && $invoice->get_total() != $invoice->get_recurring_total()) { |
|
| 39 | + $recurring_total = wpinv_price(wpinv_format_amount($invoice->get_recurring_total()), $invoice->get_currency()); |
|
| 40 | + $total .= '<small class="form-text text-muted">' . sprintf(__('Recurring Price: %s', 'invoicing'), $recurring_total) . '</small>'; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $totals = array( |
| 44 | 44 | |
| 45 | 45 | 'subtotal' => array( |
| 46 | - 'label' => __( 'Items Subtotal', 'invoicing' ), |
|
| 47 | - 'value' => wpinv_price( wpinv_format_amount( $invoice->get_subtotal() ), $invoice->get_currency() ), |
|
| 46 | + 'label' => __('Items Subtotal', 'invoicing'), |
|
| 47 | + 'value' => wpinv_price(wpinv_format_amount($invoice->get_subtotal()), $invoice->get_currency()), |
|
| 48 | 48 | ), |
| 49 | 49 | |
| 50 | 50 | 'discount' => array( |
| 51 | - 'label' => __( 'Total Discount', 'invoicing' ), |
|
| 52 | - 'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_discount() ), $invoice->get_currency() ), |
|
| 51 | + 'label' => __('Total Discount', 'invoicing'), |
|
| 52 | + 'value' => wpinv_price(wpinv_format_amount($invoice->get_total_discount()), $invoice->get_currency()), |
|
| 53 | 53 | ), |
| 54 | 54 | |
| 55 | 55 | 'tax' => array( |
| 56 | - 'label' => __( 'Total Tax', 'invoicing' ), |
|
| 57 | - 'value' => wpinv_price( wpinv_format_amount( $invoice->get_total_tax() ), $invoice->get_currency() ), |
|
| 56 | + 'label' => __('Total Tax', 'invoicing'), |
|
| 57 | + 'value' => wpinv_price(wpinv_format_amount($invoice->get_total_tax()), $invoice->get_currency()), |
|
| 58 | 58 | ), |
| 59 | 59 | |
| 60 | 60 | 'total' => array( |
| 61 | - 'label' => __( 'Invoice Total', 'invoicing' ), |
|
| 61 | + 'label' => __('Invoice Total', 'invoicing'), |
|
| 62 | 62 | 'value' => $total, |
| 63 | 63 | ) |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | |
| 67 | - if ( ! wpinv_use_taxes() ) { |
|
| 68 | - unset( $totals['tax'] ); |
|
| 67 | + if (!wpinv_use_taxes()) { |
|
| 68 | + unset($totals['tax']); |
|
| 69 | 69 | } |
| 70 | 70 | ?> |
| 71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | </style> |
| 83 | 83 | |
| 84 | - <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class( $invoice->get_template( 'edit' ) ); ?> <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem"> |
|
| 84 | + <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class($invoice->get_template('edit')); ?> <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem"> |
|
| 85 | 85 | |
| 86 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
| 87 | - <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?> |
|
| 86 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
| 87 | + <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?> |
|
| 88 | 88 | |
| 89 | 89 | <div class="row"> |
| 90 | 90 | <div class="col-12 col-sm-6"> |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | array( |
| 94 | 94 | 'id' => 'wpinv_template', |
| 95 | 95 | 'name' => 'wpinv_template', |
| 96 | - 'label' => __( 'Template', 'invoicing' ), |
|
| 96 | + 'label' => __('Template', 'invoicing'), |
|
| 97 | 97 | 'label_type' => 'vertical', |
| 98 | - 'placeholder' => __( 'Choose a template', 'invoicing' ), |
|
| 98 | + 'placeholder' => __('Choose a template', 'invoicing'), |
|
| 99 | 99 | 'class' => 'form-control-sm', |
| 100 | - 'value' => $invoice->get_template( 'edit' ), |
|
| 100 | + 'value' => $invoice->get_template('edit'), |
|
| 101 | 101 | 'options' => array( |
| 102 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
| 103 | - 'hours' => __( 'Hours', 'invoicing' ), |
|
| 104 | - 'amount' => __( 'Amount Only', 'invoicing' ), |
|
| 102 | + 'quantity' => __('Quantity', 'invoicing'), |
|
| 103 | + 'hours' => __('Hours', 'invoicing'), |
|
| 104 | + 'amount' => __('Amount Only', 'invoicing'), |
|
| 105 | 105 | ), |
| 106 | 106 | 'data-allow-clear' => 'false', |
| 107 | 107 | 'select2' => true, |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | array( |
| 118 | 118 | 'id' => 'wpinv_currency', |
| 119 | 119 | 'name' => 'wpinv_currency', |
| 120 | - 'label' => __( 'Currency', 'invoicing' ), |
|
| 120 | + 'label' => __('Currency', 'invoicing'), |
|
| 121 | 121 | 'label_type' => 'vertical', |
| 122 | - 'placeholder' => __( 'Select Invoice Currency', 'invoicing' ), |
|
| 122 | + 'placeholder' => __('Select Invoice Currency', 'invoicing'), |
|
| 123 | 123 | 'class' => 'form-control-sm', |
| 124 | - 'value' => $invoice->get_currency( 'edit' ), |
|
| 124 | + 'value' => $invoice->get_currency('edit'), |
|
| 125 | 125 | 'required' => false, |
| 126 | 126 | 'data-allow-clear' => 'false', |
| 127 | 127 | 'select2' => true, |
@@ -133,24 +133,24 @@ discard block |
||
| 133 | 133 | </div> |
| 134 | 134 | </div> |
| 135 | 135 | |
| 136 | - <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?> |
|
| 136 | + <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?> |
|
| 137 | 137 | <?php endif; ?> |
| 138 | 138 | |
| 139 | 139 | <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items"> |
| 140 | 140 | <thead> |
| 141 | 141 | <tr> |
| 142 | - <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
| 142 | + <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th> |
|
| 143 | 143 | <th class="getpaid-quantity hide-if-amount text-right"> |
| 144 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
| 145 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
| 144 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
| 145 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
| 146 | 146 | </th> |
| 147 | 147 | <th class="getpaid-price hide-if-amount text-right"> |
| 148 | - <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span> |
|
| 149 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span> |
|
| 148 | + <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span> |
|
| 149 | + <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span> |
|
| 150 | 150 | </th> |
| 151 | 151 | <th class="getpaid-item-subtotal text-right"> |
| 152 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span> |
|
| 153 | - <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span> |
|
| 152 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span> |
|
| 153 | + <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span> |
|
| 154 | 154 | </th> |
| 155 | 155 | <th class="getpaid-item-actions hide-if-not-editable" width="70px"> </th> |
| 156 | 156 | </tr> |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | <tbody class="getpaid_invoice_line_items"> |
| 159 | 159 | <tr class="hide-if-has-items hide-if-not-editable"> |
| 160 | 160 | <td colspan="2" class="pt-4 pb-4"> |
| 161 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button> |
|
| 162 | - <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a> |
|
| 161 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button> |
|
| 162 | + <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a> |
|
| 163 | 163 | </td> |
| 164 | 164 | <td class="hide-if-amount"> </th> |
| 165 | 165 | <td class="hide-if-amount"> </th> |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | <div class="col-12 col-sm-6 offset-sm-6"> |
| 192 | 192 | <table class="getpaid-invoice-totals text-right w-100"> |
| 193 | 193 | <tbody> |
| 194 | - <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?> |
|
| 195 | - <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>"> |
|
| 196 | - <td class="label"><?php echo sanitize_text_field( $data['label'] ) ?>:</td> |
|
| 194 | + <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?> |
|
| 195 | + <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>"> |
|
| 196 | + <td class="label"><?php echo sanitize_text_field($data['label']) ?>:</td> |
|
| 197 | 197 | <td width="1%"></td> |
| 198 | - <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td> |
|
| 198 | + <td class="value"><?php echo wp_kses_post($data['value']) ?></td> |
|
| 199 | 199 | </tr> |
| 200 | 200 | <?php endforeach; ?> |
| 201 | 201 | </tbody> |
@@ -208,18 +208,18 @@ discard block |
||
| 208 | 208 | <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable"> |
| 209 | 209 | <div class="row"> |
| 210 | 210 | <div class="text-left col-12 col-sm-8"> |
| 211 | - <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button> |
|
| 212 | - <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a> |
|
| 213 | - <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?> |
|
| 211 | + <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button> |
|
| 212 | + <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a> |
|
| 213 | + <?php do_action('getpaid-invoice-items-actions', $invoice); ?> |
|
| 214 | 214 | </div> |
| 215 | 215 | <div class="text-right col-12 col-sm-4"> |
| 216 | - <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button> |
|
| 216 | + <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button> |
|
| 217 | 217 | </div> |
| 218 | 218 | </div> |
| 219 | 219 | </div> |
| 220 | 220 | |
| 221 | 221 | <div class="getpaid-invoice-item-actions hide-if-editable"> |
| 222 | - <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p> |
|
| 222 | + <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p> |
|
| 223 | 223 | </div> |
| 224 | 224 | |
| 225 | 225 | <!-- Add items to an invoice --> |
@@ -227,8 +227,8 @@ discard block |
||
| 227 | 227 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 228 | 228 | <div class="modal-content"> |
| 229 | 229 | <div class="modal-header"> |
| 230 | - <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5> |
|
| 231 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
| 230 | + <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5> |
|
| 231 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
| 232 | 232 | <span aria-hidden="true">×</span> |
| 233 | 233 | </button> |
| 234 | 234 | </div> |
@@ -236,17 +236,17 @@ discard block |
||
| 236 | 236 | <table class="widefat"> |
| 237 | 237 | <thead> |
| 238 | 238 | <tr> |
| 239 | - <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th> |
|
| 239 | + <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th> |
|
| 240 | 240 | <th class="pr-0 text-right hide-if-amount"> |
| 241 | - <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span> |
|
| 242 | - <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span> |
|
| 241 | + <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span> |
|
| 242 | + <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span> |
|
| 243 | 243 | </th> |
| 244 | 244 | </tr> |
| 245 | 245 | </thead> |
| 246 | 246 | <tbody> |
| 247 | 247 | <tr> |
| 248 | 248 | <td class="pl-0 text-left"> |
| 249 | - <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e( 'Search for an item…', 'invoicing' ); ?>"></select> |
|
| 249 | + <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e('Search for an item…', 'invoicing'); ?>"></select> |
|
| 250 | 250 | </td> |
| 251 | 251 | <td class="pr-0 text-right hide-if-amount"> |
| 252 | 252 | <input type="number" class="w100" step="1" min="1" autocomplete="off" value="1" placeholder="1"> |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | </table> |
| 257 | 257 | </div> |
| 258 | 258 | <div class="modal-footer"> |
| 259 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
| 260 | - <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button> |
|
| 259 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
| 260 | + <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button> |
|
| 261 | 261 | </div> |
| 262 | 262 | </div> |
| 263 | 263 | </div> |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 269 | 269 | <div class="modal-content"> |
| 270 | 270 | <div class="modal-header"> |
| 271 | - <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5> |
|
| 272 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>"> |
|
| 271 | + <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5> |
|
| 272 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>"> |
|
| 273 | 273 | <span aria-hidden="true">×</span> |
| 274 | 274 | </button> |
| 275 | 275 | </div> |
@@ -277,27 +277,27 @@ discard block |
||
| 277 | 277 | <div class="getpaid-edit-item-div"> |
| 278 | 278 | <input type="hidden" name="id" class="form-control form-control-sm item-id"> |
| 279 | 279 | <label class="form-group w-100"> |
| 280 | - <span><?php _e( 'Name', 'invoicing' ); ?></span> |
|
| 281 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
| 280 | + <span><?php _e('Name', 'invoicing'); ?></span> |
|
| 281 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
| 282 | 282 | </label> |
| 283 | 283 | <label class="form-group w-100"> |
| 284 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span> |
|
| 285 | - <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span> |
|
| 286 | - <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price"> |
|
| 284 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span> |
|
| 285 | + <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span> |
|
| 286 | + <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price"> |
|
| 287 | 287 | </label> |
| 288 | 288 | <label class="form-group w-100 hide-if-amount"> |
| 289 | - <span><?php _e( 'Quantity', 'invoicing' ); ?></span> |
|
| 289 | + <span><?php _e('Quantity', 'invoicing'); ?></span> |
|
| 290 | 290 | <input type="number" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
| 291 | 291 | </label> |
| 292 | 292 | <label class="form-group w-100"> |
| 293 | - <span><?php _e( 'Item Description', 'invoicing' ); ?></span> |
|
| 294 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
| 293 | + <span><?php _e('Item Description', 'invoicing'); ?></span> |
|
| 294 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
| 295 | 295 | </label> |
| 296 | 296 | </div> |
| 297 | 297 | </div> |
| 298 | 298 | <div class="modal-footer"> |
| 299 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button> |
|
| 300 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button> |
|
| 299 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button> |
|
| 300 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button> |
|
| 301 | 301 | </div> |
| 302 | 302 | </div> |
| 303 | 303 | </div> |
@@ -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( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() ), |
|
| 177 | - 'countryString' => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ), |
|
| 178 | - 'compName' => wpinv_clean( $invoice->get_company() ), |
|
| 173 | + 'address1' => wpinv_clean($invoice->get_address()), |
|
| 174 | + 'town' => wpinv_clean($invoice->get_city()), |
|
| 175 | + 'region' => wpinv_clean($invoice->get_state()), |
|
| 176 | + 'amountString' => wpinv_price(wpinv_format_amount($invoice->get_total()), $invoice->get_currency()), |
|
| 177 | + 'countryString' => wpinv_clean(wpinv_country_name($invoice->get_country())), |
|
| 178 | + 'compName' => wpinv_clean($invoice->get_company()), |
|
| 179 | 179 | ), |
| 180 | 180 | $invoice |
| 181 | 181 | ); |
@@ -188,17 +188,17 @@ discard block |
||
| 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 | ); |
@@ -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 | |
@@ -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' => 'د.إ', |
@@ -8,168 +8,168 @@ |
||
| 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 | - 'USD' => __( 'US Dollar', 'invoicing' ), |
|
| 15 | - 'EUR' => __( 'Euro', 'invoicing' ), |
|
| 16 | - 'GBP' => __( 'Pound Sterling', 'invoicing' ), |
|
| 17 | - 'AED' => __( 'United Arab Emirates', 'invoicing' ), |
|
| 18 | - 'AFN' => __( 'Afghan Afghani', 'invoicing' ), |
|
| 19 | - 'ALL' => __( 'Albanian Lek', 'invoicing' ), |
|
| 20 | - 'AMD' => __( 'Armenian Dram', 'invoicing' ), |
|
| 21 | - 'ANG' => __( 'Netherlands Antillean Guilder', 'invoicing' ), |
|
| 22 | - 'AOA' => __( 'Angolan Kwanza', 'invoicing' ), |
|
| 23 | - 'ARS' => __( 'Argentine Peso', 'invoicing' ), |
|
| 24 | - 'AUD' => __( 'Australian Dollar', 'invoicing' ), |
|
| 25 | - 'AWG' => __( 'Aruban Florin', 'invoicing' ), |
|
| 26 | - 'AZN' => __( 'Azerbaijani Manat', 'invoicing' ), |
|
| 27 | - 'BAM' => __( 'Bosnia and Herzegovina Convertible Marka', 'invoicing' ), |
|
| 28 | - 'BBD' => __( 'Barbadian Dollar', 'invoicing' ), |
|
| 29 | - 'BDT' => __( 'Bangladeshi Taka', 'invoicing' ), |
|
| 30 | - 'BGN' => __( 'Bulgarian Lev', 'invoicing' ), |
|
| 31 | - 'BHD' => __( 'Bahraini Dinar', 'invoicing' ), |
|
| 32 | - 'BIF' => __( 'Burundian Franc', 'invoicing' ), |
|
| 33 | - 'BMD' => __( 'Bermudian Dollar', 'invoicing' ), |
|
| 34 | - 'BND' => __( 'Brunei Dollar', 'invoicing' ), |
|
| 35 | - 'BOB' => __( 'Bolivian Boliviano', 'invoicing' ), |
|
| 36 | - 'BRL' => __( 'Brazilian Real', 'invoicing' ), |
|
| 37 | - 'BSD' => __( 'Bahamian Dollar', 'invoicing' ), |
|
| 38 | - 'BTC' => __( 'Bitcoin', 'invoicing' ), |
|
| 39 | - 'BTN' => __( 'Bhutanese Ngultrum', 'invoicing' ), |
|
| 40 | - 'BWP' => __( 'Botswana Pula', 'invoicing' ), |
|
| 41 | - 'BYN' => __( 'Belarusian Ruble', 'invoicing' ), |
|
| 42 | - 'BZD' => __( 'Belize Dollar', 'invoicing' ), |
|
| 43 | - 'CAD' => __( 'Canadian Dollar', 'invoicing' ), |
|
| 44 | - 'CDF' => __( 'Congolese Franc', 'invoicing' ), |
|
| 45 | - 'CHF' => __( 'Swiss Franc', 'invoicing' ), |
|
| 46 | - 'CLP' => __( 'Chilean Peso', 'invoicing' ), |
|
| 47 | - 'CNY' => __( 'Chinese Yuan', 'invoicing' ), |
|
| 48 | - 'COP' => __( 'Colombian Peso', 'invoicing' ), |
|
| 49 | - 'CRC' => __( 'Costa Rican Colon', 'invoicing' ), |
|
| 50 | - 'CUC' => __( 'Cuban Convertible Peso', 'invoicing' ), |
|
| 51 | - 'CUP' => __( 'Cuban Peso', 'invoicing' ), |
|
| 52 | - 'CVE' => __( 'Cape Verdean escudo', 'invoicing' ), |
|
| 53 | - 'CZK' => __( 'Czech Koruna', 'invoicing' ), |
|
| 54 | - 'DJF' => __( 'Djiboutian Franc', 'invoicing' ), |
|
| 55 | - 'DKK' => __( 'Danish Krone', 'invoicing' ), |
|
| 56 | - 'DOP' => __( 'Dominican Peso', 'invoicing' ), |
|
| 57 | - 'DZD' => __( 'Algerian Dinar', 'invoicing' ), |
|
| 58 | - 'EGP' => __( 'Egyptian Pound', 'invoicing' ), |
|
| 59 | - 'ERN' => __( 'Eritrean Nakfa', 'invoicing' ), |
|
| 60 | - 'ETB' => __( 'Ethiopian Irr', 'invoicing' ), |
|
| 61 | - 'FJD' => __( 'Fijian Dollar', 'invoicing' ), |
|
| 62 | - 'FKP' => __( 'Falkland Islands Pound', 'invoicing' ), |
|
| 63 | - 'GEL' => __( 'Georgian Lari', 'invoicing' ), |
|
| 64 | - 'GGP' => __( 'Guernsey Pound', 'invoicing' ), |
|
| 65 | - 'GHS' => __( 'Ghana Cedi', 'invoicing' ), |
|
| 66 | - 'GIP' => __( 'Gibraltar Pound', 'invoicing' ), |
|
| 67 | - 'GMD' => __( 'Gambian Dalasi', 'invoicing' ), |
|
| 68 | - 'GNF' => __( 'Guinean Franc', 'invoicing' ), |
|
| 69 | - 'GTQ' => __( 'Guatemalan Quetzal', 'invoicing' ), |
|
| 70 | - 'GYD' => __( 'Guyanese Dollar', 'invoicing' ), |
|
| 71 | - 'HKD' => __( 'Hong Kong Dollar', 'invoicing' ), |
|
| 72 | - 'HNL' => __( 'Honduran Lempira', 'invoicing' ), |
|
| 73 | - 'HRK' => __( 'Croatian Kuna', 'invoicing' ), |
|
| 74 | - 'HTG' => __( 'Haitian Gourde', 'invoicing' ), |
|
| 75 | - 'HUF' => __( 'Hungarian Forint', 'invoicing' ), |
|
| 76 | - 'IDR' => __( 'Indonesian Rupiah', 'invoicing' ), |
|
| 77 | - 'ILS' => __( 'Israeli New Shekel', 'invoicing' ), |
|
| 78 | - 'IMP' => __( 'Manx Pound', 'invoicing' ), |
|
| 79 | - 'INR' => __( 'Indian Rupee', 'invoicing' ), |
|
| 80 | - 'IQD' => __( 'Iraqi Dinar', 'invoicing' ), |
|
| 81 | - 'IRR' => __( 'Iranian Rial', 'invoicing' ), |
|
| 82 | - 'IRT' => __( 'Iranian Toman', 'invoicing' ), |
|
| 83 | - 'ISK' => __( 'Icelandic Krona', 'invoicing' ), |
|
| 84 | - 'JEP' => __( 'Jersey Pound', 'invoicing' ), |
|
| 85 | - 'JMD' => __( 'Jamaican Dollar', 'invoicing' ), |
|
| 86 | - 'JOD' => __( 'Jordanian Dinar', 'invoicing' ), |
|
| 87 | - 'JPY' => __( 'Japanese Yen', 'invoicing' ), |
|
| 88 | - 'KES' => __( 'Kenyan Shilling', 'invoicing' ), |
|
| 89 | - 'KGS' => __( 'Kyrgyzstani Som', 'invoicing' ), |
|
| 90 | - 'KHR' => __( 'Cambodian Riel', 'invoicing' ), |
|
| 91 | - 'KMF' => __( 'Comorian Franc', 'invoicing' ), |
|
| 92 | - 'KPW' => __( 'North Korean Won', 'invoicing' ), |
|
| 93 | - 'KRW' => __( 'South Korean Won', 'invoicing' ), |
|
| 94 | - 'KWD' => __( 'Kuwaiti Dinar', 'invoicing' ), |
|
| 95 | - 'KYD' => __( 'Cayman Islands Dollar', 'invoicing' ), |
|
| 96 | - 'KZT' => __( 'Kazakhstani Tenge', 'invoicing' ), |
|
| 97 | - 'LAK' => __( 'Lao Kip', 'invoicing' ), |
|
| 98 | - 'LBP' => __( 'Lebanese Pound', 'invoicing' ), |
|
| 99 | - 'LKR' => __( 'Sri Lankan Rupee', 'invoicing' ), |
|
| 100 | - 'LRD' => __( 'Liberian Dollar', 'invoicing' ), |
|
| 101 | - 'LSL' => __( 'Lesotho Loti', 'invoicing' ), |
|
| 102 | - 'LYD' => __( 'Libyan Dinar', 'invoicing' ), |
|
| 103 | - 'MAD' => __( 'Moroccan Dirham', 'invoicing' ), |
|
| 104 | - 'MDL' => __( 'Moldovan Leu', 'invoicing' ), |
|
| 105 | - 'MGA' => __( 'Malagasy Ariary', 'invoicing' ), |
|
| 106 | - 'MKD' => __( 'Macedonian Denar', 'invoicing' ), |
|
| 107 | - 'MMK' => __( 'Burmese Kyat', 'invoicing' ), |
|
| 108 | - 'MNT' => __( 'Mongolian Tughrik', 'invoicing' ), |
|
| 109 | - 'MOP' => __( 'Macanese Pataca', 'invoicing' ), |
|
| 110 | - 'MRO' => __( 'Mauritanian Ouguiya', 'invoicing' ), |
|
| 111 | - 'MUR' => __( 'Mauritian Rupee', 'invoicing' ), |
|
| 112 | - 'MVR' => __( 'Maldivian Rufiyaa', 'invoicing' ), |
|
| 113 | - 'MWK' => __( 'Malawian Kwacha', 'invoicing' ), |
|
| 114 | - 'MXN' => __( 'Mexican Peso', 'invoicing' ), |
|
| 115 | - 'MYR' => __( 'Malaysian Ringgit', 'invoicing' ), |
|
| 116 | - 'MZN' => __( 'Mozambican Metical', 'invoicing' ), |
|
| 117 | - 'NAD' => __( 'Namibian Dollar', 'invoicing' ), |
|
| 118 | - 'NGN' => __( 'Nigerian Naira', 'invoicing' ), |
|
| 119 | - 'NIO' => __( 'Nicaraguan Cordoba', 'invoicing' ), |
|
| 120 | - 'NOK' => __( 'Norwegian Krone', 'invoicing' ), |
|
| 121 | - 'NPR' => __( 'Nepalese Rupee', 'invoicing' ), |
|
| 122 | - 'NZD' => __( 'New Zealand Dollar', 'invoicing' ), |
|
| 123 | - 'OMR' => __( 'Omani Rial', 'invoicing' ), |
|
| 124 | - 'PAB' => __( 'Panamanian Balboa', 'invoicing' ), |
|
| 125 | - 'PEN' => __( 'Peruvian Nuevo Sol', 'invoicing' ), |
|
| 126 | - 'PGK' => __( 'Papua New Guinean Kina', 'invoicing' ), |
|
| 127 | - 'PHP' => __( 'Philippine Peso', 'invoicing' ), |
|
| 128 | - 'PKR' => __( 'Pakistani Rupee', 'invoicing' ), |
|
| 129 | - 'PLN' => __( 'Polish Zloty', 'invoicing' ), |
|
| 130 | - 'PRB' => __( 'Transnistrian Ruble', 'invoicing' ), |
|
| 131 | - 'PYG' => __( 'Paraguayan Guarani', 'invoicing' ), |
|
| 132 | - 'QAR' => __( 'Qatari Riyal', 'invoicing' ), |
|
| 133 | - 'RON' => __( 'Romanian Leu', 'invoicing' ), |
|
| 134 | - 'RSD' => __( 'Serbian Dinar', 'invoicing' ), |
|
| 135 | - 'RUB' => __( 'Russian Ruble', 'invoicing' ), |
|
| 136 | - 'RWF' => __( 'Rwandan Franc', 'invoicing' ), |
|
| 137 | - 'SAR' => __( 'Saudi Riyal', 'invoicing' ), |
|
| 138 | - 'SBD' => __( 'Solomon Islands Dollar', 'invoicing' ), |
|
| 139 | - 'SCR' => __( 'Seychellois Rupee', 'invoicing' ), |
|
| 140 | - 'SDG' => __( 'Sudanese Pound', 'invoicing' ), |
|
| 141 | - 'SEK' => __( 'Swedish Krona', 'invoicing' ), |
|
| 142 | - 'SGD' => __( 'Singapore Dollar', 'invoicing' ), |
|
| 143 | - 'SHP' => __( 'Saint Helena Pound', 'invoicing' ), |
|
| 144 | - 'SLL' => __( 'Sierra Leonean Leone', 'invoicing' ), |
|
| 145 | - 'SOS' => __( 'Somali Shilling', 'invoicing' ), |
|
| 146 | - 'SRD' => __( 'Surinamese Dollar', 'invoicing' ), |
|
| 147 | - 'SSP' => __( 'South Sudanese Pound', 'invoicing' ), |
|
| 148 | - 'STD' => __( 'Sao Tomean Dobra', 'invoicing' ), |
|
| 149 | - 'SYP' => __( 'Syrian Pound', 'invoicing' ), |
|
| 150 | - 'SZL' => __( 'Swazi Lilangeni', 'invoicing' ), |
|
| 151 | - 'THB' => __( 'Thai Baht', 'invoicing' ), |
|
| 152 | - 'TJS' => __( 'Tajikistani Somoni', 'invoicing' ), |
|
| 153 | - 'TMT' => __( 'Turkmenistan Manat', 'invoicing' ), |
|
| 154 | - 'TND' => __( 'Tunisian Dinar', 'invoicing' ), |
|
| 155 | - 'TOP' => __( 'Tongan Paʻanga', 'invoicing' ), |
|
| 156 | - 'TRY' => __( 'Turkish Lira', 'invoicing' ), |
|
| 157 | - 'TTD' => __( 'Trinidad and Tobago Dollar', 'invoicing' ), |
|
| 158 | - 'TWD' => __( 'New Taiwan Dollar', 'invoicing' ), |
|
| 159 | - 'TZS' => __( 'Tanzanian Shilling', 'invoicing' ), |
|
| 160 | - 'UAH' => __( 'Ukrainian Hryvnia', 'invoicing' ), |
|
| 161 | - 'UGX' => __( 'Ugandan Shilling', 'invoicing' ), |
|
| 162 | - 'UYU' => __( 'Uruguayan Peso', 'invoicing' ), |
|
| 163 | - 'UZS' => __( 'Uzbekistani Som', 'invoicing' ), |
|
| 164 | - 'VEF' => __( 'Venezuelan Bolívar', 'invoicing' ), |
|
| 165 | - 'VND' => __( 'Vietnamese Dong', 'invoicing' ), |
|
| 166 | - 'VUV' => __( 'Vanuatu Vatu', 'invoicing' ), |
|
| 167 | - 'WST' => __( 'Samoan Tala', 'invoicing' ), |
|
| 168 | - 'XAF' => __( 'Central African CFA Franc', 'invoicing' ), |
|
| 169 | - 'XCD' => __( 'East Caribbean Dollar', 'invoicing' ), |
|
| 170 | - 'XOF' => __( 'West African CFA Franc', 'invoicing' ), |
|
| 171 | - 'XPF' => __( 'CFP Franc', 'invoicing' ), |
|
| 172 | - 'YER' => __( 'Yemeni Rial', 'invoicing' ), |
|
| 173 | - 'ZAR' => __( 'South African Rand', 'invoicing' ), |
|
| 174 | - 'ZMW' => __( 'Zambian Kwacha', 'invoicing' ), |
|
| 14 | + 'USD' => __('US Dollar', 'invoicing'), |
|
| 15 | + 'EUR' => __('Euro', 'invoicing'), |
|
| 16 | + 'GBP' => __('Pound Sterling', 'invoicing'), |
|
| 17 | + 'AED' => __('United Arab Emirates', 'invoicing'), |
|
| 18 | + 'AFN' => __('Afghan Afghani', 'invoicing'), |
|
| 19 | + 'ALL' => __('Albanian Lek', 'invoicing'), |
|
| 20 | + 'AMD' => __('Armenian Dram', 'invoicing'), |
|
| 21 | + 'ANG' => __('Netherlands Antillean Guilder', 'invoicing'), |
|
| 22 | + 'AOA' => __('Angolan Kwanza', 'invoicing'), |
|
| 23 | + 'ARS' => __('Argentine Peso', 'invoicing'), |
|
| 24 | + 'AUD' => __('Australian Dollar', 'invoicing'), |
|
| 25 | + 'AWG' => __('Aruban Florin', 'invoicing'), |
|
| 26 | + 'AZN' => __('Azerbaijani Manat', 'invoicing'), |
|
| 27 | + 'BAM' => __('Bosnia and Herzegovina Convertible Marka', 'invoicing'), |
|
| 28 | + 'BBD' => __('Barbadian Dollar', 'invoicing'), |
|
| 29 | + 'BDT' => __('Bangladeshi Taka', 'invoicing'), |
|
| 30 | + 'BGN' => __('Bulgarian Lev', 'invoicing'), |
|
| 31 | + 'BHD' => __('Bahraini Dinar', 'invoicing'), |
|
| 32 | + 'BIF' => __('Burundian Franc', 'invoicing'), |
|
| 33 | + 'BMD' => __('Bermudian Dollar', 'invoicing'), |
|
| 34 | + 'BND' => __('Brunei Dollar', 'invoicing'), |
|
| 35 | + 'BOB' => __('Bolivian Boliviano', 'invoicing'), |
|
| 36 | + 'BRL' => __('Brazilian Real', 'invoicing'), |
|
| 37 | + 'BSD' => __('Bahamian Dollar', 'invoicing'), |
|
| 38 | + 'BTC' => __('Bitcoin', 'invoicing'), |
|
| 39 | + 'BTN' => __('Bhutanese Ngultrum', 'invoicing'), |
|
| 40 | + 'BWP' => __('Botswana Pula', 'invoicing'), |
|
| 41 | + 'BYN' => __('Belarusian Ruble', 'invoicing'), |
|
| 42 | + 'BZD' => __('Belize Dollar', 'invoicing'), |
|
| 43 | + 'CAD' => __('Canadian Dollar', 'invoicing'), |
|
| 44 | + 'CDF' => __('Congolese Franc', 'invoicing'), |
|
| 45 | + 'CHF' => __('Swiss Franc', 'invoicing'), |
|
| 46 | + 'CLP' => __('Chilean Peso', 'invoicing'), |
|
| 47 | + 'CNY' => __('Chinese Yuan', 'invoicing'), |
|
| 48 | + 'COP' => __('Colombian Peso', 'invoicing'), |
|
| 49 | + 'CRC' => __('Costa Rican Colon', 'invoicing'), |
|
| 50 | + 'CUC' => __('Cuban Convertible Peso', 'invoicing'), |
|
| 51 | + 'CUP' => __('Cuban Peso', 'invoicing'), |
|
| 52 | + 'CVE' => __('Cape Verdean escudo', 'invoicing'), |
|
| 53 | + 'CZK' => __('Czech Koruna', 'invoicing'), |
|
| 54 | + 'DJF' => __('Djiboutian Franc', 'invoicing'), |
|
| 55 | + 'DKK' => __('Danish Krone', 'invoicing'), |
|
| 56 | + 'DOP' => __('Dominican Peso', 'invoicing'), |
|
| 57 | + 'DZD' => __('Algerian Dinar', 'invoicing'), |
|
| 58 | + 'EGP' => __('Egyptian Pound', 'invoicing'), |
|
| 59 | + 'ERN' => __('Eritrean Nakfa', 'invoicing'), |
|
| 60 | + 'ETB' => __('Ethiopian Irr', 'invoicing'), |
|
| 61 | + 'FJD' => __('Fijian Dollar', 'invoicing'), |
|
| 62 | + 'FKP' => __('Falkland Islands Pound', 'invoicing'), |
|
| 63 | + 'GEL' => __('Georgian Lari', 'invoicing'), |
|
| 64 | + 'GGP' => __('Guernsey Pound', 'invoicing'), |
|
| 65 | + 'GHS' => __('Ghana Cedi', 'invoicing'), |
|
| 66 | + 'GIP' => __('Gibraltar Pound', 'invoicing'), |
|
| 67 | + 'GMD' => __('Gambian Dalasi', 'invoicing'), |
|
| 68 | + 'GNF' => __('Guinean Franc', 'invoicing'), |
|
| 69 | + 'GTQ' => __('Guatemalan Quetzal', 'invoicing'), |
|
| 70 | + 'GYD' => __('Guyanese Dollar', 'invoicing'), |
|
| 71 | + 'HKD' => __('Hong Kong Dollar', 'invoicing'), |
|
| 72 | + 'HNL' => __('Honduran Lempira', 'invoicing'), |
|
| 73 | + 'HRK' => __('Croatian Kuna', 'invoicing'), |
|
| 74 | + 'HTG' => __('Haitian Gourde', 'invoicing'), |
|
| 75 | + 'HUF' => __('Hungarian Forint', 'invoicing'), |
|
| 76 | + 'IDR' => __('Indonesian Rupiah', 'invoicing'), |
|
| 77 | + 'ILS' => __('Israeli New Shekel', 'invoicing'), |
|
| 78 | + 'IMP' => __('Manx Pound', 'invoicing'), |
|
| 79 | + 'INR' => __('Indian Rupee', 'invoicing'), |
|
| 80 | + 'IQD' => __('Iraqi Dinar', 'invoicing'), |
|
| 81 | + 'IRR' => __('Iranian Rial', 'invoicing'), |
|
| 82 | + 'IRT' => __('Iranian Toman', 'invoicing'), |
|
| 83 | + 'ISK' => __('Icelandic Krona', 'invoicing'), |
|
| 84 | + 'JEP' => __('Jersey Pound', 'invoicing'), |
|
| 85 | + 'JMD' => __('Jamaican Dollar', 'invoicing'), |
|
| 86 | + 'JOD' => __('Jordanian Dinar', 'invoicing'), |
|
| 87 | + 'JPY' => __('Japanese Yen', 'invoicing'), |
|
| 88 | + 'KES' => __('Kenyan Shilling', 'invoicing'), |
|
| 89 | + 'KGS' => __('Kyrgyzstani Som', 'invoicing'), |
|
| 90 | + 'KHR' => __('Cambodian Riel', 'invoicing'), |
|
| 91 | + 'KMF' => __('Comorian Franc', 'invoicing'), |
|
| 92 | + 'KPW' => __('North Korean Won', 'invoicing'), |
|
| 93 | + 'KRW' => __('South Korean Won', 'invoicing'), |
|
| 94 | + 'KWD' => __('Kuwaiti Dinar', 'invoicing'), |
|
| 95 | + 'KYD' => __('Cayman Islands Dollar', 'invoicing'), |
|
| 96 | + 'KZT' => __('Kazakhstani Tenge', 'invoicing'), |
|
| 97 | + 'LAK' => __('Lao Kip', 'invoicing'), |
|
| 98 | + 'LBP' => __('Lebanese Pound', 'invoicing'), |
|
| 99 | + 'LKR' => __('Sri Lankan Rupee', 'invoicing'), |
|
| 100 | + 'LRD' => __('Liberian Dollar', 'invoicing'), |
|
| 101 | + 'LSL' => __('Lesotho Loti', 'invoicing'), |
|
| 102 | + 'LYD' => __('Libyan Dinar', 'invoicing'), |
|
| 103 | + 'MAD' => __('Moroccan Dirham', 'invoicing'), |
|
| 104 | + 'MDL' => __('Moldovan Leu', 'invoicing'), |
|
| 105 | + 'MGA' => __('Malagasy Ariary', 'invoicing'), |
|
| 106 | + 'MKD' => __('Macedonian Denar', 'invoicing'), |
|
| 107 | + 'MMK' => __('Burmese Kyat', 'invoicing'), |
|
| 108 | + 'MNT' => __('Mongolian Tughrik', 'invoicing'), |
|
| 109 | + 'MOP' => __('Macanese Pataca', 'invoicing'), |
|
| 110 | + 'MRO' => __('Mauritanian Ouguiya', 'invoicing'), |
|
| 111 | + 'MUR' => __('Mauritian Rupee', 'invoicing'), |
|
| 112 | + 'MVR' => __('Maldivian Rufiyaa', 'invoicing'), |
|
| 113 | + 'MWK' => __('Malawian Kwacha', 'invoicing'), |
|
| 114 | + 'MXN' => __('Mexican Peso', 'invoicing'), |
|
| 115 | + 'MYR' => __('Malaysian Ringgit', 'invoicing'), |
|
| 116 | + 'MZN' => __('Mozambican Metical', 'invoicing'), |
|
| 117 | + 'NAD' => __('Namibian Dollar', 'invoicing'), |
|
| 118 | + 'NGN' => __('Nigerian Naira', 'invoicing'), |
|
| 119 | + 'NIO' => __('Nicaraguan Cordoba', 'invoicing'), |
|
| 120 | + 'NOK' => __('Norwegian Krone', 'invoicing'), |
|
| 121 | + 'NPR' => __('Nepalese Rupee', 'invoicing'), |
|
| 122 | + 'NZD' => __('New Zealand Dollar', 'invoicing'), |
|
| 123 | + 'OMR' => __('Omani Rial', 'invoicing'), |
|
| 124 | + 'PAB' => __('Panamanian Balboa', 'invoicing'), |
|
| 125 | + 'PEN' => __('Peruvian Nuevo Sol', 'invoicing'), |
|
| 126 | + 'PGK' => __('Papua New Guinean Kina', 'invoicing'), |
|
| 127 | + 'PHP' => __('Philippine Peso', 'invoicing'), |
|
| 128 | + 'PKR' => __('Pakistani Rupee', 'invoicing'), |
|
| 129 | + 'PLN' => __('Polish Zloty', 'invoicing'), |
|
| 130 | + 'PRB' => __('Transnistrian Ruble', 'invoicing'), |
|
| 131 | + 'PYG' => __('Paraguayan Guarani', 'invoicing'), |
|
| 132 | + 'QAR' => __('Qatari Riyal', 'invoicing'), |
|
| 133 | + 'RON' => __('Romanian Leu', 'invoicing'), |
|
| 134 | + 'RSD' => __('Serbian Dinar', 'invoicing'), |
|
| 135 | + 'RUB' => __('Russian Ruble', 'invoicing'), |
|
| 136 | + 'RWF' => __('Rwandan Franc', 'invoicing'), |
|
| 137 | + 'SAR' => __('Saudi Riyal', 'invoicing'), |
|
| 138 | + 'SBD' => __('Solomon Islands Dollar', 'invoicing'), |
|
| 139 | + 'SCR' => __('Seychellois Rupee', 'invoicing'), |
|
| 140 | + 'SDG' => __('Sudanese Pound', 'invoicing'), |
|
| 141 | + 'SEK' => __('Swedish Krona', 'invoicing'), |
|
| 142 | + 'SGD' => __('Singapore Dollar', 'invoicing'), |
|
| 143 | + 'SHP' => __('Saint Helena Pound', 'invoicing'), |
|
| 144 | + 'SLL' => __('Sierra Leonean Leone', 'invoicing'), |
|
| 145 | + 'SOS' => __('Somali Shilling', 'invoicing'), |
|
| 146 | + 'SRD' => __('Surinamese Dollar', 'invoicing'), |
|
| 147 | + 'SSP' => __('South Sudanese Pound', 'invoicing'), |
|
| 148 | + 'STD' => __('Sao Tomean Dobra', 'invoicing'), |
|
| 149 | + 'SYP' => __('Syrian Pound', 'invoicing'), |
|
| 150 | + 'SZL' => __('Swazi Lilangeni', 'invoicing'), |
|
| 151 | + 'THB' => __('Thai Baht', 'invoicing'), |
|
| 152 | + 'TJS' => __('Tajikistani Somoni', 'invoicing'), |
|
| 153 | + 'TMT' => __('Turkmenistan Manat', 'invoicing'), |
|
| 154 | + 'TND' => __('Tunisian Dinar', 'invoicing'), |
|
| 155 | + 'TOP' => __('Tongan Paʻanga', 'invoicing'), |
|
| 156 | + 'TRY' => __('Turkish Lira', 'invoicing'), |
|
| 157 | + 'TTD' => __('Trinidad and Tobago Dollar', 'invoicing'), |
|
| 158 | + 'TWD' => __('New Taiwan Dollar', 'invoicing'), |
|
| 159 | + 'TZS' => __('Tanzanian Shilling', 'invoicing'), |
|
| 160 | + 'UAH' => __('Ukrainian Hryvnia', 'invoicing'), |
|
| 161 | + 'UGX' => __('Ugandan Shilling', 'invoicing'), |
|
| 162 | + 'UYU' => __('Uruguayan Peso', 'invoicing'), |
|
| 163 | + 'UZS' => __('Uzbekistani Som', 'invoicing'), |
|
| 164 | + 'VEF' => __('Venezuelan Bolívar', 'invoicing'), |
|
| 165 | + 'VND' => __('Vietnamese Dong', 'invoicing'), |
|
| 166 | + 'VUV' => __('Vanuatu Vatu', 'invoicing'), |
|
| 167 | + 'WST' => __('Samoan Tala', 'invoicing'), |
|
| 168 | + 'XAF' => __('Central African CFA Franc', 'invoicing'), |
|
| 169 | + 'XCD' => __('East Caribbean Dollar', 'invoicing'), |
|
| 170 | + 'XOF' => __('West African CFA Franc', 'invoicing'), |
|
| 171 | + 'XPF' => __('CFP Franc', 'invoicing'), |
|
| 172 | + 'YER' => __('Yemeni Rial', 'invoicing'), |
|
| 173 | + 'ZAR' => __('South African Rand', 'invoicing'), |
|
| 174 | + 'ZMW' => __('Zambian Kwacha', 'invoicing'), |
|
| 175 | 175 | ); |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * @version 1.0.19 |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * REST API items controller class. |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @see register_rest_route() |
| 44 | 44 | */ |
| 45 | - public function register_namespace_routes( $namespace ) { |
|
| 45 | + public function register_namespace_routes($namespace) { |
|
| 46 | 46 | |
| 47 | - parent::register_namespace_routes( $namespace ); |
|
| 47 | + parent::register_namespace_routes($namespace); |
|
| 48 | 48 | |
| 49 | 49 | register_rest_route( |
| 50 | 50 | $this->namespace, |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | array( |
| 53 | 53 | array( |
| 54 | 54 | 'methods' => WP_REST_Server::READABLE, |
| 55 | - 'callback' => array( $this, 'get_item_types' ), |
|
| 56 | - 'permission_callback' => array( $this, 'get_items_permissions_check' ), |
|
| 55 | + 'callback' => array($this, 'get_item_types'), |
|
| 56 | + 'permission_callback' => array($this, 'get_items_permissions_check'), |
|
| 57 | 57 | ), |
| 58 | 58 | ) |
| 59 | 59 | ); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| 70 | 70 | */ |
| 71 | 71 | public function get_item_types() { |
| 72 | - return rest_ensure_response( wpinv_get_item_types() ); |
|
| 72 | + return rest_ensure_response(wpinv_get_item_types()); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Item types |
| 91 | 91 | 'type' => array( |
| 92 | - 'description' => __( 'Type of items to fetch.', 'invoicing' ), |
|
| 93 | - 'type' => array( 'array', 'string' ), |
|
| 92 | + 'description' => __('Type of items to fetch.', 'invoicing'), |
|
| 93 | + 'type' => array('array', 'string'), |
|
| 94 | 94 | 'default' => 'any', |
| 95 | 95 | 'validate_callback' => 'rest_validate_request_arg', |
| 96 | 96 | 'sanitize_callback' => 'wpinv_parse_list', |
| 97 | 97 | 'items' => array( |
| 98 | - 'enum' => array_merge( array( 'any' ), wpinv_item_types() ), |
|
| 98 | + 'enum' => array_merge(array('any'), wpinv_item_types()), |
|
| 99 | 99 | 'type' => 'string', |
| 100 | 100 | ), |
| 101 | 101 | ), |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | 106 | // Filter collection parameters for the items controller. |
| 107 | - return apply_filters( 'getpaid_rest_items_collection_params', $params, $this ); |
|
| 107 | + return apply_filters('getpaid_rest_items_collection_params', $params, $this); |
|
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
@@ -116,26 +116,26 @@ discard block |
||
| 116 | 116 | * @param WP_REST_Request $request Request object. |
| 117 | 117 | * @return array $query_args |
| 118 | 118 | */ |
| 119 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 119 | + protected function prepare_items_query($prepared_args = array(), $request = null) { |
|
| 120 | 120 | |
| 121 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 121 | + $query_args = parent::prepare_items_query($prepared_args); |
|
| 122 | 122 | |
| 123 | 123 | // Retrieve items by type. |
| 124 | - if ( ! in_array( 'any', $request['type'] ) ) { |
|
| 124 | + if (!in_array('any', $request['type'])) { |
|
| 125 | 125 | |
| 126 | - if ( empty( $query_args['meta_query'] ) ) { |
|
| 126 | + if (empty($query_args['meta_query'])) { |
|
| 127 | 127 | $query_args['meta_query'] = array(); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $query_args['meta_query'][] = array( |
| 131 | 131 | 'key' => '_wpinv_type', |
| 132 | - 'value' => implode( ',', $request['type'] ), |
|
| 132 | + 'value' => implode(',', $request['type']), |
|
| 133 | 133 | 'compare' => 'IN', |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - return apply_filters( 'getpaid_rest_items_prepare_items_query', $query_args, $request, $this ); |
|
| 138 | + return apply_filters('getpaid_rest_items_prepare_items_query', $query_args, $request, $this); |
|
| 139 | 139 | |
| 140 | 140 | } |
| 141 | 141 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @return array A list of registered item statuses. |
| 148 | 148 | */ |
| 149 | 149 | public function get_post_statuses() { |
| 150 | - return array( 'draft', 'pending', 'publish' ); |
|
| 150 | + return array('draft', 'pending', 'publish'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -158,29 +158,29 @@ discard block |
||
| 158 | 158 | * @param string $field_key The key to check for. |
| 159 | 159 | * @return bool |
| 160 | 160 | */ |
| 161 | - public function object_supports_field( $item, $field_key ) { |
|
| 161 | + public function object_supports_field($item, $field_key) { |
|
| 162 | 162 | |
| 163 | - if ( 'minimum_price' == $field_key && ! $item->user_can_set_their_price() ) { |
|
| 163 | + if ('minimum_price' == $field_key && !$item->user_can_set_their_price()) { |
|
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - foreach( wpinv_parse_list( 'initial_price the_initial_price recurring_price the_recurring_price recurring_period recurring_interval recurring_limit is_free_trial trial_period trial_interval first_renewal_date' ) as $key ) { |
|
| 167 | + foreach (wpinv_parse_list('initial_price the_initial_price recurring_price the_recurring_price recurring_period recurring_interval recurring_limit is_free_trial trial_period trial_interval first_renewal_date') as $key) { |
|
| 168 | 168 | |
| 169 | - if ( $key == $field_key && ! $item->is_recurring() ) { |
|
| 169 | + if ($key == $field_key && !$item->is_recurring()) { |
|
| 170 | 170 | return false; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - foreach( wpinv_parse_list( 'trial_period trial_interval' ) as $key ) { |
|
| 175 | + foreach (wpinv_parse_list('trial_period trial_interval') as $key) { |
|
| 176 | 176 | |
| 177 | - if ( $key == $field_key && ! $item->has_free_trial() ) { |
|
| 177 | + if ($key == $field_key && !$item->has_free_trial()) { |
|
| 178 | 178 | return false; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - return parent::object_supports_field( $item, $field_key ); |
|
| 183 | + return parent::object_supports_field($item, $field_key); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | } |