class-wc-api-authentication.php
5 years ago
class-wc-api-coupons.php
5 years ago
class-wc-api-customers.php
5 years ago
class-wc-api-exception.php
5 years ago
class-wc-api-json-handler.php
5 years ago
class-wc-api-orders.php
4 years ago
class-wc-api-products.php
3 years ago
class-wc-api-reports.php
5 years ago
class-wc-api-resource.php
4 years ago
class-wc-api-server.php
5 years ago
class-wc-api-taxes.php
4 years ago
class-wc-api-webhooks.php
3 years ago
interface-wc-api-handler.php
5 years ago
interface-wc-api-handler.php
48 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce API |
| 4 | * |
| 5 | * Defines an interface that API request/response handlers should implement |
| 6 | * |
| 7 | * @author WooThemes |
| 8 | * @category API |
| 9 | * @package WooCommerce\RestApi |
| 10 | * @since 2.1 |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; // Exit if accessed directly |
| 15 | } |
| 16 | |
| 17 | interface WC_API_Handler { |
| 18 | |
| 19 | /** |
| 20 | * Get the content type for the response |
| 21 | * |
| 22 | * This should return the proper HTTP content-type for the response |
| 23 | * |
| 24 | * @since 2.1 |
| 25 | * @return string |
| 26 | */ |
| 27 | public function get_content_type(); |
| 28 | |
| 29 | /** |
| 30 | * Parse the raw request body entity into an array |
| 31 | * |
| 32 | * @since 2.1 |
| 33 | * @param string $data |
| 34 | * @return array |
| 35 | */ |
| 36 | public function parse_body( $data ); |
| 37 | |
| 38 | /** |
| 39 | * Generate a response from an array of data |
| 40 | * |
| 41 | * @since 2.1 |
| 42 | * @param array $data |
| 43 | * @return string |
| 44 | */ |
| 45 | public function generate_response( $data ); |
| 46 | |
| 47 | } |
| 48 |