Passed
Push — master ( 862b0e...047a35 )
by Stiofan
17:04
created
widgets/invoice-history.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
         parent::__construct( $options );
45 45
     }
46 46
 
47
-	/**
48
-	 * The Super block output function.
49
-	 *
50
-	 * @param array $args
51
-	 * @param array $widget_args
52
-	 * @param string $content
53
-	 *
54
-	 * @return mixed|string|bool
55
-	 */
47
+    /**
48
+     * The Super block output function.
49
+     *
50
+     * @param array $args
51
+     * @param array $widget_args
52
+     * @param string $content
53
+     *
54
+     * @return mixed|string|bool
55
+     */
56 56
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
57 57
         return getpaid_invoice_history();
58 58
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
widgets/invoice-receipt.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
         parent::__construct( $options );
45 45
     }
46 46
 
47
-	/**
48
-	 * The Super block output function.
49
-	 *
50
-	 * @param array $args
51
-	 * @param array $widget_args
52
-	 * @param string $content
53
-	 *
54
-	 * @return mixed|string|bool
55
-	 */
47
+    /**
48
+     * The Super block output function.
49
+     *
50
+     * @param array $args
51
+     * @param array $widget_args
52
+     * @param string $content
53
+     *
54
+     * @return mixed|string|bool
55
+     */
56 56
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
57 57
         return wpinv_payment_receipt();
58 58
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/gateways/class-getpaid-worldpay-gateway.php 2 patches
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -13,65 +13,65 @@  discard block
 block discarded – undo
