wp-user-avatar
/
third-party
/
vendor
/
stripe
/
stripe-php
/
lib
/
Exception
/
SignatureVerificationException.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
SignatureVerificationException.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Stripe\Exception; |
| 4 | |
| 5 | /** |
| 6 | * SignatureVerificationException is thrown when the signature verification for |
| 7 | * a webhook fails. |
| 8 | */ |
| 9 | class SignatureVerificationException extends \Exception implements ExceptionInterface |
| 10 | { |
| 11 | protected $httpBody; |
| 12 | protected $sigHeader; |
| 13 | /** |
| 14 | * Creates a new SignatureVerificationException exception. |
| 15 | * |
| 16 | * @param string $message the exception message |
| 17 | * @param null|string $httpBody the HTTP body as a string |
| 18 | * @param null|string $sigHeader the `Stripe-Signature` HTTP header |
| 19 | * |
| 20 | * @return SignatureVerificationException |
| 21 | */ |
| 22 | public static function factory($message, $httpBody = null, $sigHeader = null) |
| 23 | { |
| 24 | $instance = new static($message); |
| 25 | $instance->setHttpBody($httpBody); |
| 26 | $instance->setSigHeader($sigHeader); |
| 27 | return $instance; |
| 28 | } |
| 29 | /** |
| 30 | * Gets the HTTP body as a string. |
| 31 | * |
| 32 | * @return null|string |
| 33 | */ |
| 34 | public function getHttpBody() |
| 35 | { |
| 36 | return $this->httpBody; |
| 37 | } |
| 38 | /** |
| 39 | * Sets the HTTP body as a string. |
| 40 | * |
| 41 | * @param null|string $httpBody |
| 42 | */ |
| 43 | public function setHttpBody($httpBody) |
| 44 | { |
| 45 | $this->httpBody = $httpBody; |
| 46 | } |
| 47 | /** |
| 48 | * Gets the `Stripe-Signature` HTTP header. |
| 49 | * |
| 50 | * @return null|string |
| 51 | */ |
| 52 | public function getSigHeader() |
| 53 | { |
| 54 | return $this->sigHeader; |
| 55 | } |
| 56 | /** |
| 57 | * Sets the `Stripe-Signature` HTTP header. |
| 58 | * |
| 59 | * @param null|string $sigHeader |
| 60 | */ |
| 61 | public function setSigHeader($sigHeader) |
| 62 | { |
| 63 | $this->sigHeader = $sigHeader; |
| 64 | } |
| 65 | } |
| 66 |