From 966bc05b65c07024ea9b32dad355701133a0f49f Mon Sep 17 00:00:00 2001 From: clem Date: Fri, 23 Jun 2023 15:01:32 +0700 Subject: [PATCH 1/2] createSetupIntent add customer stripe_id option --- src/Concerns/ManagesPaymentMethods.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Concerns/ManagesPaymentMethods.php b/src/Concerns/ManagesPaymentMethods.php index edcd4c56..80fb913d 100644 --- a/src/Concerns/ManagesPaymentMethods.php +++ b/src/Concerns/ManagesPaymentMethods.php @@ -19,6 +19,10 @@ trait ManagesPaymentMethods */ public function createSetupIntent(array $options = []) { + if ($this->hasStripeId()) { + $options['customer'] = $this->stripe_id; + } + return $this->stripe()->setupIntents->create($options); } From 76a6cbe2952312d7488740587d748ad17f1d1b04 Mon Sep 17 00:00:00 2001 From: clem Date: Fri, 23 Jun 2023 15:27:02 +0700 Subject: [PATCH 2/2] Update ManagesPaymentMethods.php fix linting issue --- src/Concerns/ManagesPaymentMethods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/ManagesPaymentMethods.php b/src/Concerns/ManagesPaymentMethods.php index 80fb913d..9306e920 100644 --- a/src/Concerns/ManagesPaymentMethods.php +++ b/src/Concerns/ManagesPaymentMethods.php @@ -22,7 +22,7 @@ public function createSetupIntent(array $options = []) if ($this->hasStripeId()) { $options['customer'] = $this->stripe_id; } - + return $this->stripe()->setupIntents->create($options); }