From f8dff8a397fa12b3cf4bdb31ba7a58e2676b6993 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Sun, 5 Nov 2023 15:48:56 -0500 Subject: [PATCH] Add support for Payment cancelation (#1596) * add passthrough method to cancel PaymentIntent * Update Payment.php --------- Co-authored-by: Taylor Otwell --- src/Payment.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Payment.php b/src/Payment.php index 9be9aac9..4c5c1e67 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -119,6 +119,17 @@ public function requiresCapture() return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CAPTURE; } + /** + * Cancel the payment. + * + * @param array $options + * @return \Stripe\PaymentIntent + */ + public function cancel(array $options = []) + { + return $this->paymentIntent->cancel($options); + } + /** * Determine if the payment was canceled. *