Repository: juspay/hyperswitch
File: crates/router/src/core/subscription.rs (Rust)

Code before:
                })
                .attach_printable(
                    "subscriptions: billing address missing in confirm_subscription_request",
                )
                .ok(),
            request
                .payment_details
                .payment_method_data
                .payment_method_data
                .clone(),
        )
        .await?;

    let subscription_create_response = billing_handler
        .create_subscription_on_connector(
            &state,
            subscription,
            request.item_price_id.clone(),
            request
                .get_billing_address()
                .change_context(errors::ApiErrorResponse::MissingRequiredField {
                    field_name: "billing",
                })
                .attach_printable(
                    "subscriptions: billing address missing in confirm_subscription_request",
                )?,
        )
        .await?;

    let invoice_details = subscription_create_response.invoice_details;
    let invoice_entry = invoice_handler
        .update_invoice(
            &state,
            invoice.id,
            payment_response.payment_method_id.clone(),
            Some(payment_response.payment_id.clone()),
            invoice_details
                .clone()
                .and_then(|invoice| invoice.status)
                .unwrap_or(connector_enums::InvoiceStatus::InvoiceCreated),
            invoice_details
                .clone()
                .map(|invoice| invoice.id.get_string_repr().to_string()),
        )
        .await?;

    invoice_handler
        .create_invoice_sync_job(
            &state,
            &invoice_entry,
            invoice_details

Review comment (suggestion):
```suggestion
```
not needed create_subscription_on_connector will handle this error

Code after:
            &state,
            subscription,
            request.item_price_id.clone(),
            request.get_billing_address(),
        )
        .await?;

    let invoice_details = subscription_create_response.invoice_details;
    let invoice_entry = invoice_handler
        .update_invoice(
            &state,
            invoice.id,
            payment_response.payment_method_id.clone(),
            Some(payment_response.payment_id.clone()),
            invoice_details
                .clone()
                .and_then(|invoice| invoice.status)
                .unwrap_or(connector_enums::InvoiceStatus::InvoiceCreated),
            invoice_details.clone().map(|invoice| invoice.id),
        )
        .await?;

    invoice_handler
        .create_invoice_sync_job(
            &state,
            &invoice_entry,
            invoice_details.map(|invoice| invoice.id),
            billing_handler.connector_data.connector_name,
        )
        .await?;

    subscription_entry
        .update_subscription(
            hyperswitch_domain_models::subscription::SubscriptionUpdate::new(
                payment_response.payment_method_id.clone(),
                Some(SubscriptionStatus::from(subscription_create_response.status).to_string()),
                Some(
                    subscription_create_response
                        .subscription_id
                        .get_string_repr()
                        .to_string(),
                ),
            ),
        )
        .await?;

    let response = subscription_entry.generate_response(
        &invoice_entry,
        &payment_response,
        subscription_create_response.status,
        request.plan_id.clone(),