summaryrefslogtreecommitdiffstats
path: root/vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
commit19985dbb8c0aa66dc4bf7905abc1148de909097d (patch)
tree2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php
download1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip
Diffstat (limited to 'vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php')
-rw-r--r--vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php74
1 files changed, 74 insertions, 0 deletions
diff --git a/vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php b/vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php
new file mode 100644
index 0000000..b08534a
--- /dev/null
+++ b/vendor/stripe/stripe-php/lib/Exception/SignatureVerificationException.php
@@ -0,0 +1,74 @@
+<?php
+
+namespace Stripe\Exception;
+
+/**
+ * SignatureVerificationException is thrown when the signature verification for
+ * a webhook fails.
+ */
+class SignatureVerificationException extends \Exception implements ExceptionInterface
+{
+ protected $httpBody;
+ protected $sigHeader;
+
+ /**
+ * Creates a new SignatureVerificationException exception.
+ *
+ * @param string $message the exception message
+ * @param null|string $httpBody the HTTP body as a string
+ * @param null|string $sigHeader the `Stripe-Signature` HTTP header
+ *
+ * @return SignatureVerificationException
+ */
+ public static function factory(
+ $message,
+ $httpBody = null,
+ $sigHeader = null
+ ) {
+ $instance = new static($message);
+ $instance->setHttpBody($httpBody);
+ $instance->setSigHeader($sigHeader);
+
+ return $instance;
+ }
+
+ /**
+ * Gets the HTTP body as a string.
+ *
+ * @return null|string
+ */
+ public function getHttpBody()
+ {
+ return $this->httpBody;
+ }
+
+ /**
+ * Sets the HTTP body as a string.
+ *
+ * @param null|string $httpBody
+ */
+ public function setHttpBody($httpBody)
+ {
+ $this->httpBody = $httpBody;
+ }
+
+ /**
+ * Gets the `Stripe-Signature` HTTP header.
+ *
+ * @return null|string
+ */
+ public function getSigHeader()
+ {
+ return $this->sigHeader;
+ }
+
+ /**
+ * Sets the `Stripe-Signature` HTTP header.
+ *
+ * @param null|string $sigHeader
+ */
+ public function setSigHeader($sigHeader)
+ {
+ $this->sigHeader = $sigHeader;
+ }
+}