ronantakizawa/codereview-bench huggingface dataset:
Repository: juspay/hyperswitch
File: migrations/2025-08-21-110802_add_subcription_table/up.sql (SQL)

Code before:
CREATE TABLE subscription (
  id VARCHAR(128) PRIMARY KEY,
  subscription_id VARCHAR(128),
  billing_processor VARCHAR(128),
  payment_method_id VARCHAR(128),
  mca_id VARCHAR(128),
  client_secret VARCHAR(128),
  merchant_id VARCHAR(64) NOT NULL,
  customer_id VARCHAR(64) NOT NULL,
  metadata JSONB,
  created_at TIMESTAMP NOT NULL,
  modified_at TIMESTAMP NOT NULL
);

CREATE UNIQUE INDEX merchant_customer_subscription_unique_index ON subscription (merchant_id, customer_id, subscription_id);


Review comment (suggestion):
```suggestion
  id SERIAL PRIMARY KEY,
  subscription_id VARCHAR(128)  NOT NULL,
```

Code after:
CREATE TABLE subscription (
  id SERIAL PRIMARY KEY,
  subscription_id VARCHAR(128) NOT NULL,
  status VARCHAR(128) NOT NULL,
  billing_processor VARCHAR(128),
  payment_method_id VARCHAR(128),
  mca_id VARCHAR(128),
  client_secret VARCHAR(128),
  connector_subscription_id VARCHAR(128),
  merchant_id VARCHAR(64) NOT NULL,
  customer_id VARCHAR(64) NOT NULL,
  metadata JSONB,
  created_at TIMESTAMP NOT NULL,
  modified_at TIMESTAMP NOT NULL
);

CREATE UNIQUE INDEX merchant_subscription_unique_index ON subscription (merchant_id, subscription_id);
Repository: juspay/hyperswitch
File: crates/diesel_models/src/subscription.rs (Rust)

Code before:
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};

use crate::schema::subscription;

#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = subscription)]
pub struct SubscriptionNew {
    pub id: String,
    pub subscription_id: Option<String>,
    pub billing_processor: Option<String>,
    pub payment_method_id: Option<String>,
    pub mca_id: Option<String>,
    pub client_secret: Option<String>,
    pub customer_id: common_utils::id_type::CustomerId,
    pub merchant_id: common_utils::id_type::MerchantId,
    pub metadata: Option<serde_json::Value>,
    pub created_at: time::PrimitiveDateTime,
    pub modified_at: time::PrimitiveDateTime,
}

#[derive(
    Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Deserialize, Serialize,
)]
#[diesel(table_name = subscription, primary_key(id), check_for_backend(diesel::pg::Pg))]
pub struct Subscription {
    pub id: String,
    pub subscription_id: Option<String>,
    pub billing_processor: Option<String>,
    pub payment_method_id: Option<String>,
    pub mca_id: Option<String>,
    pub client_secret: Option<String>,
    pub customer_id: common_utils::id_type::CustomerId,
    pub merchant_id: common_utils::id_type::MerchantId,
    pub metadata: Option<serde_json::Value>,
    pub created_at: time::PrimitiveDateTime,
    pub modified_at: time::PrimitiveDateTime,
}


Review comment (security):
```suggestion
    pub client_secret: Option<Secret<String>>,
```

Code after:
use common_utils::pii::SecretSerdeValue;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};

use crate::schema::subscription;

#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = subscription)]
pub struct SubscriptionNew {
    subscription_id: String,
    status: String,
    billing_processor: Option<String>,
    payment_method_id: Option<String>,
    mca_id: Option<String>,
    client_secret: Option<String>,
    connector_subscription_id: Option<String>,
    merchant_id: common_utils::id_type::MerchantId,
    customer_id: common_utils::id_type::CustomerId,
    metadata: Option<SecretSerdeValue>,
    created_at: time::PrimitiveDateTime,
    modified_at: time::PrimitiveDateTime,
}

