Skip to content

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

feat(core): Add billing_descriptor in the payment intent (#10077)

Vani Gupta379cfd5a6c00
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index adc9fb04d4..61b5a12297 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -12585,6 +12585,40 @@
}
}
},
+ "BillingDescriptor": {
+ "type": "object",
+ "description": "Billing Descriptor information to be sent to the payment gateway",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name to be put in billing description",
+ "example": "John Doe",
+ "nullable": true
+ },
+ "city": {
+ "type": "string",
+ "description": "city to be put in billing description",
+ "example": "San Francisco",
+ "nullable": true
+ },
+ "phone": {
+ "type": "string",
+ "description": "phone to be put in billing description",
+ "example": "9123456789",
+ "nullable": true
+ },
+ "statement_descriptor": {
+ "type": "string",
+ "description": "a short description for the payment",
+ "nullable": true
+ },
+ "statement_descriptor_suffix": {
+ "type": "string",
+ "description": "Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor.",
+ "nullable": true
+ }
+ }
+ },
"BlikBankRedirectAdditionalData": {
"type": "object",
"properties": {
@@ -26094,14 +26128,16 @@
},
"statement_descriptor_name": {
"type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Hyperswitch Router",
"nullable": true,
"maxLength": 255
},
"statement_descriptor_suffix": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Payment for shoes purchase",
"nullable": true,
"maxLength": 255
@@ -26394,6 +26430,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -26569,14 +26613,16 @@
},
"statement_descriptor_name": {
"type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Hyperswitch Router",
"nullable": true,
"maxLength": 255
},
"statement_descriptor_suffix": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Payment for shoes purchase",
"nullable": true,
"maxLength": 255
@@ -26888,6 +26934,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -27540,6 +27594,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -28036,14 +28098,16 @@
},
"statement_descriptor_name": {
"type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Hyperswitch Router",
"nullable": true,
"maxLength": 255
},
"statement_descriptor_suffix": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Payment for shoes purchase",
"nullable": true,
"maxLength": 255
@@ -28382,6 +28446,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
},
"additionalProperties": false
@@ -29060,6 +29132,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
}
},
@@ -29386,14 +29466,16 @@
},
"statement_descriptor_name": {
"type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Hyperswitch Router",
"nullable": true,
"maxLength": 255
},
"statement_descriptor_suffix": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.",
+ "deprecated": true,
"example": "Payment for shoes purchase",
"nullable": true,
"maxLength": 255
@@ -29687,6 +29769,14 @@
}
],
"nullable": true
+ },
+ "billing_descriptor": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BillingDescriptor"
+ }
+ ],
+ "nullable": true
}
}
},
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 4b0c54ee69..d2d6908dc1 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -1072,12 +1072,12 @@ pub struct PaymentsRequest {
/// The shipping address for the payment
pub shipping: Option<Address>,
- /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
- #[schema(max_length = 255, example = "Hyperswitch Router")]
+ /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.
+ #[schema(max_length = 255, example = "Hyperswitch Router", deprecated)]
pub statement_descriptor_name: Option<String>,
- /// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
- #[schema(max_length = 255, example = "Payment for shoes purchase")]
+ /// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.
+ #[schema(max_length = 255, example = "Payment for shoes purchase", deprecated)]
pub statement_descriptor_suffix: Option<String>,
/// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount
@@ -1294,6 +1294,10 @@ pub struct PaymentsRequest {
/// The category of the MIT transaction
#[schema(value_type = Option<MitCategory>, example = "recurring")]
pub mit_category: Option<api_enums::MitCategory>,
+
+ /// Billing descriptor information for the payment
+ #[schema(value_type = Option<BillingDescriptor>)]
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@@ -5833,6 +5837,10 @@ pub struct PaymentsResponse {
/// The category of the MIT transaction
#[schema(value_type = Option<MitCategory>, example = "recurring")]
pub mit_category: Option<api_enums::MitCategory>,
+
+ /// Billing descriptor information for the payment
+ #[schema(value_type = Option<BillingDescriptor>)]
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[cfg(feature = "v2")]
diff --git a/crates/common_types/src/payments.rs b/crates/common_types/src/payments.rs
index 57f239f613..850c650536 100644
--- a/crates/common_types/src/payments.rs
+++ b/crates/common_types/src/payments.rs
@@ -695,3 +695,26 @@ pub enum RecoveryAction {
/// Invalid event has been received.
InvalidAction,
}
+
+/// Billing Descriptor information to be sent to the payment gateway
+#[derive(
+ Serialize, Deserialize, Debug, Clone, PartialEq, Eq, AsExpression, FromSqlRow, ToSchema,
+)]
+#[diesel(sql_type = Jsonb)]
+pub struct BillingDescriptor {
+ /// name to be put in billing description
+ #[schema(value_type = Option<String>, example = "John Doe")]
+ pub name: Option<Secret<String>>,
+ /// city to be put in billing description
+ #[schema(value_type = Option<String>, example = "San Francisco")]
+ pub city: Option<Secret<String>>,
+ /// phone to be put in billing description
+ #[schema(value_type = Option<String>, example = "9123456789")]
+ pub phone: Option<Secret<String>>,
+ /// a short description for the payment
+ pub statement_descriptor: Option<String>,
+ /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor.
+ pub statement_descriptor_suffix: Option<String>,
+}
+
+impl_to_sql_from_sql_json!(BillingDescriptor);
diff --git a/crates/diesel_models/src/payment_intent.rs b/crates/diesel_models/src/payment_intent.rs
index 7079c720a3..4b41a020c3 100644
--- a/crates/diesel_models/src/payment_intent.rs
+++ b/crates/diesel_models/src/payment_intent.rs
@@ -81,6 +81,7 @@ pub struct PaymentIntent {
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub mit_category: Option<storage_enums::MitCategory>,
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
pub merchant_reference_id: Option<common_utils::id_type::PaymentReferenceId>,
pub billing_address: Option<Encryption>,
pub shipping_address: Option<Encryption>,
@@ -186,6 +187,7 @@ pub struct PaymentIntent {
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub mit_category: Option<storage_enums::MitCategory>,
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression, PartialEq)]
@@ -478,6 +480,7 @@ pub struct PaymentIntentNew {
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub mit_category: Option<storage_enums::MitCategory>,
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[cfg(feature = "v2")]
@@ -821,6 +824,7 @@ impl PaymentIntentUpdateInternal {
active_attempt_id_type: source.active_attempt_id_type,
active_attempts_group_id: source.active_attempts_group_id,
mit_category: None,
+ billing_descriptor: source.billing_descriptor,
}
}
}
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index 9b3c27f07f..a67ca03423 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -1196,6 +1196,7 @@ diesel::table! {
enable_overcapture -> Nullable<Bool>,
#[max_length = 64]
mit_category -> Nullable<Varchar>,
+ billing_descriptor -> Nullable<Jsonb>,
}
}
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index 2ab6c51ef4..9d642dbe8c 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -1130,6 +1130,7 @@ diesel::table! {
enable_overcapture -> Nullable<Bool>,
#[max_length = 64]
mit_category -> Nullable<Varchar>,
+ billing_descriptor -> Nullable<Jsonb>,
#[max_length = 64]
merchant_reference_id -> Nullable<Varchar>,
billing_address -> Nullable<Bytea>,
diff --git a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
index 5460dd6ad0..ddbaf18a50 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
@@ -1872,6 +1872,13 @@ impl From<&PaymentsAuthorizeRouterData> for AdyenShopperInteraction {
}
type RecurringDetails = (Option<AdyenRecurringModel>, Option<bool>, Option<String>);
+fn get_shopper_statement(item: &PaymentsAuthorizeRouterData) -> Option<String> {
+ item.request
+ .billing_descriptor
+ .clone()
+ .and_then(|descriptor| descriptor.statement_descriptor)
+}
+
fn get_recurring_processing_model(
item: &PaymentsAuthorizeRouterData,
) -> Result<RecurringDetails, Error> {
@@ -3049,7 +3056,7 @@ impl
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3140,7 +3147,7 @@ impl TryFrom<(&AdyenRouterData<&PaymentsAuthorizeRouterData>, &Card)> for AdyenP
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3236,7 +3243,7 @@ impl
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3320,7 +3327,7 @@ impl TryFrom<(&AdyenRouterData<&PaymentsAuthorizeRouterData>, &VoucherData)>
shopper_reference: None,
store_payment_method: None,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3446,7 +3453,7 @@ impl
shopper_reference: None,
store_payment_method: None,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3531,7 +3538,7 @@ impl
store_payment_method: None,
channel: None,
social_security_number: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3620,7 +3627,7 @@ impl
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3759,7 +3766,7 @@ impl TryFrom<(&AdyenRouterData<&PaymentsAuthorizeRouterData>, &WalletData)>
shopper_reference,
store_payment_method,
channel,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3856,7 +3863,7 @@ impl
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -3946,7 +3953,7 @@ impl
store_payment_method: None,
channel: None,
social_security_number: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
store,
@@ -6494,7 +6501,7 @@ impl
shopper_reference,
store_payment_method,
channel: None,
- shopper_statement: item.router_data.request.statement_descriptor.clone(),
+ shopper_statement: get_shopper_statement(item.router_data),
shopper_ip: item.router_data.request.get_ip_address_as_optional(),
merchant_order_reference: item.router_data.request.merchant_order_reference_id.clone(),
mpi_data: Some(mpi_data),
diff --git a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
index 6570990fda..1e0b8d4537 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
@@ -362,6 +362,14 @@ pub struct CheckoutLineItem {
pub unit_price: Option<MinorUnit>,
}
+#[skip_serializing_none]
+#[derive(Debug, Default, Serialize)]
+pub struct CheckoutBillingDescriptor {
+ pub name: Option<Secret<String>>,
+ pub city: Option<Secret<String>>,
+ pub reference: Option<String>,
+}
+
#[skip_serializing_none]
#[derive(Debug, Serialize)]
pub struct PaymentsRequest {
@@ -380,6 +388,7 @@ pub struct PaymentsRequest {
pub merchant_initiated: Option<bool>,
pub previous_payment_id: Option<String>,
pub store_for_future_use: Option<bool>,
+ pub billing_descriptor: Option<CheckoutBillingDescriptor>,
// Level 2/3 data fields
pub customer: Option<CheckoutCustomer>,
pub processing: Option<CheckoutProcessing>,
@@ -806,6 +815,17 @@ impl TryFrom<&CheckoutRouterData<&PaymentsAuthorizeRouterData>> for PaymentsRequ
let payment_ip = item.router_data.request.get_ip_address_as_optional();
+ let billing_descriptor =
+ item.router_data
+ .request
+ .billing_descriptor
+ .as_ref()
+ .map(|descriptor| CheckoutBillingDescriptor {
+ name: descriptor.name.clone(),
+ city: descriptor.city.clone(),
+ reference: descriptor.statement_descriptor.clone(),
+ });
+
let request = Self {
source: source_var,
amount: item.amount.to_owned(),
@@ -826,6 +846,7 @@ impl TryFrom<&CheckoutRouterData<&PaymentsAuthorizeRouterData>> for PaymentsRequ
items,
partial_authorization,
payment_ip,
+ billing_descriptor,
};
Ok(request)
diff --git a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
index 4d16f1686f..5d00a43e27 100644
--- a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
@@ -113,6 +113,9 @@ trait NuveiAuthorizePreprocessingCommon {
Ok(None)
}
fn get_is_stored_credential(&self) -> Option<StoredCredentialMode>;
+ fn get_dynamic_descriptor(
+ &self,
+ ) -> Result<Option<NuveiDynamicDescriptor>, error_stack::Report<errors::ConnectorError>>;
}
impl NuveiAuthorizePreprocessingCommon for SetupMandateRequestData {
@@ -198,6 +201,37 @@ impl NuveiAuthorizePreprocessingCommon for SetupMandateRequestData {
fn get_is_stored_credential(&self) -> Option<StoredCredentialMode> {
StoredCredentialMode::get_optional_stored_credential(self.is_stored_credential)
}
+
+ fn get_dynamic_descriptor(
+ &self,
+ ) -> Result<Option<NuveiDynamicDescriptor>, error_stack::Report<errors::ConnectorError>> {
+ if let Some(descriptor) = self.billing_descriptor.as_ref() {
+ if let Some(phone) = descriptor.phone.as_ref() {
+ if phone.clone().expose().len() > 13 {
+ //Nuvei allows max 13 characters for merchant phone in dynamic descriptor
+ return Err(errors::ConnectorError::MaxFieldLengthViolated {
+ connector: "Nuvei".to_string(),
+ field_name: "dynamic_descriptor.merchant_phone".to_string(),
+ max_length: 13,
+ received_length: phone.clone().expose().len(),
+ }
+ .into());
+ }
+ }
+
+ let dynamic_descriptor = NuveiDynamicDescriptor {
+ merchant_name: descriptor.name.as_ref().map(|name| {
+ Secret::new(name.clone().expose().trim().chars().take(25).collect())
+ //Nuvei allows max 25 characters for merchant name in dynamic descriptor
+ }),
+ merchant_phone: descriptor.phone.clone(),
+ };
+
+ Ok(Some(dynamic_descriptor))
+ } else {
+ Ok(None)
+ }
+ }
}
impl NuveiAuthorizePreprocessingCommon for PaymentsAuthorizeData {
@@ -275,6 +309,37 @@ impl NuveiAuthorizePreprocessingCommon for PaymentsAuthorizeData {
fn get_is_stored_credential(&self) -> Option<StoredCredentialMode> {
StoredCredentialMode::get_optional_stored_credential(self.is_stored_credential)
}
+
+ fn get_dynamic_descriptor(
+ &self,
+ ) -> Result<Option<NuveiDynamicDescriptor>, error_stack::Report<errors::ConnectorError>> {
+ if let Some(descriptor) = self.billing_descriptor.as_ref() {
+ if let Some(phone) = descriptor.phone.as_ref() {
+ if phone.clone().expose().len() > 13 {
+ //Nuvei allows max 13 characters for merchant phone in dynamic descriptor
+ return Err(errors::ConnectorError::MaxFieldLengthViolated {
+ connector: "Nuvei".to_string(),
+ field_name: "dynamic_descriptor.merchant_phone".to_string(),
+ max_length: 13,
+ received_length: phone.clone().expose().len(),
+ }
+ .into());
+ }
+ }
+
+ let dynamic_descriptor = NuveiDynamicDescriptor {
+ merchant_name: descriptor.name.as_ref().map(|name| {
+ Secret::new(name.clone().expose().trim().chars().take(25).collect())
+ //Nuvei allows max 25 characters for merchant name in dynamic descriptor
+ }),
+ merchant_phone: descriptor.phone.clone(),
+ };
+
+ Ok(Some(dynamic_descriptor))
+ } else {
+ Ok(None)
+ }
+ }
}
impl NuveiAuthorizePreprocessingCommon for PaymentsPreProcessingData {
@@ -352,6 +417,12 @@ impl NuveiAuthorizePreprocessingCommon for PaymentsPreProcessingData {
fn get_is_stored_credential(&self) -> Option<StoredCredentialMode> {
StoredCredentialMode::get_optional_stored_credential(self.is_stored_credential)
}
+
+ fn get_dynamic_descriptor(
+ &self,
+ ) -> Result<Option<NuveiDynamicDescriptor>, error_stack::Report<errors::ConnectorError>> {
+ Ok(None)
+ }
}
#[derive(Debug, Serialize, Default, Deserialize)]
@@ -455,6 +526,14 @@ pub enum IsRebilling {
False,
}
+#[serde_with::skip_serializing_none]
+#[derive(Debug, Serialize, Default)]
+#[serde(rename_all = "camelCase")]
+pub struct NuveiDynamicDescriptor {
+ pub merchant_name: Option<Secret<String>>,
+ pub merchant_phone: Option<Secret<String>>,
+}
+
#[serde_with::skip_serializing_none]
#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
@@ -484,6 +563,7 @@ pub struct NuveiPaymentsRequest {
pub items: Option<Vec<NuveiItem>>,
pub is_partial_approval: Option<PartialApprovalFlag>,
pub external_scheme_details: Option<ExternalSchemeDetails>,
+ pub dynamic_descriptor: Option<NuveiDynamicDescriptor>,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
@@ -1930,6 +2010,9 @@ where
} else {
request_data.device_details.clone()
};
+
+ let dynamic_descriptor = item.request.get_dynamic_descriptor()?;
+
Ok(Self {
is_rebilling: request_data.is_rebilling,
user_token_id: request_data.user_token_id,
@@ -1947,6 +2030,7 @@ where
items: l2_l3_items,
is_partial_approval: item.request.get_is_partial_approval(),
external_scheme_details: request_data.external_scheme_details,
+ dynamic_descriptor,
..request
})
}
diff --git a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
index 8bb6002dcb..36783535ee 100644
--- a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
@@ -403,7 +403,13 @@ impl
original: value.0.amount.to_owned(),
},
key: santander_mca_metadata.pix_key.clone(),
- request_payer: value.0.router_data.request.statement_descriptor.clone(),
+ request_payer: value
+ .0
+ .router_data
+ .request
+ .billing_descriptor
+ .as_ref()
+ .and_then(|descriptor| descriptor.statement_descriptor.clone()),
additional_info: None,
})))
}
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
index 342d0d675b..ed4d1ea3fd 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
@@ -2198,8 +2198,16 @@ impl TryFrom<(&PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntentRequest
Ok(Self {
amount, //hopefully we don't loose some cents here
currency: item.request.currency.to_string(), //we need to copy the value and not transfer ownership
- statement_descriptor_suffix: item.request.statement_descriptor_suffix.clone(),
- statement_descriptor: item.request.statement_descriptor.clone(),
+ statement_descriptor_suffix: item
+ .request
+ .billing_descriptor
+ .as_ref()
+ .and_then(|descriptor| descriptor.statement_descriptor_suffix.clone()),
+ statement_descriptor: item
+ .request
+ .billing_descriptor
+ .as_ref()
+ .and_then(|descriptor| descriptor.statement_descriptor.clone()),
meta_data,
return_url: item
.request
diff --git a/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
index 72ddb2a610..569472bfac 100644
--- a/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs
@@ -379,7 +379,11 @@ fn get_card_request_data(
browser_challenge_window: "1".to_string(),
payment_action: None,
payment_type: "Plain".to_string(),
- descriptor: item.request.statement_descriptor.clone(),
+ descriptor: item
+ .request
+ .billing_descriptor
+ .as_ref()
+ .and_then(|descriptor| descriptor.statement_descriptor.clone()),
},
)))
}
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index e618bc9b3b..fd249ff811 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -6906,7 +6906,6 @@ pub(crate) fn convert_setup_mandate_router_data_to_authorize_router_data(
currency: data.request.currency,
payment_method_data: data.request.payment_method_data.clone(),
confirm: data.request.confirm,
- statement_descriptor_suffix: data.request.statement_descriptor_suffix.clone(),
mandate_id: data.request.mandate_id.clone(),
setup_future_usage: data.request.setup_future_usage,
off_session: data.request.off_session,
@@ -6917,7 +6916,6 @@ pub(crate) fn convert_setup_mandate_router_data_to_authorize_router_data(
amount: 0,
order_tax_amount: Some(MinorUnit::zero()),
minor_amount: MinorUnit::new(0),
- statement_descriptor: None,
capture_method: data.request.capture_method,
webhook_url: None,
complete_authorize_url: None,
@@ -6951,6 +6949,7 @@ pub(crate) fn convert_setup_mandate_router_data_to_authorize_router_data(
enable_overcapture: None,
is_stored_credential: data.request.is_stored_credential,
mit_category: None,
+ billing_descriptor: data.request.billing_descriptor.clone(),
}
}
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index 67b2b56d9b..c1cbdfbb31 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -5,8 +5,11 @@ use std::marker::PhantomData;
use api_models::payments::{ConnectorMetadata, SessionToken, VaultSessionDetails};
use common_types::primitive_wrappers;
#[cfg(feature = "v1")]
-use common_types::primitive_wrappers::{
- AlwaysRequestExtendedAuthorization, EnableOvercaptureBool, RequestExtendedAuthorizationBool,
+use common_types::{
+ payments::BillingDescriptor,
+ primitive_wrappers::{
+ AlwaysRequestExtendedAuthorization, EnableOvercaptureBool, RequestExtendedAuthorizationBool,
+ },
};
use common_utils::{
self,
@@ -126,6 +129,7 @@ pub struct PaymentIntent {
pub enable_partial_authorization: Option<primitive_wrappers::EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<EnableOvercaptureBool>,
pub mit_category: Option<common_enums::MitCategory>,
+ pub billing_descriptor: Option<BillingDescriptor>,
}
impl PaymentIntent {
@@ -287,6 +291,25 @@ impl PaymentIntent {
Err(common_utils::errors::ParsingError::UnknownError)
}
}
+
+ #[cfg(feature = "v1")]
+ pub fn get_billing_descriptor(&self) -> Option<BillingDescriptor> {
+ self.billing_descriptor
+ .as_ref()
+ .map(|descriptor| BillingDescriptor {
+ name: descriptor.name.clone(),
+ city: descriptor.city.clone(),
+ phone: descriptor.phone.clone(),
+ statement_descriptor: descriptor
+ .statement_descriptor
+ .clone()
+ .or_else(|| self.statement_descriptor_name.clone()),
+ statement_descriptor_suffix: descriptor
+ .statement_descriptor_suffix
+ .clone()
+ .or_else(|| self.statement_descriptor_suffix.clone()),
+ })
+ }
}
#[cfg(feature = "v2")]
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
index ecb8445768..d297026f6d 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
@@ -1859,6 +1859,7 @@ impl behaviour::Conversion for PaymentIntent {
enable_partial_authorization,
enable_overcapture: None,
mit_category: None,
+ billing_descriptor: None,
})
}
async fn convert_back(
@@ -2200,6 +2201,7 @@ impl behaviour::Conversion for PaymentIntent {
enable_partial_authorization: self.enable_partial_authorization,
enable_overcapture: self.enable_overcapture,
mit_category: self.mit_category,
+ billing_descriptor: self.billing_descriptor,
})
}
@@ -2310,6 +2312,7 @@ impl behaviour::Conversion for PaymentIntent {
enable_partial_authorization: storage_model.enable_partial_authorization,
enable_overcapture: storage_model.enable_overcapture,
mit_category: storage_model.mit_category,
+ billing_descriptor: storage_model.billing_descriptor,
})
}
.await
@@ -2392,6 +2395,7 @@ impl behaviour::Conversion for PaymentIntent {
enable_partial_authorization: self.enable_partial_authorization,
enable_overcapture: self.enable_overcapture,
mit_category: self.mit_category,
+ billing_descriptor: self.billing_descriptor,
})
}
}
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index 708e38d8fb..aea3a97e38 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -40,8 +40,6 @@ pub struct PaymentsAuthorizeData {
pub customer_name: Option<Secret<String>>,
pub currency: storage_enums::Currency,
pub confirm: bool,
- pub statement_descriptor_suffix: Option<String>,
- pub statement_descriptor: Option<String>,
pub capture_method: Option<storage_enums::CaptureMethod>,
pub router_return_url: Option<String>,
pub webhook_url: Option<String>,
@@ -90,6 +88,7 @@ pub struct PaymentsAuthorizeData {
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub is_stored_credential: Option<bool>,
pub mit_category: Option<common_enums::MitCategory>,
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[derive(Debug, Clone, Serialize)]
@@ -1427,7 +1426,6 @@ pub struct SetupMandateRequestData {
pub payment_method_data: PaymentMethodData,
pub amount: Option<i64>,
pub confirm: bool,
- pub statement_descriptor_suffix: Option<String>,
pub customer_acceptance: Option<common_payments_types::CustomerAcceptance>,
pub mandate_id: Option<api_models::payments::MandateIds>,
pub setup_future_usage: Option<storage_enums::FutureUsage>,
@@ -1456,6 +1454,7 @@ pub struct SetupMandateRequestData {
Option<common_types::primitive_wrappers::EnablePartialAuthorizationBool>,
pub payment_channel: Option<storage_enums::PaymentChannel>,
pub is_stored_credential: Option<bool>,
+ pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,
}
#[derive(Debug, Clone)]
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 581e6fb145..8cfafde1d5 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -292,6 +292,7 @@ Never share your secret api keys. Keep them guarded and secure.
common_types::three_ds_decision_rule_engine::ThreeDSDecisionRule,
common_types::three_ds_decision_rule_engine::ThreeDSDecision,
common_types::payments::MerchantCountryCode,
+ common_types::payments::BillingDescriptor,
api_models::enums::PaymentChannel,
api_models::three_ds_decision_rule::ThreeDsDecisionRuleExecuteRequest,
api_models::three_ds_decision_rule::ThreeDsDecisionRuleExecuteResponse,
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 80f0c19d09..72ee7c72b0 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -4167,6 +4167,7 @@ mod tests {
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
+ billing_descriptor: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent).is_ok());
@@ -4253,6 +4254,7 @@ mod tests {
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
+ billing_descriptor: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent,).is_err())
@@ -4337,6 +4339,7 @@ mod tests {
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
+ billing_descriptor: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent).is_err())
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 9d082f0e33..a3c1c76751 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -1671,6 +1671,7 @@ impl PaymentCreate {
enable_partial_authorization: request.enable_partial_authorization,
enable_overcapture: request.enable_overcapture,
mit_category: request.mit_category,
+ billing_descriptor: request.billing_descriptor.clone(),
})
}
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 882a015e30..727fecddf5 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -406,8 +406,6 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
off_session: None,
setup_mandate_details: None,
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
capture_method: Some(payment_data.payment_intent.capture_method),
amount: payment_data
.payment_attempt
@@ -460,6 +458,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
enable_partial_authorization: payment_data.payment_intent.enable_partial_authorization,
enable_overcapture: None,
is_stored_credential: None,
+ billing_descriptor: None,
};
let connector_mandate_request_reference_id = payment_data
.payment_attempt
@@ -1507,7 +1506,6 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(
.get_amount_as_i64(),
),
confirm: true,
- statement_descriptor_suffix: None,
customer_acceptance: None,
mandate_id: None,
setup_future_usage: Some(payment_data.payment_intent.setup_future_usage),
@@ -1538,6 +1536,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(
enrolled_for_3ds: true,
related_transaction_id: None,
is_stored_credential: None,
+ billing_descriptor: None,
};
let connector_mandate_request_reference_id = payment_data
.payment_attempt
@@ -3775,6 +3774,7 @@ where
.map(NetworkDetails::foreign_from),
is_stored_credential: payment_attempt.is_stored_credential,
request_extended_authorization: payment_attempt.request_extended_authorization,
+ billing_descriptor: payment_intent.billing_descriptor,
};
services::ApplicationResponse::JsonWithHeaders((payments_response, headers))
@@ -4091,6 +4091,7 @@ impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::Pay
network_details: pa.network_details.map(NetworkDetails::foreign_from),
is_stored_credential:pa.is_stored_credential,
request_extended_authorization: pa.request_extended_authorization,
+ billing_descriptor: pi.billing_descriptor,
}
}
}
@@ -4380,8 +4381,6 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
customer_name,
currency: payment_data.currency,
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
capture_method: Some(payment_data.payment_intent.capture_method),
router_return_url,
webhook_url,
@@ -4425,6 +4424,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
enable_partial_authorization: None,
enable_overcapture: None,
is_stored_credential: None,
+ billing_descriptor: None,
})
}
}
@@ -4600,6 +4600,8 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
payment_data.payment_intent.off_session,
);
+ let billing_descriptor = payment_data.payment_intent.get_billing_descriptor();
+
Ok(Self {
payment_method_data: (payment_method_data.get_required_value("payment_method_data")?),
setup_future_usage: payment_data.payment_attempt.setup_future_usage_applied,
@@ -4607,8 +4609,6 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
off_session: is_off_session,
setup_mandate_details: payment_data.setup_mandate.clone(),
confirm: payment_data.payment_attempt.confirm,
- statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix,
- statement_descriptor: payment_data.payment_intent.statement_descriptor_name,
capture_method: payment_data.payment_attempt.capture_method,
amount: amount.get_amount_as_i64(),
order_tax_amount: payment_data
@@ -4661,6 +4661,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
enable_partial_authorization: payment_data.payment_intent.enable_partial_authorization,
enable_overcapture: payment_data.payment_intent.enable_overcapture,
is_stored_credential: payment_data.payment_attempt.is_stored_credential,
+ billing_descriptor,
})
}
}
@@ -5638,6 +5639,8 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
payment_data.payment_intent.off_session,
);
+ let billing_descriptor = payment_data.payment_intent.get_billing_descriptor();
+
Ok(Self {
currency: payment_data.currency,
confirm: true,
@@ -5646,7 +5649,6 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
payment_method_data: (payment_data
.payment_method_data
.get_required_value("payment_method_data")?),
- statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix,
setup_future_usage: payment_data.payment_attempt.setup_future_usage_applied,
off_session: is_off_session,
mandate_id: payment_data.mandate_id.clone(),
@@ -5676,6 +5678,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
related_transaction_id: None,
enrolled_for_3ds: true,
is_stored_credential: payment_data.payment_attempt.is_stored_credential,
+ billing_descriptor,
})
}
}
diff --git a/crates/router/src/db/events.rs b/crates/router/src/db/events.rs
index 44c9afe947..35496157a0 100644
--- a/crates/router/src/db/events.rs
+++ b/crates/router/src/db/events.rs
@@ -1428,6 +1428,7 @@ mod tests {
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
+ billing_descriptor: None,
};
let content =
api_webhooks::OutgoingWebhookContent::PaymentDetails(Box::new(expected_response));
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index 865a707175..ea318511d3 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -1275,7 +1275,6 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData {
currency: data.request.currency,
payment_method_data: data.request.payment_method_data.clone(),
confirm: data.request.confirm,
- statement_descriptor_suffix: data.request.statement_descriptor_suffix.clone(),
mandate_id: data.request.mandate_id.clone(),
setup_future_usage: data.request.setup_future_usage,
off_session: data.request.off_session,
@@ -1286,7 +1285,6 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData {
amount: 0,
order_tax_amount: Some(MinorUnit::zero()),
minor_amount: MinorUnit::new(0),
- statement_descriptor: None,
capture_method: None,
webhook_url: None,
complete_authorize_url: None,
@@ -1320,6 +1318,7 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData {
enable_overcapture: None,
is_stored_credential: data.request.is_stored_credential,
mit_category: None,
+ billing_descriptor: data.request.billing_descriptor.clone(),
}
}
}
diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs
index bc0a9a21c9..0aad63be84 100644
--- a/crates/router/src/types/api/verify_connector.rs
+++ b/crates/router/src/types/api/verify_connector.rs
@@ -47,11 +47,9 @@ impl VerifyConnectorData {
setup_future_usage: None,
payment_experience: None,
payment_method_type: None,
- statement_descriptor: None,
setup_mandate_details: None,
complete_authorize_url: None,
related_transaction_id: None,
- statement_descriptor_suffix: None,
request_extended_authorization: None,
request_incremental_authorization: false,
authentication_data: None,
@@ -71,6 +69,7 @@ impl VerifyConnectorData {
enable_overcapture: None,
is_stored_credential: None,
mit_category: None,
+ billing_descriptor: None,
}
}
diff --git a/crates/router/src/utils/user/sample_data.rs b/crates/router/src/utils/user/sample_data.rs
index 8ba426e945..3265cd0db5 100644
--- a/crates/router/src/utils/user/sample_data.rs
+++ b/crates/router/src/utils/user/sample_data.rs
@@ -299,6 +299,7 @@ pub async fn generate_sample_data(
enable_partial_authorization: None,
enable_overcapture: None,
mit_category: None,
+ billing_descriptor: None,
};
let (connector_transaction_id, processor_transaction_data) =
ConnectorTransactionId::form_id_and_data(attempt_id.clone());
diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rs
index fa5638d7b4..90daed75ba 100644
--- a/crates/router/tests/connectors/adyen.rs
+++ b/crates/router/tests/connectors/adyen.rs
@@ -168,8 +168,6 @@ impl AdyenTest {
co_badged_card_data: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -195,6 +193,7 @@ impl AdyenTest {
authentication_data: None,
customer_acceptance: None,
locale: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/bitpay.rs b/crates/router/tests/connectors/bitpay.rs
index 70af3b7521..a41dd25357 100644
--- a/crates/router/tests/connectors/bitpay.rs
+++ b/crates/router/tests/connectors/bitpay.rs
@@ -74,8 +74,6 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
network: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -101,6 +99,7 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/cashtocode.rs b/crates/router/tests/connectors/cashtocode.rs
index d06f4a604c..61d2bef797 100644
--- a/crates/router/tests/connectors/cashtocode.rs
+++ b/crates/router/tests/connectors/cashtocode.rs
@@ -48,8 +48,6 @@ impl CashtocodeTest {
currency: enums::Currency::EUR,
payment_method_data,
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -74,6 +72,7 @@ impl CashtocodeTest {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/coinbase.rs b/crates/router/tests/connectors/coinbase.rs
index 840e41c591..5b6a5b92d5 100644
--- a/crates/router/tests/connectors/coinbase.rs
+++ b/crates/router/tests/connectors/coinbase.rs
@@ -76,8 +76,6 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
network: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -103,6 +101,7 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/cryptopay.rs b/crates/router/tests/connectors/cryptopay.rs
index 58fcdc6dae..2817967185 100644
--- a/crates/router/tests/connectors/cryptopay.rs
+++ b/crates/router/tests/connectors/cryptopay.rs
@@ -74,8 +74,6 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
network: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -100,6 +98,7 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/opennode.rs b/crates/router/tests/connectors/opennode.rs
index 42e40829f2..e54bb3688e 100644
--- a/crates/router/tests/connectors/opennode.rs
+++ b/crates/router/tests/connectors/opennode.rs
@@ -74,8 +74,6 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
network: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -101,6 +99,7 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index 6e46b160ca..67f150ee78 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -972,8 +972,6 @@ impl Default for PaymentAuthorizeType {
order_tax_amount: Some(MinorUnit::zero()),
currency: enums::Currency::USD,
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
capture_method: None,
setup_future_usage: None,
mandate_id: None,
@@ -1014,6 +1012,7 @@ impl Default for PaymentAuthorizeType {
enable_overcapture: None,
is_stored_credential: None,
mit_category: None,
+ billing_descriptor: None,
};
Self(data)
}
diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rs
index 22fd198bd0..da55bfcbd4 100644
--- a/crates/router/tests/connectors/worldline.rs
+++ b/crates/router/tests/connectors/worldline.rs
@@ -87,8 +87,6 @@ impl WorldlineTest {
co_badged_card_data: None,
}),
confirm: true,
- statement_descriptor_suffix: None,
- statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
@@ -113,6 +111,7 @@ impl WorldlineTest {
metadata: None,
authentication_data: None,
customer_acceptance: None,
+ billing_descriptor: None,
..utils::PaymentAuthorizeType::default().0
})
}
diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs
index 14d8a88051..f3cdcf917a 100644
--- a/crates/router/tests/payments.rs
+++ b/crates/router/tests/payments.rs
@@ -475,6 +475,7 @@ async fn payments_create_core() {
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
+ billing_descriptor: None,
};
let expected_response =
services::ApplicationResponse::JsonWithHeaders((expected_response, vec![]));
@@ -764,6 +765,7 @@ async fn payments_create_core_adyen_no_redirect() {
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
+ billing_descriptor: None,
},
vec![],
));
diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs
index 4545dc5c7f..0638ee67e7 100644
--- a/crates/router/tests/payments2.rs
+++ b/crates/router/tests/payments2.rs
@@ -237,6 +237,7 @@ async fn payments_create_core() {
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
+ billing_descriptor: None,
};
let expected_response =
@@ -534,6 +535,7 @@ async fn payments_create_core_adyen_no_redirect() {
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
+ billing_descriptor: None,
},
vec![],
));
diff --git a/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/down.sql b/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/down.sql
new file mode 100644
index 0000000000..6b0d3f53bb
--- /dev/null
+++ b/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE payment_intent DROP COLUMN IF EXISTS billing_descriptor;
\ No newline at end of file
diff --git a/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/up.sql b/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/up.sql
new file mode 100644
index 0000000000..482fbd07dc
--- /dev/null
+++ b/migrations/2025-10-31-090928_add_billing_descriptor_in_payment_intent/up.sql
@@ -0,0 +1,2 @@
+-- Your SQL goes here
+ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS billing_descriptor jsonb;
\ No newline at end of file