diff --git a/src/Plugin/Commerce/PaymentGateway/Stripe.php b/src/Plugin/Commerce/PaymentGateway/Stripe.php index b303ecc..7d7efe2 100755 --- a/src/Plugin/Commerce/PaymentGateway/Stripe.php +++ b/src/Plugin/Commerce/PaymentGateway/Stripe.php @@ -206,18 +206,15 @@ class Stripe extends OnsitePaymentGatewayBase implements StripeInterface { assert($order instanceof OrderInterface); $intent_id = $order->getData('stripe_intent'); if (empty($intent_id)) { - // We need to ensure we send the off_session param. - if ($order->bundle() === 'recurring') { - $intent = $this->createPaymentIntent($order, [ - // By default assume customer is not available for SCA. - 'confirm' => TRUE, - 'off_session' => TRUE, - 'capture_method' => $capture ? 'automatic' : 'manual', - ]); - } - else { - $intent = $this->createPaymentIntent($order); - } + // If createPayment is called and there is no payment intent, it means we + // are not in a checkout flow with the stripe review pane, so we can + // assume that it's an off_session payment initiated, e.g. by recurring. + $intent = $this->createPaymentIntent($order, [ + // By default assume customer is not available for SCA. + 'confirm' => TRUE, + 'off_session' => TRUE, + 'capture_method' => $capture ? 'automatic' : 'manual', + ]); $intent_id = $intent['id']; } try {