Commit Graph

459 Commits

Author SHA1 Message Date
Claudio Sanches a215c4ed3c [API] Fixed variation without parent for v2 2015-07-30 21:53:00 -03:00
nils-fredrik@maksimer.no f4db67bcbc Fix for #8691: Variation without parent will not cause 500. 2015-07-30 23:32:24 +02:00
Claudio Sanches 09145181e5 [API] Removed deprecated products/sku endpoint 2015-07-30 17:35:14 -03:00
Claudio Sanches 948c5c9cfc Fixed the sanitization for text-based default attributes 2015-07-22 21:40:06 -03:00
Claudio Sanches aa263ddc1e [API] Updated variable product attributes update for the new standard of WC 2.4 2015-07-22 21:07:05 -03:00
Claudio Sanches aec1e28549 [API] Check if REDIRECT_URL exists, closes #8632 2015-07-21 20:08:19 -03:00
Claudio Sanches 3a0d2f7c89 [API] Fixed edit coupon description, closes #8614 2015-07-20 12:49:21 -03:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -03:00
Claudio Sanches 83bdf82767 Fixed docblock for WC_API_Orders::get_variation_id() 2015-07-16 16:14:39 -03:00
Claudio Sanches e0be5a2e9f Added truncated consumer key and last access fields in woocommerce_api_keys table 2015-07-16 15:42:00 -03:00
Claudio Sanches a01660cbba Fixed WC_API_Products::clear_product() 2015-07-10 10:49:18 -03:00
Mike Jolley d5a74203c2 Only need one numeric check 2015-07-10 10:48:29 +01:00
nils-fredrik@maksimer.no 3c2b54b360 Fix for #8550 2015-07-10 09:32:10 +02:00
Claudio Sanches 349fc2f665 [API] post__in filter for v2 2015-06-23 11:51:40 -03:00
Claudio Sanches e003b7803f Merge pull request #8440 from kilbot/patch-4
Add post__not_in filter for REST API requests
2015-06-23 11:50:36 -03:00
Claudio Sanches 9dc28be577 Support HTTP_X_HTTP_METHOD_OVERRIDE in API old versions 2015-06-23 11:49:19 -03:00
Paul Kilmurray 9b848fb1bd Add post__not_in filter for REST API requests
To match the `post__in` filter above
2015-06-23 20:48:19 +08:00
Paul Kilmurray a030ab52cb Allow HTTP method to be overwritten by HTTP_X_HTTP_METHOD_OVERRIDE
For the same reasons [outlined here](https://github.com/WP-API/WP-API/issues/964), ie: Backbone uses X-HTTP-Method-Override.
2015-06-23 20:42:39 +08:00
Mike Jolley 817e5355fd Pass $item object, not item meta array
Closes #8419
2015-06-23 10:24:13 +01:00
Claudio Sanches b43abff674 Merge pull request #8415 from justinshreve/oauth-7928
Fix issues with our OAuth implementation, including nonconformance to spec. Closes #7928
2015-06-22 15:00:51 -03:00
Justin Shreve 819a4fae0d wp_endswith doesn't actually exist (its a wpcom/jetpackism) - update with a simple substr check 2015-06-22 17:58:50 +00:00
Justin Shreve fcab013d53 $enc_type for http_build_query() is only available in PHP 5.4+
go back to a normalization approach
2015-06-19 23:03:45 +00:00
Justin Shreve 482303c0f9 Don't convert nested parameters to strings.
Switch to the native http_build_query instead of our own normalize function.
2015-06-19 16:11:17 +00:00
Justin Shreve 59bc17e0cb Check before building the current URL to see if a trailing slash should be appended or not, that way if a request includes one, the signature still matches. 2015-06-19 16:05:23 +00:00
Justin Shreve c43f9157c3 When generating the signature to compare, append a trailing &.
The OAuth spec (http://tools.ietf.org/html/rfc5849#section-3.4.2) states that a & character must be present, even if a token secret is not a part of the request.
2015-06-19 15:05:51 +00:00
Justin Shreve 9e2f0f55d8 Remove reauth endpoint. It's not going to work the way we want it to. If clients need to log out (like a browser), they can clear the sessions per browser. Also returns JSON error when auth is not returned correctly. 2015-06-19 13:42:10 +00:00
Justin Shreve 8da19e4dae Provide some directions in the Basic auth input box so the user knows where to provide the API key and secret. 2015-06-19 13:42:10 +00:00
Justin Shreve d63f7d014f Implement basic auth improvements and query string fall back.
If the key and secret query strings are provided, do auth based on those. If not, and the Basic auth headers are set, do full basic auth (including sending the correct headers).
Also implements a /reauth endpoint for basic auth.
2015-06-19 13:42:10 +00:00
Justin Shreve c9a2611d33 Version off the current api files into a v2 folder. 2015-06-19 13:42:10 +00:00
Paul Kilmurray 3538d02ca9 Allow decimal stock quantity via REST API
The WooCommerce default is to validate stock quantity as integer, however some users find it useful to override this to allow any float quantity, eg: 
```php
remove_filter('woocommerce_stock_amount', 'intval');
add_filter( 'woocommerce_stock_amount', 'floatval' );
```

Currently the API forces stock quantities to integer, this change will allow decimal quantities.
2015-06-19 12:07:10 +08:00
Justin Shreve e1130005a5 When figuring out if to store a sale price, make sure $date_from is set to "today" when blank. The date meta was previously set, but the check to set the actual sale price saw $date_from as empty. 2015-06-16 20:00:16 +00:00
Justin Shreve 66ccc8a75c Only run the file URL through esc_url_raw if it looks like an absolute URL, otherwise if it is a shortcode or relative URL, continue to use wc_clean. 2015-06-10 16:12:10 +00:00
Justin Shreve 7c3774e65f For file URLs and images, run the URL through esc_url_raw rather than wc_clean (which removes/strips things like entities). 2015-06-10 15:34:36 +00:00
Claudio Sanches c9c3be6d3e [API] Use settings to auto generate passwords or not, closes #8342 2015-06-10 10:56:25 -03:00
Claudio Sanches eefd9a24f1 Merge pull request #8330 from justinshreve/api-tax-rounding-8328
Stop using the frontend display setting for tax rounding in the API (#8328)
2015-06-09 13:09:46 -03:00
Claudio Sanches c02052a206 [API] Stop undefined index erros for variations in orders endpoint
@justinshreve
2015-06-09 12:39:37 -03:00
Justin Shreve 1d8b6a58d6 Avoid rounding subtotal_tax and total_tax. Don't call wc_round_tax_total for subtotal, and avoid the call to get_line_tax directly which also calls wc_round_tax_total. 2015-06-09 15:06:30 +00:00
Justin Shreve 651b65f28e Add a unit test for get_variation_id so we know we are getting back the IDs that we want 2015-06-09 13:02:02 +00:00
Justin Shreve 937f93faa6 Clean up some naming and add a clarifying comment for the attribute & pa_ stripping. 2015-06-09 12:41:06 +00:00
Justin Shreve 251636c02e First pass at figuring out what the variation ID is based on variation information being passed in via the API. 2015-06-09 12:41:06 +00:00
Mike Jolley 34f8536b20 Merge pull request #8306 from krautnerds/fix-customer-rest-api-pagination
Fixed pagination headers for customer REST API
2015-06-09 11:43:27 +01:00
Claudio Sanches 91bb8c7ba9 Updated the api authentication 2015-06-08 19:58:38 -03:00
Florian Ludwig 994e4104e9 Fixed pagination headers for customer REST API
The old code didn’t ever work in my opinion, because WP_User_Query has
no attributes page and total_pages
2015-06-05 19:28:58 +02:00
Claudio Sanches 6fee82b377 [API] Added display and image info in product category endpoint, closes #8298 2015-06-05 11:37:46 -03:00
Claudio Sanches 9eb3b6ddf9 Changed all requests with wp_remote_* to wp_safe_remote_* 2015-06-01 13:28:55 +01:00
Claudio Sanches b2711f3d64 [API] Fixed products tags in write-mode 2015-05-29 10:05:15 -03:00
Claudio Sanches 88003436a6 [API] Add properly sanitization for categories and tags in products endpoint, closes #8251 2015-05-29 10:04:02 -03:00
Claudio Sanches ebdcb0d9e8 [2.3] [API] Fixed subtotal_tax round and decimal dp, closes #8140 2015-05-27 16:18:02 -03:00
Claudio Sanches 9c5cd0e525 [API] Accept dashes in products/sku endpoint, closes #8220 2015-05-25 10:22:59 -03:00
Claudio Sanches e106d57947 Merged #8021 2015-05-18 16:53:04 -03:00