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
CardException.php
71 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Stripe\Exception; |
| 4 | |
| 5 | /** |
| 6 | * CardException is thrown when a user enters a card that can't be charged for |
| 7 | * some reason. |
| 8 | */ |
| 9 | class CardException extends ApiErrorException |
| 10 | { |
| 11 | protected $declineCode; |
| 12 | protected $stripeParam; |
| 13 | /** |
| 14 | * Creates a new CardException 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 $declineCode the decline code |
| 23 | * @param null|string $stripeParam the parameter related to the error |
| 24 | * |
| 25 | * @return CardException |
| 26 | */ |
| 27 | public static function factory($message, $httpStatus = null, $httpBody = null, $jsonBody = null, $httpHeaders = null, $stripeCode = null, $declineCode = null, $stripeParam = null) |
| 28 | { |
| 29 | $instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode); |
| 30 | $instance->setDeclineCode($declineCode); |
| 31 | $instance->setStripeParam($stripeParam); |
| 32 | return $instance; |
| 33 | } |
| 34 | /** |
| 35 | * Gets the decline code. |
| 36 | * |
| 37 | * @return null|string |
| 38 | */ |
| 39 | public function getDeclineCode() |
| 40 | { |
| 41 | return $this->declineCode; |
| 42 | } |
| 43 | /** |
| 44 | * Sets the decline code. |
| 45 | * |
| 46 | * @param null|string $declineCode |
| 47 | */ |
| 48 | public function setDeclineCode($declineCode) |
| 49 | { |
| 50 | $this->declineCode = $declineCode; |
| 51 | } |
| 52 | /** |
| 53 | * Gets the parameter related to the error. |
| 54 | * |
| 55 | * @return null|string |
| 56 | */ |
| 57 | public function getStripeParam() |
| 58 | { |
| 59 | return $this->stripeParam; |
| 60 | } |
| 61 | /** |
| 62 | * Sets the parameter related to the error. |
| 63 | * |
| 64 | * @param null|string $stripeParam |
| 65 | */ |
| 66 | public function setStripeParam($stripeParam) |
| 67 | { |
| 68 | $this->stripeParam = $stripeParam; |
| 69 | } |
| 70 | } |
| 71 |