wp-user-avatar
/
third-party
/
vendor
/
stripe
/
stripe-php
/
lib
/
Exception
/
InvalidRequestException.php
OAuth
2 months ago
ApiConnectionException.php
2 months ago
ApiErrorException.php
2 months ago
AuthenticationException.php
2 months ago
BadMethodCallException.php
2 months ago
CardException.php
2 months ago
ExceptionInterface.php
2 months ago
IdempotencyException.php
2 months ago
InvalidArgumentException.php
2 months ago
InvalidRequestException.php
2 months ago
PermissionException.php
2 months ago
RateLimitException.php
2 months ago
SignatureVerificationException.php
2 months ago
TemporarySessionExpiredException.php
2 months ago
UnexpectedValueException.php
2 months ago
UnknownApiErrorException.php
2 months ago
InvalidRequestException.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\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 | * Creates a new InvalidRequestException exception. |
| 14 | * |
| 15 | * @param string $message the exception message |
| 16 | * @param null|int $httpStatus the HTTP status code |
| 17 | * @param null|string $httpBody the HTTP body as a string |
| 18 | * @param null|array $jsonBody the JSON deserialized body |
| 19 | * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders the HTTP headers array |
| 20 | * @param null|string $stripeCode the Stripe error code |
| 21 | * @param null|string $stripeParam the parameter related to the error |
| 22 | * |
| 23 | * @return InvalidRequestException |
| 24 | */ |
| 25 | public static function factory($message, $httpStatus = null, $httpBody = null, $jsonBody = null, $httpHeaders = null, $stripeCode = null, $stripeParam = null) |
| 26 | { |
| 27 | $instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode); |
| 28 | $instance->setStripeParam($stripeParam); |
| 29 | return $instance; |
| 30 | } |
| 31 | /** |
| 32 | * Gets the parameter related to the error. |
| 33 | * |
| 34 | * @return null|string |
| 35 | */ |
| 36 | public function getStripeParam() |
| 37 | { |
| 38 | return $this->stripeParam; |
| 39 | } |
| 40 | /** |
| 41 | * Sets the parameter related to the error. |
| 42 | * |
| 43 | * @param null|string $stripeParam |
| 44 | */ |
| 45 | public function setStripeParam($stripeParam) |
| 46 | { |
| 47 | $this->stripeParam = $stripeParam; |
| 48 | } |
| 49 | } |
| 50 |