Description
Before switching to the new checkout experience we used add_filter('wc_stripe_force_save_source', '__return_true');
which attaches the stripe payment method to the stripe customer for our subscription service (we're not using the official Woocommerce Subscriptions plugin). There doesn't seem to be an equivalent hook for the new checkout experience.
For now as a hacky workaround I'm defining the functions wcs_order_contains_subscription
, wcs_is_subscription
, wcs_order_contains_renewal
to make WC_Stripe_Subscriptions_Utilities_Trait::has_subscription()
return true
for certain orders. This causes the stripe plugin to set setup_future_usage:off_session
for the payment intent which is what we want for our use case. It would be great if there would be a cleaner way to do that.