2019-11-25 09:47:18 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* WCCOM Site Installer Errors Class
|
|
|
|
*
|
2020-08-05 20:49:10 +00:00
|
|
|
* @package WooCommerce\WCCom\API
|
2019-11-25 09:47:18 +00:00
|
|
|
* @since 3.9.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WCCOM Site Installer Errors Class
|
|
|
|
*
|
|
|
|
* Stores data for errors, returned by installer API.
|
|
|
|
*/
|
|
|
|
class WC_REST_WCCOM_Site_Installer_Errors {
|
|
|
|
|
2019-11-25 16:32:10 +00:00
|
|
|
/**
|
|
|
|
* Not unauthenticated generic error
|
|
|
|
*/
|
|
|
|
const NOT_AUTHENTICATED_CODE = 'not_authenticated';
|
|
|
|
const NOT_AUTHENTICATED_MESSAGE = 'Authentication required';
|
|
|
|
const NOT_AUTHENTICATED_HTTP_CODE = 401;
|
|
|
|
|
|
|
|
/**
|
2020-01-30 07:54:40 +00:00
|
|
|
* No access token provided
|
2019-11-25 16:32:10 +00:00
|
|
|
*/
|
2020-01-30 07:54:40 +00:00
|
|
|
const NO_ACCESS_TOKEN_CODE = 'no_access_token';
|
|
|
|
const NO_ACCESS_TOKEN_MESSAGE = 'No access token provided';
|
|
|
|
const NO_ACCESS_TOKEN_HTTP_CODE = 400;
|
2019-11-25 16:32:10 +00:00
|
|
|
|
|
|
|
/**
|
2020-01-30 07:54:40 +00:00
|
|
|
* No signature provided
|
2019-11-25 16:32:10 +00:00
|
|
|
*/
|
2020-01-30 07:54:40 +00:00
|
|
|
const NO_SIGNATURE_CODE = 'no_signature';
|
|
|
|
const NO_SIGNATURE_MESSAGE = 'No signature provided';
|
|
|
|
const NO_SIGNATURE_HTTP_CODE = 400;
|
2019-11-25 16:32:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Site not connected to WooCommerce.com
|
|
|
|
*/
|
|
|
|
const SITE_NOT_CONNECTED_CODE = 'site_not_connnected';
|
|
|
|
const SITE_NOT_CONNECTED_MESSAGE = 'Site not connected to WooCommerce.com';
|
|
|
|
const SITE_NOT_CONNECTED_HTTP_CODE = 401;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provided access token is not valid
|
|
|
|
*/
|
|
|
|
const INVALID_TOKEN_CODE = 'invalid_token';
|
|
|
|
const INVALID_TOKEN_MESSAGE = 'Invalid access token provided';
|
|
|
|
const INVALID_TOKEN_HTTP_CODE = 401;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request verification by provided signature failed
|
|
|
|
*/
|
|
|
|
const REQUEST_VERIFICATION_FAILED_CODE = 'request_verification_failed';
|
|
|
|
const REQUEST_VERIFICATION_FAILED_MESSAGE = 'Request verification by signature failed';
|
|
|
|
const REQUEST_VERIFICATION_FAILED_HTTP_CODE = 400;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User doesn't exist
|
|
|
|
*/
|
|
|
|
const USER_NOT_FOUND_CODE = 'user_not_found';
|
|
|
|
const USER_NOT_FOUND_MESSAGE = 'Token owning user not found';
|
|
|
|
const USER_NOT_FOUND_HTTP_CODE = 401;
|
|
|
|
|
2019-11-25 09:47:18 +00:00
|
|
|
/**
|
|
|
|
* No permissions error
|
|
|
|
*/
|
2019-11-25 16:32:10 +00:00
|
|
|
const NO_PERMISSION_CODE = 'forbidden';
|
2019-11-25 09:47:18 +00:00
|
|
|
const NO_PERMISSION_MESSAGE = 'You do not have permission to install plugin or theme';
|
2019-11-25 16:32:10 +00:00
|
|
|
const NO_PERMISSION_HTTP_CODE = 403;
|
2019-11-25 09:47:18 +00:00
|
|
|
}
|