| @@ 470-476 (lines=7) @@ | ||
| 467 | * @uses Give_API::output() |
|
| 468 | * @since 1.1 |
|
| 469 | */ |
|
| 470 | private function missing_auth() { |
|
| 471 | $error = array(); |
|
| 472 | $error['error'] = __( 'You must specify both a token and API key.', 'give' ); |
|
| 473 | ||
| 474 | $this->data = $error; |
|
| 475 | $this->output( 401 ); |
|
| 476 | } |
|
| 477 | ||
| 478 | /** |
|
| 479 | * Displays an authentication failed error if the user failed to provide valid |
|
| @@ 487-493 (lines=7) @@ | ||
| 484 | * @uses Give_API::output() |
|
| 485 | * @return void |
|
| 486 | */ |
|
| 487 | private function invalid_auth() { |
|
| 488 | $error = array(); |
|
| 489 | $error['error'] = __( 'Your request could not be authenticated.', 'give' ); |
|
| 490 | ||
| 491 | $this->data = $error; |
|
| 492 | $this->output( 403 ); |
|
| 493 | } |
|
| 494 | ||
| 495 | /** |
|
| 496 | * Displays an invalid API key error if the API key provided couldn't be |
|
| @@ 504-510 (lines=7) @@ | ||
| 501 | * @uses Give_API::output() |
|
| 502 | * @return void |
|
| 503 | */ |
|
| 504 | private function invalid_key() { |
|
| 505 | $error = array(); |
|
| 506 | $error['error'] = __( 'Invalid API key.', 'give' ); |
|
| 507 | ||
| 508 | $this->data = $error; |
|
| 509 | $this->output( 403 ); |
|
| 510 | } |
|
| 511 | ||
| 512 | /** |
|
| 513 | * Displays an invalid version error if the version number passed isn't valid |
|
| @@ 520-526 (lines=7) @@ | ||
| 517 | * @uses Give_API::output() |
|
| 518 | * @return void |
|
| 519 | */ |
|
| 520 | private function invalid_version() { |
|
| 521 | $error = array(); |
|
| 522 | $error['error'] = __( 'Invalid API version.', 'give' ); |
|
| 523 | ||
| 524 | $this->data = $error; |
|
| 525 | $this->output( 404 ); |
|
| 526 | } |
|
| 527 | ||
| 528 | /** |
|
| 529 | * Listens for the API and then processes the API requests |
|