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(payments): add error details for PaymentsResponse (#10799)

Ayush Anand71919ce32965
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index eb07c3df79..3cb305b1ca 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -9065,6 +9065,51 @@
}
}
},
+ "ApiConnectorErrorDetails": {
+ "type": "object",
+ "description": "Error details from the payment connector",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "Connector-specific error code",
+ "nullable": true
+ },
+ "message": {
+ "type": "string",
+ "description": "Connector-specific error message",
+ "nullable": true
+ },
+ "reason": {
+ "type": "string",
+ "description": "Additional error reason/details",
+ "nullable": true
+ }
+ }
+ },
+ "ApiIssuerErrorDetails": {
+ "type": "object",
+ "description": "Error details from the card issuer",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "Error code from the issuer",
+ "nullable": true
+ },
+ "message": {
+ "type": "string",
+ "description": "Error message from the issuer",
+ "nullable": true
+ },
+ "network_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiNetworkErrorDetails"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"ApiKeyExpiration": {
"oneOf": [
{
@@ -9079,6 +9124,75 @@
}
]
},
+ "ApiNetworkErrorDetails": {
+ "type": "object",
+ "description": "Network-specific error details (e.g., Visa, Mastercard)",
+ "properties": {
+ "name": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CardNetwork"
+ }
+ ],
+ "nullable": true
+ },
+ "advice_code": {
+ "type": "string",
+ "description": "Network advice code",
+ "nullable": true
+ },
+ "advice_message": {
+ "type": "string",
+ "description": "Network advice message",
+ "nullable": true
+ }
+ }
+ },
+ "ApiUnifiedErrorDetails": {
+ "type": "object",
+ "description": "Unified error details standardized across all payment connectors",
+ "properties": {
+ "category": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/UnifiedCode"
+ }
+ ],
+ "nullable": true
+ },
+ "message": {
+ "type": "string",
+ "description": "Human-readable error message",
+ "nullable": true
+ },
+ "standardised_code": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/StandardisedCode"
+ }
+ ],
+ "nullable": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Detailed description of the error",
+ "nullable": true
+ },
+ "user_guidance_message": {
+ "type": "string",
+ "description": "User-friendly guidance message",
+ "nullable": true
+ },
+ "recommended_action": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecommendedAction"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"ApplePayAddressParameters": {
"type": "string",
"enum": [
@@ -24724,6 +24838,36 @@
}
}
},
+ "PaymentErrorDetails": {
+ "type": "object",
+ "description": "Complete error details for V1 PaymentsResponse containing unified, issuer, and connector-level error information.",
+ "properties": {
+ "unified_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiUnifiedErrorDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "issuer_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiIssuerErrorDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "connector_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiConnectorErrorDetails"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"PaymentExperience": {
"type": "string",
"description": "To indicate the type of payment experience that the customer would go through",
@@ -28287,6 +28431,14 @@
"example": "Failed while verifying the card",
"nullable": true
},
+ "error_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PaymentErrorDetails"
+ }
+ ],
+ "nullable": true
+ },
"payment_experience": {
"allOf": [
{
@@ -29892,6 +30044,14 @@
"description": "error message unified across the connectors is received here if there was an error while calling connector",
"nullable": true
},
+ "error_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PaymentErrorDetails"
+ }
+ ],
+ "nullable": true
+ },
"payment_experience": {
"allOf": [
{
@@ -33991,6 +34151,23 @@
}
}
},
+ "RecommendedAction": {
+ "type": "string",
+ "enum": [
+ "do_not_retry",
+ "retry_after10_days",
+ "retry_after1_hour",
+ "retry_after24_hours",
+ "retry_after2_days",
+ "retry_after4_days",
+ "retry_after6_days",
+ "retry_after8_days",
+ "retry_after_instrument_update",
+ "retry_later",
+ "retry_with_different_payment_method_data",
+ "stop_recurring"
+ ]
+ },
"ReconStatus": {
"type": "string",
"enum": [
@@ -37665,6 +37842,16 @@
"delete"
]
},
+ "UnifiedCode": {
+ "type": "string",
+ "enum": [
+ "UE_1000",
+ "UE_2000",
+ "UE_3000",
+ "UE_4000",
+ "UE_9000"
+ ]
+ },
"UnpaidInvoicesHandling": {
"type": "string",
"enum": [
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index 0def8f8906..f1f445b862 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -27813,6 +27813,16 @@
"journey"
]
},
+ "UnifiedCode": {
+ "type": "string",
+ "enum": [
+ "UE_1000",
+ "UE_2000",
+ "UE_3000",
+ "UE_4000",
+ "UE_9000"
+ ]
+ },
"UpdateActiveAttempt": {
"oneOf": [
{
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 08bf07edd1..a61e4f87ac 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -7293,6 +7293,11 @@ pub struct PaymentsResponse {
#[smithy(value_type = "Option<String>")]
pub unified_message: Option<String>,
+ /// Complete error details containing unified, issuer, and connector-level error information.
+ #[schema(value_type = Option<PaymentErrorDetails>)]
+ #[smithy(value_type = "Option<PaymentErrorDetails>")]
+ pub error_details: Option<PaymentErrorDetails>,
+
/// Describes the type of payment flow experienced by the customer (e.g., 'redirect_to_url', 'invoke_sdk', 'display_qr_code').
#[schema(value_type = Option<PaymentExperience>, example = "redirect_to_url")]
#[smithy(value_type = "Option<PaymentExperience>")]
@@ -8207,6 +8212,76 @@ pub struct PaymentsStatusRequest {
pub return_raw_connector_response: Option<bool>,
}
+/// Complete error details for V1 PaymentsResponse containing unified, issuer, and connector-level error information.
+#[cfg(feature = "v1")]
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+pub struct PaymentErrorDetails {
+ /// Unified error details (standardized across connectors)
+ pub unified_details: Option<ApiUnifiedErrorDetails>,
+ /// Error details from the card issuer
+ pub issuer_details: Option<ApiIssuerErrorDetails>,
+ /// Error details from the payment connector
+ pub connector_details: Option<ApiConnectorErrorDetails>,
+}
+
+/// Unified error details standardized across all payment connectors
+#[cfg(feature = "v1")]
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+pub struct ApiUnifiedErrorDetails {
+ /// Error category
+ #[schema(value_type = Option<UnifiedCode>)]
+ pub category: Option<String>,
+ /// Human-readable error message
+ pub message: Option<String>,
+ /// Standardised error code
+ #[schema(value_type = Option<StandardisedCode>)]
+ pub standardised_code: Option<api_enums::StandardisedCode>,
+ /// Detailed description of the error
+ pub description: Option<String>,
+ /// User-friendly guidance message
+ pub user_guidance_message: Option<String>,
+ /// Recommended action (e.g., "do_not_retry", "retry_later")
+ #[schema(value_type = Option<RecommendedAction>)]
+ pub recommended_action: Option<api_enums::RecommendedAction>,
+}
+
+/// Error details from the card issuer
+#[cfg(feature = "v1")]
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+pub struct ApiIssuerErrorDetails {
+ /// Error code from the issuer
+ pub code: Option<String>,
+ /// Error message from the issuer
+ pub message: Option<String>,
+ /// Network-specific error details
+ pub network_details: Option<ApiNetworkErrorDetails>,
+}
+
+/// Network-specific error details (e.g., Visa, Mastercard)
+#[cfg(feature = "v1")]
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+pub struct ApiNetworkErrorDetails {
+ /// Card network (e.g., Visa, Mastercard)
+ #[schema(value_type = Option<CardNetwork>)]
+ pub name: Option<api_enums::CardNetwork>,
+ /// Network advice code
+ pub advice_code: Option<String>,
+ /// Network advice message
+ pub advice_message: Option<String>,
+}
+
+/// Error details from the payment connector
+#[cfg(feature = "v1")]
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+pub struct ApiConnectorErrorDetails {
+ /// Connector-specific error code
+ pub code: Option<String>,
+ /// Connector-specific error message
+ pub message: Option<String>,
+ /// Additional error reason/details
+ pub reason: Option<String>,
+}
+
/// Error details for the payment
#[cfg(feature = "v2")]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, ToSchema)]
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index bfa810db0b..cbc4b7075b 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -9740,6 +9740,36 @@ impl ErrorCategory {
}
}
+#[derive(
+ Clone,
+ Copy,
+ Debug,
+ Eq,
+ Hash,
+ PartialEq,
+ serde::Serialize,
+ serde::Deserialize,
+ strum::Display,
+ strum::EnumString,
+ ToSchema,
+ PartialOrd,
+ Ord,
+)]
+#[router_derive::diesel_enum(storage_type = "text")]
+#[allow(non_camel_case_types)]
+pub enum UnifiedCode {
+ /// Customer Error - Issue with payment method details
+ UE_1000,
+ /// Connector Declines - Issue with Configurations
+ UE_2000,
+ /// Connector Error - Technical issue with PSP
+ UE_3000,
+ /// Integration Error - Issue in the integration
+ UE_4000,
+ /// Others - Something went wrong
+ UE_9000,
+}
+
#[derive(
Clone,
Debug,
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 98ef4937b7..598f2975b6 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -1062,6 +1062,8 @@ pub struct PaymentAttempt {
pub authorized_amount: Option<MinorUnit>,
#[encrypt(ty = Value)]
pub encrypted_payment_method_data: Option<Encryptable<pii::SecretSerdeValue>>,
+ /// Complete error details containing unified, issuer, and connector-level error information
+ pub error_details: Option<diesel_models::payment_attempt::ErrorDetails>,
}
#[cfg(feature = "v1")]
@@ -2340,6 +2342,7 @@ impl behaviour::Conversion for PaymentAttempt {
issuer_error_code: self.issuer_error_code,
issuer_error_message: self.issuer_error_message,
setup_future_usage_applied: self.setup_future_usage_applied,
+ error_details: self.error_details,
// Below fields are deprecated. Please add any new fields above this line.
connector_transaction_data: None,
processor_merchant_id: Some(self.processor_merchant_id),
@@ -2352,7 +2355,6 @@ impl behaviour::Conversion for PaymentAttempt {
is_stored_credential: self.is_stored_credential,
authorized_amount: self.authorized_amount,
encrypted_payment_method_data: self.encrypted_payment_method_data.map(Encryption::from),
- error_details: None,
})
}
@@ -2479,6 +2481,7 @@ impl behaviour::Conversion for PaymentAttempt {
is_stored_credential: storage_model.is_stored_credential,
authorized_amount: storage_model.authorized_amount,
encrypted_payment_method_data,
+ error_details: storage_model.error_details,
})
}
.await
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 4150341044..227552aa0d 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -462,6 +462,8 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::GsmDecision,
api_models::enums::GsmFeature,
api_models::enums::StandardisedCode,
+ api_models::enums::UnifiedCode,
+ api_models::enums::RecommendedAction,
common_types::domain::GsmFeatureData,
common_types::domain::RetryFeatureData,
api_models::payments::AddressDetails,
@@ -831,6 +833,11 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::PaymentChargeType,
api_models::enums::StripeChargeType,
api_models::payments::CustomerDetailsResponse,
+ api_models::payments::PaymentErrorDetails,
+ api_models::payments::ApiUnifiedErrorDetails,
+ api_models::payments::ApiIssuerErrorDetails,
+ api_models::payments::ApiNetworkErrorDetails,
+ api_models::payments::ApiConnectorErrorDetails,
api_models::payments::SdkType,
api_models::payments::OpenBankingData,
api_models::payments::OpenBankingSessionToken,
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index c9e2c0252c..c70468befe 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -391,6 +391,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::GsmDecision,
api_models::enums::GsmFeature,
api_models::enums::StandardisedCode,
+ api_models::enums::UnifiedCode,
common_types::domain::GsmFeatureData,
common_types::domain::RetryFeatureData,
api_models::payments::NullObject,
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index c5e43a1062..38db448625 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -4941,6 +4941,7 @@ impl AttemptType {
issuer_error_message: None,
debit_routing_savings: None,
is_overcapture_enabled: None,
+ error_details: None,
}
}
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 88e0713cca..8222fe7bb4 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -1441,6 +1441,7 @@ impl PaymentCreate {
debit_routing_savings: None,
is_overcapture_enabled: None,
encrypted_payment_method_data: None,
+ error_details: None,
},
additional_pm_data,
diff --git a/crates/router/src/core/payments/retry.rs b/crates/router/src/core/payments/retry.rs
index ab0d86cf3d..678d9f8e29 100644
--- a/crates/router/src/core/payments/retry.rs
+++ b/crates/router/src/core/payments/retry.rs
@@ -781,6 +781,7 @@ pub fn make_new_payment_attempt(
issuer_error_message: Default::default(),
debit_routing_savings: Default::default(),
is_overcapture_enabled: Default::default(),
+ error_details: Default::default(),
}
}
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 4af27ed3b4..fdf99be954 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -3,7 +3,7 @@ use std::{fmt::Debug, marker::PhantomData, str::FromStr};
#[cfg(feature = "v2")]
use api_models::enums as api_enums;
#[cfg(feature = "v1")]
-use api_models::payments::PaymentMethodTokenizationDetails;
+use api_models::payments as api_payments;
#[cfg(feature = "v2")]
use api_models::payments::RevenueRecoveryGetIntentResponse;
use api_models::payments::{
@@ -3903,7 +3903,7 @@ where
let payment_method_tokenization_details = payment_data
.get_payment_method_info()
- .map(PaymentMethodTokenizationDetails::foreign_try_from)
+ .map(api_payments::PaymentMethodTokenizationDetails::foreign_try_from)
.transpose()?;
let payments_response = api::PaymentsResponse {
@@ -3974,6 +3974,9 @@ where
.filter(|message| message != NO_ERROR_MESSAGE),
unified_code: payment_attempt.unified_code,
unified_message: payment_attempt.unified_message,
+ error_details: payment_attempt
+ .error_details
+ .map(api_payments::PaymentErrorDetails::foreign_from),
payment_experience: payment_attempt.payment_experience,
payment_method_type: payment_attempt.payment_method_type,
connector_label,
@@ -4312,6 +4315,7 @@ impl
error_message: None,
unified_code: None,
unified_message: None,
+ error_details: None,
payment_experience: None,
connector_label: None,
allowed_payment_method_types: None,
@@ -4367,7 +4371,7 @@ impl
}
#[cfg(feature = "v1")]
-impl ForeignTryFrom<&domain::PaymentMethod> for PaymentMethodTokenizationDetails {
+impl ForeignTryFrom<&domain::PaymentMethod> for api_payments::PaymentMethodTokenizationDetails {
type Error = error_stack::Report<errors::ApiErrorResponse>;
fn foreign_try_from(payment_method: &domain::PaymentMethod) -> Result<Self, Self::Error> {
let connector_common_mandate_details = payment_method
diff --git a/crates/router/src/db/events.rs b/crates/router/src/db/events.rs
index b792b26ca0..f76fb33afb 100644
--- a/crates/router/src/db/events.rs
+++ b/crates/router/src/db/events.rs
@@ -1527,6 +1527,7 @@ mod tests {
billing_descriptor: None,
partner_merchant_identifier_details: None,
payment_method_tokenization_details: None,
+ error_details: None,
};
let content =
api_webhooks::OutgoingWebhookContent::PaymentDetails(Box::new(expected_response));
diff --git a/crates/router/src/types/storage/payment_attempt.rs b/crates/router/src/types/storage/payment_attempt.rs
index dd673769ce..089d15e651 100644
--- a/crates/router/src/types/storage/payment_attempt.rs
+++ b/crates/router/src/types/storage/payment_attempt.rs
@@ -241,6 +241,7 @@ mod tests {
is_overcapture_enabled: Default::default(),
connector_transaction_id: Default::default(),
encrypted_payment_method_data: Default::default(),
+ error_details: Default::default(),
};
let store = state
@@ -358,6 +359,7 @@ mod tests {
is_overcapture_enabled: Default::default(),
connector_transaction_id: Default::default(),
encrypted_payment_method_data: Default::default(),
+ error_details: Default::default(),
};
let store = state
.stores
@@ -489,6 +491,7 @@ mod tests {
is_overcapture_enabled: Default::default(),
connector_transaction_id: Default::default(),
encrypted_payment_method_data: Default::default(),
+ error_details: Default::default(),
};
let store = state
.stores
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index d270206e75..6af9d458a3 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -798,6 +798,80 @@ impl ForeignFrom<diesel_models::cards_info::CardInfo> for api_models::cards_info
}
}
+#[cfg(feature = "v1")]
+impl ForeignFrom<diesel_models::payment_attempt::UnifiedErrorDetails>
+ for payments::ApiUnifiedErrorDetails
+{
+ fn foreign_from(unified: diesel_models::payment_attempt::UnifiedErrorDetails) -> Self {
+ Self {
+ category: unified.category,
+ message: unified.message,
+ standardised_code: unified.standardised_code,
+ description: unified.description,
+ user_guidance_message: unified.user_guidance_message,
+ recommended_action: unified.recommended_action,
+ }
+ }
+}
+
+#[cfg(feature = "v1")]
+impl ForeignFrom<diesel_models::payment_attempt::NetworkErrorDetails>
+ for payments::ApiNetworkErrorDetails
+{
+ fn foreign_from(network: diesel_models::payment_attempt::NetworkErrorDetails) -> Self {
+ Self {
+ name: network.name,
+ advice_code: network.advice_code,
+ advice_message: network.advice_message,
+ }
+ }
+}
+
+#[cfg(feature = "v1")]
+impl ForeignFrom<diesel_models::payment_attempt::IssuerErrorDetails>
+ for payments::ApiIssuerErrorDetails
+{
+ fn foreign_from(issuer: diesel_models::payment_attempt::IssuerErrorDetails) -> Self {
+ Self {
+ code: issuer.code,
+ message: issuer.message,
+ network_details: issuer
+ .network_details
+ .map(payments::ApiNetworkErrorDetails::foreign_from),
+ }
+ }
+}
+
+#[cfg(feature = "v1")]
+impl ForeignFrom<diesel_models::payment_attempt::ConnectorErrorDetails>
+ for payments::ApiConnectorErrorDetails
+{
+ fn foreign_from(connector: diesel_models::payment_attempt::ConnectorErrorDetails) -> Self {
+ Self {
+ code: connector.code,
+ message: connector.message,
+ reason: connector.reason,
+ }
+ }
+}
+
+#[cfg(feature = "v1")]
+impl ForeignFrom<diesel_models::payment_attempt::ErrorDetails> for payments::PaymentErrorDetails {
+ fn foreign_from(details: diesel_models::payment_attempt::ErrorDetails) -> Self {
+ Self {
+ unified_details: details
+ .unified_details
+ .map(payments::ApiUnifiedErrorDetails::foreign_from),
+ issuer_details: details
+ .issuer_details
+ .map(payments::ApiIssuerErrorDetails::foreign_from),
+ connector_details: details
+ .connector_details
+ .map(payments::ApiConnectorErrorDetails::foreign_from),
+ }
+ }
+}
+
impl ForeignTryFrom<domain::MerchantConnectorAccount>
for api_models::admin::MerchantConnectorListResponse
{
diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs
index fb37ad5886..5f419bedb5 100644
--- a/crates/router/tests/payments.rs
+++ b/crates/router/tests/payments.rs
@@ -478,6 +478,7 @@ async fn payments_create_core() {
billing_descriptor: None,
partner_merchant_identifier_details: None,
payment_method_tokenization_details: None,
+ error_details: None,
};
let expected_response =
services::ApplicationResponse::JsonWithHeaders((expected_response, vec![]));
@@ -774,6 +775,7 @@ async fn payments_create_core_adyen_no_redirect() {
billing_descriptor: None,
partner_merchant_identifier_details: None,
payment_method_tokenization_details: None,
+ error_details: None,
},
vec![],
));
diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs
index 863e5c83ee..5389e2a486 100644
--- a/crates/router/tests/payments2.rs
+++ b/crates/router/tests/payments2.rs
@@ -238,6 +238,7 @@ async fn payments_create_core() {
billing_descriptor: None,
partner_merchant_identifier_details: None,
payment_method_tokenization_details: None,
+ error_details: None,
};
let expected_response =
@@ -543,6 +544,7 @@ async fn payments_create_core_adyen_no_redirect() {
billing_descriptor: None,
partner_merchant_identifier_details: None,
payment_method_tokenization_details: None,
+ error_details: None,
},
vec![],
));
diff --git a/crates/storage_impl/src/mock_db/payment_attempt.rs b/crates/storage_impl/src/mock_db/payment_attempt.rs
index eec4e9bebd..44b98640a3 100644
--- a/crates/storage_impl/src/mock_db/payment_attempt.rs
+++ b/crates/storage_impl/src/mock_db/payment_attempt.rs
@@ -247,6 +247,7 @@ impl PaymentAttemptInterface for MockDb {
authorized_amount: payment_attempt.authorized_amount,
tokenization: payment_attempt.tokenization,
encrypted_payment_method_data: payment_attempt.encrypted_payment_method_data,
+ error_details: payment_attempt.error_details,
};
payment_attempts.push(payment_attempt.clone());
Ok(payment_attempt)
diff --git a/crates/storage_impl/src/payments/payment_attempt.rs b/crates/storage_impl/src/payments/payment_attempt.rs
index da926b5a48..37b339598e 100644
--- a/crates/storage_impl/src/payments/payment_attempt.rs
+++ b/crates/storage_impl/src/payments/payment_attempt.rs
@@ -813,6 +813,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
extended_authorization_applied: payment_attempt.extended_authorization_applied,
extended_authorization_last_applied_at: payment_attempt
.extended_authorization_last_applied_at,
+ error_details: payment_attempt.error_details.clone(),
capture_before: payment_attempt.capture_before,
card_discovery: payment_attempt.card_discovery,
charges: None,