Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(payments): expose card subtype, segment type and funding source (#13985)
Longsueyninc8fb0acf4fa8
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex 5b2556a0e9..e57f8c1496 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -16593,6 +16593,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -16836,6 +16858,27 @@"type": "string","description": "Card Type","nullable": true+ },+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true}},"additionalProperties": false@@ -16906,6 +16949,26 @@"type": "string","nullable": true},+ "card_subtype": {+ "type": "string",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"saved_to_locker": {"type": "boolean"}@@ -17327,6 +17390,27 @@"type": "string","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`.",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_network": {"allOf": [{@@ -17624,6 +17708,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -28463,6 +28569,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -46830,6 +46958,27 @@}],"nullable": true+ },+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true}},"additionalProperties": falsediff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex 58459976b9..f4a89ddcd7 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -11006,6 +11006,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -11179,6 +11201,27 @@],"nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_cvc": {"type": "string","description": "The CVC number for the card\nThis is optional in case the card needs to be vaulted",@@ -11253,6 +11296,27 @@"example": "Credit","nullable": true},+ "card_subtype": {+ "type": "string",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"saved_to_locker": {"type": "boolean","example": true@@ -11539,6 +11603,27 @@"type": "string","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`.",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_network": {"allOf": [{@@ -11587,6 +11672,15 @@}}},+ "CardSegmentType": {+ "type": "string",+ "enum": [+ "business",+ "commercial",+ "consumer",+ "government"+ ]+ },"CardSpecificFeatures": {"type": "object","required": [@@ -11827,6 +11921,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -16299,6 +16415,16 @@"post"]},+ "FundingSource": {+ "type": "string",+ "enum": [+ "CREDIT",+ "DEBIT",+ "DEFERRED DEBIT",+ "PREPAID",+ "CHARGE CARD"+ ]+ },"FutureUsage": {"type": "string","description": "Specifies how the payment method can be used for future payments.\n- `off_session`: The payment method can be used for future payments when the customer is not present.\n- `on_session`: The payment method is intended for use only when the customer is present during checkout.\nIf omitted, defaults to `on_session`.",@@ -20335,6 +20461,28 @@"example": "CREDIT","nullable": true},+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "example": "CLASSIC",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true+ },"card_issuing_country": {"type": "string","example": "INDIA",@@ -34274,6 +34422,27 @@}],"nullable": true+ },+ "card_subtype": {+ "type": "string",+ "description": "The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`",+ "nullable": true+ },+ "card_segment_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CardSegmentType"+ }+ ],+ "nullable": true+ },+ "funding_source": {+ "allOf": [+ {+ "$ref": "#/components/schemas/FundingSource"+ }+ ],+ "nullable": true}},"additionalProperties": falsediff --git a/crates/api_models/src/mandates.rs b/crates/api_models/src/mandates.rsindex 5514422629..b569decd6e 100644--- a/crates/api_models/src/mandates.rs+++ b/crates/api_models/src/mandates.rs@@ -245,6 +245,22 @@ pub struct NetworkTransactionIdAndCardDetails {#[smithy(value_type = "Option<String>")]pub card_type: Option<String>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ #[schema(example = "CLASSIC")]+ #[smithy(value_type = "Option<String>")]+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>, example = "consumer")]+ #[smithy(value_type = "Option<CardSegmentType>")]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded. More granular than `card_type`, which collapses+ /// deferred debit and charge cards.+ #[schema(value_type = Option<FundingSource>, example = "CREDIT")]+ #[smithy(value_type = "Option<FundingSource>")]+ pub funding_source: Option<api_enums::FundingSource>,+#[schema(example = "INDIA")]#[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rsindex 507156e9cb..c0d4cdacb5 100644--- a/crates/api_models/src/payment_methods.rs+++ b/crates/api_models/src/payment_methods.rs@@ -454,6 +454,9 @@ impl PaymentMethodCreate {card_network: payment_method_migrate_card.card_network.clone(),card_issuer: payment_method_migrate_card.card_issuer.clone(),card_type: payment_method_migrate_card.card_type.clone(),+ card_subtype: payment_method_migrate_card.card_subtype.clone(),+ card_segment_type: payment_method_migrate_card.card_segment_type,+ funding_source: payment_method_migrate_card.funding_source,card_cvc: None,});@@ -902,6 +905,17 @@ pub struct CardDetail {/// Card Typepub card_type: Option<String>,++ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,}#[derive(@@ -965,6 +979,17 @@ pub struct CardDetail {/// Card Typepub card_type: Option<CardType>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,+/// The CVC number for the card/// This is optional in case the card needs to be vaulted#[schema(value_type = String, example = "242")]@@ -1060,6 +1085,17 @@ pub struct MigrateCardDetail {/// Card Typepub card_type: Option<String>,++ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,}#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]@@ -1100,6 +1136,17 @@ pub struct MigrateNetworkTokenData {/// Card Typepub card_type: Option<String>,++ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,}#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]@@ -1179,6 +1226,9 @@ impl CardDetailUpdate {card_network: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,}}}@@ -1218,6 +1268,9 @@ impl CardDetailUpdate {card_network: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_cvc: None,}}@@ -1265,7 +1318,7 @@ pub struct RawProxyCardDataResponse {#[serde(rename_all = "snake_case")]pub enum RawPaymentMethodData {Card(CardDetail),- CardWithNT(RawCardWithNTDetails),+ CardWithNT(Box<RawCardWithNTDetails>),BankDebit(BankDebitDetail),ProxyCard(RawProxyCardDataResponse),}@@ -1680,6 +1733,9 @@ pub struct CardDetailsPaymentMethod {pub card_issuer: Option<String>,pub card_network: Option<api_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<api_enums::CardSegmentType>,+ pub funding_source: Option<api_enums::FundingSource>,#[serde(default = "saved_in_locker_default")]pub saved_to_locker: bool,pub co_badged_card_data: Option<CoBadgedCardDataToBeSaved>,@@ -1961,6 +2017,9 @@ impl From<(Card, Option<common_enums::CardNetwork>)> for CardDetail {card_network,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,}}}@@ -2000,6 +2059,11 @@ pub struct CardDetailFromLocker {pub card_isin: Option<String>,pub card_issuer: Option<String>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,pub saved_to_locker: bool,}@@ -2038,6 +2102,12 @@ pub struct CardDetailFromLocker {pub card_issuer: Option<String>,#[schema(value_type=Option<String>, example = "Credit")]pub card_type: Option<String>,+ #[schema(value_type=Option<String>, example = "CLASSIC")]+ pub card_subtype: Option<String>,+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,#[schema(value_type=bool, example = true)]pub saved_to_locker: bool,}@@ -2058,6 +2128,9 @@ impl From<CardDetailFromLocker> for payments::AdditionalCardInfo {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,card_issuing_country: item.issuer_country,card_issuing_country_code: item.issuer_country_code,bank_code: None,@@ -2085,6 +2158,9 @@ impl From<CardDetailFromLocker> for payments::AdditionalCardInfo {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,card_issuing_country: item.issuer_country.map(|country| country.to_string()),card_issuing_country_code: None,bank_code: None,@@ -2134,6 +2210,9 @@ impl From<CardDetailsPaymentMethod> for CardDetailFromLocker {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,}}@@ -2161,6 +2240,9 @@ impl From<CardDetailsPaymentMethod> for CardDetailFromLocker {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,}}@@ -2181,6 +2263,9 @@ impl From<CardDetail> for CardDetailFromLocker {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type.map(|card| card.to_string()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: true,card_fingerprint: None,}@@ -2208,6 +2293,9 @@ impl From<CardDetail> for CardDetailFromLocker {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type.map(|card| card.to_string()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: true,card_fingerprint: None,scheme: card_scheme,@@ -2230,6 +2318,9 @@ impl From<CardDetail> for CardDetailsPaymentMethod {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type.map(|card| card.to_string()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: true,co_badged_card_data: None,issuer_country_code: None,@@ -2254,6 +2345,9 @@ impl From<(CardDetailFromLocker, Option<&CoBadgedCardData>)> for CardDetailsPaymcard_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,co_badged_card_data: co_badged_card_data.map(CoBadgedCardDataToBeSaved::from),}@@ -2274,6 +2368,9 @@ impl From<CardDetailFromLocker> for CardDetailsPaymentMethod {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,co_badged_card_data: None,issuer_country_code: None,@@ -4314,6 +4411,9 @@ implcard_holder_name: record.card_holder_name.clone().or(record.name.clone()),card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuer: None,card_issuing_country: None,card_issuing_country_code: None,@@ -4342,6 +4442,9 @@ implcard_network: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,},network_token_requestor_ref_id: record.network_token_requestor_ref_id@@ -4456,6 +4559,17 @@ pub struct TokenizeCardRequest {/// Card Typepub card_type: Option<CardType>,++ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>)]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN+ #[schema(value_type = Option<FundingSource>)]+ pub funding_source: Option<api_enums::FundingSource>,}#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]@@ -4512,6 +4626,9 @@ impl From<&Card> for MigrateCardDetail {card_network: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,}}}diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 946a0a5f10..ea3024b2e1 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -2607,6 +2607,22 @@ pub struct Card {#[smithy(value_type = "Option<String>")]pub card_type: Option<String>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ #[schema(example = "CLASSIC")]+ #[smithy(value_type = "Option<String>")]+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>, example = "consumer")]+ #[smithy(value_type = "Option<CardSegmentType>")]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded. More granular than `card_type`, which collapses+ /// deferred debit and charge cards.+ #[schema(value_type = Option<FundingSource>, example = "CREDIT")]+ #[smithy(value_type = "Option<FundingSource>")]+ pub funding_source: Option<api_enums::FundingSource>,+#[schema(example = "INDIA")]#[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,@@ -2671,6 +2687,22 @@ pub struct CardWithNoCVC {#[smithy(value_type = "Option<String>")]pub card_type: Option<String>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`+ #[schema(example = "CLASSIC")]+ #[smithy(value_type = "Option<String>")]+ pub card_subtype: Option<String>,++ /// The segment the card is issued to+ #[schema(value_type = Option<CardSegmentType>, example = "consumer")]+ #[smithy(value_type = "Option<CardSegmentType>")]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded. More granular than `card_type`, which collapses+ /// deferred debit and charge cards.+ #[schema(value_type = Option<FundingSource>, example = "CREDIT")]+ #[smithy(value_type = "Option<FundingSource>")]+ pub funding_source: Option<api_enums::FundingSource>,+#[schema(example = "INDIA")]#[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,@@ -2703,6 +2735,9 @@ impl TryFrom<payment_methods::CardDetail> for Card {nick_name,card_network,card_issuer,+ card_subtype,+ card_segment_type,+ funding_source,card_cvc,..} = value;@@ -2718,6 +2753,9 @@ impl TryFrom<payment_methods::CardDetail> for Card {card_issuer,card_network,card_type: None,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -4165,6 +4203,18 @@ pub struct AdditionalCardInfo {/// Card type, can be either `credit` or `debit`pub card_type: Option<String>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`.+ /// Free form, as the value comes straight from the BIN record.+ pub card_subtype: Option<String>,++ /// The segment the card is issued to, as recorded against its BIN+ #[schema(value_type = Option<CardSegmentType>, example = "consumer")]+ pub card_segment_type: Option<api_enums::CardSegmentType>,++ /// How the card is funded, as recorded against its BIN. More granular than+ /// `card_type`, which collapses deferred debit and charge cards.+ pub funding_source: Option<api_enums::FundingSource>,+pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -5896,6 +5946,18 @@ pub struct CardResponse {pub last4: Option<String>,#[smithy(value_type = "Option<String>")]pub card_type: Option<String>,+ /// The product the card is issued under, e.g. `CLASSIC` or `ELECTRON`.+ #[smithy(value_type = "Option<String>")]+ pub card_subtype: Option<String>,+ /// The segment the card is issued to, as recorded against its BIN+ #[schema(value_type = Option<CardSegmentType>, example = "consumer")]+ #[smithy(value_type = "Option<CardSegmentType>")]+ pub card_segment_type: Option<api_enums::CardSegmentType>,+ /// How the card is funded, as recorded against its BIN. More granular than+ /// `card_type`, which collapses deferred debit and charge cards.+ #[schema(value_type = Option<FundingSource>, example = "CREDIT")]+ #[smithy(value_type = "Option<FundingSource>")]+ pub funding_source: Option<api_enums::FundingSource>,#[schema(value_type = Option<CardNetwork>, example = "Visa")]#[smithy(value_type = "Option<CardNetwork>")]pub card_network: Option<api_enums::CardNetwork>,@@ -9487,6 +9549,9 @@ impl From<AdditionalCardInfo> for CardResponse {Self {last4: card.last4,card_type: card.card_type,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_network: card.card_network,card_issuer: card.card_issuer,card_issuing_country: card.card_issuing_country,diff --git a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rsindex fbc3dbb77e..e4a8a767ff 100644--- a/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs@@ -212,6 +212,9 @@ implcard_isin: Some(item.response.payment_method.first_six),card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rsindex fc61fc776a..610f9e0a43 100644--- a/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs@@ -576,6 +576,9 @@ implcard_isin: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/hyperswitch_domain_models/src/bulk_tokenization.rs b/crates/hyperswitch_domain_models/src/bulk_tokenization.rsindex 2a086a3d3b..335260f9cb 100644--- a/crates/hyperswitch_domain_models/src/bulk_tokenization.rs+++ b/crates/hyperswitch_domain_models/src/bulk_tokenization.rs@@ -42,6 +42,9 @@ pub struct TokenizeCardRequest {pub card_network: Option<enums::CardNetwork>,pub card_issuer: Option<String>,pub card_type: Option<payment_methods_api::CardType>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<enums::CardSegmentType>,+ pub funding_source: Option<enums::FundingSource>,}#[derive(Clone, Debug)]@@ -64,6 +67,9 @@ pub struct CardNetworkTokenizeRecord {pub card_network: Option<enums::CardNetwork>,pub card_issuer: Option<String>,pub card_type: Option<payment_methods_api::CardType>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<enums::CardSegmentType>,+ pub funding_source: Option<enums::FundingSource>,// Payment method detailspub payment_method_id: Option<String>,@@ -171,6 +177,9 @@ impl ForeignTryFrom<CardNetworkTokenizeRecord> for payment_methods_api::CardNetwcard_network: record.card_network,card_issuer: record.card_issuer,card_type: record.card_type.clone(),+ card_subtype: record.card_subtype,+ card_segment_type: record.card_segment_type,+ funding_source: record.funding_source,},),billing,@@ -215,6 +224,9 @@ impl ForeignFrom<&TokenizeCardRequest> for payment_methods_api::MigrateCardDetai.card_type.as_ref().map(|card_type| card_type.to_string()),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,}}}@@ -263,6 +275,9 @@ impl ForeignFrom<payment_methods_api::TokenizeDataRequest> for TokenizeDataRequecard_network: card.card_network,card_issuer: card.card_issuer,card_type: card.card_type,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,})}payment_methods_api::TokenizeDataRequest::ExistingPaymentMethod(pm) => {diff --git a/crates/hyperswitch_domain_models/src/mandates.rs b/crates/hyperswitch_domain_models/src/mandates.rsindex 14985bbf1d..5840b73e5f 100644--- a/crates/hyperswitch_domain_models/src/mandates.rs+++ b/crates/hyperswitch_domain_models/src/mandates.rs@@ -780,6 +780,9 @@ impl From<&UpdatedMandateDetails> for api_models::payments::AdditionalCardInfo {card_isin: card_info.card_isin.clone(),card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/hyperswitch_domain_models/src/payment_method_data.rs b/crates/hyperswitch_domain_models/src/payment_method_data.rsindex b27bbea94a..7db3c5a516 100644--- a/crates/hyperswitch_domain_models/src/payment_method_data.rs+++ b/crates/hyperswitch_domain_models/src/payment_method_data.rs@@ -115,6 +115,12 @@ pub struct NetworkTransactionIdAndCardDetails {pub card_type: Option<String>,+ pub card_subtype: Option<String>,++ pub card_segment_type: Option<api_enums::CardSegmentType>,++ pub funding_source: Option<api_enums::FundingSource>,+pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,@@ -450,6 +456,9 @@ pub struct Card {pub card_issuer: Option<String>,pub card_network: Option<common_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -478,6 +487,14 @@ impl Card {.clone().or(additional_card_info.card_network.clone()),card_type: self.card_type.clone().or(additional_card_info.card_type),+ card_subtype: self+ .card_subtype+ .clone()+ .or(additional_card_info.card_subtype),+ card_segment_type: self+ .card_segment_type+ .or(additional_card_info.card_segment_type),+ funding_source: self.funding_source.or(additional_card_info.funding_source),card_issuing_country: self.card_issuing_country.clone()@@ -512,6 +529,9 @@ pub struct CardWithOptionalCVC {pub card_issuer: Option<String>,pub card_network: Option<common_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -557,6 +577,14 @@ impl CardWithOptionalCVC {.clone().or(additional_card_info.card_network.clone()),card_type: self.card_type.clone().or(additional_card_info.card_type),+ card_subtype: self+ .card_subtype+ .clone()+ .or(additional_card_info.card_subtype),+ card_segment_type: self+ .card_segment_type+ .or(additional_card_info.card_segment_type),+ funding_source: self.funding_source.or(additional_card_info.funding_source),card_issuing_country: self.card_issuing_country.clone()@@ -624,6 +652,9 @@ pub struct CardDetailsForNetworkTransactionId {pub card_issuer: Option<String>,pub card_network: Option<common_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -650,6 +681,14 @@ impl CardDetailsForNetworkTransactionId {.clone().or(additional_card_info.card_network.clone()),card_type: self.card_type.clone().or(additional_card_info.card_type),+ card_subtype: self+ .card_subtype+ .clone()+ .or(additional_card_info.card_subtype),+ card_segment_type: self+ .card_segment_type+ .or(additional_card_info.card_segment_type),+ funding_source: self.funding_source.or(additional_card_info.funding_source),card_issuing_country: self.card_issuing_country.clone()@@ -698,6 +737,9 @@ pub struct CardDetail {pub card_issuer: Option<String>,pub card_network: Option<api_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -714,6 +756,9 @@ pub struct CardWithLimitedDetails {pub card_issuer: Option<String>,pub card_network: Option<api_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_issuing_country: Option<String>,pub card_issuing_country_code: Option<String>,pub bank_code: Option<String>,@@ -741,6 +786,14 @@ impl CardWithLimitedDetails {.clone().or(additional_card_info.card_network.clone()),card_type: self.card_type.clone().or(additional_card_info.card_type),+ card_subtype: self+ .card_subtype+ .clone()+ .or(additional_card_info.card_subtype),+ card_segment_type: self+ .card_segment_type+ .or(additional_card_info.card_segment_type),+ funding_source: self.funding_source.or(additional_card_info.funding_source),card_issuing_country: self.card_issuing_country.clone()@@ -852,6 +905,9 @@ impl From<&Card> for CardDetail {card_issuer: item.card_issuer.to_owned(),card_network: item.card_network.to_owned(),card_type: item.card_type.to_owned(),+ card_subtype: item.card_subtype.to_owned(),+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,card_issuing_country: item.card_issuing_country.to_owned(),card_issuing_country_code: item.card_issuing_country_code.to_owned(),bank_code: item.bank_code.to_owned(),@@ -871,6 +927,9 @@ impl From<CardWithLimitedData> for CardWithLimitedDetails {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -890,6 +949,9 @@ impl From<NetworkTransactionIdAndCardDetails> for CardDetailsForNetworkTransacticard_issuer: card_details_for_nti.card_issuer,card_network: card_details_for_nti.card_network,card_type: card_details_for_nti.card_type,+ card_subtype: card_details_for_nti.card_subtype,+ card_segment_type: card_details_for_nti.card_segment_type,+ funding_source: card_details_for_nti.funding_source,card_issuing_country: card_details_for_nti.card_issuing_country,card_issuing_country_code: card_details_for_nti.card_issuing_country_code,bank_code: card_details_for_nti.bank_code,@@ -1979,6 +2041,9 @@ impl TryFrom<payment_methods::PaymentMethodCreateData> for PaymentMethodData {card_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,nick_name,card_holder_name,@@ -1990,6 +2055,9 @@ impl TryFrom<payment_methods::PaymentMethodCreateData> for PaymentMethodData {card_issuer,card_network,card_type: card_type.map(|card_type| card_type.to_string()),+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country: card_issuing_country.map(|country| country.to_string()),card_issuing_country_code: None,bank_code: None,@@ -2189,6 +2257,9 @@ implcard_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,card_issuing_country_code,bank_code,@@ -2203,6 +2274,9 @@ implcard_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,card_issuing_country_code,bank_code,@@ -2233,6 +2307,9 @@ implcard_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,card_issuing_country_code,bank_code,@@ -2247,6 +2324,9 @@ implcard_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,card_issuing_country_code,bank_code,@@ -2457,6 +2537,9 @@ implcard_issuer: card_detail.card_issuer,card_network: card_detail.card_network,card_type: card_detail.card_type.map(|val| val.to_string()),+ card_subtype: card_detail.card_subtype,+ card_segment_type: card_detail.card_segment_type,+ funding_source: card_detail.funding_source,card_issuing_country: card_detail.card_issuing_country.map(|val| val.to_string()),card_issuing_country_code: None,bank_code: None,@@ -2480,6 +2563,9 @@ impl From<Card> for payment_methods::CardDetail {card_network: card.card_network,card_issuer: card.card_issuer,card_type: None,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_cvc: Some(card.card_cvc),}}@@ -3994,6 +4080,9 @@ pub struct CardDetailsPaymentMethod {pub card_issuer: Option<String>,pub card_network: Option<api_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,#[serde(default = "saved_in_locker_default")]pub saved_to_locker: bool,pub co_badged_card_data: Option<payment_methods::CoBadgedCardDataToBeSaved>,@@ -4012,6 +4101,9 @@ pub struct CardDetailsPaymentMethod {pub card_issuer: Option<String>,pub card_network: Option<api_enums::CardNetwork>,pub card_type: Option<String>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,#[serde(default = "saved_in_locker_default")]pub saved_to_locker: bool,}@@ -4067,6 +4159,9 @@ impl TryFrom<CardNumberWithStoredDetails> for payment_methods::CardDetail {card_type: item.card_type.and_then(|card_type| payment_methods::CardType::from_str(&card_type).ok()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,card_cvc,})}@@ -4081,6 +4176,9 @@ impl CardDetailsPaymentMethod {card_issuer: self.card_issuer.clone(),card_network: self.card_network.clone(),card_type: self.card_type.clone(),+ card_subtype: self.card_subtype.clone(),+ card_segment_type: self.card_segment_type,+ funding_source: self.funding_source,issuer_country: self.clone().get_issuer_country_alpha2(),last4_digits: self.last4_digits,expiry_month: self.expiry_month,@@ -4117,6 +4215,9 @@ impl From<CardDetailsPaymentMethod> for payment_methods::CardDetailsPaymentMethocard_issuer: domain_card.card_issuer,card_network: domain_card.card_network,card_type: domain_card.card_type,+ card_subtype: domain_card.card_subtype,+ card_segment_type: domain_card.card_segment_type,+ funding_source: domain_card.funding_source,saved_to_locker: domain_card.saved_to_locker,co_badged_card_data: None,}@@ -4140,6 +4241,9 @@ impl From<payment_methods::CardDetail> for CardDetailsPaymentMethod {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type.map(|card| card.to_string()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: true,co_badged_card_data: None,}@@ -4171,6 +4275,9 @@ implcard_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,co_badged_card_data: co_badged_card_data.map(payment_methods::CoBadgedCardDataToBeSaved::from),@@ -4192,6 +4299,9 @@ impl From<payment_methods::CardDetailsPaymentMethod> for CardDetailsPaymentMethocard_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type,+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: item.saved_to_locker,}}@@ -4211,6 +4321,9 @@ impl From<payment_methods::CardDetail> for CardDetailsPaymentMethod {card_issuer: item.card_issuer,card_network: item.card_network,card_type: item.card_type.map(|card| card.to_string()),+ card_subtype: item.card_subtype,+ card_segment_type: item.card_segment_type,+ funding_source: item.funding_source,saved_to_locker: true,}}@@ -4305,6 +4418,9 @@ impl From<Card> for payment_methods::CardDetail {card_network: card_data.card_network.clone(),card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,}}}@@ -4324,6 +4440,9 @@ impl From<NetworkTokenData> for payment_methods::CardDetail {card_network: network_token_data.card_network.clone(),card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,}}}@@ -4441,6 +4560,9 @@ implcard_issuing_country,card_issuing_country_code,card_type,+ card_subtype,+ card_segment_type,+ funding_source,..},card_token_data,@@ -4473,6 +4595,9 @@ implcard_issuer,card_network,card_type,+ card_subtype,+ card_segment_type,+ funding_source,card_issuing_country,card_issuing_country_code,bank_code: None,@@ -4534,6 +4659,9 @@ implcard_issuer: card_details.card_issuer,card_network: card_details.card_network,card_type: card_details.card_type,+ card_subtype: card_details.card_subtype,+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,card_issuing_country: card_details.issuer_country,card_issuing_country_code: card_details.issuer_country_code,bank_code: None,@@ -4590,6 +4718,9 @@ impl From<api_mandates::NetworkTransactionIdAndCardDetails> for NetworkTransacticard_issuer: value.card_issuer,card_network: value.card_network,card_type: value.card_type,+ card_subtype: value.card_subtype,+ card_segment_type: value.card_segment_type,+ funding_source: value.funding_source,card_issuing_country: value.card_issuing_country,card_issuing_country_code: value.card_issuing_country_code,bank_code: value.bank_code,diff --git a/crates/hyperswitch_domain_models/src/vault.rs b/crates/hyperswitch_domain_models/src/vault.rsindex 26ee656867..38f3abcd83 100644--- a/crates/hyperswitch_domain_models/src/vault.rs+++ b/crates/hyperswitch_domain_models/src/vault.rs@@ -233,6 +233,9 @@ impl PaymentMethodVaultingData {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,saved_to_locker: false,#[cfg(feature = "v1")]co_badged_card_data: None,@@ -633,6 +636,9 @@ impl From<payment_methods::Card> for PaymentMethodVaultingData {card_issuing_country: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,})}}diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rsindex 90df76d52f..35548102c5 100644--- a/crates/openapi/src/openapi_v2.rs+++ b/crates/openapi/src/openapi_v2.rs@@ -419,6 +419,8 @@ Never share your secret api keys. Keep them guarded and secure.api_models::enums::PaymentLinkSdkLabelType,api_models::enums::PaymentLinkShowSdkTerms,api_models::enums::OrganizationType,+ api_models::enums::FundingSource,+ api_models::enums::CardSegmentType,api_models::enums::GooglePayCardFundingSource,api_models::enums::VaultTokenType,api_models::enums::StorageType,diff --git a/crates/payment_methods/src/client/create.rs b/crates/payment_methods/src/client/create.rsindex 8911314ac7..81e9f4639e 100644--- a/crates/payment_methods/src/client/create.rs+++ b/crates/payment_methods/src/client/create.rs@@ -63,6 +63,9 @@ pub struct CardDetail {pub card_network: Option<common_enums::CardNetwork>,pub card_issuer: Option<String>,pub card_type: Option<common_enums::CardType>,+ pub card_subtype: Option<String>,+ pub card_segment_type: Option<common_enums::CardSegmentType>,+ pub funding_source: Option<common_enums::FundingSource>,pub card_cvc: Option<Secret<String>>,}@@ -167,6 +170,9 @@ impl TryFrom<PaymentMethodData> for PaymentMethodCreateData {card_network: card.card_network,card_issuer: card.card_issuer,card_type: None,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_cvc: Some(card.card_cvc),};Ok(Self::Card(card_detail))diff --git a/crates/payment_methods/src/core/migration/payment_methods.rs b/crates/payment_methods/src/core/migration/payment_methods.rsindex 81dab939ea..cbff632d80 100644--- a/crates/payment_methods/src/core/migration/payment_methods.rs+++ b/crates/payment_methods/src/core/migration/payment_methods.rs@@ -381,6 +381,14 @@ impl.clone().or(card_bin_info.card_network),card_type: card_details.card_type.clone().or(card_bin_info.card_type),+ card_subtype: card_details+ .card_subtype+ .clone()+ .or(card_bin_info.card_subtype),+ card_segment_type: card_details.card_segment_type.or(card_bin_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok())),+ funding_source: card_details.funding_source.or(card_bin_info.funding_source),saved_to_locker: false,})} else {@@ -403,6 +411,9 @@ implcard_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,saved_to_locker: false,})}@@ -461,6 +472,14 @@ impl.clone().or(card_bin_info.card_network),card_type: card_details.card_type.clone().or(card_bin_info.card_type),+ card_subtype: card_details+ .card_subtype+ .clone()+ .or(card_bin_info.card_subtype),+ card_segment_type: card_details.card_segment_type.or(card_bin_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok())),+ funding_source: card_details.funding_source.or(card_bin_info.funding_source),saved_to_locker: false,})} else {@@ -483,6 +502,9 @@ implcard_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,saved_to_locker: false,})}diff --git a/crates/payment_methods/src/helpers.rs b/crates/payment_methods/src/helpers.rsindex 0e15825736..65cb208885 100644--- a/crates/payment_methods/src/helpers.rs+++ b/crates/payment_methods/src/helpers.rs@@ -21,6 +21,9 @@ pub async fn populate_bin_details_for_payment_method_create(card_issuer: card_details.card_issuer.to_owned(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.to_owned(),+ card_subtype: card_details.card_subtype.to_owned(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,card_issuing_country: card_details.card_issuing_country.to_owned(),card_issuing_country_code: card_details.card_issuing_country_code.to_owned(),card_exp_month: card_details.card_exp_month.clone(),@@ -45,6 +48,11 @@ pub async fn populate_bin_details_for_payment_method_create(card_issuer: card_info.card_issuer,card_network: card_info.card_network.clone(),card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,card_issuing_country: card_info.card_issuing_country,card_issuing_country_code: card_details.card_issuing_country_code,card_exp_month: card_details.card_exp_month.clone(),@@ -58,6 +66,9 @@ pub async fn populate_bin_details_for_payment_method_create(card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,card_cvc: card_details.card_cvc.clone(),diff --git a/crates/payment_methods/src/types.rs b/crates/payment_methods/src/types.rsindex e5d79955a1..1f6f5757d6 100644--- a/crates/payment_methods/src/types.rs+++ b/crates/payment_methods/src/types.rs@@ -116,7 +116,7 @@ pub struct ModularPMRetrieveResponse {#[serde(rename_all = "snake_case")]pub enum RawPaymentMethodData {Card(CardDetail),- CardWithNT(RawCardWithNTDetails),+ CardWithNT(Box<RawCardWithNTDetails>),BankDebit(BankDebitDetail),ProxyCard(RawProxyCardDataResponse),}diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rsindex b53a9d5951..f0b0a140bc 100644--- a/crates/router/src/compatibility/stripe/payment_intents/types.rs+++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs@@ -135,6 +135,9 @@ impl From<StripeCard> for payments::Card {card_issuing_country: None,card_issuing_country_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,nick_name: None,}}diff --git a/crates/router/src/compatibility/stripe/setup_intents/types.rs b/crates/router/src/compatibility/stripe/setup_intents/types.rsindex 8ec5bf4604..a300d7c680 100644--- a/crates/router/src/compatibility/stripe/setup_intents/types.rs+++ b/crates/router/src/compatibility/stripe/setup_intents/types.rs@@ -104,6 +104,9 @@ impl From<StripeCard> for payments::Card {card_issuing_country: None,card_issuing_country_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,nick_name: None,}}diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rsindex 3f37dfd026..3bf1a81546 100644--- a/crates/router/src/core/payment_methods.rs+++ b/crates/router/src/core/payment_methods.rs@@ -1343,6 +1343,9 @@ pub(crate) fn get_payment_method_create_request(.transpose().ok().flatten(),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_cvc: Some(card.card_cvc.clone()),};let payment_method_request = payment_methods::PaymentMethodCreate {@@ -1460,6 +1463,9 @@ pub(crate) async fn get_payment_method_create_request(card_network: card_network.clone(),card_issuer: card.card_issuer.clone(),card_type: card.card_type.clone(),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_cvc: None, // DO NOT POPULATE CVC FOR ADDITIONAL PAYMENT METHOD DATA};let payment_method_request = payment_methods::PaymentMethodCreate {@@ -1506,6 +1512,9 @@ pub(crate) async fn get_payment_method_create_request(card_network: card_network.clone(),card_issuer: card.card_issuer.clone(),card_type: card.card_type.clone(),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_cvc: None, // DO NOT POPULATE CVC FOR ADDITIONAL PAYMENT METHOD DATA};let payment_method_request = payment_methods::PaymentMethodCreate {@@ -3929,6 +3938,15 @@ impl PaymentMethodExt for domain::PaymentMethodVaultingData {.ok().flatten()}),+ card_subtype: card_info+ .as_ref()+ .and_then(|val| val.card_subtype.clone()),+ card_segment_type: card_info.as_ref().and_then(|val| {+ val.card_segment_type+ .as_deref()+ .and_then(|segment_type| segment_type.parse().ok())+ }),+ funding_source: card_info.as_ref().and_then(|val| val.funding_source),card_cvc: card.card_cvc.clone(),}),payment_method_subtype,@@ -4056,6 +4074,9 @@ impl PaymentMethodExt for payment_methods::PaymentMethodCreateData {card_network: card_details.card_network,card_issuer: card_details.card_issuer,card_type: card_details.card_type,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_isin: card_details.bin_number,saved_to_locker: false,co_badged_card_data: None,@@ -4076,6 +4097,9 @@ impl PaymentMethodExt for payment_methods::PaymentMethodCreateData {card_type: card_details.card_type.map(|card_type| card_type.to_string()),+ card_subtype: card_details.card_subtype,+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,saved_to_locker: false,card_isin: None,last4_digits: None,@@ -5969,12 +5993,12 @@ pub async fn retrieve_payment_method((Some(payment_methods::RawPaymentMethodData::Card(card_details)),Some(network_token_details),- ) => Some(payment_methods::RawPaymentMethodData::CardWithNT(+ ) => Some(payment_methods::RawPaymentMethodData::CardWithNT(Box::new(payment_methods::RawCardWithNTDetails {card_details,network_token_details,},- )),+ ))),(raw_payment_method_data, _) => raw_payment_method_data,};@@ -6457,6 +6481,9 @@ impl RawPaymentMethodFetchAccess {card_network: network_token_details.card_network,card_issuer: network_token_details.card_issuer,card_type: network_token_details.card_type,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_cvc: None,}),_ => Err(report!(errors::ApiErrorResponse::GenericNotFoundError {diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rsindex 64b1d16f6e..223b3aa539 100644--- a/crates/router/src/core/payment_methods/cards.rs+++ b/crates/router/src/core/payment_methods/cards.rs@@ -414,6 +414,9 @@ impl PaymentMethodsController for PmCards<'_> {card_network: network_token_data.card_network.clone(),card_issuer: network_token_data.card_issuer.clone(),card_type: network_token_data.card_type.clone(),+ card_subtype: network_token_data.card_subtype.clone(),+ card_segment_type: network_token_data.card_segment_type,+ funding_source: network_token_data.funding_source,card_cvc: None,};@@ -2002,6 +2005,11 @@ impl PaymentMethodsController for PmCards<'_> {card_network: card.card_network.or(existing_pm_data.card_network),card_issuer: card.card_issuer.or(existing_pm_data.card_issuer),card_type: card.card_type.or(existing_pm_data.card_type),+ card_subtype: card.card_subtype.or(existing_pm_data.card_subtype),+ card_segment_type: card+ .card_segment_type+ .or(existing_pm_data.card_segment_type),+ funding_source: card.funding_source.or(existing_pm_data.funding_source),saved_to_locker: true,});@@ -2609,6 +2617,15 @@ pub async fn add_payment_method_data(card_isin: Some(card_isin),card_issuer: card_info.as_ref().and_then(|ci| ci.card_issuer.clone()),card_type: card_info.as_ref().and_then(|ci| ci.card_type.clone()),+ card_subtype: card_info+ .as_ref()+ .and_then(|ci| ci.card_subtype.clone()),+ card_segment_type: card_info.as_ref().and_then(|ci| {+ ci.card_segment_type+ .as_deref()+ .and_then(|segment_type| segment_type.parse().ok())+ }),+ funding_source: card_info.as_ref().and_then(|ci| ci.funding_source),saved_to_locker: true,co_badged_card_data: None,};@@ -2900,6 +2917,9 @@ pub async fn update_customer_payment_method(card_isin: existing_card_data.card_isin,card_issuer: card_update.card_issuer.or(existing_card_data.card_issuer),card_type: existing_card_data.card_type,+ card_subtype: existing_card_data.card_subtype,+ card_segment_type: existing_card_data.card_segment_type,+ funding_source: existing_card_data.funding_source,saved_to_locker: true,});diff --git a/crates/router/src/core/payment_methods/tokenize.rs b/crates/router/src/core/payment_methods/tokenize.rsindex 9f3d677df4..8ac165d16f 100644--- a/crates/router/src/core/payment_methods/tokenize.rs+++ b/crates/router/src/core/payment_methods/tokenize.rs@@ -277,6 +277,9 @@ wherecard_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,saved_to_locker,co_badged_card_data: card_details.co_badged_card_data@@ -313,6 +316,9 @@ wherecard_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,saved_to_locker,co_badged_card_data: None,});diff --git a/crates/router/src/core/payment_methods/tokenize/card_executor.rs b/crates/router/src/core/payment_methods/tokenize/card_executor.rsindex 99492ef281..ac77562697 100644--- a/crates/router/src/core/payment_methods/tokenize/card_executor.rs+++ b/crates/router/src/core/payment_methods/tokenize/card_executor.rs@@ -127,6 +127,25 @@ impl<'a> NetworkTokenizationBuilder<'a, CardRequestValidated> {.map(|card_type| card_type.to_string()),|card_info| card_info.card_type.clone(),),+ card_subtype: optional_card_info+ .as_ref()+ .map_or(card_req.card_subtype.clone(), |card_info| {+ card_info.card_subtype.clone()+ }),+ card_segment_type: optional_card_info.as_ref().map_or(+ card_req.card_segment_type,+ |card_info| {+ card_info+ .card_segment_type+ .as_deref()+ .and_then(|segment_type| segment_type.parse().ok())+ },+ ),+ funding_source: optional_card_info+ .as_ref()+ .map_or(card_req.funding_source, |card_info| {+ card_info.funding_source+ }),card_issuing_country: optional_card_info.as_ref().map_or(card_req.card_issuing_country.clone(), |card_info| {@@ -268,6 +287,9 @@ impl<'a> NetworkTokenizationBuilder<'a, CardTokenStored> {card_isin: Some(card.card_number.clone().get_card_isin()),card_issuer: card.card_issuer.clone(),card_type: card.card_type.clone(),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,saved_to_locker: true,});let payment_method_response = api::PaymentMethodResponse {@@ -569,6 +591,9 @@ impl CardNetworkTokenizeExecutor<'_, domain::TokenizeCardRequest> {card_network: card_details.card_network.clone(),card_issuer: card_details.card_issuer.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,card_cvc: None, // DO NOT POPULATE CVC FOR ADDITIONAL PAYMENT METHOD DATA}),metadata: None,diff --git a/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs b/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rsindex b880b18fd5..bde01f3b79 100644--- a/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs+++ b/crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs@@ -146,6 +146,18 @@ impl<'a> NetworkTokenizationBuilder<'a, PmValidated> {card_type: optional_card_info.as_ref().and_then(|card_info| card_info.card_type.clone()),+ card_subtype: optional_card_info+ .as_ref()+ .and_then(|card_info| card_info.card_subtype.clone()),+ card_segment_type: optional_card_info.as_ref().and_then(|card_info| {+ card_info+ .card_segment_type+ .as_deref()+ .and_then(|segment_type| segment_type.parse().ok())+ }),+ funding_source: optional_card_info+ .as_ref()+ .and_then(|card_info| card_info.funding_source),card_issuing_country: optional_card_info.as_ref().and_then(|card_info| card_info.card_issuing_country.clone()),diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rsindex 12f25ac646..e411ec5eaa 100644--- a/crates/router/src/core/payment_methods/transformers.rs+++ b/crates/router/src/core/payment_methods/transformers.rs@@ -589,6 +589,9 @@ pub fn mk_add_card_response_hs(card_issuer: card.card_issuer,card_network: card.card_network,card_type: card.card_type,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,saved_to_locker: true,};domain::PaymentMethodResponse {@@ -638,6 +641,9 @@ pub fn generate_pm_vaulting_req_from_update_request(card_network: card_create.card_network,card_issuer: card_create.card_issuer,card_type: card_create.card_type,+ card_subtype: card_create.card_subtype,+ card_segment_type: card_create.card_segment_type,+ funding_source: card_create.funding_source,card_holder_name: update_card.card_holder_name.or(card_create.card_holder_name),@@ -886,6 +892,9 @@ pub fn get_card_detail(issuer_country_code: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,saved_to_locker: true,};Ok(card_detail)@@ -913,6 +922,9 @@ pub fn get_card_detail(card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,saved_to_locker: true,};Ok(card_detail)@@ -1737,6 +1749,9 @@ implcard_issuer: card_detail.card_issuer,card_network: card_detail.card_network,card_type: card_detail.card_type.map(|card_type| card_type.to_string()),+ card_subtype: card_detail.card_subtype,+ card_segment_type: card_detail.card_segment_type,+ funding_source: card_detail.funding_source,card_issuing_country: card_detail.card_issuing_country,card_issuing_country_code: None,bank_code: None,@@ -1769,6 +1784,9 @@ impl.card_details.card_type.map(|card_type| card_type.to_string()),+ card_subtype: card_with_nt.card_details.card_subtype,+ card_segment_type: card_with_nt.card_details.card_segment_type,+ funding_source: card_with_nt.card_details.funding_source,card_issuing_country: card_with_nt.card_details.card_issuing_country,card_issuing_country_code: None,bank_code: None,@@ -1908,6 +1926,9 @@ impl<'a>card_issuer: card_data.card_issuer.clone(),card_network: card_data.card_network.clone(),card_type: card_data.card_type.clone(),+ card_subtype: card_data.card_subtype.clone(),+ card_segment_type: card_data.card_segment_type,+ funding_source: card_data.funding_source,card_issuing_country: card_data.card_issuing_country.clone(),card_issuing_country_code: card_data.card_issuing_country_code.clone(),bank_code: card_data.bank_code.clone(),@@ -1937,6 +1958,9 @@ impl<'a>card_issuer: card_data.card_issuer.clone(),card_network: card_data.card_network.clone(),card_type: card_data.card_type.clone(),+ card_subtype: card_data.card_subtype.clone(),+ card_segment_type: card_data.card_segment_type,+ funding_source: card_data.funding_source,card_issuing_country: card_data.card_issuing_country.clone(),card_issuing_country_code: card_data.card_issuing_country_code.clone(),bank_code: card_data.bank_code.clone(),diff --git a/crates/router/src/core/payment_methods/vault.rs b/crates/router/src/core/payment_methods/vault.rsindex 9a86895bf2..fa00ad5ba6 100644--- a/crates/router/src/core/payment_methods/vault.rs+++ b/crates/router/src/core/payment_methods/vault.rs@@ -152,6 +152,9 @@ impl Vaultable for domain::Card {card_issuing_country: None,card_issuing_country_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,nick_name: value1.nickname.map(hyperswitch_masking::Secret::new),card_holder_name: value1.card_holder_name,co_badged_card_data: None,diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rsindex 3272a8845a..bb8b073c5e 100644--- a/crates/router/src/core/payments/helpers.rs+++ b/crates/router/src/core/payments/helpers.rs@@ -3229,6 +3229,9 @@ pub async fn fetch_card_details_from_internal_locker(.ok().flatten(),card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -3392,6 +3395,9 @@ pub async fn fetch_card_details_for_network_transaction_flow_from_locker(card_issuer: None,card_network,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -3620,6 +3626,9 @@ impl<'a>card_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,card_issuing_country: card_details.card_issuing_country.clone(),card_issuing_country_code: card_details.card_issuing_country_code@@ -3667,6 +3676,9 @@ impl<'a>card_issuer: card_details.card_issuer.clone(),card_network: card_details.card_network.clone(),card_type: card_details.card_type.clone(),+ card_subtype: card_details.card_subtype.clone(),+ card_segment_type: card_details.card_segment_type,+ funding_source: card_details.funding_source,card_issuing_country: card_details.card_issuing_country.clone(),card_issuing_country_code: card_details.card_issuing_country_code.clone(),bank_code: card_details.bank_code.clone(),@@ -6017,6 +6029,9 @@ pub async fn get_additional_payment_data(card_issuer: card_data.card_issuer.to_owned(),card_network,card_type: card_data.card_type.to_owned(),+ card_subtype: card_data.card_subtype.to_owned(),+ card_segment_type: card_data.card_segment_type,+ funding_source: card_data.funding_source,card_issuing_country: card_data.card_issuing_country.to_owned(),card_issuing_country_code: card_data.card_issuing_country_code.to_owned(),bank_code: card_data.bank_code.to_owned(),@@ -6052,6 +6067,11 @@ pub async fn get_additional_payment_data(card_network: card_network.clone().or(card_info.card_network),bank_code: card_info.bank_code,card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,card_issuing_country: card_info.card_issuing_country,card_issuing_country_code: card_info.country_code,last4: last4.clone(),@@ -6076,6 +6096,9 @@ pub async fn get_additional_payment_data(card_network,bank_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,last4,@@ -6155,6 +6178,9 @@ pub async fn get_additional_payment_data(card_issuer: card_data.card_issuer.to_owned(),card_network,card_type: card_data.card_type.to_owned(),+ card_subtype: card_data.card_subtype.to_owned(),+ card_segment_type: card_data.card_segment_type,+ funding_source: card_data.funding_source,card_issuing_country: card_data.card_issuing_country.to_owned(),card_issuing_country_code: card_data.card_issuing_country_code.to_owned(),bank_code: card_data.bank_code.to_owned(),@@ -6190,6 +6216,11 @@ pub async fn get_additional_payment_data(card_network: card_network.clone().or(card_info.card_network),bank_code: card_info.bank_code,card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,card_issuing_country: card_info.card_issuing_country,card_issuing_country_code: card_info.country_code,last4: last4.clone(),@@ -6214,6 +6245,9 @@ pub async fn get_additional_payment_data(card_network,bank_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,last4,@@ -6520,6 +6554,9 @@ pub async fn get_additional_payment_data(card_issuer: card_data.card_issuer.to_owned(),card_network,card_type: card_data.card_type.to_owned(),+ card_subtype: card_data.card_subtype.to_owned(),+ card_segment_type: card_data.card_segment_type,+ funding_source: card_data.funding_source,card_issuing_country: card_data.card_issuing_country.to_owned(),card_issuing_country_code: card_data.card_issuing_country_code.to_owned(),bank_code: card_data.bank_code.to_owned(),@@ -6555,6 +6592,11 @@ pub async fn get_additional_payment_data(card_network: card_network.clone().or(card_info.card_network),bank_code: card_info.bank_code,card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,card_issuing_country: card_info.card_issuing_country,card_issuing_country_code: card_info.country_code,last4: last4.clone(),@@ -6579,6 +6621,9 @@ pub async fn get_additional_payment_data(card_network,bank_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,last4,@@ -6623,6 +6668,9 @@ pub async fn get_additional_payment_data(card_issuer: card_with_limited_details.card_issuer.to_owned(),card_network: card_with_limited_details.card_network.clone(),card_type: card_with_limited_details.card_type.to_owned(),+ card_subtype: card_with_limited_details.card_subtype.to_owned(),+ card_segment_type: card_with_limited_details.card_segment_type,+ funding_source: card_with_limited_details.funding_source,card_issuing_country: card_with_limited_details.card_issuing_country.to_owned(),@@ -6665,6 +6713,11 @@ pub async fn get_additional_payment_data(.or(card_info.card_network),bank_code: card_info.bank_code,card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,card_issuing_country: card_info.card_issuing_country,card_issuing_country_code: card_info.country_code,last4: last4.clone(),@@ -6691,6 +6744,9 @@ pub async fn get_additional_payment_data(card_network: card_with_limited_details.card_network.clone(),bank_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,last4,diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rsindex 46cc7370bb..44fab4b692 100644--- a/crates/router/src/core/payments/operations/payment_confirm.rs+++ b/crates/router/src/core/payments/operations/payment_confirm.rs@@ -2115,6 +2115,9 @@ impl<F: Clone + Send + Sync> Domain<F, api::PaymentsRequest, PaymentData<F>> forcard_issuer: card.card_issuer,card_network: card.card_network,card_type: card.card_type,+ card_subtype: card.card_subtype,+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,card_issuing_country: card.card_issuing_country,card_issuing_country_code: card.card_issuing_country_code,bank_code: card.bank_code,diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rsindex 5034646677..98eb4a7761 100644--- a/crates/router/src/core/payments/tokenization.rs+++ b/crates/router/src/core/payments/tokenization.rs@@ -910,6 +910,15 @@ where.or(existing_pm_data.card_network),card_issuer: card.card_issuer.or(existing_pm_data.card_issuer),card_type: card.card_type.or(existing_pm_data.card_type),+ card_subtype: card+ .card_subtype+ .or(existing_pm_data.card_subtype),+ card_segment_type: card+ .card_segment_type+ .or(existing_pm_data.card_segment_type),+ funding_source: card+ .funding_source+ .or(existing_pm_data.funding_source),saved_to_locker: true,});@@ -1331,6 +1340,9 @@ async fn skip_saving_card_in_locker(card_issuer: card.card_issuer.clone(),card_network: card.card_network.clone(),card_type: card.card_type.clone(),+ card_subtype: card.card_subtype.clone(),+ card_segment_type: card.card_segment_type,+ funding_source: card.funding_source,saved_to_locker: false,};let pm_resp = domain::PaymentMethodResponse {@@ -1705,6 +1717,9 @@ pub async fn save_network_token_in_locker(card_network: Some(token_response.card_brand.clone()),card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,};let (res, dc) = Box::pin(PmCards { state, provider }.add_card_to_locker(@@ -2426,6 +2441,9 @@ impl From<NetworkTokenizationCardData<'_>> for domain::Card {card_type: None,card_issuing_country: None,card_issuing_country_code: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,bank_code: None,card_holder_name: tracking_data.billing_name.clone(),nick_name: locker_card.nick_name.clone().map(Secret::new),diff --git a/crates/router/src/core/payouts/helpers.rs b/crates/router/src/core/payouts/helpers.rsindex e355fe556c..9861c5a230 100644--- a/crates/router/src/core/payouts/helpers.rs+++ b/crates/router/src/core/payouts/helpers.rs@@ -396,6 +396,9 @@ pub async fn save_payout_data_to_locker(card_network: None,card_issuer: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,};let payload = StoreLockerReq::LockerCard(StoreCardReq {merchant_id: platform.get_processor().get_account().get_id().clone(),@@ -653,6 +656,11 @@ pub async fn save_payout_data_to_locker(card_issuer: card_info.card_issuer,card_network: card_info.card_network,card_type: card_info.card_type,+ card_subtype: card_info.card_subtype,+ card_segment_type: card_info+ .card_segment_type+ .and_then(|segment_type| segment_type.parse().ok()),+ funding_source: card_info.funding_source,saved_to_locker: true,co_badged_card_data: None,},@@ -675,6 +683,9 @@ pub async fn save_payout_data_to_locker(card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,saved_to_locker: true,co_badged_card_data: None,},diff --git a/crates/router/src/core/unified_authentication_service/utils.rs b/crates/router/src/core/unified_authentication_service/utils.rsindex ac80166a63..5b7dedf94a 100644--- a/crates/router/src/core/unified_authentication_service/utils.rs+++ b/crates/router/src/core/unified_authentication_service/utils.rs@@ -592,6 +592,9 @@ fn get_vault_details(card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,card_holder_name: None,diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rsindex 7f46764f94..4370e8c843 100644--- a/crates/router/src/core/unified_connector_service.rs+++ b/crates/router/src/core/unified_connector_service.rs@@ -123,6 +123,9 @@ impl ForeignTryFrom<payments_grpc::PaymentMethod> for domain_pm::PaymentMethodDacard_type: card.card_type,card_issuing_country: card.card_issuing_country_alpha2,card_issuing_country_code: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,bank_code: card.bank_code,nick_name: card.nick_name.map(Secret::new),co_badged_card_data: None,diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rsindex fbf669be71..e0633ce0ce 100644--- a/crates/router/src/types/api/payments.rs+++ b/crates/router/src/types/api/payments.rs@@ -155,6 +155,9 @@ mod payments_test {card_issuing_country: None,card_issuing_country_code: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),}}diff --git a/crates/router/src/types/storage/revenue_recovery_redis_operation.rs b/crates/router/src/types/storage/revenue_recovery_redis_operation.rsindex 56fb8482f8..974becc0b5 100644--- a/crates/router/src/types/storage/revenue_recovery_redis_operation.rs+++ b/crates/router/src/types/storage/revenue_recovery_redis_operation.rs@@ -64,6 +64,9 @@ impl From<&PaymentProcessorTokenDetails> for api_models::payments::AdditionalCarcard_issuer: data.card_issuer.clone(),card_network: data.card_network.clone(),card_type: data.card_type.clone(),+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,last4: data.last_four_digits.clone(),card_isin: data.card_isin.clone(),card_issuing_country: None,diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rsindex 2bdd3b8fc2..9c4cfd1c85 100644--- a/crates/router/src/types/transformers.rs+++ b/crates/router/src/types/transformers.rs@@ -2866,6 +2866,9 @@ impl ForeignFrom<&revenue_recovery_redis_operation::PaymentProcessorTokenStatus>card_issuer: card_info.card_issuer.to_owned(),card_network: card_info.card_network.to_owned(),card_type: card_info.card_type.to_owned(),+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/src/utils/verify_connector.rs b/crates/router/src/utils/verify_connector.rsindex 6847642170..a5e31e1b58 100644--- a/crates/router/src/utils/verify_connector.rs+++ b/crates/router/src/utils/verify_connector.rs@@ -21,6 +21,9 @@ pub fn generate_card_from_details(card_exp_month: hyperswitch_masking::Secret::new(card_exp_month),nick_name: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rsindex f6d4e08040..7d2c14e8ee 100644--- a/crates/router/tests/connectors/adyen.rs+++ b/crates/router/tests/connectors/adyen.rs@@ -163,6 +163,9 @@ impl AdyenTest {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/airwallex.rs b/crates/router/tests/connectors/airwallex.rsindex 088dde2f65..324aadcac9 100644--- a/crates/router/tests/connectors/airwallex.rs+++ b/crates/router/tests/connectors/airwallex.rs@@ -79,6 +79,9 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/fiserv.rs b/crates/router/tests/connectors/fiserv.rsindex bd873e8d1c..dfef4003ae 100644--- a/crates/router/tests/connectors/fiserv.rs+++ b/crates/router/tests/connectors/fiserv.rs@@ -50,6 +50,9 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/rapyd.rs b/crates/router/tests/connectors/rapyd.rsindex d00e8205b4..eb7a245c12 100644--- a/crates/router/tests/connectors/rapyd.rs+++ b/crates/router/tests/connectors/rapyd.rs@@ -50,6 +50,9 @@ async fn should_only_authorize_payment() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -80,6 +83,9 @@ async fn should_authorize_and_capture_payment() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/trustpayments.rs b/crates/router/tests/connectors/trustpayments.rsindex ef54ce42fe..d55ca973bc 100644--- a/crates/router/tests/connectors/trustpayments.rs+++ b/crates/router/tests/connectors/trustpayments.rs@@ -76,6 +76,9 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rsindex 919cdc6ee3..d603220e9c 100644--- a/crates/router/tests/connectors/utils.rs+++ b/crates/router/tests/connectors/utils.rs@@ -972,6 +972,9 @@ impl Default for CCardType {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rsindex 3d8a2568c2..72a2e97c8a 100644--- a/crates/router/tests/connectors/worldline.rs+++ b/crates/router/tests/connectors/worldline.rs@@ -80,6 +80,9 @@ impl WorldlineTest {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rsindex 022259f52e..b1f81e3158 100644--- a/crates/router/tests/payments.rs+++ b/crates/router/tests/payments.rs@@ -348,6 +348,9 @@ async fn payments_create_core() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -659,6 +662,9 @@ async fn payments_create_core_adyen_no_redirect() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rsindex fe78b3b671..91723583e4 100644--- a/crates/router/tests/payments2.rs+++ b/crates/router/tests/payments2.rs@@ -108,6 +108,9 @@ async fn payments_create_core() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,bank_code: None,@@ -428,6 +431,9 @@ async fn payments_create_core_adyen_no_redirect() {card_issuer: None,card_network: None,card_type: None,+ card_subtype: None,+ card_segment_type: None,+ funding_source: None,card_issuing_country: None,card_issuing_country_code: None,nick_name: Some(hyperswitch_masking::Secret::new("nick_name".into())),