#[derive(
    Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Deserialize, Serialize,
)]
#[diesel(table_name = subscription, primary_key(id), check_for_backend(diesel::pg::Pg))]
pub struct Subscription {
    #[serde(skip_serializing, skip_deserializing)]
    pub id: i32,
    pub subscription_id: String,
    pub status: String,
    pub billing_processor: Option<String>,
    pub payment_method_id: Option<String>,
    pub mca_id: Option<String>,
    pub client_secret: Option<String>,
    pub connector_subscription_id: Option<String>,
    pub merchant_id: common_utils::id_type::MerchantId,
    pub customer_id: common_utils::id_type::CustomerId,
Repository: juspay/hyperswitch
File: migrations/2025-08-21-110802_add_subcription_table/up.sql (SQL)

Code before:
CREATE TABLE subscription (
  id SERIAL PRIMARY KEY,
  subscription_id VARCHAR(128) NOT NULL,
  billing_processor VARCHAR(128),
  payment_method_id VARCHAR(128),
  mca_id VARCHAR(128),
  client_secret VARCHAR(128),
  merchant_id VARCHAR(64) NOT NULL,
  customer_id VARCHAR(64) NOT NULL,
  metadata JSONB,
  created_at TIMESTAMP NOT NULL,
  modified_at TIMESTAMP NOT NULL
);

CREATE UNIQUE INDEX merchant_customer_subscription_unique_index ON subscription (merchant_id, customer_id, subscription_id);


Review comment (suggestion):
```suggestion
CREATE UNIQUE INDEX merchant_customer_subscription_unique_index ON subscription (merchant_id, subscription_id);
```

Code after:
CREATE TABLE subscription (
  id SERIAL PRIMARY KEY,
  subscription_id VARCHAR(128) NOT NULL,
  status VARCHAR(128) NOT NULL,
  billing_processor VARCHAR(128),
  payment_method_id VARCHAR(128),
  mca_id VARCHAR(128),
  client_secret VARCHAR(128),
  connector_subscription_id VARCHAR(128),
  merchant_id VARCHAR(64) NOT NULL,
  customer_id VARCHAR(64) NOT NULL,
  metadata JSONB,
  created_at TIMESTAMP NOT NULL,
  modified_at TIMESTAMP NOT NULL
);

CREATE UNIQUE INDEX merchant_subscription_unique_index ON subscription (merchant_id, subscription_id);
Repository: juspay/hyperswitch
File: crates/hyperswitch_domain_models/src/types.rs (Rust)

Code before:
    router_data_v2::flow_common_types::RevenueRecoveryRecordBackData,
    RevenueRecoveryRecordBackRequest,
    RevenueRecoveryRecordBackResponse,
>;

pub type VaultRouterData<F> = RouterData<F, VaultRequestData, VaultResponseData>;

pub type VaultRouterDataV2<F> = RouterDataV2<
    F,
    router_data_v2::flow_common_types::VaultConnectorFlowData,
    VaultRequestData,
    VaultResponseData,
>;

pub type ExternalVaultProxyPaymentsRouterDataV2 = RouterDataV2<
    ExternalVaultProxy,
    router_data_v2::flow_common_types::ExternalVaultProxyFlowData,
    ExternalVaultProxyPaymentsData,
    PaymentsResponseData,
>;

pub type SubscriptionRecordBackRouterData = RouterData<
    SubscriptionRecordBack,
    SubscriptionsRecordBackRequest,
    RevenueRecoveryRecordBackResponse,
>;

pub type SubscriptionCreateRouterData =
    RouterData<SubscriptionCreate, SubscriptionCreateRequest, SubscriptionCreateResponse>;


Review comment (suggestion):
```suggestion
pub type SubscriptionInvoiceRecordBackRouterData = RouterData<
    SubscriptionInvoiceRecordBack,
    SubscriptionInvoiceRecordBackRequest,
    SubscriptionInvoiceRecordBackResponse,
>;
```

Code after:
    BillingConnectorInvoiceSyncResponse,
>;

pub type BillingConnectorInvoiceSyncRouterDataV2 = RouterDataV2<
    BillingConnectorInvoiceSync,
    router_data_v2::flow_common_types::BillingConnectorInvoiceSyncFlowData,
    BillingConnectorInvoiceSyncRequest,
    BillingConnectorInvoiceSyncResponse,
>;

pub type BillingConnectorPaymentsSyncRouterDataV2 = RouterDataV2<
    BillingConnectorPaymentsSync,
    router_data_v2::flow_common_types::BillingConnectorPaymentsSyncFlowData,
    BillingConnectorPaymentsSyncRequest,
    BillingConnectorPaymentsSyncResponse,
>;

pub type InvoiceRecordBackRouterDataV2 = RouterDataV2<
    InvoiceRecordBack,
    router_data_v2::flow_common_types::InvoiceRecordBackData,
    InvoiceRecordBackRequest,
    InvoiceRecordBackResponse,
>;

pub type GetSubscriptionPlanPricesRouterData = RouterData<
    GetSubscriptionPlanPrices,
    GetSubscriptionPlanPricesRequest,
    GetSubscriptionPlanPricesResponse,
>;

pub type VaultRouterData<F> = RouterData<F, VaultRequestData, VaultResponseData>;

pub type VaultRouterDataV2<F> = RouterDataV2<
    F,
    router_data_v2::flow_common_types::VaultConnectorFlowData,
    VaultRequestData,
    VaultResponseData,
>;

pub type ExternalVaultProxyPaymentsRouterDataV2 = RouterDataV2<
    ExternalVaultProxy,
    router_data_v2::flow_common_types::ExternalVaultProxyFlowData,
    ExternalVaultProxyPaymentsData,
    PaymentsResponseData,
>;

pub type SubscriptionCreateRouterData =
    RouterData<SubscriptionCreate, SubscriptionCreateRequest, SubscriptionCreateResponse>;
Repository: juspay/hyperswitch
File: crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs (Rust)

Code before:
use common_enums::enums;
use common_utils::types::MinorUnit;
use time::PrimitiveDateTime;

#[derive(Debug, Clone)]
pub struct SubscriptionCreateResponse {
    pub subscription_id: String,
    pub status: String,
    pub customer_id: String,
    pub currency_code: enums::Currency,
    pub total_amount: MinorUnit,
    pub next_billing_at: Option<PrimitiveDateTime>,
    pub created_at: Option<PrimitiveDateTime>,
}


Review comment (suggestion):
```suggestion
    pub status: SubscriptionStatus,
```

Code after:
use common_enums::Currency;
use common_utils::{id_type, types::MinorUnit};
use time::PrimitiveDateTime;

#[derive(Debug, Clone)]
pub struct SubscriptionCreateResponse {
    pub subscription_id: id_type::SubscriptionId,
    pub status: SubscriptionStatus,
    pub customer_id: id_type::CustomerId,
    pub currency_code: Currency,
    pub total_amount: MinorUnit,
    pub next_billing_at: Option<PrimitiveDateTime>,
    pub created_at: Option<PrimitiveDateTime>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SubscriptionStatus {
    Pending,
    Trial,
    Active,
    Paused,
    Unpaid,
    Onetime,
    Cancelled,
    Failed,
}

#[derive(Debug, Clone)]
pub struct GetSubscriptionPlansResponse {
    pub list: Vec<SubscriptionPlans>,
}

#[derive(Debug, Clone)]
Repository: juspay/hyperswitch
File: crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs (Rust)

Code before:
use common_enums::enums;
use common_utils::types::MinorUnit;
use time::PrimitiveDateTime;

#[derive(Debug, Clone)]
pub struct SubscriptionCreateResponse {
    pub subscription_id: String,
    pub status: String,
    pub customer_id: String,
    pub currency_code: enums::Currency,
    pub total_amount: MinorUnit,
    pub next_billing_at: Option<PrimitiveDateTime>,
    pub created_at: Option<PrimitiveDateTime>,
}


Review comment (suggestion):
```suggestion
    pub customer_id: id_type::CustomerId,
```

Code after:
use common_enums::Currency;
use common_utils::{id_type, types::MinorUnit};
use time::PrimitiveDateTime;

#[derive(Debug, Clone)]
pub struct SubscriptionCreateResponse {
    pub subscription_id: id_type::SubscriptionId,
    pub status: SubscriptionStatus,
    pub customer_id: id_type::CustomerId,
    pub currency_code: Currency,
    pub total_amount: MinorUnit,
    pub next_billing_at: Option<PrimitiveDateTime>,
    pub created_at: Option<PrimitiveDateTime>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SubscriptionStatus {
    Pending,
    Trial,
    Active,
    Paused,
    Unpaid,
    Onetime,
    Cancelled,
    Failed,
}

#[derive(Debug, Clone)]
pub struct GetSubscriptionPlansResponse {
    pub list: Vec<SubscriptionPlans>,
}

#[derive(Debug, Clone)]
pub struct SubscriptionPlans {
Repository: juspay/hyperswitch
File: crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs (Rust)

Code before:
use api_models::payments::Address;

use crate::connector_endpoints;

#[derive(Debug, Clone)]
pub struct SubscriptionItem {
    pub item_price_id: String,
    pub quantity: Option<u32>,
}

#[derive(Debug, Clone)]
pub struct SubscriptionCreateRequest {
    pub customer_id: String,
    pub subscription_id: String,
    pub subscription_items: Vec<SubscriptionItem>,
    pub billing_address: Address,
    pub auto_collection: SubscriptionAutoCollection,
    pub connector_params: connector_endpoints::ConnectorParams,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SubscriptionAutoCollection {
    On,
    Off,
}
#[derive(Debug, Clone)]
pub struct GetSubscriptionPlansRequest {
    pub limit: Option<u32>,
    pub offset: Option<u32>,
}


Review comment (suggestion):
```suggestion
    pub customer_id: id_type::CustomerId,
```

Code after:
use api_models::payments::Address;
use common_utils::id_type;

use crate::connector_endpoints;

#[derive(Debug, Clone)]
pub struct SubscriptionItem {
    pub item_price_id: String,
    pub quantity: Option<u32>,
}

#[derive(Debug, Clone)]
pub struct SubscriptionCreateRequest {
    pub customer_id: id_type::CustomerId,
    pub subscription_id: id_type::SubscriptionId,
    pub subscription_items: Vec<SubscriptionItem>,
    pub billing_address: Address,
    pub auto_collection: SubscriptionAutoCollection,
    pub connector_params: connector_endpoints::ConnectorParams,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SubscriptionAutoCollection {
    On,
    Off,
}
#[derive(Debug, Clone)]
pub struct GetSubscriptionPlansRequest {
    pub limit: Option<u32>,
    pub offset: Option<u32>,
}

#[derive(Debug, Clone)]
pub struct GetSubscriptionPlanPricesRequest {
    pub plan_price_id: String,
}
Repository: juspay/hyperswitch
File: crates/diesel_models/src/invoice.rs (Rust)

Code before:
use common_utils::pii::SecretSerdeValue;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};

use crate::schema::invoices;

#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = invoices)]
pub struct InvoiceNew {
    pub invoice_id: String,
    pub subscription_id: Option<String>,
    pub connector_subscription_id: Option<String>,
    pub merchant_id: common_utils::id_type::MerchantId,
    pub profile_id: common_utils::id_type::ProfileId,
    pub merchant_connector_id: common_utils::id_type::MerchantConnectorAccountId,
    pub payment_intent_id: String,
    pub payment_method_id: Option<String>,
    pub customer_id: common_utils::id_type::CustomerId,
    pub amount: i32,
    pub currency: String,
    pub status: String,
    pub provider_name: String,
    pub metadata: Option<SecretSerdeValue>,
    pub created_at: time::PrimitiveDateTime,
    pub modified_at: time::PrimitiveDateTime,
}

#[derive(
    Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Deserialize, Serialize,
)]
#[diesel(
    table_name = invoices,
    primary_key(invoice_id),
    check_for_backend(diesel::pg::Pg)
)]
pub struct Invoice {

Review comment (suggestion):
```suggestion
    pub subscription_id: String,
```
Let's make it mandatory

Code after:
use common_enums::connector_enums::{Connector, InvoiceStatus};
use common_utils::{pii::SecretSerdeValue, types::MinorUnit};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};

use crate::schema::invoice;

#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = invoice, check_for_backend(diesel::pg::Pg))]
pub struct InvoiceNew {
    pub id: String,
    pub subscription_id: String,
    pub merchant_id: common_utils::id_type::MerchantId,
    pub profile_id: common_utils::id_type::ProfileId,
    pub merchant_connector_id: common_utils::id_type::MerchantConnectorAccountId,
    pub payment_intent_id: Option<common_utils::id_type::PaymentId>,
    pub payment_method_id: Option<String>,
    pub customer_id: common_utils::id_type::CustomerId,
    pub amount: MinorUnit,
    pub currency: String,
    pub status: String,
    pub provider_name: Connector,
    pub metadata: Option<SecretSerdeValue>,
    pub created_at: time::PrimitiveDateTime,
    pub modified_at: time::PrimitiveDateTime,
}

#[derive(
    Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Deserialize, Serialize,
)]
#[diesel(
    table_name = invoice,
    primary_key(id),
    check_for_backend(diesel::pg::Pg)
)]
pub struct Invoice {
Repository: juspay/hyperswitch
File: migrations/2025-09-10-101514_add_invoice_table/up.sql (SQL)

Code before:
CREATE TABLE invoices (
    invoice_id VARCHAR(255) PRIMARY KEY,
    subscription_id VARCHAR(255),
    connector_subscription_id VARCHAR(255),
    merchant_id VARCHAR(255) NOT NULL,
    profile_id VARCHAR(255) NOT NULL,
    merchant_connector_id VARCHAR(255) NOT NULL,
    payment_intent_id VARCHAR(255) UNIQUE NOT NULL,
    payment_method_id VARCHAR(128),
    customer_id VARCHAR(255) NOT NULL,
    amount INTEGER NOT NULL,
    currency VARCHAR(3) NOT NULL,
    status VARCHAR(50) NOT NULL,
    provider_name VARCHAR(100) NOT NULL,
    metadata JSONB,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    modified_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_payment_intent_id ON invoices (payment_intent_id);
CREATE INDEX idx_subscription_id ON invoices (subscription_id);
CREATE INDEX idx_merchant_customer ON invoices (merchant_id, customer_id);


Review comment (suggestion):
```suggestion
    payment_intent_id VARCHAR(255) UNIQUE NOT NULL,
```
If the invoice is created at our end, we may not attach a payment ID to it immediately. so it can be null

Code after:
CREATE TABLE invoice (
    id VARCHAR(64) PRIMARY KEY,
    subscription_id VARCHAR(128) NOT NULL,
    merchant_id VARCHAR(64) NOT NULL,
    profile_id VARCHAR(64) NOT NULL,
    merchant_connector_id VARCHAR(128) NOT NULL,
    payment_intent_id VARCHAR(64) UNIQUE,
    payment_method_id VARCHAR(64),
    customer_id VARCHAR(64) NOT NULL,
    amount BIGINT NOT NULL,
    currency VARCHAR(3) NOT NULL,
    status VARCHAR(64) NOT NULL,
    provider_name VARCHAR(128) NOT NULL,
    metadata JSONB,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    modified_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_subscription_id ON invoice (subscription_id);
Repository: juspay/hyperswitch
File: migrations/2025-09-10-101514_add_invoice_table/up.sql (SQL)

Code before:
CREATE TABLE invoices (
    invoice_id VARCHAR(255) PRIMARY KEY,
    subscription_id VARCHAR(255) NOT NULL,
    connector_subscription_id VARCHAR(255),
    merchant_id VARCHAR(255) NOT NULL,
    profile_id VARCHAR(255) NOT NULL,
    merchant_connector_id VARCHAR(255) NOT NULL,
    payment_intent_id VARCHAR(255) UNIQUE,
    payment_method_id VARCHAR(128),
    customer_id VARCHAR(255) NOT NULL,
    amount BIGINT NOT NULL,
    currency VARCHAR(3) NOT NULL,
    status VARCHAR(50) NOT NULL,
    provider_name VARCHAR(100) NOT NULL,
    metadata JSONB,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    modified_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_payment_intent_id ON invoices (payment_intent_id);
CREATE INDEX idx_subscription_id ON invoices (subscription_id);
CREATE INDEX idx_merchant_customer ON invoices (merchant_id, customer_id);


Review comment (suggestion):
```suggestion
    id VARCHAR(255) PRIMARY KEY,
```

Code after:
CREATE TABLE invoice (
    id VARCHAR(64) PRIMARY KEY,
    subscription_id VARCHAR(128) NOT NULL,
    merchant_id VARCHAR(64) NOT NULL,
    profile_id VARCHAR(64) NOT NULL,
    merchant_connector_id VARCHAR(128) NOT NULL,
    payment_intent_id VARCHAR(64) UNIQUE,
    payment_method_id VARCHAR(64),
    customer_id VARCHAR(64) NOT NULL,
    amount BIGINT NOT NULL,
    currency VARCHAR(3) NOT NULL,
    status VARCHAR(64) NOT NULL,
    provider_name VARCHAR(128) NOT NULL,
    metadata JSONB,
    created_at TIMESTAMP NOT NULL DEFAULT NOW(),
    modified_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_subscription_id ON invoice (subscription_id);
Repository: juspay/hyperswitch
File: crates/common_enums/src/connector_enums.rs (Rust)

Code before:
            Connector::Zsl => Ok(Self::Zsl),
            Connector::Recurly => Ok(Self::Recurly),
            Connector::Getnet => Ok(Self::Getnet),
            Connector::Hipay => Ok(Self::Hipay),
            Connector::Inespay => Ok(Self::Inespay),
            Connector::Redsys => Ok(Self::Redsys),
            Connector::Paytm => Ok(Self::Paytm),
            Connector::Phonepe => Ok(Self::Phonepe),
            Connector::CtpMastercard
            | Connector::Gpayments
            | Connector::HyperswitchVault
            | Connector::Juspaythreedsserver
            | Connector::Netcetera
            | Connector::Taxjar
            | Connector::Threedsecureio
            | Connector::Vgs
            | Connector::CtpVisa
            | Connector::Cardinal => Err("Invalid conversion. Not a routable connector"),
        }
    }
}

// Enum representing different status an invoice can have.
#[derive(Debug, Clone, PartialEq, Eq, strum::Display, strum::EnumString)]
pub enum InvoiceStatus {
    PendingPayment,
    PaymentRequiresAction,
    PaymentAuthorized,
    PaymentPending,
    PaymentPendingTimeout,
    PaymentSucceeded,
    PaymentFailed,
    PaymentCanceled,
    SubscriptionCreating,
    SubscriptionCreated,
    SubscriptionCreationFailed,
    InvoicePaid,
    Disputed,
    Refunded,
    ManualReview,
}


Review comment (suggestion):
`PendingPayment` and `PaymentPending` are bit confusing, choose a better variant for `PendingPayment` maybe InvoiceCreated

Code after:
            Connector::Plaid => Ok(Self::Plaid),
            Connector::Zsl => Ok(Self::Zsl),
            Connector::Recurly => Ok(Self::Recurly),
            Connector::Getnet => Ok(Self::Getnet),
            Connector::Hipay => Ok(Self::Hipay),
            Connector::Inespay => Ok(Self::Inespay),
            Connector::Redsys => Ok(Self::Redsys),
            Connector::Paytm => Ok(Self::Paytm),
            Connector::Phonepe => Ok(Self::Phonepe),
            Connector::CtpMastercard
            | Connector::Gpayments
            | Connector::HyperswitchVault
            | Connector::Juspaythreedsserver
            | Connector::Netcetera
            | Connector::Taxjar
            | Connector::Threedsecureio
            | Connector::Vgs
            | Connector::CtpVisa
            | Connector::Cardinal => Err("Invalid conversion. Not a routable connector"),
        }
    }
}

// Enum representing different status an invoice can have.
#[derive(Debug, Clone, PartialEq, Eq, strum::Display, strum::EnumString)]
pub enum InvoiceStatus {
    InvoiceCreated,
    PaymentPending,
    PaymentPendingTimeout,
    PaymentSucceeded,
    PaymentFailed,
    PaymentCanceled,
    InvoicePaid,
    ManualReview,
}