From 64266969ca0e2c705165fd3ef4213888611e979f Mon Sep 17 00:00:00 2001 From: Ben Doe Date: Fri, 19 Feb 2021 10:07:08 +0000 Subject: [PATCH 1/5] requires confirmation status helper method --- src/Payment.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Payment.php b/src/Payment.php index a03b1f14..7f0b77a0 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -76,6 +76,17 @@ public function requiresAction() return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_ACTION; } + + /** + * Determine if the payment needs to be confirmed. + * + * @return bool + */ + public function requiresConfirmation() + { + return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CONFIRMATION; + } + /** * Determine if the payment was cancelled. * From f81bb1d25390b09fbe7023a30359a08c99e82495 Mon Sep 17 00:00:00 2001 From: Ben Doe Date: Fri, 19 Feb 2021 10:11:34 +0000 Subject: [PATCH 2/5] style --- src/Payment.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Payment.php b/src/Payment.php index 7f0b77a0..5aa85a5d 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -76,7 +76,6 @@ public function requiresAction() return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_ACTION; } - /** * Determine if the payment needs to be confirmed. * From 85dce4ff744cd351214f1a50cd0a995b76f4ed3d Mon Sep 17 00:00:00 2001 From: Ben Doe Date: Fri, 19 Feb 2021 10:23:26 +0000 Subject: [PATCH 3/5] requires_capture status --- src/Payment.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Payment.php b/src/Payment.php index 5aa85a5d..82af427a 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -86,6 +86,16 @@ public function requiresConfirmation() return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CONFIRMATION; } + /** + * Determine if the payment needs to be captured. + * + * @return bool + */ + public function requiresCapture() + { + return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CAPTURE; + } + /** * Determine if the payment was cancelled. * From b7e0b1e04f393589bcc50e3faf9beb35f3689611 Mon Sep 17 00:00:00 2001 From: Ben Doe Date: Fri, 19 Feb 2021 10:23:34 +0000 Subject: [PATCH 4/5] processing status --- src/Payment.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Payment.php b/src/Payment.php index 82af427a..f55531fb 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -116,6 +116,16 @@ public function isSucceeded() return $this->paymentIntent->status === StripePaymentIntent::STATUS_SUCCEEDED; } + /** + * Determine if the payment is processing. + * + * @return bool + */ + public function isProcessing() + { + return $this->paymentIntent->status === StripePaymentIntent::STATUS_PROCESSING; + } + /** * Validate if the payment intent was successful and throw an exception if not. * From 54297194b867e5d23f1d51002c38708f26391db6 Mon Sep 17 00:00:00 2001 From: Ben Doe Date: Fri, 19 Feb 2021 10:24:55 +0000 Subject: [PATCH 5/5] no ENUM for requires_capture --- src/Payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Payment.php b/src/Payment.php index f55531fb..c31eee92 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -93,7 +93,7 @@ public function requiresConfirmation() */ public function requiresCapture() { - return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CAPTURE; + return $this->paymentIntent->status === 'requires_capture'; } /**