Нет описания

class-wc-rest-wccom-site-installer-errors.php 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * WCCOM Site Installer Errors Class
  4. *
  5. * @package WooCommerce\WCCom\API
  6. * @since 3.9.0
  7. */
  8. defined( 'ABSPATH' ) || exit;
  9. /**
  10. * WCCOM Site Installer Errors Class
  11. *
  12. * Stores data for errors, returned by installer API.
  13. */
  14. class WC_REST_WCCOM_Site_Installer_Errors {
  15. /**
  16. * Not unauthenticated generic error
  17. */
  18. const NOT_AUTHENTICATED_CODE = 'not_authenticated';
  19. const NOT_AUTHENTICATED_MESSAGE = 'Authentication required';
  20. const NOT_AUTHENTICATED_HTTP_CODE = 401;
  21. /**
  22. * No access token provided
  23. */
  24. const NO_ACCESS_TOKEN_CODE = 'no_access_token';
  25. const NO_ACCESS_TOKEN_MESSAGE = 'No access token provided';
  26. const NO_ACCESS_TOKEN_HTTP_CODE = 400;
  27. /**
  28. * No signature provided
  29. */
  30. const NO_SIGNATURE_CODE = 'no_signature';
  31. const NO_SIGNATURE_MESSAGE = 'No signature provided';
  32. const NO_SIGNATURE_HTTP_CODE = 400;
  33. /**
  34. * Site not connected to WooCommerce.com
  35. */
  36. const SITE_NOT_CONNECTED_CODE = 'site_not_connnected';
  37. const SITE_NOT_CONNECTED_MESSAGE = 'Site not connected to WooCommerce.com';
  38. const SITE_NOT_CONNECTED_HTTP_CODE = 401;
  39. /**
  40. * Provided access token is not valid
  41. */
  42. const INVALID_TOKEN_CODE = 'invalid_token';
  43. const INVALID_TOKEN_MESSAGE = 'Invalid access token provided';
  44. const INVALID_TOKEN_HTTP_CODE = 401;
  45. /**
  46. * Request verification by provided signature failed
  47. */
  48. const REQUEST_VERIFICATION_FAILED_CODE = 'request_verification_failed';
  49. const REQUEST_VERIFICATION_FAILED_MESSAGE = 'Request verification by signature failed';
  50. const REQUEST_VERIFICATION_FAILED_HTTP_CODE = 400;
  51. /**
  52. * User doesn't exist
  53. */
  54. const USER_NOT_FOUND_CODE = 'user_not_found';
  55. const USER_NOT_FOUND_MESSAGE = 'Token owning user not found';
  56. const USER_NOT_FOUND_HTTP_CODE = 401;
  57. /**
  58. * No permissions error
  59. */
  60. const NO_PERMISSION_CODE = 'forbidden';
  61. const NO_PERMISSION_MESSAGE = 'You do not have permission to install plugin or theme';
  62. const NO_PERMISSION_HTTP_CODE = 403;
  63. }