13 13
 class GetPaid_Worldpay_Gateway extends GetPaid_Payment_Gateway {
14 14
 
15 15
     /**
16
-	 * Payment method id.
17
-	 *
18
-	 * @var string
19
-	 */
16
+     * Payment method id.
17
+     *
18
+     * @var string
19
+     */
20 20
     public $id = 'worldpay';
21 21
 
22 22
     /**
23
-	 * Payment method order.
24
-	 *
25
-	 * @var int
26
-	 */
23
+     * Payment method order.
24
+     *
25
+     * @var int
26
+     */
27 27
     public $order = 5;
28 28
 
29 29
     /**
30
-	 * Endpoint for requests from Worldpay.
31
-	 *
32
-	 * @var string
33
-	 */
34
-	protected $notify_url;
35
-
36
-	/**
37
-	 * Endpoint for requests to Worldpay.
38
-	 *
39
-	 * @var string
40
-	 */
30
+     * Endpoint for requests from Worldpay.
31
+     *
32
+     * @var string
33
+     */
34
+    protected $notify_url;
35
+
36
+    /**
37
+     * Endpoint for requests to Worldpay.
38
+     *
39
+     * @var string
40
+     */
41 41
     protected $endpoint;
42 42
 
43 43
     /**
44
-	 * An array of features that this gateway supports.
45
-	 *
46
-	 * @var array
47
-	 */
44
+     * An array of features that this gateway supports.
45
+     *
46
+     * @var array
47
+     */
48 48
     protected $supports = array( 'sandbox' );
49 49
     
50 50
     /**
51
-	 * Currencies this gateway is allowed for.
52
-	 *
53
-	 * @var array
54
-	 */
55
-	public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' );
51
+     * Currencies this gateway is allowed for.
52
+     *
53
+     * @var array
54
+     */
55
+    public $currencies = array( 'AUD', 'ARS', 'CAD', 'CHF', 'DKK', 'EUR', 'HKD', 'MYR', 'GBP', 'NZD', 'NOK', 'SGD', 'LKR', 'SEK', 'TRY', 'USD', 'ZAR' );
56 56
 
57 57
     /**
58
-	 * URL to view a transaction.
59
-	 *
60
-	 * @var string
61
-	 */
58
+     * URL to view a transaction.
59
+     *
60
+     * @var string
61
+     */
62 62
     public $view_transaction_url = 'https://www.{sandbox}paypal.com/activity/payment/%s';
63 63
 
64 64
     /**
65
-	 * URL to view a subscription.
66
-	 *
67
-	 * @var string
68
-	 */
69
-	public $view_subscription_url = 'https://www.{sandbox}paypal.com/cgi-bin/webscr?cmd=_profile-recurring-payments&encrypted_profile_id=%s';
65
+     * URL to view a subscription.
66
+     *
67
+     * @var string
68
+     */
69
+    public $view_subscription_url = 'https://www.{sandbox}paypal.com/cgi-bin/webscr?cmd=_profile-recurring-payments&encrypted_profile_id=%s';
70 70
 
71 71
     /**
72
-	 * Class constructor.
73
-	 */
74
-	public function __construct() {
72
+     * Class constructor.
73
+     */
74
+    public function __construct() {
75 75
 
76 76
         $this->method_title         = __( 'Worldpay', 'invoicing' );
77 77
         $this->title                = __( 'Worldpay - Credit Card / Debit Card', 'invoicing' );
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
     }
86 86
 
87 87
     /**
88
-	 * Process Payment.
89
-	 *
90
-	 *
91
-	 * @param WPInv_Invoice $invoice Invoice.
92
-	 * @param array $submission_data Posted checkout fields.
93
-	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
94
-	 * @return array
95
-	 */
96
-	public function process_payment( $invoice, $submission_data, $submission ) {
88
+     * Process Payment.
89
+     *
90
+     *
91
+     * @param WPInv_Invoice $invoice Invoice.
92
+     * @param array $submission_data Posted checkout fields.
93
+     * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
94
+     * @return array
95
+     */
96
+    public function process_payment( $invoice, $submission_data, $submission ) {
97 97
 
98 98
         // Get redirect url.
99 99
         $worldpay_redirect = esc_url( $this->get_request_url( $invoice ) );
@@ -128,31 +128,31 @@  discard block
 block discarded – undo
128 128
     }
129 129
 
130 130
     /**
131
-	 * Get the Worldpay request URL for an invoice.
132
-	 *
133
-	 * @param  WPInv_Invoice $invoice Invoice object.
134
-	 * @return string
135
-	 */
136
-	public function get_request_url( $invoice ) {
131
+     * Get the Worldpay request URL for an invoice.
132
+     *
133
+     * @param  WPInv_Invoice $invoice Invoice object.
134
+     * @return string
135
+     */
136
+    public function get_request_url( $invoice ) {
137 137
 
138 138
         // Endpoint for this request
139
-		$this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase';
139
+        $this->endpoint = $this->is_sandbox( $invoice ) ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase';
140 140
 
141 141
         return $this->endpoint;
142 142
 
143
-	}
143
+    }
144 144
 
145 145
     /**
146
-	 * Get Worldpay Args for passing to Worldpay.
147
-	 *
148
-	 * @param  WPInv_Invoice $invoice Invoice object.
149
-	 * @return array
150
-	 */
151
-	protected function get_worldpay_args( $invoice ) {
152
-
153
-		return apply_filters(
154
-			'getpaid_worldpay_args',
155
-			array(
146
+     * Get Worldpay Args for passing to Worldpay.
147
+     *
148
+     * @param  WPInv_Invoice $invoice Invoice object.
149
+     * @return array
150
+     */
151
+    protected function get_worldpay_args( $invoice ) {
152
+
153
+        return apply_filters(
154
+            'getpaid_worldpay_args',
155
+            array(
156 156
                 'amount'         => wpinv_sanitize_amount( $invoice->get_total() ), // mandatory
157 157
                 'cartId'         => wpinv_clean( $invoice->get_number() ), // mandatory reference for the item purchased
158 158
                 'currency'       => wpinv_clean( $invoice->get_currency() ), // mandatory
@@ -177,18 +177,18 @@  discard block
 block discarded – undo
177 177
                 'countryString'  => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ),
178 178
                 'compName'       => wpinv_clean( $invoice->get_company() ),
179 179
             ),
180
-			$invoice
181
-		);
180
+            $invoice
181
+        );
182 182
 
183 183
     }
184 184
 
185 185
     /**
186
-	 * Secures worldpay args with an md5 hash.
187
-	 *
188
-	 * @param  array $args Gateway args.
189
-	 * @return array
190
-	 */
191
-	public function hash_args( $args ) {
186
+     * Secures worldpay args with an md5 hash.
187
+     *
188
+     * @param  array $args Gateway args.
189
+     * @return array
190
+     */
191
+    public function hash_args( $args ) {
192 192
 
193 193
         $md5_secret = $this->get_option( 'md5_secret' );
194 194
 
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
     }
205 205
 
206 206
     /**
207
-	 * Processes ipns and marks payments as complete.
208
-	 *
209
-	 * @return void
210
-	 */
211
-	public function verify_ipn() {
207
+     * Processes ipns and marks payments as complete.
208
+     *
209
+     * @return void
210
+     */
211
+    public function verify_ipn() {
212 212
 
213 213
         // Validate the IPN.
214 214
         if ( empty( $_POST ) || ! $this->validate_ipn() ) {
215
-		    wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) );
216
-		}
215
+            wp_die( 'Worldpay IPN Request Failure', 'Worldpay IPN', array( 'response' => 500 ) );
216
+        }
217 217
 
218 218
         // Process the IPN.
219 219
         $posted  = wp_unslash( $_POST );
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
                 $invoice->set_transaction_id( wpinv_clean( $posted['transId'] ) );
230 230
             }
231 231
 
232
-             // Update the ip address.
233
-             if ( ! empty( $posted['ipAddress'] ) ) {
232
+                // Update the ip address.
233
+                if ( ! empty( $posted['ipAddress'] ) ) {
234 234
                 $invoice->set_ip( wpinv_clean( $posted['ipAddress'] ) );
235 235
             }
236 236
 
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
     }
258 258
 
259 259
     /**
260
-	 * Check Worldpay IPN validity.
261
-	 */
262
-	public function validate_ipn() {
260
+     * Check Worldpay IPN validity.
261
+     */
262
+    public function validate_ipn() {
263 263
 
264 264
         wpinv_error_log( 'Validating Worldpay IPN response' );
265 265
 
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
     }
306 306
 
307 307
     /**
308
-	 * Filters the gateway settings.
309
-	 * 
310
-	 * @param array $admin_settings
311
-	 */
312
-	public function admin_settings( $admin_settings ) {
308
+     * Filters the gateway settings.
309
+     * 
310
+     * @param array $admin_settings
311
+     */
312
+    public function admin_settings( $admin_settings ) {
313 313
 
314 314
         $currencies = sprintf(
315 315
             __( 'Supported Currencies: %s', 'invoicing' ),
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
             'readonly' => true
351 351
         );
352 352
 
353
-		return $admin_settings;
354
-	}
353
+        return $admin_settings;
354
+    }
355 355
 
356 356
 }
Please login to merge, or discard this patch.
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Worldpay Payment Gateway class.
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
148 148
 	 * @param  WPInv_Invoice $invoice Invoice object.
149 149
 	 * @return array
150 150
 	 */
151
-	protected function get_worldpay_args( $invoice ) {
151
+	protected function get_worldpay_args($invoice) {
152 152
 
153 153
 		return apply_filters(
154 154
 			'getpaid_worldpay_args',
155 155
 			array(
156
-                'amount'         => wpinv_sanitize_amount( $invoice->get_total() ), // mandatory
157
-                'cartId'         => wpinv_clean( $invoice->get_number() ), // mandatory reference for the item purchased
158
-                'currency'       => wpinv_clean( $invoice->get_currency() ), // mandatory
159
-                'instId'         => wpinv_clean( $this->get_option( 'instId', '' ) ), // mandatory
160
-                'testMode'       => $this->is_sandbox( $invoice ) ? 100 : 0, // mandatory
161
-                'name'           => wpinv_clean( $invoice->get_full_name() ),
162
-                'address'        => wpinv_clean( $invoice->get_address() ),
163
-                'postcode'       => wpinv_clean( $invoice->get_zip() ),
164
-                'tel'            => wpinv_clean( $invoice->get_phone() ),
165
-                'email'          => sanitize_email( $invoice->get_email() ),
166
-                'country'        => wpinv_clean( $invoice->get_country() ),
167
-                'desc'           => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ),
168
-                'MC_description' => sprintf( __( 'Payment for invoice %s.', 'invoicing' ), wpinv_clean( $invoice->get_number() ) ),
169
-                'MC_callback'    => esc_url_raw( $this->notify_url ),
170
-                'resultfile'     => esc_url_raw( $this->get_return_url( $invoice ) ),
171
-                'MC_key'         => wpinv_clean( $invoice->get_key() ),
156
+                'amount'         => wpinv_sanitize_amount($invoice->get_total()), // mandatory
157
+                'cartId'         => wpinv_clean($invoice->get_number()), // mandatory reference for the item purchased
158
+                'currency'       => wpinv_clean($invoice->get_currency()), // mandatory
159
+                'instId'         => wpinv_clean($this->get_option('instId', '')), // mandatory
160
+                'testMode'       => $this->is_sandbox($invoice) ? 100 : 0, // mandatory
161
+                'name'           => wpinv_clean($invoice->get_full_name()),
162
+                'address'        => wpinv_clean($invoice->get_address()),
163
+                'postcode'       => wpinv_clean($invoice->get_zip()),
164
+                'tel'            => wpinv_clean($invoice->get_phone()),
165
+                'email'          => sanitize_email($invoice->get_email()),
166
+                'country'        => wpinv_clean($invoice->get_country()),
167
+                'desc'           => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())),
168
+                'MC_description' => sprintf(__('Payment for invoice %s.', 'invoicing'), wpinv_clean($invoice->get_number())),
169
+                'MC_callback'    => esc_url_raw($this->notify_url),
170
+                'resultfile'     => esc_url_raw($this->get_return_url($invoice)),
171
+                'MC_key'         => wpinv_clean($invoice->get_key()),
172 172
                 'MC_invoice_id'  => $invoice->get_id(),
173
-                'address1'       => wpinv_clean( $invoice->get_address() ),
174
-                'town'           => wpinv_clean( $invoice->get_city() ),
175
-                'region'         => wpinv_clean( $invoice->get_state() ),
176
-                'amountString'   => wpinv_price( $invoice->get_total(), $invoice->get_currency() ),
177
-                'countryString'  => wpinv_clean( wpinv_country_name( $invoice->get_country() ) ),
178
-                'compName'       => wpinv_clean( $invoice->get_company() ),
173
+                'address1'       => wpinv_clean($invoice->get_address()),
174
+                'town'           => wpinv_clean($invoice->get_city()),
175
+                'region'         => wpinv_clean($invoice->get_state()),
176
+                'amountString'   => wpinv_price($invoice->get_total(), $invoice->get_currency()),
177
+                'countryString'  => wpinv_clean(wpinv_country_name($invoice->get_country())),
178
+                'compName'       => wpinv_clean($invoice->get_company()),
179 179
             ),
180 180
 			$invoice
181 181
 		);
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
includes/data/currency-symbols.php 2 patches
Indentation   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -11,166 +11,166 @@
 block discarded – undo
11 11
 defined( 'ABSPATH' ) || exit;
12 12
 
13 13
 return array(
14
-	'AED' => '&#x62f;.&#x625;',
15
-	'AFN' => '&#x60b;',
16
-	'ALL' => 'L',
17
-	'AMD' => 'AMD',
18
-	'ANG' => '&fnof;',
19
-	'AOA' => 'Kz',
20
-	'ARS' => '&#36;',
21
-	'AUD' => '&#36;',
22
-	'AWG' => '&fnof;',
23
-	'AZN' => 'AZN',
24
-	'BAM' => 'KM',
25
-	'BBD' => '&#36;',
26
-	'BDT' => '&#2547;',
27
-	'BGN' => '&#1083;&#1074;.',
28
-	'BHD' => '.&#x62f;.&#x628;',
29
-	'BIF' => 'Fr',
30
-	'BMD' => '&#36;',
31
-	'BND' => '&#36;',
32
-	'BOB' => 'Bs.',
33
-	'BRL' => '&#82;&#36;',
34
-	'BSD' => '&#36;',
35
-	'BTC' => '&#3647;',
36
-	'BTN' => 'Nu.',
37
-	'BWP' => 'P',
38
-	'BYN' => 'Br',
39
-	'BZD' => '&#36;',
40
-	'CAD' => '&#36;',
41
-	'CDF' => 'Fr',
42
-	'CHF' => '&#67;&#72;&#70;',
43
-	'CLP' => '&#36;',
44
-	'CNY' => '&yen;',
45
-	'COP' => '&#36;',
46
-	'CRC' => '&#x20a1;',
47
-	'CUC' => '&#36;',
48
-	'CUP' => '&#36;',
49
-	'CVE' => '&#36;',
50
-	'CZK' => '&#75;&#269;',
51
-	'DJF' => 'Fr',
52
-	'DKK' => 'DKK',
53
-	'DOP' => 'RD&#36;',
54
-	'DZD' => '&#x62f;.&#x62c;',
55
-	'EGP' => 'EGP',
56
-	'ERN' => 'Nfk',
57
-	'ETB' => 'Br',
58
-	'EUR' => '&euro;',
59
-	'FJD' => '&#36;',
60
-	'FKP' => '&pound;',
61
-	'GBP' => '&pound;',
62
-	'GEL' => '&#x10da;',
63
-	'GGP' => '&pound;',
64
-	'GHS' => '&#x20b5;',
65
-	'GIP' => '&pound;',
66
-	'GMD' => 'D',
67
-	'GNF' => 'Fr',
68
-	'GTQ' => 'Q',
69
-	'GYD' => '&#36;',
70
-	'HKD' => '&#36;',
71
-	'HNL' => 'L',
72
-	'HRK' => 'Kn',
73
-	'HTG' => 'G',
74
-	'HUF' => '&#70;&#116;',
75
-	'IDR' => 'Rp',
76
-	'ILS' => '&#8362;',
77
-	'IMP' => '&pound;',
78
-	'INR' => '&#8377;',
79
-	'IQD' => '&#x639;.&#x62f;',
80
-	'IRR' => '&#xfdfc;',
81
-	'IRT' => '&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;',
82
-	'ISK' => 'kr.',
83
-	'JEP' => '&pound;',
84
-	'JMD' => '&#36;',
85
-	'JOD' => '&#x62f;.&#x627;',
86
-	'JPY' => '&yen;',
87
-	'KES' => 'KSh',
88
-	'KGS' => '&#x441;&#x43e;&#x43c;',
89
-	'KHR' => '&#x17db;',
90
-	'KMF' => 'Fr',
91
-	'KPW' => '&#x20a9;',
92
-	'KRW' => '&#8361;',
93
-	'KWD' => '&#x62f;.&#x643;',
94
-	'KYD' => '&#36;',
95
-	'KZT' => 'KZT',
96
-	'LAK' => '&#8365;',
97
-	'LBP' => '&#x644;.&#x644;',
98
-	'LKR' => '&#xdbb;&#xdd4;',
99
-	'LRD' => '&#36;',
100
-	'LSL' => 'L',
101
-	'LYD' => '&#x644;.&#x62f;',
102
-	'MAD' => '&#x62f;.&#x645;.',
103
-	'MDL' => 'MDL',
104
-	'MGA' => 'Ar',
105
-	'MKD' => '&#x434;&#x435;&#x43d;',
106
-	'MMK' => 'Ks',
107
-	'MNT' => '&#x20ae;',
108
-	'MOP' => 'P',
109
-	'MRO' => 'UM',
110
-	'MUR' => '&#x20a8;',
111
-	'MVR' => '.&#x783;',
112
-	'MWK' => 'MK',
113
-	'MXN' => '&#36;',
114
-	'MYR' => '&#82;&#77;',
115
-	'MZN' => 'MT',
116
-	'NAD' => '&#36;',
117
-	'NGN' => '&#8358;',
118
-	'NIO' => 'C&#36;',
119
-	'NOK' => '&#107;&#114;',
120
-	'NPR' => '&#8360;',
121
-	'NZD' => '&#36;',
122
-	'OMR' => '&#x631;.&#x639;.',
123
-	'PAB' => 'B/.',
124
-	'PEN' => 'S/.',
125
-	'PGK' => 'K',
126
-	'PHP' => '&#8369;',
127
-	'PKR' => '&#8360;',
128
-	'PLN' => '&#122;&#322;',
129
-	'PRB' => '&#x440;.',
130
-	'PYG' => '&#8370;',
131
-	'QAR' => '&#x631;.&#x642;',
132
-	'RMB' => '&yen;',
133
-	'RON' => 'lei',
134
-	'RSD' => '&#x434;&#x438;&#x43d;.',
135
-	'RUB' => '&#8381;',
136
-	'RWF' => 'Fr',
137
-	'SAR' => '&#x631;.&#x633;',
138
-	'SBD' => '&#36;',
139
-	'SCR' => '&#x20a8;',
140
-	'SDG' => '&#x62c;.&#x633;.',
141
-	'SEK' => '&#107;&#114;',
142
-	'SGD' => '&#36;',
143
-	'SHP' => '&pound;',
144
-	'SLL' => 'Le',
145
-	'SOS' => 'Sh',
146
-	'SRD' => '&#36;',
147
-	'SSP' => '&pound;',
148
-	'STD' => 'Db',
149
-	'SYP' => '&#x644;.&#x633;',
150
-	'SZL' => 'L',
151
-	'THB' => '&#3647;',
152
-	'TJS' => '&#x405;&#x41c;',
153
-	'TMT' => 'm',
154
-	'TND' => '&#x62f;.&#x62a;',
155
-	'TOP' => 'T&#36;',
156
-	'TRY' => '&#8378;',
157
-	'TTD' => '&#36;',
158
-	'TWD' => '&#78;&#84;&#36;',
159
-	'TZS' => 'Sh',
160
-	'UAH' => '&#8372;',
161
-	'UGX' => 'UGX',
162
-	'USD' => '&#36;',
163
-	'UYU' => '&#36;',
164
-	'UZS' => 'UZS',
165
-	'VEF' => 'Bs.',
166
-	'VND' => '&#8363;',
167
-	'VUV' => 'Vt',
168
-	'WST' => 'T',
169
-	'XAF' => 'Fr',
170
-	'XCD' => '&#36;',
171
-	'XOF' => 'Fr',
172
-	'XPF' => 'Fr',
173
-	'YER' => '&#xfdfc;',
174
-	'ZAR' => '&#82;',
175
-	'ZMW' => 'ZK',
14
+    'AED' => '&#x62f;.&#x625;',
15
+    'AFN' => '&#x60b;',
16
+    'ALL' => 'L',
17
+    'AMD' => 'AMD',
18
+    'ANG' => '&fnof;',
19
+    'AOA' => 'Kz',
20
+    'ARS' => '&#36;',
21
+    'AUD' => '&#36;',
22
+    'AWG' => '&fnof;',
23
+    'AZN' => 'AZN',
24
+    'BAM' => 'KM',
25
+    'BBD' => '&#36;',
26
+    'BDT' => '&#2547;',
27
+    'BGN' => '&#1083;&#1074;.',
28
+    'BHD' => '.&#x62f;.&#x628;',
29
+    'BIF' => 'Fr',
30
+    'BMD' => '&#36;',
31
+    'BND' => '&#36;',
32
+    'BOB' => 'Bs.',
33
+    'BRL' => '&#82;&#36;',
34
+    'BSD' => '&#36;',
35
+    'BTC' => '&#3647;',
36
+    'BTN' => 'Nu.',
37
+    'BWP' => 'P',
38
+    'BYN' => 'Br',
39
+    'BZD' => '&#36;',
40
+    'CAD' => '&#36;',
41
+    'CDF' => 'Fr',
42
+    'CHF' => '&#67;&#72;&#70;',
43
+    'CLP' => '&#36;',
44
+    'CNY' => '&yen;',
45
+    'COP' => '&#36;',
46
+    'CRC' => '&#x20a1;',
47
+    'CUC' => '&#36;',
48
+    'CUP' => '&#36;',
49
+    'CVE' => '&#36;',
50
+    'CZK' => '&#75;&#269;',
51
+    'DJF' => 'Fr',
52
+    'DKK' => 'DKK',
53
+    'DOP' => 'RD&#36;',
54
+    'DZD' => '&#x62f;.&#x62c;',
55
+    'EGP' => 'EGP',
56
+    'ERN' => 'Nfk',
57
+    'ETB' => 'Br',
58
+    'EUR' => '&euro;',
59
+    'FJD' => '&#36;',
60
+    'FKP' => '&pound;',
61
+    'GBP' => '&pound;',
62
+    'GEL' => '&#x10da;',
63
+    'GGP' => '&pound;',
64
+    'GHS' => '&#x20b5;',
65
+    'GIP' => '&pound;',
66
+    'GMD' => 'D',
67
+    'GNF' => 'Fr',
68
+    'GTQ' => 'Q',
69
+    'GYD' => '&#36;',
70
+    'HKD' => '&#36;',
71
+    'HNL' => 'L',
72
+    'HRK' => 'Kn',
73
+    'HTG' => 'G',
74
+    'HUF' => '&#70;&#116;',
75
+    'IDR' => 'Rp',
76
+    'ILS' => '&#8362;',
77
+    'IMP' => '&pound;',
78
+    'INR' => '&#8377;',
79
+    'IQD' => '&#x639;.&#x62f;',
80
+    'IRR' => '&#xfdfc;',
81
+    'IRT' => '&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;',
82
+    'ISK' => 'kr.',
83
+    'JEP' => '&pound;',
84
+    'JMD' => '&#36;',
85
+    'JOD' => '&#x62f;.&#x627;',
86
+    'JPY' => '&yen;',
87
+    'KES' => 'KSh',
88
+    'KGS' => '&#x441;&#x43e;&#x43c;',
89
+    'KHR' => '&#x17db;',
90
+    'KMF' => 'Fr',
91
+    'KPW' => '&#x20a9;',
92
+    'KRW' => '&#8361;',
93
+    'KWD' => '&#x62f;.&#x643;',
94
+    'KYD' => '&#36;',
95
+    'KZT' => 'KZT',
96
+    'LAK' => '&#8365;',
97
+    'LBP' => '&#x644;.&#x644;',
98
+    'LKR' => '&#xdbb;&#xdd4;',
99
+    'LRD' => '&#36;',
100
+    'LSL' => 'L',
101
+    'LYD' => '&#x644;.&#x62f;',
102
+    'MAD' => '&#x62f;.&#x645;.',
103
+    'MDL' => 'MDL',
104
+    'MGA' => 'Ar',
105
+    'MKD' => '&#x434;&#x435;&#x43d;',
106
+    'MMK' => 'Ks',
107
+    'MNT' => '&#x20ae;',
108
+    'MOP' => 'P',
109
+    'MRO' => 'UM',
110
+    'MUR' => '&#x20a8;',
111
+    'MVR' => '.&#x783;',
112
+    'MWK' => 'MK',
113
+    'MXN' => '&#36;',
114
+    'MYR' => '&#82;&#77;',
115
+    'MZN' => 'MT',
116
+    'NAD' => '&#36;',
117
+    'NGN' => '&#8358;',
118
+    'NIO' => 'C&#36;',
119
+    'NOK' => '&#107;&#114;',
120
+    'NPR' => '&#8360;',
121
+    'NZD' => '&#36;',
122
+    'OMR' => '&#x631;.&#x639;.',
123
+    'PAB' => 'B/.',
124
+    'PEN' => 'S/.',
125
+    'PGK' => 'K',
126
+    'PHP' => '&#8369;',
127
+    'PKR' => '&#8360;',
128
+    'PLN' => '&#122;&#322;',
129
+    'PRB' => '&#x440;.',
130
+    'PYG' => '&#8370;',
131
+    'QAR' => '&#x631;.&#x642;',
132
+    'RMB' => '&yen;',
133
+    'RON' => 'lei',
134
+    'RSD' => '&#x434;&#x438;&#x43d;.',
135
+    'RUB' => '&#8381;',
136
+    'RWF' => 'Fr',
137
+    'SAR' => '&#x631;.&#x633;',
138
+    'SBD' => '&#36;',
139
+    'SCR' => '&#x20a8;',
140
+    'SDG' => '&#x62c;.&#x633;.',
141
+    'SEK' => '&#107;&#114;',
142
+    'SGD' => '&#36;',
143
+    'SHP' => '&pound;',
144
+    'SLL' => 'Le',
145
+    'SOS' => 'Sh',
146
+    'SRD' => '&#36;',
147
+    'SSP' => '&pound;',
148
+    'STD' => 'Db',
149
+    'SYP' => '&#x644;.&#x633;',
150
+    'SZL' => 'L',
151
+    'THB' => '&#3647;',
152
+    'TJS' => '&#x405;&#x41c;',
153
+    'TMT' => 'm',
154
+    'TND' => '&#x62f;.&#x62a;',
155
+    'TOP' => 'T&#36;',
156
+    'TRY' => '&#8378;',
157
+    'TTD' => '&#36;',
158
+    'TWD' => '&#78;&#84;&#36;',
159
+    'TZS' => 'Sh',
160
+    'UAH' => '&#8372;',
161
+    'UGX' => 'UGX',
162
+    'USD' => '&#36;',
163
+    'UYU' => '&#36;',
164
+    'UZS' => 'UZS',
165
+    'VEF' => 'Bs.',
166
+    'VND' => '&#8363;',
167
+    'VUV' => 'Vt',
168
+    'WST' => 'T',
169
+    'XAF' => 'Fr',
170
+    'XCD' => '&#36;',
171
+    'XOF' => 'Fr',
172
+    'XPF' => 'Fr',
173
+    'YER' => '&#xfdfc;',
174
+    'ZAR' => '&#82;',
175
+    'ZMW' => 'ZK',
176 176
 );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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' => '&#x62f;.&#x625;',
Please login to merge, or discard this patch.
includes/data/currencies.php 2 patches
Indentation   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -11,165 +11,165 @@
 block discarded – undo
11 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&#x2bb;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&iacute;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&#x2bb;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&iacute;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
 );
Please login to merge, or discard this patch.
Spacing   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -8,168 +8,168 @@
 block discarded – undo
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&#x2bb;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&iacute;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&#x2bb;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&iacute;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
 );
