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

fix(checkout): billing descriptor reference (#10384)

Nithin N10e6b0e20e55
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index d479150b0c..6064428c17 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -12721,6 +12721,11 @@
"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
+ },
+ "reference": {
+ "type": "string",
+ "description": "A reference to be shown on billing description",
+ "nullable": true
}
}
},
diff --git a/crates/common_types/src/payments.rs b/crates/common_types/src/payments.rs
index 766e9c7c1d..926b91db40 100644
--- a/crates/common_types/src/payments.rs
+++ b/crates/common_types/src/payments.rs
@@ -898,6 +898,8 @@ pub struct BillingDescriptor {
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>,
+ /// A reference to be shown on billing description
+ pub reference: Option<String>,
}
impl_to_sql_from_sql_json!(BillingDescriptor);
diff --git a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
index 1e0b8d4537..5657941c32 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
@@ -823,7 +823,7 @@ impl TryFrom<&CheckoutRouterData<&PaymentsAuthorizeRouterData>> for PaymentsRequ
.map(|descriptor| CheckoutBillingDescriptor {
name: descriptor.name.clone(),
city: descriptor.city.clone(),
- reference: descriptor.statement_descriptor.clone(),
+ reference: descriptor.reference.clone(),
});
let request = Self {
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index 51a8a371e7..98f1bd024b 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -311,6 +311,7 @@ impl PaymentIntent {
.statement_descriptor_suffix
.clone()
.or_else(|| self.statement_descriptor_suffix.clone()),
+ reference: descriptor.reference.clone(),
})
}
}