PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.4
GiveWP – Donation Plugin and Fundraising Platform v4.15.4
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / vendor / stripe / stripe-php / lib / Exception / CardException.php

CardException.php in GiveWP – Donation Plugin and Fundraising Platform 4.15.4, at vendor/stripe/stripe-php/lib/Exception/CardException.php

85 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace 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 /**
15 * Creates a new CardException exception.
16 *
17 * @param string $message the exception message
18 * @param null|int $httpStatus the HTTP status code
19 * @param null|string $httpBody the HTTP body as a string
20 * @param null|array $jsonBody the JSON deserialized body
21 * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders the HTTP headers array
22 * @param null|string $stripeCode the Stripe error code
23 * @param null|string $declineCode the decline code
24 * @param null|string $stripeParam the parameter related to the error
25 *
26 * @return CardException
27 */
28 public static function factory(
29 $message,
30 $httpStatus = null,
31 $httpBody = null,
32 $jsonBody = null,
33 $httpHeaders = null,
34 $stripeCode = null,
35 $declineCode = null,
36 $stripeParam = null
37 ) {
38 $instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode);
39 $instance->setDeclineCode($declineCode);
40 $instance->setStripeParam($stripeParam);
41
42 return $instance;
43 }
44
45 /**
46 * Gets the decline code.
47 *
48 * @return null|string
49 */
50 public function getDeclineCode()
51 {
52 return $this->declineCode;
53 }
54
55 /**
56 * Sets the decline code.
57 *
58 * @param null|string $declineCode
59 */
60 public function setDeclineCode($declineCode)
61 {
62 $this->declineCode = $declineCode;
63 }
64
65 /**
66 * Gets the parameter related to the error.
67 *
68 * @return null|string
69 */
70 public function getStripeParam()
71 {
72 return $this->stripeParam;
73 }
74
75 /**
76 * Sets the parameter related to the error.
77 *
78 * @param null|string $stripeParam
79 */
80 public function setStripeParam($stripeParam)
81 {
82 $this->stripeParam = $stripeParam;
83 }
84 }
85