Please login to merge, or discard this patch.
includes/api/class-wpinv-rest-items-controller.php 2 patches
Indentation   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -15,172 +15,172 @@
 block discarded – undo
15 15
 class WPInv_REST_Items_Controller extends GetPaid_REST_Posts_Controller {
16 16
 
17 17
     /**
18
-	 * Post type.
19
-	 *
20
-	 * @var string
21
-	 */
22
-	protected $post_type = 'wpi_item';
18
+     * Post type.
19
+     *
20
+     * @var string
21
+     */
22
+    protected $post_type = 'wpi_item';
23 23
 	
24
-	/**
25
-	 * The base of this controller's route.
26
-	 *
27
-	 * @since 1.0.13
28
-	 * @var string
29
-	 */
30
-	protected $rest_base = 'items';
31
-
32
-	/** Contains this controller's class name.
33
-	 *
34
-	 * @var string
35
-	 */
36
-	public $crud_class = 'WPInv_Item';
37
-
38
-	/**
39
-	 * Registers the routes for the objects of the controller.
40
-	 *
41
-	 * @since 1.0.19
42
-	 *
43
-	 * @see register_rest_route()
44
-	 */
45
-	public function register_namespace_routes( $namespace ) {
46
-
47
-		parent::register_namespace_routes( $namespace );
48
-
49
-		register_rest_route(
50
-			$this->namespace,
51
-			'/' . $this->rest_base . '/item-types',
52
-			array(
53
-				array(
54
-					'methods'             => WP_REST_Server::READABLE,
55
-					'callback'            => array( $this, 'get_item_types' ),
56
-					'permission_callback' => array( $this, 'get_items_permissions_check' ),
57
-				),
58
-			)
59
-		);
60
-
61
-	}
62
-
63
-	/**
64
-	 * Handles rest requests for item types.
65
-	 *
66
-	 * @since 1.0.13
67
-	 * 
68
-	 * 
69
-	 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
70
-	 */
71
-	public function get_item_types() {
72
-		return rest_ensure_response( wpinv_get_item_types() );
73
-	}
24
+    /**
25
+     * The base of this controller's route.
26
+     *
27
+     * @since 1.0.13
28
+     * @var string
29
+     */
30
+    protected $rest_base = 'items';
31
+
32
+    /** Contains this controller's class name.
33
+     *
34
+     * @var string
35
+     */
36
+    public $crud_class = 'WPInv_Item';
37
+
38
+    /**
39
+     * Registers the routes for the objects of the controller.
40
+     *
41
+     * @since 1.0.19
42
+     *
43
+     * @see register_rest_route()
44
+     */
45
+    public function register_namespace_routes( $namespace ) {
46
+
47
+        parent::register_namespace_routes( $namespace );
48
+
49
+        register_rest_route(
50
+            $this->namespace,
51
+            '/' . $this->rest_base . '/item-types',
52
+            array(
53
+                array(
54
+                    'methods'             => WP_REST_Server::READABLE,
55
+                    'callback'            => array( $this, 'get_item_types' ),
56
+                    'permission_callback' => array( $this, 'get_items_permissions_check' ),
57
+                ),
58
+            )
59
+        );
60
+
61
+    }
62
+
63
+    /**
64
+     * Handles rest requests for item types.
65
+     *
66
+     * @since 1.0.13
67
+     * 
68
+     * 
69
+     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
70
+     */
71
+    public function get_item_types() {
72
+        return rest_ensure_response( wpinv_get_item_types() );
73
+    }
74
+
75
+    /**
76
+     * Retrieves the query params for the items collection.
77
+     *
78
+     * @since 1.0.13
79
+     *
80
+     * @return array Collection parameters.
81
+     */
82
+    public function get_collection_params() {
83
+
84
+        $params = array_merge(
85
+
86
+            parent::get_collection_params(),
87
+
88
+            array(
89
+
90
+                // Item types
91
+                'type'                  => array(
92
+                    'description'       => __( 'Type of items to fetch.', 'invoicing' ),
93
+                    'type'              => array( 'array', 'string' ),
94
+                    'default'           => 'any',
95
+                    'validate_callback' => 'rest_validate_request_arg',
96
+                    'sanitize_callback' => 'wpinv_parse_list',
97
+                    'items'             => array(
98
+                        'enum'          => array_merge( array( 'any' ), wpinv_item_types() ),
99
+                        'type'          => 'string',
100
+                    ),
101
+                ),
102
+
103
+            )
104
+        );
105
+
106
+        // Filter collection parameters for the items controller.
107
+        return apply_filters( 'getpaid_rest_items_collection_params', $params, $this );
108
+
109
+    }
110
+
111
+    /**
112
+     * Determine the allowed query_vars for a get_items() response and
113
+     * prepare for WP_Query.
114
+     *
115
+     * @param array           $prepared_args Prepared arguments.
116
+     * @param WP_REST_Request $request Request object.
117
+     * @return array          $query_args
118
+     */
119
+    protected function prepare_items_query( $prepared_args = array(), $request = null ) {
120
+
121
+        $query_args = parent::prepare_items_query( $prepared_args );
122
+
123
+        // Retrieve items by type.
124
+        if ( ! in_array( 'any', $request['type'] ) ) {
125
+
126
+            if ( empty( $query_args['meta_query'] ) ) {
127
+                $query_args['meta_query'] = array();
128
+            }
129
+
130
+            $query_args['meta_query'][] = array(
131
+                'key'     => '_wpinv_type',
132
+                'value'   => implode( ',', $request['type'] ),
133
+                'compare' => 'IN',
134
+            );
135
+
136
+        }
137
+
138
+        return apply_filters( 'getpaid_rest_items_prepare_items_query', $query_args, $request, $this );
139
+
140
+    }
141
+
142
+    /**
143
+     * Retrieves a valid list of post statuses.
144
+     *
145
+     * @since 1.0.15
146
+     *
147
+     * @return array A list of registered item statuses.
148
+     */
149
+    public function get_post_statuses() {
150
+        return array( 'draft', 'pending', 'publish' );
151
+    }
74 152
 
75 153
     /**
76
-	 * Retrieves the query params for the items collection.
77
-	 *
78
-	 * @since 1.0.13
79
-	 *
80
-	 * @return array Collection parameters.
81
-	 */
82
-	public function get_collection_params() {
83
-
84
-		$params = array_merge(
85
-
86
-			parent::get_collection_params(),
87
-
88
-        	array(
89
-
90
-				// Item types
91
-				'type'                  => array(
92
-					'description'       => __( 'Type of items to fetch.', 'invoicing' ),
93
-					'type'              => array( 'array', 'string' ),
94
-					'default'           => 'any',
95
-					'validate_callback' => 'rest_validate_request_arg',
96
-					'sanitize_callback' => 'wpinv_parse_list',
97
-					'items'             => array(
98
-						'enum'          => array_merge( array( 'any' ), wpinv_item_types() ),
99
-						'type'          => 'string',
100
-					),
101
-				),
102
-
103
-			)
104
-		);
105
-
106
-		// Filter collection parameters for the items controller.
107
-		return apply_filters( 'getpaid_rest_items_collection_params', $params, $this );
108
-
109
-	}
110
-
111
-	/**
112
-	 * Determine the allowed query_vars for a get_items() response and
113
-	 * prepare for WP_Query.
114
-	 *
115
-	 * @param array           $prepared_args Prepared arguments.
116
-	 * @param WP_REST_Request $request Request object.
117
-	 * @return array          $query_args
118
-	 */
119
-	protected function prepare_items_query( $prepared_args = array(), $request = null ) {
120
-
121
-		$query_args = parent::prepare_items_query( $prepared_args );
122
-
123
-		// Retrieve items by type.
124
-		if ( ! in_array( 'any', $request['type'] ) ) {
125
-
126
-			if ( empty( $query_args['meta_query'] ) ) {
127
-				$query_args['meta_query'] = array();
128
-			}
129
-
130
-			$query_args['meta_query'][] = array(
131
-				'key'     => '_wpinv_type',
132
-				'value'   => implode( ',', $request['type'] ),
133
-				'compare' => 'IN',
134
-			);
135
-
136
-		}
137
-
138
-		return apply_filters( 'getpaid_rest_items_prepare_items_query', $query_args, $request, $this );
139
-
140
-	}
141
-
142
-	/**
143
-	 * Retrieves a valid list of post statuses.
144
-	 *
145
-	 * @since 1.0.15
146
-	 *
147
-	 * @return array A list of registered item statuses.
148
-	 */
149
-	public function get_post_statuses() {
150
-		return array( 'draft', 'pending', 'publish' );
151
-	}
152
-
153
-	/**
154
-	 * Checks if a key should be included in a response.
155
-	 *
156
-	 * @since  1.0.19
157
-	 * @param  WPInv_Item   $item  Item object.
158
-	 * @param  string       $field_key The key to check for.
159
-	 * @return bool
160
-	 */
161
-	public function object_supports_field( $item, $field_key ) {
162
-
163
-		if ( 'minimum_price' == $field_key && ! $item->user_can_set_their_price() ) {
164
-			return false;
165
-		}
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 ) {
168
-
169
-			if ( $key == $field_key && ! $item->is_recurring() ) {
170
-				return false;
171
-			}
172
-
173
-		}
174
-
175
-		foreach( wpinv_parse_list( 'trial_period trial_interval' ) as $key ) {
176
-
177
-			if ( $key == $field_key && ! $item->has_free_trial() ) {
178
-				return false;
179
-			}
180
-
181
-		}
154
+     * Checks if a key should be included in a response.
155
+     *
156
+     * @since  1.0.19
157
+     * @param  WPInv_Item   $item  Item object.
158
+     * @param  string       $field_key The key to check for.
159
+     * @return bool
160
+     */
161
+    public function object_supports_field( $item, $field_key ) {
162
+
163
+        if ( 'minimum_price' == $field_key && ! $item->user_can_set_their_price() ) {
164
+            return false;
165
+        }
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 ) {
168
+
169
+            if ( $key == $field_key && ! $item->is_recurring() ) {
170
+                return false;
171
+            }
172
+
173
+        }
174
+
175
+        foreach( wpinv_parse_list( 'trial_period trial_interval' ) as $key ) {
176
+
177
+            if ( $key == $field_key && ! $item->has_free_trial() ) {
178
+                return false;
179
+            }
180
+
181
+        }
182 182
 
183
-		return parent::object_supports_field( $item, $field_key );
184
-	}
183
+        return parent::object_supports_field( $item, $field_key );
184
+    }
185 185
 
