fix(payments): update error handling for payment void v2 (#9595)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Ayush Anand
2025-10-07 13:01:14 +05:30
committed by GitHub
parent cc4eaed570
commit e2ed289f2d
6 changed files with 87 additions and 8 deletions

View File

@ -4992,6 +4992,9 @@ pub struct PaymentsCancelResponse {
/// The url to which user must be redirected to after completion of the purchase
#[schema(value_type = Option<String>)]
pub return_url: Option<common_utils::types::Url>,
/// Error details for the payment
pub error: Option<ErrorDetails>,
}
#[derive(Default, Clone, Debug, Eq, PartialEq, serde::Serialize)]
@ -6284,6 +6287,8 @@ pub struct ErrorDetails {
pub code: String,
/// The error message
pub message: String,
/// The detailed error reason that was returned by the connector.
pub reason: Option<String>,
/// The unified error code across all connectors.
/// This can be relied upon for taking decisions based on the error.
pub unified_code: Option<String>,