Here my solution which I adapted from another thread:
add_action( ‘wc_gateway_stripe_process_response’, ‘action_wc_gateway_stripe_regard_sepa_pending_as_complete’, 0, 2);
/**
* Action function that sets the order to “payment completed” even if the SEPA direct debit is pending at Stripe.
* @author Kai Mindermann
*/
function action_wc_gateway_stripe_regard_sepa_pending_as_complete ($response, $order) {
// check if payment (stripe response) is in pending state
// check if payment (stripe response) is of ‘sepa_debit’ type
// check if order contains a subscription
if( $response->status === ‘pending’ && $response->source->type === ‘sepa_debit’) {
$order->payment_complete($response->id);
/* translators: response id */
$order->add_order_note( sprintf( __( ‘Pending status automatically set as payment complete by custom hook (Charge ID: %s)’, ‘woocommerce-gateway-stripe’ ), $response->id ) );
if ( is_callable( array( $order, ‘save’ ) ) ) {
$order->save();
}
}
// TODO update post_meta?
// TODO update fees
}