186 186
 }
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
includes/api/class-wpinv-rest-discounts-controller.php 2 patches
Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -15,138 +15,138 @@
 block discarded – undo
15 15
 class WPInv_REST_Discounts_Controller extends GetPaid_REST_Posts_Controller {
16 16
 
17 17
     /**
18
-	 * Post type.
19
-	 *
20
-	 * @var string
21
-	 */
22
-	protected $post_type = 'wpi_discount';
23
-
24
-	/**
25
-	 * The base of this controller's route.
26
-	 *
27
-	 * @since 1.0.13
28
-	 * @var string
29
-	 */
30
-	protected $rest_base = 'discounts';
31
-
32
-	/** Contains this controller's class name.
33
-	 *
34
-	 * @var string
35
-	 */
36
-	public $crud_class = 'WPInv_Discount';
37
-
38
-	/**
39
-	 * Registers the routes for the objects of the controller.
40
-	 *
41
-	 * @since 1.0.19
42
-	 *
43
-	 * @see register_rest_route()
44
-	 */
45
-	public function register_namespace_routes( $namespace ) {
46
-
47
-		parent::register_namespace_routes( $namespace );
48
-
49
-		register_rest_route(
50
-			$this->namespace,
51
-			'/' . $this->rest_base . '/discount-types',
52
-			array(
53
-				array(
54
-					'methods'             => WP_REST_Server::READABLE,
55
-					'callback'            => array( $this, 'get_discount_types' ),
56
-					'permission_callback' => array( $this, 'get_items_permissions_check' ),
57
-				),
58
-			)
59
-		);
60
-
61
-	}
62
-
63
-	/**
64
-	 * Handles rest requests for discount types.
65
-	 *
66
-	 * @since 1.0.13
67
-	 *
68
-	 *
69
-	 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
70
-	 */
71
-	public function get_discount_types() {
72
-		return rest_ensure_response( wpinv_get_discount_types() );
73
-	}
18
+     * Post type.
19
+     *
20
+     * @var string
21
+     */
22
+    protected $post_type = 'wpi_discount';
74 23
 
75 24
     /**
76
-	 * Retrieves the query params for the discount collection.
77
-	 *
78
-	 * @since 1.0.13
79
-	 *
80
-	 * @return array Collection parameters.
81
-	 */
82
-	public function get_collection_params() {
83
-
84
-		$params = array_merge(
85
-
86
-			parent::get_collection_params(),
87
-
88
-        	array(
89
-
90
-				// Discount types
91
-				'type'                  => array(
92
-					'description'       => __( 'Type of discounts to fetch.', 'invoicing' ),
93
-					'type'              => array( 'array', 'string' ),
94
-					'default'           => 'any',
95
-					'validate_callback' => 'rest_validate_request_arg',
96
-					'sanitize_callback' => 'wpinv_parse_list',
97
-					'items'             => array(
98
-						'enum'          => array_merge( array( 'any' ), array_keys( wpinv_get_discount_types() ) ),
99
-						'type'          => 'string',
100
-					),
101
-				),
102
-
103
-			)
104
-		);
105
-
106
-		// Filter collection parameters for the discounts controller.
107
-		return apply_filters( 'getpaid_rest_discounts_collection_params', $params, $this );
108
-	}
109
-
110
-	/**
111
-	 * Determine the allowed query_vars for a get_items() response and
112
-	 * prepare for WP_Query.
113
-	 *
114
-	 * @param array           $prepared_args Prepared arguments.
115
-	 * @param WP_REST_Request $request Request object.
116
-	 * @return array          $query_args
117
-	 */
118
-	protected function prepare_items_query( $prepared_args = array(), $request = null ) {
119
-
120
-		$query_args = parent::prepare_items_query( $prepared_args );
121
-
122
-		// Retrieve items by type.
123
-		if ( ! in_array( 'any', $request['type'] ) ) {
124
-
125
-			if ( empty( $query_args['meta_query'] ) ) {
126
-				$query_args['meta_query'] = array();
127
-			}
128
-
129
-			$query_args['meta_query'][] = array(
130
-				'key'     => '_wpi_discount_type',
131
-				'value'   => implode( ',', $request['type'] ),
132
-				'compare' => 'IN',
133
-			);
134
-
135
-		}
136
-
137
-		return apply_filters( 'getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this );
138
-
139
-	}
140
-
141
-	/**
142
-	 * Retrieves a valid list of post statuses.
143
-	 *
144
-	 * @since 1.0.15
145
-	 *
146
-	 * @return array A list of registered item statuses.
147
-	 */
148
-	public function get_post_statuses() {
149
-		return array( 'publish', 'pending', 'draft', 'expired' );
150
-	}
25
+     * The base of this controller's route.
26
+     *
27
+     * @since 1.0.13
28
+     * @var string
29
+     */
30
+    protected $rest_base = 'discounts';
31
+
32
+    /** Contains this controller's class name.
33
+     *
34
+     * @var string
35
+     */
36
+    public $crud_class = 'WPInv_Discount';
37
+
38
+    /**
39
+     * Registers the routes for the objects of the controller.
40
+     *
41
+     * @since 1.0.19
42
+     *
43
+     * @see register_rest_route()
44
+     */
45
+    public function register_namespace_routes( $namespace ) {
46
+
47
+        parent::register_namespace_routes( $namespace );
48
+
49
+        register_rest_route(
50
+            $this->namespace,
51
+            '/' . $this->rest_base . '/discount-types',
52
+            array(
53
+                array(
54
+                    'methods'             => WP_REST_Server::READABLE,
55
+                    'callback'            => array( $this, 'get_discount_types' ),
56
+                    'permission_callback' => array( $this, 'get_items_permissions_check' ),
57
+                ),
58
+            )
59
+        );
60
+
61
+    }
62
+
63
+    /**
64
+     * Handles rest requests for discount types.
65
+     *
66
+     * @since 1.0.13
67
+     *
68
+     *
69
+     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
70
+     */
71
+    public function get_discount_types() {
72
+        return rest_ensure_response( wpinv_get_discount_types() );
73
+    }
74
+
75
+    /**
76
+     * Retrieves the query params for the discount collection.
77
+     *
78
+     * @since 1.0.13
79
+     *
80
+     * @return array Collection parameters.
81
+     */
82
+    public function get_collection_params() {
83
+
84
+        $params = array_merge(
85
+
86
+            parent::get_collection_params(),
87
+
88
+            array(
89
+
90
+                // Discount types
91
+                'type'                  => array(
92
+                    'description'       => __( 'Type of discounts to fetch.', 'invoicing' ),
93
+                    'type'              => array( 'array', 'string' ),
94
+                    'default'           => 'any',
95
+                    'validate_callback' => 'rest_validate_request_arg',
96
+                    'sanitize_callback' => 'wpinv_parse_list',
97
+                    'items'             => array(
98
+                        'enum'          => array_merge( array( 'any' ), array_keys( wpinv_get_discount_types() ) ),
99
+                        'type'          => 'string',
100
+                    ),
101
+                ),
102
+
103
+            )
104
+        );
105
+
106
+        // Filter collection parameters for the discounts controller.
107
+        return apply_filters( 'getpaid_rest_discounts_collection_params', $params, $this );
108
+    }
109
+
110
+    /**
111
+     * Determine the allowed query_vars for a get_items() response and
112
+     * prepare for WP_Query.
113
+     *
114
+     * @param array           $prepared_args Prepared arguments.
115
+     * @param WP_REST_Request $request Request object.
116
+     * @return array          $query_args
117
+     */
118
+    protected function prepare_items_query( $prepared_args = array(), $request = null ) {
119
+
120
+        $query_args = parent::prepare_items_query( $prepared_args );
121
+
122
+        // Retrieve items by type.
123
+        if ( ! in_array( 'any', $request['type'] ) ) {
124
+
125
+            if ( empty( $query_args['meta_query'] ) ) {
126
+                $query_args['meta_query'] = array();
127
+            }
128
+
129
+            $query_args['meta_query'][] = array(
130
+                'key'     => '_wpi_discount_type',
131
+                'value'   => implode( ',', $request['type'] ),
132
+                'compare' => 'IN',
133
+            );
134
+
135
+        }
136
+
137
+        return apply_filters( 'getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this );
138
+
139
+    }
140
+
141
+    /**
142
+     * Retrieves a valid list of post statuses.
143
+     *
144
+     * @since 1.0.15
145
+     *
146
+     * @return array A list of registered item statuses.
147
+     */
148
+    public function get_post_statuses() {
149
+        return array( 'publish', 'pending', 'draft', 'expired' );
150
+    }
151 151
 
152 152
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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 discounts controller class.
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
52 52
 			array(
53 53
 				array(
54 54
 					'methods'             => WP_REST_Server::READABLE,
55
-					'callback'            => array( $this, 'get_discount_types' ),
56
-					'permission_callback' => array( $this, 'get_items_permissions_check' ),
55
+					'callback'            => array($this, 'get_discount_types'),
56
+					'permission_callback' => array($this, 'get_items_permissions_check'),
57 57
 				),
58 58
 			)
59 59
 		);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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_discount_types() {
72
-		return rest_ensure_response( wpinv_get_discount_types() );
72
+		return rest_ensure_response(wpinv_get_discount_types());
73 73
 	}
74 74
 
75 75
     /**
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 
90 90
 				// Discount types
91 91
 				'type'                  => array(
92
-					'description'       => __( 'Type of discounts to fetch.', 'invoicing' ),
93
-					'type'              => array( 'array', 'string' ),
92
+					'description'       => __('Type of discounts 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' ), array_keys( wpinv_get_discount_types() ) ),
98
+						'enum'          => array_merge(array('any'), array_keys(wpinv_get_discount_types())),
99 99
 						'type'          => 'string',
100 100
 					),
101 101
 				),
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		);
105 105
 
106 106
 		// Filter collection parameters for the discounts controller.
107
-		return apply_filters( 'getpaid_rest_discounts_collection_params', $params, $this );
107
+		return apply_filters('getpaid_rest_discounts_collection_params', $params, $this);
108 108
 	}
109 109
 
110 110
 	/**
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 	 * @param WP_REST_Request $request Request object.
116 116
 	 * @return array          $query_args
117 117
 	 */
118
-	protected function prepare_items_query( $prepared_args = array(), $request = null ) {
118
+	protected function prepare_items_query($prepared_args = array(), $request = null) {
119 119
 
120
-		$query_args = parent::prepare_items_query( $prepared_args );
120
+		$query_args = parent::prepare_items_query($prepared_args);
121 121
 
122 122
 		// Retrieve items by type.
123
-		if ( ! in_array( 'any', $request['type'] ) ) {
123
+		if (!in_array('any', $request['type'])) {
124 124
 
125
-			if ( empty( $query_args['meta_query'] ) ) {
125
+			if (empty($query_args['meta_query'])) {
126 126
 				$query_args['meta_query'] = array();
127 127
 			}
128 128
 
129 129
 			$query_args['meta_query'][] = array(
130 130
 				'key'     => '_wpi_discount_type',
131
-				'value'   => implode( ',', $request['type'] ),
131
+				'value'   => implode(',', $request['type']),
132 132
 				'compare' => 'IN',
133 133
 			);
134 134
 
135 135
 		}
136 136
 
137
-		return apply_filters( 'getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this );
137
+		return apply_filters('getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this);
138 138
 
139 139
 	}
140 140
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @return array A list of registered item statuses.
147 147
 	 */
148 148
 	public function get_post_statuses() {
149
-		return array( 'publish', 'pending', 'draft', 'expired' );
149
+		return array('publish', 'pending', 'draft', 'expired');
150 150
 	}
151 151
 
152 152
 }
Please login to merge, or discard this patch.
includes/data/discount-schema.php 2 patches
Indentation   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -13,168 +13,168 @@
 block discarded – undo
13 13
 
14 14
 return array(
15 15
 
16
-	'id'              => array(
17
-		'description' => __( 'Unique identifier for the discount.', 'invoicing' ),
18
-		'type'        => 'integer',
19
-		'context'     => array( 'view', 'edit', 'embed' ),
20
-		'readonly'    => true,
21
-	),
22
-
23
-	'status'          => array(
24
-		'description' => __( 'A named status for the discount.', 'invoicing' ),
25
-		'type'        => 'string',
26
-		'enum'        => array( 'publish', 'pending', 'draft', 'expired' ),
27
-		'default'     => 'draft',
28
-		'context'     => array( 'view', 'edit', 'embed' ),
29
-	),
30
-
31
-	'version'         => array(
32
-		'description' => __( 'Plugin version when the discount was created.', 'invoicing' ),
33
-		'type'        => 'string',
34
-		'context'     => array( 'view', 'edit', 'embed' ),
35
-		'readonly'    => true,
36
-	),
37
-
38
-	'date_created'    => array(
39
-		'description' => __( "The date the discount was created, in the site's timezone.", 'invoicing' ),
40
-		'type'        => 'string',
41
-		'context'     => array( 'view', 'edit', 'embed' ),
42
-	),
43
-
44
-	'date_created_gmt'    => array(
45
-		'description' => __( 'The GMT date the discount was created.', 'invoicing' ),
46
-		'type'        => 'string',
47
-		'context'     => array( 'view', 'edit', 'embed' ),
48
-		'readonly'    => true,
49
-	),
50
-
51
-	'date_modified'   => array(
52
-		'description' => __( "The date the discount was last modified, in the site's timezone.", 'invoicing' ),
53
-		'type'        => 'string',
54
-		'context'     => array( 'view', 'edit', 'embed' ),
55
-		'readonly'    => true,
56
-	),
57
-
58
-	'date_modified_gmt'    => array(
59
-		'description' => __( 'The GMT date the discount was last modified.', 'invoicing' ),
60
-		'type'        => 'string',
61
-		'context'     => array( 'view', 'edit', 'embed' ),
62
-		'readonly'    => true,
63
-	),
64
-
65
-	'name'			  => array(
66
-		'description' => __( 'The discount name.', 'invoicing' ),
67
-		'type'        => 'string',
68
-		'context'     => array( 'view', 'edit', 'embed' ),
69
-	),
70
-
71
-	'description'     => array(
72
-		'description' => __( 'A description of what the discount is all about.', 'invoicing' ),
73
-		'type'        => 'string',
74
-		'context'     => array( 'view', 'edit', 'embed' ),
75
-	),
76
-
77
-	'code'            => array(
78
-		'description' => __( 'The discount code.', 'invoicing' ),
79
-		'type'        => 'string',
80
-		'context'     => array( 'view', 'edit', 'embed' ),
81
-		'required'	  => true,
82
-	),
83
-
84
-	'type'            => array(
85
-		'description' => __( 'The type of discount.', 'invoicing' ),
86
-		'type'        => 'string',
87
-		'enum'        => array_keys( wpinv_get_discount_types() ),
88
-		'context'     => array( 'view', 'edit', 'embed' ),
89
-		'default'	  => 'percent',
90
-	),
91
-
92
-	'amount'        => array(
93
-		'description' => __( 'The discount value.', 'invoicing' ),
94
-		'type'        => 'number',
95
-		'context'     => array( 'view', 'edit', 'embed' ),
96
-		'required'	  => true,
97
-	),
98
-
99
-	'formatted_amount'        => array(
100
-		'description' => __( 'The formatted discount value.', 'invoicing' ),
101
-		'type'        => 'string',
102
-		'context'     => array( 'view', 'edit', 'embed' ),
103
-		'readonly'    => true,
104
-	),
105
-
106
-	'uses'            => array(
107
-		'description' => __( 'The number of times the discount has been used.', 'invoicing' ),
108
-		'type'        => 'integer',
109
-		'context'     => array( 'view', 'embed' ),
110
-		'readonly'    => true,
111
-	),
112
-
113
-	'max_uses'        => array(
114
-		'description' => __( 'The maximum number of times the discount can be used.', 'invoicing' ),
115
-		'type'        => 'integer',
116
-		'context'     => array( 'view', 'edit' ),
117
-	),
118
-
119
-	'usage'           => array(
120
-		'description' => __( "The discount's usage, i.e uses / max uses.", 'invoicing' ),
121
-		'type'        => 'string',
122
-		'context'     => array( 'view', 'embed' ),
123
-		'readonly'    => true,
124
-	),
125
-
126
-	'is_single_use'   => array(
127
-		'description' => __( 'Whether or not the discount can only be used once per user.', 'invoicing' ),
128
-		'type'        => 'boolean',
129
-		'context'     => array( 'view', 'edit' ),
130
-	),
131
-
132
-	'is_recurring'   => array(
133
-		'description' => __( 'Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing' ),
134
-		'type'        => 'boolean',
135
-		'context'     => array( 'view', 'edit' ),
136
-	),
137
-
138
-	'start_date'      => array(
139
-		'description' => __( 'The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing' ),
140
-		'type'        => 'string',
141
-		'context'     => array( 'view', 'edit' ),
142
-	),
143
-
144
-	'end_date'        => array(
145
-		'description' => __( 'The expiration date for the discount.', 'invoicing' ),
146
-		'type'        => 'string',
147
-		'context'     => array( 'view', 'edit' ),
148
-	),
149
-
150
-	'allowed_items'   => array(
151
-		'description' => __( 'Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing' ),
152
-		'type'        => 'array',
153
-		'context'     => array( 'view', 'edit' ),
154
-		'items'       => array(
155
-			'type'    => 'integer'
156
-		)
157
-	),
158
-
159
-	'excluded_items'  => array(
160
-		'description' => __( 'Items which are NOT allowed to use this discount.', 'invoicing' ),
161
-		'type'        => 'array',
162
-		'context'     => array( 'view', 'edit' ),
163
-		'items'       => array(
164
-			'type'    => 'integer'
165
-		)
166
-	),
16
+    'id'              => array(
17
+        'description' => __( 'Unique identifier for the discount.', 'invoicing' ),
18
+        'type'        => 'integer',
19
+        'context'     => array( 'view', 'edit', 'embed' ),
20
+        'readonly'    => true,
21
+    ),
22
+
23
+    'status'          => array(
24
+        'description' => __( 'A named status for the discount.', 'invoicing' ),
25
+        'type'        => 'string',
26
+        'enum'        => array( 'publish', 'pending', 'draft', 'expired' ),
27
+        'default'     => 'draft',
28
+        'context'     => array( 'view', 'edit', 'embed' ),
29
+    ),
30
+
31
+    'version'         => array(
32
+        'description' => __( 'Plugin version when the discount was created.', 'invoicing' ),
33
+        'type'        => 'string',
34
+        'context'     => array( 'view', 'edit', 'embed' ),
35
+        'readonly'    => true,
36
+    ),
37
+
38
+    'date_created'    => array(
39
+        'description' => __( "The date the discount was created, in the site's timezone.", 'invoicing' ),
40
+        'type'        => 'string',
41
+        'context'     => array( 'view', 'edit', 'embed' ),
42
+    ),
43
+
44
+    'date_created_gmt'    => array(
45
+        'description' => __( 'The GMT date the discount was created.', 'invoicing' ),
46
+        'type'        => 'string',
47
+        'context'     => array( 'view', 'edit', 'embed' ),
48
+        'readonly'    => true,
49
+    ),
50
+
51
+    'date_modified'   => array(
52
+        'description' => __( "The date the discount was last modified, in the site's timezone.", 'invoicing' ),
53
+        'type'        => 'string',
54
+        'context'     => array( 'view', 'edit', 'embed' ),
55
+        'readonly'    => true,
56
+    ),
57
+
58
+    'date_modified_gmt'    => array(
59
+        'description' => __( 'The GMT date the discount was last modified.', 'invoicing' ),
60
+        'type'        => 'string',
61
+        'context'     => array( 'view', 'edit', 'embed' ),
62
+        'readonly'    => true,
63
+    ),
64
+
65
+    'name'			  => array(
66
+        'description' => __( 'The discount name.', 'invoicing' ),
67
+        'type'        => 'string',
68
+        'context'     => array( 'view', 'edit', 'embed' ),
69
+    ),
70
+
71
+    'description'     => array(
72
+        'description' => __( 'A description of what the discount is all about.', 'invoicing' ),
73
+        'type'        => 'string',
74
+        'context'     => array( 'view', 'edit', 'embed' ),
75
+    ),
76
+
77
+    'code'            => array(
78
+        'description' => __( 'The discount code.', 'invoicing' ),
79
+        'type'        => 'string',
80
+        'context'     => array( 'view', 'edit', 'embed' ),
81
+        'required'	  => true,
82
+    ),
83
+
84
+    'type'            => array(
85
+        'description' => __( 'The type of discount.', 'invoicing' ),
86
+        'type'        => 'string',
87
+        'enum'        => array_keys( wpinv_get_discount_types() ),
88
+        'context'     => array( 'view', 'edit', 'embed' ),
89
+        'default'	  => 'percent',
90
+    ),
91
+
92
+    'amount'        => array(
93
+        'description' => __( 'The discount value.', 'invoicing' ),
94
+        'type'        => 'number',
95
+        'context'     => array( 'view', 'edit', 'embed' ),
96
+        'required'	  => true,
97
+    ),
98
+
99
+    'formatted_amount'        => array(
100
+        'description' => __( 'The formatted discount value.', 'invoicing' ),
101
+        'type'        => 'string',
102
+        'context'     => array( 'view', 'edit', 'embed' ),
103
+        'readonly'    => true,
104
+    ),
105
+
106
+    'uses'            => array(
107
+        'description' => __( 'The number of times the discount has been used.', 'invoicing' ),
108
+        'type'        => 'integer',
109
+        'context'     => array( 'view', 'embed' ),
110
+        'readonly'    => true,
111
+    ),
112
+
113
+    'max_uses'        => array(
114
+        'description' => __( 'The maximum number of times the discount can be used.', 'invoicing' ),
115
+        'type'        => 'integer',
116
+        'context'     => array( 'view', 'edit' ),
117
+    ),
118
+
119
+    'usage'           => array(
120
+        'description' => __( "The discount's usage, i.e uses / max uses.", 'invoicing' ),
121
+        'type'        => 'string',
122
+        'context'     => array( 'view', 'embed' ),
123
+        'readonly'    => true,
124
+    ),
125
+
126
+    'is_single_use'   => array(
127
+        'description' => __( 'Whether or not the discount can only be used once per user.', 'invoicing' ),
128
+        'type'        => 'boolean',
129
+        'context'     => array( 'view', 'edit' ),
130
+    ),
131
+
132
+    'is_recurring'   => array(
133
+        'description' => __( 'Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing' ),
134
+        'type'        => 'boolean',
135
+        'context'     => array( 'view', 'edit' ),
136
+    ),
137
+
138
+    'start_date'      => array(
139
+        'description' => __( 'The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing' ),
140
+        'type'        => 'string',
141
+        'context'     => array( 'view', 'edit' ),
142
+    ),
143
+
144
+    'end_date'        => array(
145
+        'description' => __( 'The expiration date for the discount.', 'invoicing' ),
146
+        'type'        => 'string',
147
+        'context'     => array( 'view', 'edit' ),
148
+    ),
149
+
150
+    'allowed_items'   => array(
151
+        'description' => __( 'Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing' ),
152
+        'type'        => 'array',
153
+        'context'     => array( 'view', 'edit' ),
154
+        'items'       => array(
155
+            'type'    => 'integer'
156
+        )
157
+    ),
158
+
159
+    'excluded_items'  => array(
160
+        'description' => __( 'Items which are NOT allowed to use this discount.', 'invoicing' ),
161
+        'type'        => 'array',
162
+        'context'     => array( 'view', 'edit' ),
163
+        'items'       => array(
164
+            'type'    => 'integer'
165
+        )
166
+    ),
167 167
 	
168
-	'minimum_total'   => array(
169
-		'description' => __( 'The minimum total needed to use this invoice.', 'invoicing' ),
170
-		'type'        => 'number',
171
-		'context'     => array( 'view', 'edit' ),
172
-	),
173
-
174
-	'maximum_total'   => array(
175
-		'description' => __( 'The maximum total needed to use this invoice.', 'invoicing' ),
176
-		'type'        => 'number',
177
-		'context'     => array( 'view', 'edit' ),
178
-	),
168
+    'minimum_total'   => array(
169
+        'description' => __( 'The minimum total needed to use this invoice.', 'invoicing' ),
170
+        'type'        => 'number',
171
+        'context'     => array( 'view', 'edit' ),
172
+    ),
173
+
174
+    'maximum_total'   => array(
175
+        'description' => __( 'The maximum total needed to use this invoice.', 'invoicing' ),
176
+        'type'        => 'number',
177
+        'context'     => array( 'view', 'edit' ),
178
+    ),
179 179
 
180 180
 );
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -9,172 +9,172 @@
 block discarded – undo
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 discount.', 'invoicing' ),
17
+		'description' => __('Unique identifier for the discount.', '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
 	'status'          => array(
24
-		'description' => __( 'A named status for the discount.', 'invoicing' ),
24
+		'description' => __('A named status for the discount.', 'invoicing'),
25 25
 		'type'        => 'string',
26
-		'enum'        => array( 'publish', 'pending', 'draft', 'expired' ),
26
+		'enum'        => array('publish', 'pending', 'draft', 'expired'),
27 27
 		'default'     => 'draft',
28
-		'context'     => array( 'view', 'edit', 'embed' ),
28
+		'context'     => array('view', 'edit', 'embed'),
29 29
 	),
30 30
 
31 31
 	'version'         => array(
32
-		'description' => __( 'Plugin version when the discount was created.', 'invoicing' ),
32
+		'description' => __('Plugin version when the discount was created.', 'invoicing'),
33 33
 		'type'        => 'string',
34
-		'context'     => array( 'view', 'edit', 'embed' ),
34
+		'context'     => array('view', 'edit', 'embed'),
35 35
 		'readonly'    => true,
36 36
 	),
37 37
 
38 38
 	'date_created'    => array(
39
-		'description' => __( "The date the discount was created, in the site's timezone.", 'invoicing' ),
39
+		'description' => __("The date the discount was created, in the site's timezone.", 'invoicing'),
40 40
 		'type'        => 'string',
41
-		'context'     => array( 'view', 'edit', 'embed' ),
41
+		'context'     => array('view', 'edit', 'embed'),
42 42
 	),
43 43
 
44 44
 	'date_created_gmt'    => array(
45
-		'description' => __( 'The GMT date the discount was created.', 'invoicing' ),
45
+		'description' => __('The GMT date the discount was created.', '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
 	'date_modified'   => array(
52
-		'description' => __( "The date the discount was last modified, in the site's timezone.", 'invoicing' ),
52
+		'description' => __("The date the discount was last modified, in the site's timezone.", '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
 	'date_modified_gmt'    => array(
59
-		'description' => __( 'The GMT date the discount was last modified.', 'invoicing' ),
59
+		'description' => __('The GMT date the discount was last modified.', 'invoicing'),
60 60
 		'type'        => 'string',
61
-		'context'     => array( 'view', 'edit', 'embed' ),
61
+		'context'     => array('view', 'edit', 'embed'),
62 62
 		'readonly'    => true,
63 63
 	),
64 64
 
65 65
 	'name'			  => array(
66
-		'description' => __( 'The discount name.', 'invoicing' ),
66
+		'description' => __('The discount name.', 'invoicing'),
67 67
 		'type'        => 'string',
68
-		'context'     => array( 'view', 'edit', 'embed' ),
68
+		'context'     => array('view', 'edit', 'embed'),
69 69
 	),
70 70
 
71 71
 	'description'     => array(
72
-		'description' => __( 'A description of what the discount is all about.', 'invoicing' ),
72
+		'description' => __('A description of what the discount is all about.', 'invoicing'),
73 73
 		'type'        => 'string',
74
-		'context'     => array( 'view', 'edit', 'embed' ),
74
+		'context'     => array('view', 'edit', 'embed'),
75 75
 	),
76 76
 
77 77
 	'code'            => array(
78
-		'description' => __( 'The discount code.', 'invoicing' ),
78
+		'description' => __('The discount code.', 'invoicing'),
79 79
 		'type'        => 'string',
80
-		'context'     => array( 'view', 'edit', 'embed' ),
80
+		'context'     => array('view', 'edit', 'embed'),
81 81
 		'required'	  => true,
82 82
 	),
83 83
 
84 84
 	'type'            => array(
85
-		'description' => __( 'The type of discount.', 'invoicing' ),
85
+		'description' => __('The type of discount.', 'invoicing'),
86 86
 		'type'        => 'string',
87
-		'enum'        => array_keys( wpinv_get_discount_types() ),
88
-		'context'     => array( 'view', 'edit', 'embed' ),
87
+		'enum'        => array_keys(wpinv_get_discount_types()),
88
+		'context'     => array('view', 'edit', 'embed'),
89 89
 		'default'	  => 'percent',
90 90
 	),
91 91
 
92 92
 	'amount'        => array(
93
-		'description' => __( 'The discount value.', 'invoicing' ),
93
+		'description' => __('The discount value.', 'invoicing'),
94 94
 		'type'        => 'number',
95
-		'context'     => array( 'view', 'edit', 'embed' ),
95
+		'context'     => array('view', 'edit', 'embed'),
96 96
 		'required'	  => true,
97 97
 	),
98 98
 
99 99
 	'formatted_amount'        => array(
100
-		'description' => __( 'The formatted discount value.', 'invoicing' ),
100
+		'description' => __('The formatted discount value.', 'invoicing'),
101 101
 		'type'        => 'string',
102
-		'context'     => array( 'view', 'edit', 'embed' ),
102
+		'context'     => array('view', 'edit', 'embed'),
103 103
 		'readonly'    => true,
104 104
 	),
105 105
 
106 106
 	'uses'            => array(
107
-		'description' => __( 'The number of times the discount has been used.', 'invoicing' ),
107
+		'description' => __('The number of times the discount has been used.', 'invoicing'),
108 108
 		'type'        => 'integer',
109
-		'context'     => array( 'view', 'embed' ),
109
+		'context'     => array('view', 'embed'),
110 110
 		'readonly'    => true,
111 111
 	),
112 112
 
113 113
 	'max_uses'        => array(
114
-		'description' => __( 'The maximum number of times the discount can be used.', 'invoicing' ),
114
+		'description' => __('The maximum number of times the discount can be used.', 'invoicing'),
115 115
 		'type'        => 'integer',
116
-		'context'     => array( 'view', 'edit' ),
116
+		'context'     => array('view', 'edit'),
117 117
 	),
118 118
 
119 119
 	'usage'           => array(
120
-		'description' => __( "The discount's usage, i.e uses / max uses.", 'invoicing' ),
120
+		'description' => __("The discount's usage, i.e uses / max uses.", 'invoicing'),
121 121
 		'type'        => 'string',
122
-		'context'     => array( 'view', 'embed' ),
122
+		'context'     => array('view', 'embed'),
123 123
 		'readonly'    => true,
124 124
 	),
125 125
 
126 126
 	'is_single_use'   => array(
127
-		'description' => __( 'Whether or not the discount can only be used once per user.', 'invoicing' ),
127
+		'description' => __('Whether or not the discount can only be used once per user.', 'invoicing'),
128 128
 		'type'        => 'boolean',
129
-		'context'     => array( 'view', 'edit' ),
129
+		'context'     => array('view', 'edit'),
130 130
 	),
131 131
 
132 132
 	'is_recurring'   => array(
133
-		'description' => __( 'Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing' ),
133
+		'description' => __('Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing'),
134 134
 		'type'        => 'boolean',
135
-		'context'     => array( 'view', 'edit' ),
135
+		'context'     => array('view', 'edit'),
136 136
 	),
137 137
 
138 138
 	'start_date'      => array(
139
-		'description' => __( 'The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing' ),
139
+		'description' => __('The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing'),
140 140
 		'type'        => 'string',
141
-		'context'     => array( 'view', 'edit' ),
141
+		'context'     => array('view', 'edit'),
142 142
 	),
143 143
 
144 144
 	'end_date'        => array(
145
-		'description' => __( 'The expiration date for the discount.', 'invoicing' ),
145
+		'description' => __('The expiration date for the discount.', 'invoicing'),
146 146
 		'type'        => 'string',
147
-		'context'     => array( 'view', 'edit' ),
147
+		'context'     => array('view', 'edit'),
148 148
 	),
149 149
 
150 150
 	'allowed_items'   => array(
151
-		'description' => __( 'Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing' ),
151
+		'description' => __('Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing'),
152 152
 		'type'        => 'array',
153
-		'context'     => array( 'view', 'edit' ),
153
+		'context'     => array('view', 'edit'),
154 154
 		'items'       => array(
155 155
 			'type'    => 'integer'
156 156
 		)
157 157
 	),
158 158
 
159 159
 	'excluded_items'  => array(
160
-		'description' => __( 'Items which are NOT allowed to use this discount.', 'invoicing' ),
160
+		'description' => __('Items which are NOT allowed to use this discount.', 'invoicing'),
161 161
 		'type'        => 'array',
162
-		'context'     => array( 'view', 'edit' ),
162
+		'context'     => array('view', 'edit'),
163 163
 		'items'       => array(
164 164
 			'type'    => 'integer'
165 165
 		)
166 166
 	),
167 167
 	
168 168
 	'minimum_total'   => array(
169
-		'description' => __( 'The minimum total needed to use this invoice.', 'invoicing' ),
169
+		'description' => __('The minimum total needed to use this invoice.', 'invoicing'),
170 170
 		'type'        => 'number',
171
-		'context'     => array( 'view', 'edit' ),
171
+		'context'     => array('view', 'edit'),
172 172
 	),
173 173
 
174 174
 	'maximum_total'   => array(
175
-		'description' => __( 'The maximum total needed to use this invoice.', 'invoicing' ),
175
+		'description' => __('The maximum total needed to use this invoice.', 'invoicing'),
176 176
 		'type'        => 'number',
177
-		'context'     => array( 'view', 'edit' ),
177
+		'context'     => array('view', 'edit'),
178 178
 	),
179 179
 
180 180
 );
Please login to merge, or discard this patch.
uninstall.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
-	exit;
4
+    exit;
5 5
 }
6 6
 
7 7
 global $wpdb;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
3
+if (!defined('WP_UNINSTALL_PLUGIN')) {
4 4
 	exit;
5 5
 }
6 6
 
7 7
 global $wpdb;
8 8
 
9
-if ( get_option( 'wpinv_remove_data_on_invoice_unistall' ) ) {
9
+if (get_option('wpinv_remove_data_on_invoice_unistall')) {
10 10
 
11 11
     // Fetch settings.
12
-    $settings = get_option( 'wpinv_settings' );
12
+    $settings = get_option('wpinv_settings');
13 13
 
14 14
     // Delete pages.
15
-    $pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' );
16
-    foreach ( $pages as $page ) {
17
-        if ( is_array( $settings ) && ! empty( $settings[ $page ] ) ) {
18
-            wp_delete_post( $settings[ $page ], true );
15
+    $pages = array('checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page');
16
+    foreach ($pages as $page) {
17
+        if (is_array($settings) && !empty($settings[$page])) {
18
+            wp_delete_post($settings[$page], true);
19 19
         }
20 20
     }
21 21
 
22 22
     // Delete options.
23
-    $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';" );
23
+    $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';");
24 24
 
25 25
     // Delete posts.
26 26
     $wpdb->query(
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     );
50 50
 
51 51
     // Cleanup Cron Schedule
52
-    wp_clear_scheduled_hook( 'wp_session_garbage_collection' );
53
-    wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
54
-    wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
52
+    wp_clear_scheduled_hook('wp_session_garbage_collection');
53
+    wp_clear_scheduled_hook('wpinv_register_schedule_event_twicedaily');
54
+    wp_clear_scheduled_hook('wpinv_register_schedule_event_daily');
55 55
 
56 56
     // Clear any cached data that has been removed
57 57
     wp_cache_flush();
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
         "{$wpdb->prefix}getpaid_invoice_items",
64 64
     );
65 65
 
66
-    foreach ( $tables as $table ) {
67
-        $wpdb->query( "DROP TABLE IF EXISTS {$table}" );
66
+    foreach ($tables as $table) {
67
+        $wpdb->query("DROP TABLE IF EXISTS {$table}");
68 68
     }
69 69
 
70 70
 }
Please login to merge, or discard this patch.