OAuth
4 years ago
ApiConnectionException.php
4 years ago
ApiErrorException.php
4 years ago
AuthenticationException.php
4 years ago
BadMethodCallException.php
4 years ago
CardException.php
4 years ago
ExceptionInterface.php
4 years ago
IdempotencyException.php
4 years ago
InvalidArgumentException.php
4 years ago
InvalidRequestException.php
4 years ago
PermissionException.php
4 years ago
RateLimitException.php
4 years ago
SignatureVerificationException.php
4 years ago
UnexpectedValueException.php
4 years ago
UnknownApiErrorException.php
4 years ago
InvalidRequestException.php
61 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Stripe\Exception; |
| 4 | |
| 5 | /** |
| 6 | * InvalidRequestException is thrown when a request is initiated with invalid |
| 7 | * parameters. |
| 8 | */ |
| 9 | class InvalidRequestException extends ApiErrorException |
| 10 | { |
| 11 | protected $stripeParam; |
| 12 | |
| 13 | /** |
| 14 | * Creates a new InvalidRequestException exception. |
| 15 | * |
| 16 | * @param string $message the exception message |
| 17 | * @param null|int $httpStatus the HTTP status code |
| 18 | * @param null|string $httpBody the HTTP body as a string |
| 19 | * @param null|array $jsonBody the JSON deserialized body |
| 20 | * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders the HTTP headers array |
| 21 | * @param null|string $stripeCode the Stripe error code |
| 22 | * @param null|string $stripeParam the parameter related to the error |
| 23 | * |
| 24 | * @return InvalidRequestException |
| 25 | */ |
| 26 | public static function factory( |
| 27 | $message, |
| 28 | $httpStatus = null, |
| 29 | $httpBody = null, |
| 30 | $jsonBody = null, |
| 31 | $httpHeaders = null, |
| 32 | $stripeCode = null, |
| 33 | $stripeParam = null |
| 34 | ) { |
| 35 | $instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode); |
| 36 | $instance->setStripeParam($stripeParam); |
| 37 | |
| 38 | return $instance; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Gets the parameter related to the error. |
| 43 | * |
| 44 | * @return null|string |
| 45 | */ |
| 46 | public function getStripeParam() |
| 47 | { |
| 48 | return $this->stripeParam; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Sets the parameter related to the error. |
| 53 | * |
| 54 | * @param null|string $stripeParam |
| 55 | */ |
| 56 | public function setStripeParam($stripeParam) |
| 57 | { |
| 58 | $this->stripeParam = $stripeParam; |
| 59 | } |
| 60 | } |
| 61 |