If you use a SetupIntent to collect the payment method then you can set the payment method as default on the subscription when you update it - https://docs.stripe.com/api/subscriptions/update#update_subscription-default_payment_method
The other option here to use Customer Portal to collect the payment method - https://docs.stripe.com/billing/subscriptions/trials#use-the-customer-portal-to-collect-payment