feat(connectors): [Redsys] add 3D secure card payment support, including transaction capture, cancellation, and refunds (#7508)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2025-03-21 15:08:44 +05:30
committed by GitHub
parent 0efeaa890f
commit a1ecce8f25
58 changed files with 3153 additions and 536 deletions

View File

@ -1148,6 +1148,9 @@ pub struct PaymentsRequest {
/// Service details for click to pay external authentication
#[schema(value_type = Option<CtpServiceDetails>)]
pub ctp_service_details: Option<CtpServiceDetails>,
/// Indicates if 3DS method data was successfully completed or not
pub threeds_method_comp_ind: Option<ThreeDsCompletionIndicator>,
}
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@ -4482,6 +4485,28 @@ pub enum NextActionData {
CollectOtp {
consent_data_required: MobilePaymentConsent,
},
/// Contains data required to invoke hidden iframe
InvokeHiddenIframe {
iframe_data: IframeData,
},
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, ToSchema)]
#[serde(tag = "method_key")]
pub enum IframeData {
#[serde(rename = "threeDSMethodData")]
ThreedsInvokeAndCompleteAutorize {
/// ThreeDS method url
three_ds_method_url: String,
/// Whether ThreeDS method data submission is required
three_ds_method_data_submission: bool,
/// ThreeDS method data
three_ds_method_data: Option<String>,
/// ThreeDS Server ID
directory_server_id: String,
/// ThreeDS Protocol version
message_version: Option<String>,
},
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, ToSchema)]
@ -4638,6 +4663,15 @@ pub struct SepaBankTransferInstructions {
pub reference: Secret<String>,
}
#[derive(Clone, Debug, serde::Deserialize)]
pub struct PaymentsConnectorThreeDsInvokeData {
pub directory_server_id: String,
pub three_ds_method_url: String,
pub three_ds_method_data: String,
pub message_version: Option<String>,
pub three_ds_method_data_submission: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct BacsBankTransferInstructions {
#[schema(value_type = String, example = "Jane Doe")]
@ -7266,6 +7300,8 @@ pub struct PaymentsCompleteAuthorizeRequest {
/// Client Secret
#[schema(value_type = String)]
pub client_secret: Secret<String>,
/// Indicates if 3DS method data was successfully completed or not
pub threeds_method_comp_ind: Option<ThreeDsCompletionIndicator>,
}
#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]