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): populate connector raw response and connector_response_reference_id for razorpay (#8499)

Aishwariyaa Anand2253d981c898
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index 8da8f56f70..76a35e926e 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -17881,41 +17881,6 @@
"propertyName": "payment_processing_details_at"
}
},
- "PaymentRetrieveBody": {
- "type": "object",
- "properties": {
- "merchant_id": {
- "type": "string",
- "description": "The identifier for the Merchant Account.",
- "nullable": true
- },
- "force_sync": {
- "type": "boolean",
- "description": "Decider to enable or disable the connector call for retrieve request",
- "nullable": true
- },
- "client_secret": {
- "type": "string",
- "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK",
- "nullable": true
- },
- "expand_captures": {
- "type": "boolean",
- "description": "If enabled provides list of captures linked to latest attempt",
- "nullable": true
- },
- "expand_attempts": {
- "type": "boolean",
- "description": "If enabled provides list of attempts linked to payment intent",
- "nullable": true
- },
- "all_keys_required": {
- "type": "boolean",
- "description": "If enabled, provides whole connector response",
- "nullable": true
- }
- }
- },
"PaymentRevenueRecoveryMetadata": {
"type": "object",
"required": [
@@ -18128,6 +18093,11 @@
}
],
"nullable": true
+ },
+ "return_raw_connector_response": {
+ "type": "boolean",
+ "description": "If true, returns stringified connector raw response body",
+ "nullable": true
}
},
"additionalProperties": false
@@ -19127,6 +19097,11 @@
}
],
"nullable": true
+ },
+ "return_raw_connector_response": {
+ "type": "boolean",
+ "description": "Stringified connector raw response body. Only returned if `return_raw_connector_response` is true",
+ "nullable": true
}
},
"additionalProperties": false
@@ -19311,6 +19286,11 @@
"nullable": true,
"maxLength": 30,
"minLength": 30
+ },
+ "raw_connector_response": {
+ "type": "string",
+ "description": "Stringified connector raw response body. Only returned if `return_raw_connector_response` is true",
+ "nullable": true
}
}
},
@@ -19331,9 +19311,9 @@
"description": "These are the query params that are sent in case of redirect response.\nThese can be ingested by the connector to take necessary actions.",
"nullable": true
},
- "all_keys_required": {
+ "return_raw_connector_response": {
"type": "boolean",
- "description": "If enabled, provides whole connector response",
+ "description": "If true, returns stringified connector raw response body",
"nullable": true
},
"merchant_connector_details": {
@@ -19394,9 +19374,9 @@
"description": "These are the query params that are sent in case of redirect response.\nThese can be ingested by the connector to take necessary actions.",
"nullable": true
},
- "all_keys_required": {
+ "return_raw_connector_response": {
"type": "boolean",
- "description": "If enabled, provides whole connector response",
+ "description": "If true, returns stringified connector raw response body",
"nullable": true
}
}
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 2ff07472a0..9150697aa1 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -5347,6 +5347,9 @@ pub struct PaymentsConfirmIntentRequest {
/// Merchant connector details used to make payments.
#[schema(value_type = Option<MerchantConnectorAuthDetails>)]
pub merchant_connector_details: Option<common_types::domain::MerchantConnectorAuthDetails>,
+
+ /// If true, returns stringified connector raw response body
+ pub return_raw_connector_response: Option<bool>,
}
#[cfg(feature = "v2")]
@@ -5523,6 +5526,9 @@ pub struct PaymentsRequest {
/// Merchant connector details used to make payments.
#[schema(value_type = Option<MerchantConnectorAuthDetails>)]
pub merchant_connector_details: Option<common_types::domain::MerchantConnectorAuthDetails>,
+
+ /// Stringified connector raw response body. Only returned if `return_raw_connector_response` is true
+ pub return_raw_connector_response: Option<bool>,
}
#[cfg(feature = "v2")]
@@ -5575,6 +5581,7 @@ impl From<&PaymentsRequest> for PaymentsConfirmIntentRequest {
payment_method_id: request.payment_method_id.clone(),
payment_token: None,
merchant_connector_details: request.merchant_connector_details.clone(),
+ return_raw_connector_response: request.return_raw_connector_response,
}
}
}
@@ -5597,8 +5604,8 @@ pub struct PaymentsRetrieveRequest {
/// These are the query params that are sent in case of redirect response.
/// These can be ingested by the connector to take necessary actions.
pub param: Option<String>,
- /// If enabled, provides whole connector response
- pub all_keys_required: Option<bool>,
+ /// If true, returns stringified connector raw response body
+ pub return_raw_connector_response: Option<bool>,
/// Merchant connector details used to make payments.
#[schema(value_type = Option<MerchantConnectorAuthDetails>)]
pub merchant_connector_details: Option<common_types::domain::MerchantConnectorAuthDetails>,
@@ -5619,8 +5626,8 @@ pub struct PaymentsStatusRequest {
/// These are the query params that are sent in case of redirect response.
/// These can be ingested by the connector to take necessary actions.
pub param: Option<String>,
- /// If enabled, provides whole connector response
- pub all_keys_required: Option<bool>,
+ /// If true, returns stringified connector raw response body
+ pub return_raw_connector_response: Option<bool>,
}
/// Error details for the payment
@@ -5776,6 +5783,9 @@ pub struct PaymentsResponse {
example = "pay_mbabizu24mvu3mela5njyhpit4"
)]
pub merchant_reference_id: Option<id_type::PaymentReferenceId>,
+
+ /// Stringified connector raw response body. Only returned if `return_raw_connector_response` is true
+ pub raw_connector_response: Option<String>,
}
#[cfg(feature = "v2")]
@@ -7496,6 +7506,7 @@ pub struct PaymentsSessionResponse {
pub vault_details: Option<VaultSessionDetails>,
}
+#[cfg(feature = "v1")]
#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
pub struct PaymentRetrieveBody {
/// The identifier for the Merchant Account.
@@ -7513,6 +7524,7 @@ pub struct PaymentRetrieveBody {
pub all_keys_required: Option<bool>,
}
+#[cfg(feature = "v1")]
#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
pub struct PaymentRetrieveBodyWithCredentials {
/// The identifier for payment.
diff --git a/crates/common_types/src/domain.rs b/crates/common_types/src/domain.rs
index f41f874cd0..66ffa6029d 100644
--- a/crates/common_types/src/domain.rs
+++ b/crates/common_types/src/domain.rs
@@ -106,3 +106,11 @@ pub struct MerchantConnectorAuthDetails {
}"#)]
pub merchant_connector_creds: common_utils::pii::SecretSerdeValue,
}
+
+/// Connector Response Data that are required to be populated in response
+#[cfg(feature = "v2")]
+#[derive(Clone, Debug)]
+pub struct ConnectorResponseData {
+ /// Stringified connector raw response body
+ pub raw_connector_response: Option<String>,
+}
diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rs
index eeda9e7887..95bb5a875d 100644
--- a/crates/diesel_models/src/payment_attempt.rs
+++ b/crates/diesel_models/src/payment_attempt.rs
@@ -852,7 +852,7 @@ pub struct PaymentAttemptUpdateInternal {
// payment_experience: Option<storage_enums::PaymentExperience>,
// preprocessing_step_id: Option<String>,
pub error_reason: Option<String>,
- // connector_response_reference_id: Option<String>,
+ pub connector_response_reference_id: Option<String>,
// multiple_capture_count: Option<i16>,
// pub surcharge_amount: Option<MinorUnit>,
// tax_on_surcharge: Option<MinorUnit>,
@@ -910,6 +910,7 @@ impl PaymentAttemptUpdateInternal {
network_error_message,
payment_method_id,
connector_request_reference_id,
+ connector_response_reference_id,
} = self;
PaymentAttempt {
@@ -939,7 +940,8 @@ impl PaymentAttemptUpdateInternal {
preprocessing_step_id: source.preprocessing_step_id,
error_reason: error_reason.or(source.error_reason),
multiple_capture_count: source.multiple_capture_count,
- connector_response_reference_id: source.connector_response_reference_id,
+ connector_response_reference_id: connector_response_reference_id
+ .or(source.connector_response_reference_id),
amount_capturable: amount_capturable.unwrap_or(source.amount_capturable),
updated_by,
merchant_connector_id: merchant_connector_id.or(source.merchant_connector_id),
diff --git a/crates/hyperswitch_connectors/src/connectors/razorpay.rs b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
index 39b83c73e4..33cdc32698 100644
--- a/crates/hyperswitch_connectors/src/connectors/razorpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/razorpay.rs
@@ -316,7 +316,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
- "{}v1/payments/create/json",
+ "{}v1/payments/create/upi",
self.base_url(connectors)
))
}
@@ -404,15 +404,15 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Raz
req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
- let connector_payment_id = req
+ let order_id = req
.request
- .connector_transaction_id
- .get_connector_transaction_id()
- .change_context(errors::ConnectorError::MissingConnectorTransactionID)?;
+ .connector_reference_id
+ .clone()
+ .ok_or(errors::ConnectorError::RequestEncodingFailed)?;
Ok(format!(
- "{}v1/payments/{}",
+ "{}v1/orders/{}/payments",
self.base_url(connectors),
- connector_payment_id,
+ order_id,
))
}
@@ -512,21 +512,11 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
fn handle_response(
&self,
- data: &PaymentsCaptureRouterData,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
+ _data: &PaymentsCaptureRouterData,
+ _event_builder: Option<&mut ConnectorEvent>,
+ _res: Response,
) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {
- let response: razorpay::RazorpayPaymentsResponse = res
- .response
- .parse_struct("Razorpay PaymentsCaptureResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(ResponseRouterData {
- response,
- data: data.clone(),
- http_code: res.status_code,
- })
+ Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
}
fn get_error_response(
diff --git a/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
index 23aa882829..0176ae4785 100644
--- a/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs
@@ -11,7 +11,7 @@ use hyperswitch_domain_models::{
payment_method_data::{PaymentMethodData, UpiData},
router_data::{ConnectorAuthType, RouterData},
router_flow_types::refunds::{Execute, RSync},
- router_request_types::ResponseId,
+ router_request_types::{PaymentsAuthorizeData, ResponseId},
router_response_types::{PaymentsResponseData, RefundsResponseData},
types,
};
@@ -227,18 +227,29 @@ pub struct NextAction {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RazorpayPaymentsResponse {
pub razorpay_payment_id: String,
- pub next: Option<Vec<NextAction>>,
}
-impl<F, T> TryFrom<ResponseRouterData<F, RazorpayPaymentsResponse, T, PaymentsResponseData>>
- for RouterData<F, T, PaymentsResponseData>
+impl<F>
+ TryFrom<
+ ResponseRouterData<
+ F,
+ RazorpayPaymentsResponse,
+ PaymentsAuthorizeData,
+ PaymentsResponseData,
+ >,
+ > for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData>
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
- item: ResponseRouterData<F, RazorpayPaymentsResponse, T, PaymentsResponseData>,
+ item: ResponseRouterData<
+ F,
+ RazorpayPaymentsResponse,
+ PaymentsAuthorizeData,
+ PaymentsResponseData,
+ >,
) -> Result<Self, Self::Error> {
let connector_metadata = get_wait_screen_metadata()?;
-
+ let order_id = item.data.request.get_order_id()?;
Ok(Self {
status: enums::AttemptStatus::AuthenticationPending,
response: Ok(PaymentsResponseData::TransactionResponse {
@@ -249,7 +260,7 @@ impl<F, T> TryFrom<ResponseRouterData<F, RazorpayPaymentsResponse, T, PaymentsRe
mandate_reference: Box::new(None),
connector_metadata,
network_txn_id: None,
- connector_response_reference_id: Some(item.response.razorpay_payment_id),
+ connector_response_reference_id: Some(order_id),
incremental_authorization_allowed: None,
charges: None,
}),
@@ -281,6 +292,12 @@ pub fn get_wait_screen_metadata() -> CustomResult<Option<serde_json::Value>, err
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RazorpaySyncResponse {
+ items: Vec<RazorpaySyncItem>,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct RazorpaySyncItem {
id: String,
status: RazorpayStatus,
}
@@ -311,8 +328,15 @@ impl<F, T> TryFrom<ResponseRouterData<F, RazorpaySyncResponse, T, PaymentsRespon
fn try_from(
item: ResponseRouterData<F, RazorpaySyncResponse, T, PaymentsResponseData>,
) -> Result<Self, Self::Error> {
+ let status = match item.response.items.last() {
+ Some(last_item) => {
+ let razorpay_status = last_item.status;
+ get_psync_razorpay_payment_status(razorpay_status)
+ }
+ None => item.data.status,
+ };
Ok(Self {
- status: get_psync_razorpay_payment_status(item.response.status),
+ status,
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::NoResponseId,
redirection_data: Box::new(None),
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index b346b40d97..1353d06819 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -6209,7 +6209,7 @@ pub(crate) fn convert_payment_authorize_router_response<F1, F2, T1, T2>(
connector_mandate_request_reference_id: data.connector_mandate_request_reference_id.clone(),
authentication_id: data.authentication_id.clone(),
psd2_sca_exemption_type: data.psd2_sca_exemption_type,
- whole_connector_response: data.whole_connector_response.clone(),
+ raw_connector_response: data.raw_connector_response.clone(),
}
}
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index d644c519ea..9078f1d49d 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -1763,6 +1763,7 @@ pub struct ConfirmIntentResponseUpdate {
pub connector_metadata: Option<pii::SecretSerdeValue>,
pub amount_capturable: Option<MinorUnit>,
pub connector_token_details: Option<diesel_models::ConnectorTokenDetails>,
+ pub connector_response_reference_id: Option<String>,
}
#[cfg(feature = "v2")]
@@ -1776,6 +1777,7 @@ pub enum PaymentAttemptUpdate {
merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
authentication_type: storage_enums::AuthenticationType,
connector_request_reference_id: Option<String>,
+ connector_response_reference_id: Option<String>,
},
/// Update the payment attempt on confirming the intent, before calling the connector, when payment_method_id is present
ConfirmIntentTokenized {
@@ -2569,6 +2571,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
merchant_connector_id,
authentication_type,
connector_request_reference_id,
+ connector_response_reference_id,
} => Self {
status: Some(status),
payment_method_id: None,
@@ -2594,6 +2597,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id,
+ connector_response_reference_id,
},
PaymentAttemptUpdate::ErrorUpdate {
status,
@@ -2626,6 +2630,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: error.network_decline_code,
network_error_message: error.network_error_message,
connector_request_reference_id: None,
+ connector_response_reference_id: None,
},
PaymentAttemptUpdate::ConfirmIntentResponse(confirm_intent_response_update) => {
let ConfirmIntentResponseUpdate {
@@ -2636,6 +2641,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
connector_metadata,
amount_capturable,
connector_token_details,
+ connector_response_reference_id,
} = *confirm_intent_response_update;
Self {
status: Some(status),
@@ -2663,6 +2669,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id: None,
+ connector_response_reference_id,
}
}
PaymentAttemptUpdate::SyncUpdate {
@@ -2694,6 +2701,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id: None,
+ connector_response_reference_id: None,
},
PaymentAttemptUpdate::CaptureUpdate {
status,
@@ -2724,6 +2732,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id: None,
+ connector_response_reference_id: None,
},
PaymentAttemptUpdate::PreCaptureUpdate {
amount_to_capture,
@@ -2753,6 +2762,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id: None,
+ connector_response_reference_id: None,
},
PaymentAttemptUpdate::ConfirmIntentTokenized {
status,
@@ -2786,6 +2796,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
network_decline_code: None,
network_error_message: None,
connector_request_reference_id: None,
+ connector_response_reference_id: None,
},
}
}
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index dd1004c701..851ac69a81 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -103,8 +103,8 @@ pub struct RouterData<Flow, Request, Response> {
/// Contains the type of sca exemption required for the transaction
pub psd2_sca_exemption_type: Option<common_enums::ScaExemptionType>,
- /// Contains whole connector response
- pub whole_connector_response: Option<String>,
+ /// Contains stringified connector raw response body
+ pub raw_connector_response: Option<String>,
}
// Different patterns of authentication.
@@ -567,6 +567,7 @@ impl
resource_id,
redirection_data,
connector_metadata,
+ connector_response_reference_id,
..
} => {
let attempt_status = self.get_attempt_status_for_db_update(payment_data);
@@ -595,6 +596,8 @@ impl
token_details.get_connector_token_request_reference_id()
}),
),
+ connector_response_reference_id: connector_response_reference_id
+ .clone(),
},
))
}
@@ -1253,6 +1256,7 @@ impl
resource_id,
redirection_data,
connector_metadata,
+ connector_response_reference_id,
..
} => {
let attempt_status = self.get_attempt_status_for_db_update(payment_data);
@@ -1281,6 +1285,9 @@ impl
token_details.get_connector_token_request_reference_id()
}),
),
+
+ connector_response_reference_id: connector_response_reference_id
+ .clone(),
},
))
}
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index c7987122ea..31879b4cfe 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -508,6 +508,7 @@ pub struct PaymentsSyncData {
pub split_payments: Option<common_types::payments::SplitPaymentsRequest>,
pub amount: MinorUnit,
pub integrity_object: Option<SyncIntegrityObject>,
+ pub connector_reference_id: Option<String>,
}
#[derive(Debug, Default, Clone)]
diff --git a/crates/hyperswitch_interfaces/src/conversion_impls.rs b/crates/hyperswitch_interfaces/src/conversion_impls.rs
index 252caed961..ae5f071a20 100644
--- a/crates/hyperswitch_interfaces/src/conversion_impls.rs
+++ b/crates/hyperswitch_interfaces/src/conversion_impls.rs
@@ -84,7 +84,7 @@ fn get_default_router_data<F, Req, Resp>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index 4a3c03d69f..11dae0588a 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -424,7 +424,6 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::PaymentsRequest,
api_models::payments::PaymentsResponse,
api_models::payments::PaymentsListResponseItem,
- api_models::payments::PaymentRetrieveBody,
api_models::payments::PaymentsRetrieveRequest,
api_models::payments::PaymentsStatusRequest,
api_models::payments::PaymentsCaptureRequest,
diff --git a/crates/router/src/core/authentication/transformers.rs b/crates/router/src/core/authentication/transformers.rs
index e1cf04c20a..91b7c23f05 100644
--- a/crates/router/src/core/authentication/transformers.rs
+++ b/crates/router/src/core/authentication/transformers.rs
@@ -206,7 +206,7 @@ pub fn construct_router_data<F: Clone, Req, Res>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type,
- whole_connector_response: None,
+ raw_connector_response: None,
})
}
diff --git a/crates/router/src/core/fraud_check/flows/checkout_flow.rs b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
index 786192f8e9..a33dcc89a9 100644
--- a/crates/router/src/core/fraud_check/flows/checkout_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/checkout_flow.rs
@@ -161,7 +161,7 @@ impl ConstructFlowSpecificData<frm_api::Checkout, FraudCheckCheckoutData, FraudC
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
index 421c255e11..08b3c78926 100644
--- a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs
@@ -128,7 +128,7 @@ pub async fn construct_fulfillment_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
diff --git a/crates/router/src/core/fraud_check/flows/record_return.rs b/crates/router/src/core/fraud_check/flows/record_return.rs
index ea34b8af17..d33cd51e57 100644
--- a/crates/router/src/core/fraud_check/flows/record_return.rs
+++ b/crates/router/src/core/fraud_check/flows/record_return.rs
@@ -129,7 +129,7 @@ impl ConstructFlowSpecificData<RecordReturn, FraudCheckRecordReturnData, FraudCh
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/fraud_check/flows/sale_flow.rs b/crates/router/src/core/fraud_check/flows/sale_flow.rs
index efdeeec774..55d53f0096 100644
--- a/crates/router/src/core/fraud_check/flows/sale_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/sale_flow.rs
@@ -137,7 +137,7 @@ impl ConstructFlowSpecificData<frm_api::Sale, FraudCheckSaleData, FraudCheckResp
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/fraud_check/flows/transaction_flow.rs b/crates/router/src/core/fraud_check/flows/transaction_flow.rs
index eae995be4b..29013c70e9 100644
--- a/crates/router/src/core/fraud_check/flows/transaction_flow.rs
+++ b/crates/router/src/core/fraud_check/flows/transaction_flow.rs
@@ -146,7 +146,7 @@ impl
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/mandate/utils.rs b/crates/router/src/core/mandate/utils.rs
index 642a28c567..1298162d41 100644
--- a/crates/router/src/core/mandate/utils.rs
+++ b/crates/router/src/core/mandate/utils.rs
@@ -85,7 +85,7 @@ pub async fn construct_mandate_revoke_router_data(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs
index 6d36f7d434..d04bf5b39e 100644
--- a/crates/router/src/core/payment_methods.rs
+++ b/crates/router/src/core/payment_methods.rs
@@ -2922,6 +2922,7 @@ fn construct_zero_auth_payments_request(
force_3ds_challenge: None,
is_iframe_redirection_enabled: None,
merchant_connector_details: None,
+ return_raw_connector_response: None,
})
}
@@ -3263,7 +3264,7 @@ async fn create_single_use_tokenization_flow(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
let payment_method_token_response = tokenization::add_token_for_payment_method(
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 63a4942d34..f15e920259 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -148,7 +148,14 @@ pub async fn payments_operation_core<F, Req, Op, FData, D>(
get_tracker_response: operations::GetTrackerResponse<D>,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
-) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>
+) -> RouterResult<(
+ D,
+ Req,
+ Option<domain::Customer>,
+ Option<u16>,
+ Option<u128>,
+ common_types::domain::ConnectorResponseData,
+)>
where
F: Send + Clone + Sync,
Req: Send + Sync + Authenticate,
@@ -204,7 +211,7 @@ where
.perform_routing(&merchant_context, profile, state, &mut payment_data)
.await?;
- let payment_data = match connector {
+ let (payment_data, connector_response_data) = match connector {
ConnectorCallType::PreDetermined(connector_data) => {
let router_data = call_connector_service(
state,
@@ -224,10 +231,14 @@ where
profile,
false,
false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType
- req.get_all_keys_required(),
+ req.should_return_raw_response(),
)
.await?;
+ let connector_response_data = common_types::domain::ConnectorResponseData {
+ raw_connector_response: router_data.raw_connector_response.clone(),
+ };
+
let payments_response_operation = Box::new(PaymentResponse);
payments_response_operation
@@ -241,7 +252,7 @@ where
)
.await?;
- payments_response_operation
+ let payment_data = payments_response_operation
.to_post_update_tracker()?
.update_tracker(
state,
@@ -250,7 +261,9 @@ where
merchant_context.get_merchant_key_store(),
merchant_context.get_merchant_account().storage_scheme,
)
- .await?
+ .await?;
+
+ (payment_data, connector_response_data)
}
ConnectorCallType::Retryable(connectors) => {
let mut connectors = connectors.clone().into_iter();
@@ -273,10 +286,14 @@ where
profile,
false,
false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType
- req.get_all_keys_required(),
+ req.should_return_raw_response(),
)
.await?;
+ let connector_response_data = common_types::domain::ConnectorResponseData {
+ raw_connector_response: router_data.raw_connector_response.clone(),
+ };
+
let payments_response_operation = Box::new(PaymentResponse);
payments_response_operation
@@ -290,7 +307,7 @@ where
)
.await?;
- payments_response_operation
+ let payment_data = payments_response_operation
.to_post_update_tracker()?
.update_tracker(
state,
@@ -299,10 +316,17 @@ where
merchant_context.get_merchant_key_store(),
merchant_context.get_merchant_account().storage_scheme,
)
- .await?
+ .await?;
+
+ (payment_data, connector_response_data)
}
ConnectorCallType::SessionMultiple(vec) => todo!(),
- ConnectorCallType::Skip => payment_data,
+ ConnectorCallType::Skip => (
+ payment_data,
+ common_types::domain::ConnectorResponseData {
+ raw_connector_response: None,
+ },
+ ),
};
let payment_intent_status = payment_data.get_payment_intent().status;
@@ -321,7 +345,14 @@ where
})
.await;
- Ok((payment_data, req, customer, None, None))
+ Ok((
+ payment_data,
+ req,
+ customer,
+ None,
+ None,
+ connector_response_data,
+ ))
}
#[cfg(feature = "v2")]
@@ -337,7 +368,13 @@ pub async fn internal_payments_operation_core<F, Req, Op, FData, D>(
get_tracker_response: operations::GetTrackerResponse<D>,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
-) -> RouterResult<(D, Req, Option<u16>, Option<u128>)>
+) -> RouterResult<(
+ D,
+ Req,
+ Option<u16>,
+ Option<u128>,
+ common_types::domain::ConnectorResponseData,
+)>
where
F: Send + Clone + Sync,
Req: Send + Sync + Authenticate,
@@ -379,10 +416,14 @@ where
call_connector_action.clone(),
header_payload.clone(),
profile,
- req.get_all_keys_required(),
+ req.should_return_raw_response(),
)
.await?;
+ let connector_response_data = common_types::domain::ConnectorResponseData {
+ raw_connector_response: router_data.raw_connector_response.clone(),
+ };
+
let payments_response_operation = Box::new(PaymentResponse);
let payment_data = payments_response_operation
@@ -396,7 +437,7 @@ where
)
.await?;
- Ok((payment_data, req, None, None))
+ Ok((payment_data, req, None, None, connector_response_data))
}
#[cfg(feature = "v1")]
@@ -686,7 +727,7 @@ where
false,
false,
None,
- <Req as Authenticate>::get_all_keys_required(&req),
+ <Req as Authenticate>::should_return_raw_response(&req),
)
.await?;
@@ -810,7 +851,7 @@ where
false,
false,
routing_decision,
- <Req as Authenticate>::get_all_keys_required(&req),
+ <Req as Authenticate>::should_return_raw_response(&req),
)
.await?;
@@ -941,7 +982,7 @@ where
session_surcharge_details,
&business_profile,
header_payload.clone(),
- <Req as Authenticate>::get_all_keys_required(&req),
+ <Req as Authenticate>::should_return_raw_response(&req),
))
.await?
}
@@ -1070,7 +1111,7 @@ pub async fn proxy_for_payments_operation_core<F, Req, Op, FData, D>(
call_connector_action: CallConnectorAction,
auth_flow: services::AuthFlow,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>
where
F: Send + Clone + Sync,
@@ -1184,7 +1225,7 @@ where
schedule_time,
header_payload.clone(),
&business_profile,
- all_keys_required,
+ return_raw_connector_response,
)
.await?;
@@ -1270,7 +1311,7 @@ pub async fn proxy_for_payments_operation_core<F, Req, Op, FData, D>(
get_tracker_response: operations::GetTrackerResponse<D>,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<(D, Req, Option<u16>, Option<u128>)>
where
F: Send + Clone + Sync,
@@ -1315,7 +1356,7 @@ where
call_connector_action.clone(),
header_payload.clone(),
&profile,
- all_keys_required,
+ return_raw_connector_response,
)
.await?;
@@ -1865,7 +1906,7 @@ pub async fn proxy_for_payments_core<F, Res, Req, Op, FData, D>(
auth_flow: services::AuthFlow,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResponse<Res>
where
F: Send + Clone + Sync,
@@ -1896,7 +1937,7 @@ where
call_connector_action,
auth_flow,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await?;
@@ -1925,7 +1966,7 @@ pub async fn proxy_for_payments_core<F, Res, Req, Op, FData, D>(
payment_id: id_type::GlobalPaymentId,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResponse<Res>
where
F: Send + Clone + Sync,
@@ -1977,7 +2018,7 @@ where
get_tracker_response,
call_connector_action,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await?;
@@ -1988,6 +2029,7 @@ where
header_payload.x_hs_latency,
&merchant_context,
&profile,
+ None,
)
}
@@ -2065,7 +2107,7 @@ pub async fn record_attempt_core(
force_sync: true,
expand_attempts: false,
param: None,
- all_keys_required: None,
+ return_raw_connector_response: None,
merchant_connector_details: None,
},
operations::GetTrackerResponse {
@@ -2125,6 +2167,7 @@ pub async fn record_attempt_core(
header_payload.x_hs_latency,
&merchant_context,
&profile,
+ None,
)
}
@@ -2334,37 +2377,58 @@ where
)
.await?;
- let (payment_data, connector_http_status_code, external_latency) =
+ let (payment_data, connector_http_status_code, external_latency, connector_response_data) =
if state.conf.merchant_id_auth.merchant_id_auth_enabled {
- let (payment_data, _req, connector_http_status_code, external_latency) =
- internal_payments_operation_core::<_, _, _, _, _>(
- &state,
- req_state,
- merchant_context.clone(),
- &profile,
- operation.clone(),
- req,
- get_tracker_response,
- call_connector_action,
- header_payload.clone(),
- )
- .await?;
- (payment_data, connector_http_status_code, external_latency)
+ let (
+ payment_data,
+ _req,
+ connector_http_status_code,
+ external_latency,
+ connector_response_data,
+ ) = internal_payments_operation_core::<_, _, _, _, _>(
+ &state,
+ req_state,
+ merchant_context.clone(),
+ &profile,
+ operation.clone(),
+ req,
+ get_tracker_response,
+ call_connector_action,
+ header_payload.clone(),
+ )
+ .await?;
+ (
+ payment_data,
+ connector_http_status_code,
+ external_latency,
+ connector_response_data,
+ )
} else {
- let (payment_data, _req, _customer, connector_http_status_code, external_latency) =
- payments_operation_core::<_, _, _, _, _>(
- &state,
- req_state,
- merchant_context.clone(),
- &profile,
- operation.clone(),
- req,
- get_tracker_response,
- call_connector_action,
- header_payload.clone(),
- )
- .await?;
- (payment_data, connector_http_status_code, external_latency)
+ let (
+ payment_data,
+ _req,
+ _customer,
+ connector_http_status_code,
+ external_latency,
+ connector_response_data,
+ ) = payments_operation_core::<_, _, _, _, _>(
+ &state,
+ req_state,
+ merchant_context.clone(),
+ &profile,
+ operation.clone(),
+ req,
+ get_tracker_response,
+ call_connector_action,
+ header_payload.clone(),
+ )
+ .await?;
+ (
+ payment_data,
+ connector_http_status_code,
+ external_latency,
+ connector_response_data,
+ )
};
payment_data.generate_response(
@@ -2374,6 +2438,7 @@ where
header_payload.x_hs_latency,
&merchant_context,
&profile,
+ Some(connector_response_data),
)
}
@@ -3000,7 +3065,7 @@ impl PaymentRedirectFlow for PaymentRedirectSync {
param: Some(req.query_params.clone()),
force_sync: true,
expand_attempts: false,
- all_keys_required: None,
+ return_raw_connector_response: None,
merchant_connector_details: None, // TODO: Implement for connectors requiring 3DS or redirection-based authentication flows.
};
@@ -3056,7 +3121,7 @@ impl PaymentRedirectFlow for PaymentRedirectSync {
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to decide the response flow")?;
- let (payment_data, _, _, _, _) =
+ let (payment_data, _, _, _, _, _) =
Box::pin(payments_operation_core::<api::PSync, _, _, _, _>(
state,
req_state,
@@ -3378,7 +3443,7 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(
is_retry_payment: bool,
should_retry_with_pan: bool,
routing_decision: Option<routing_helpers::RoutingDecisionData>,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<(
RouterData<F, RouterDReq, router_types::PaymentsResponseData>,
helpers::MerchantConnectorAccountType,
@@ -3539,16 +3604,28 @@ where
router_data = router_data.add_session_token(state, &connector).await?;
- let should_continue_further = access_token::update_router_data_with_access_token_result(
+ let mut should_continue_further = access_token::update_router_data_with_access_token_result(
&add_access_token_result,
&mut router_data,
&call_connector_action,
);
- let should_continue_further = router_data
+ let add_create_order_result = router_data
.create_order_at_connector(state, &connector, should_continue_further)
.await?;
+ if add_create_order_result.is_create_order_performed {
+ if let Ok(order_id_opt) = &add_create_order_result.create_order_result {
+ payment_data.set_connector_response_reference_id(order_id_opt.clone());
+ }
+ should_continue_further = router_data
+ .update_router_data_with_create_order_result(
+ add_create_order_result,
+ should_continue_further,
+ )
+ .await?;
+ }
+
let updated_customer = call_create_connector_customer_if_required(
state,
customer,
@@ -3664,7 +3741,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await
} else {
@@ -3696,7 +3773,7 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(
business_profile: &domain::Profile,
is_retry_payment: bool,
should_retry_with_pan: bool,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
where
F: Send + Clone + Sync,
@@ -3765,16 +3842,28 @@ where
router_data = router_data.add_session_token(state, &connector).await?;
- let should_continue_further = access_token::update_router_data_with_access_token_result(
+ let mut should_continue_further = access_token::update_router_data_with_access_token_result(
&add_access_token_result,
&mut router_data,
&call_connector_action,
);
- let should_continue_further = router_data
+ let add_create_order_result = router_data
.create_order_at_connector(state, &connector, should_continue_further)
.await?;
+ if add_create_order_result.is_create_order_performed {
+ if let Ok(order_id_opt) = &add_create_order_result.create_order_result {
+ payment_data.set_connector_response_reference_id(order_id_opt.clone());
+ }
+ should_continue_further = router_data
+ .update_router_data_with_create_order_result(
+ add_create_order_result,
+ should_continue_further,
+ )
+ .await?;
+ }
+
// In case of authorize flow, pre-task and post-tasks are being called in build request
// if we do not want to proceed further, then the function will return Ok(None, false)
let (connector_request, should_continue_further) = if should_continue_further {
@@ -3819,7 +3908,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await
} else {
@@ -3851,7 +3940,7 @@ pub async fn proxy_for_call_connector_service<F, RouterDReq, ApiRequest, D>(
header_payload: HeaderPayload,
business_profile: &domain::Profile,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<(
RouterData<F, RouterDReq, router_types::PaymentsResponseData>,
helpers::MerchantConnectorAccountType,
@@ -3992,7 +4081,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await
} else {
@@ -4019,7 +4108,7 @@ pub async fn proxy_for_call_connector_service<F, RouterDReq, ApiRequest, D>(
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
business_profile: &domain::Profile,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
where
F: Send + Clone + Sync,
@@ -4116,7 +4205,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await
} else {
@@ -4143,7 +4232,7 @@ pub async fn internal_call_connector_service<F, RouterDReq, ApiRequest, D>(
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
business_profile: &domain::Profile,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
where
F: Send + Clone + Sync,
@@ -4211,10 +4300,22 @@ where
&call_connector_action,
);
- let should_continue_further = router_data
+ let add_create_order_result = router_data
.create_order_at_connector(state, &connector, should_continue_further)
.await?;
+ if add_create_order_result.is_create_order_performed {
+ if let Ok(order_id_opt) = &add_create_order_result.create_order_result {
+ payment_data.set_connector_response_reference_id(order_id_opt.clone());
+ }
+ should_continue_further = router_data
+ .update_router_data_with_create_order_result(
+ add_create_order_result,
+ should_continue_further,
+ )
+ .await?;
+ }
+
let (connector_request, should_continue_further) = if should_continue_further {
router_data
.build_flow_specific_connector_request(state, &connector, call_connector_action.clone())
@@ -4247,7 +4348,7 @@ where
connector_request,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
)
.await
} else {
@@ -4509,7 +4610,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, D>(
_session_surcharge_details: Option<api::SessionSurchargeDetails>,
business_profile: &domain::Profile,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<D>
where
Op: Debug,
@@ -4560,7 +4661,7 @@ where
None,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
);
join_handlers.push(res);
@@ -4620,7 +4721,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, D>(
session_surcharge_details: Option<api::SessionSurchargeDetails>,
business_profile: &domain::Profile,
header_payload: HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<D>
where
Op: Debug,
@@ -4682,7 +4783,7 @@ where
None,
business_profile,
header_payload.clone(),
- all_keys_required,
+ return_raw_connector_response,
);
join_handlers.push(res);
@@ -8893,6 +8994,7 @@ pub trait OperationSessionGetters<F> {
fn get_token_data(&self) -> Option<&storage::PaymentTokenData>;
fn get_mandate_connector(&self) -> Option<&MandateConnectorDetails>;
fn get_force_sync(&self) -> Option<bool>;
+ #[cfg(feature = "v1")]
fn get_all_keys_required(&self) -> Option<bool>;
fn get_capture_method(&self) -> Option<enums::CaptureMethod>;
fn get_merchant_connector_id_in_attempt(&self) -> Option<id_type::MerchantConnectorAccountId>;
@@ -8902,6 +9004,8 @@ pub trait OperationSessionGetters<F> {
) -> Option<common_types::domain::MerchantConnectorAuthDetails>;
fn get_connector_customer_id(&self) -> Option<String>;
+
+ #[cfg(feature = "v1")]
fn get_whole_connector_response(&self) -> Option<String>;
#[cfg(feature = "v1")]
@@ -8980,6 +9084,8 @@ pub trait OperationSessionSetters<F> {
#[cfg(feature = "v2")]
fn set_connector_request_reference_id(&mut self, reference_id: Option<String>);
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>);
+
#[cfg(feature = "v2")]
fn set_vault_session_details(
&mut self,
@@ -9292,6 +9398,10 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentData<F> {
) {
self.payment_attempt.routing_approach = routing_approach;
}
+
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>) {
+ self.payment_attempt.connector_response_reference_id = reference_id;
+ }
}
#[cfg(feature = "v2")]
@@ -9446,14 +9556,6 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentIntentData<F> {
todo!();
}
- fn get_all_keys_required(&self) -> Option<bool> {
- todo!();
- }
-
- fn get_whole_connector_response(&self) -> Option<String> {
- todo!();
- }
-
fn get_pre_routing_result(
&self,
) -> Option<HashMap<enums::PaymentMethodType, domain::PreRoutingConnectorChoice>> {
@@ -9572,6 +9674,10 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentIntentData<F> {
todo!()
}
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>) {
+ todo!()
+ }
+
fn set_vault_session_details(
&mut self,
vault_session_details: Option<api::VaultSessionDetails>,
@@ -9737,14 +9843,6 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentConfirmData<F> {
Some(&self.payment_attempt)
}
- fn get_all_keys_required(&self) -> Option<bool> {
- todo!()
- }
-
- fn get_whole_connector_response(&self) -> Option<String> {
- todo!()
- }
-
fn get_pre_routing_result(
&self,
) -> Option<HashMap<enums::PaymentMethodType, domain::PreRoutingConnectorChoice>> {
@@ -9868,6 +9966,10 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentConfirmData<F> {
self.payment_attempt.connector_request_reference_id = reference_id;
}
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>) {
+ self.payment_attempt.connector_response_reference_id = reference_id;
+ }
+
fn set_vault_session_details(
&mut self,
external_vault_session_details: Option<api::VaultSessionDetails>,
@@ -10033,14 +10135,6 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentStatusData<F> {
Some(&self.payment_attempt)
}
- fn get_all_keys_required(&self) -> Option<bool> {
- todo!()
- }
-
- fn get_whole_connector_response(&self) -> Option<String> {
- todo!()
- }
-
fn get_pre_routing_result(
&self,
) -> Option<HashMap<enums::PaymentMethodType, domain::PreRoutingConnectorChoice>> {
@@ -10160,6 +10254,10 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentStatusData<F> {
todo!()
}
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>) {
+ todo!()
+ }
+
fn set_vault_session_details(
&mut self,
external_vault_session_details: Option<api::VaultSessionDetails>,
@@ -10326,13 +10424,6 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentCaptureData<F> {
Some(&self.payment_attempt)
}
- fn get_all_keys_required(&self) -> Option<bool> {
- todo!();
- }
-
- fn get_whole_connector_response(&self) -> Option<String> {
- todo!();
- }
fn get_pre_routing_result(
&self,
) -> Option<HashMap<enums::PaymentMethodType, domain::PreRoutingConnectorChoice>> {
@@ -10452,6 +10543,10 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentCaptureData<F> {
todo!()
}
+ fn set_connector_response_reference_id(&mut self, reference_id: Option<String>) {
+ todo!()
+ }
+
fn set_vault_session_details(
&mut self,
external_vault_session_details: Option<api::VaultSessionDetails>,
@@ -10613,13 +10708,6 @@ impl<F: Clone> OperationSessionGetters<F> for PaymentAttemptListData<F> {
todo!()
}
- fn get_all_keys_required(&self) -> Option<bool> {
- todo!();
- }
-
- fn get_whole_connector_response(&self) -> Option<String> {
- todo!();
- }
fn get_pre_routing_result(
&self,
) -> Option<HashMap<enums::PaymentMethodType, domain::PreRoutingConnectorChoice>> {
diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs
index 2b68120274..5cc7cfa777 100644
--- a/crates/router/src/core/payments/flows.rs
+++ b/crates/router/src/core/payments/flows.rs
@@ -78,7 +78,7 @@ pub trait Feature<F, T> {
connector_request: Option<services::Request>,
business_profile: &domain::Profile,
header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<Self>
where
Self: Sized,
@@ -182,6 +182,22 @@ pub trait Feature<F, T> {
&mut self,
_state: &SessionState,
_connector: &api::ConnectorData,
+ _should_continue_payment: bool,
+ ) -> RouterResult<types::CreateOrderResult>
+ where
+ F: Clone,
+ Self: Sized,
+ dyn api::Connector: services::ConnectorIntegration<F, T, types::PaymentsResponseData>,
+ {
+ Ok(types::CreateOrderResult {
+ create_order_result: Ok(None),
+ is_create_order_performed: false,
+ })
+ }
+
+ async fn update_router_data_with_create_order_result(
+ &mut self,
+ _create_order_result: types::CreateOrderResult,
should_continue_payment: bool,
) -> RouterResult<bool>
where
diff --git a/crates/router/src/core/payments/flows/approve_flow.rs b/crates/router/src/core/payments/flows/approve_flow.rs
index 30b7b834f5..e2f671d914 100644
--- a/crates/router/src/core/payments/flows/approve_flow.rs
+++ b/crates/router/src/core/payments/flows/approve_flow.rs
@@ -80,7 +80,7 @@ impl Feature<api::Approve, types::PaymentsApproveData>
_connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
Err(ApiErrorResponse::NotImplemented {
message: NotImplementedMessage::Reason("Flow not supported".to_string()),
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index ace3588c22..4df6ae9fe9 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -171,7 +171,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
connector_request: Option<services::Request>,
business_profile: &domain::Profile,
header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::Authorize,
@@ -188,7 +188,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
&self,
call_connector_action.clone(),
connector_request,
- all_keys_required,
+ return_raw_connector_response,
)
.await
.to_payment_failed_response()?;
@@ -422,17 +422,92 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu
state: &SessionState,
connector: &api::ConnectorData,
should_continue_payment: bool,
- ) -> RouterResult<bool> {
- let create_order_result =
- create_order_at_connector(self, state, connector, should_continue_payment).await?;
+ ) -> RouterResult<types::CreateOrderResult> {
+ if connector
+ .connector_name
+ .requires_order_creation_before_payment(self.payment_method)
+ && should_continue_payment
+ {
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::CreateOrder,
+ types::CreateOrderRequestData,
+ types::PaymentsResponseData,
+ > = connector.connector.get_connector_integration();
+
+ let request_data = types::CreateOrderRequestData::try_from(self.request.clone())?;
+
+ let response_data: Result<types::PaymentsResponseData, types::ErrorResponse> =
+ Err(types::ErrorResponse::default());
+
+ let createorder_router_data =
+ helpers::router_data_type_conversion::<_, api::CreateOrder, _, _, _, _>(
+ self.clone(),
+ request_data,
+ response_data,
+ );
- let should_continue_payment = update_router_data_with_create_order_result(
- create_order_result,
- self,
- should_continue_payment,
- )?;
+ let resp = services::execute_connector_processing_step(
+ state,
+ connector_integration,
+ &createorder_router_data,
+ payments::CallConnectorAction::Trigger,
+ None,
+ None,
+ )
+ .await
+ .to_payment_failed_response()?;
+
+ let create_order_resp = match resp.response {
+ Ok(res) => {
+ if let types::PaymentsResponseData::PaymentsCreateOrderResponse { order_id } =
+ res
+ {
+ Ok(Some(order_id))
+ } else {
+ Err(error_stack::report!(ApiErrorResponse::InternalServerError)
+ .attach_printable(format!(
+ "Unexpected response format from connector: {res:?}",
+ )))?
+ }
+ }
+ Err(error) => Err(error),
+ };
+
+ Ok(types::CreateOrderResult {
+ create_order_result: create_order_resp,
+ is_create_order_performed: true,
+ })
+ } else {
+ Ok(types::CreateOrderResult {
+ create_order_result: Ok(None),
+ is_create_order_performed: false,
+ })
+ }
+ }
- Ok(should_continue_payment)
+ async fn update_router_data_with_create_order_result(
+ &mut self,
+ create_order_result: types::CreateOrderResult,
+ should_continue_further: bool,
+ ) -> RouterResult<bool> {
+ if create_order_result.is_create_order_performed {
+ match create_order_result.create_order_result {
+ Ok(Some(order_id)) => {
+ self.request.order_id = Some(order_id.clone());
+ self.response =
+ Ok(types::PaymentsResponseData::PaymentsCreateOrderResponse { order_id });
+ Ok(true)
+ }
+ Ok(None) => Err(error_stack::report!(ApiErrorResponse::InternalServerError)
+ .attach_printable("Order Id not found."))?,
+ Err(err) => {
+ self.response = Err(err.clone());
+ Ok(false)
+ }
+ }
+ } else {
+ Ok(should_continue_further)
+ }
}
}
@@ -719,102 +794,3 @@ async fn process_capture_flow(
router_data.response = Ok(updated_response);
Ok(router_data)
}
-
-async fn create_order_at_connector<F: Clone>(
- router_data: &mut types::RouterData<
- F,
- types::PaymentsAuthorizeData,
- types::PaymentsResponseData,
- >,
- state: &SessionState,
- connector: &api::ConnectorData,
- should_continue_payment: bool,
-) -> RouterResult<types::CreateOrderResult> {
- if connector
- .connector_name
- .requires_order_creation_before_payment(router_data.payment_method)
- && should_continue_payment
- {
- let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
- api::CreateOrder,
- types::CreateOrderRequestData,
- types::PaymentsResponseData,
- > = connector.connector.get_connector_integration();
-
- let request_data = types::CreateOrderRequestData::try_from(router_data.request.clone())?;
-
- let response_data: Result<types::PaymentsResponseData, types::ErrorResponse> =
- Err(types::ErrorResponse::default());
-
- let createorder_router_data =
- helpers::router_data_type_conversion::<_, api::CreateOrder, _, _, _, _>(
- router_data.clone(),
- request_data,
- response_data,
- );
-
- let resp = services::execute_connector_processing_step(
- state,
- connector_integration,
- &createorder_router_data,
- payments::CallConnectorAction::Trigger,
- None,
- None,
- )
- .await
- .to_payment_failed_response()?;
-
- let create_order_resp = match resp.response {
- Ok(res) => {
- if let types::PaymentsResponseData::PaymentsCreateOrderResponse { order_id } = res {
- Ok(Some(order_id))
- } else {
- Err(error_stack::report!(ApiErrorResponse::InternalServerError)
- .attach_printable(format!(
- "Unexpected response format from connector: {res:?}",
- )))?
- }
- }
- Err(error) => Err(error),
- };
-
- Ok(types::CreateOrderResult {
- create_order_result: create_order_resp,
- is_create_order_performed: true,
- })
- } else {
- Ok(types::CreateOrderResult {
- create_order_result: Ok(None),
- is_create_order_performed: false,
- })
- }
-}
-
-fn update_router_data_with_create_order_result<F>(
- create_order_result: types::CreateOrderResult,
- router_data: &mut types::RouterData<
- F,
- types::PaymentsAuthorizeData,
- types::PaymentsResponseData,
- >,
- should_continue_further: bool,
-) -> RouterResult<bool> {
- if create_order_result.is_create_order_performed {
- match create_order_result.create_order_result {
- Ok(Some(order_id)) => {
- router_data.request.order_id = Some(order_id.clone());
- router_data.response =
- Ok(types::PaymentsResponseData::PaymentsCreateOrderResponse { order_id });
- Ok(true)
- }
- Ok(None) => Err(error_stack::report!(ApiErrorResponse::InternalServerError)
- .attach_printable("Order Id not found."))?,
- Err(err) => {
- router_data.response = Err(err.clone());
- Ok(false)
- }
- }
- } else {
- Ok(should_continue_further)
- }
-}
diff --git a/crates/router/src/core/payments/flows/cancel_flow.rs b/crates/router/src/core/payments/flows/cancel_flow.rs
index fc27a60042..046213dbe5 100644
--- a/crates/router/src/core/payments/flows/cancel_flow.rs
+++ b/crates/router/src/core/payments/flows/cancel_flow.rs
@@ -79,7 +79,7 @@ impl Feature<api::Void, types::PaymentsCancelData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
metrics::PAYMENT_CANCEL_COUNT.add(
1,
diff --git a/crates/router/src/core/payments/flows/capture_flow.rs b/crates/router/src/core/payments/flows/capture_flow.rs
index 545b3fc263..09d60db9a4 100644
--- a/crates/router/src/core/payments/flows/capture_flow.rs
+++ b/crates/router/src/core/payments/flows/capture_flow.rs
@@ -108,7 +108,7 @@ impl Feature<api::Capture, types::PaymentsCaptureData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::Capture,
diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
index 4fb4e7574a..d734f195ce 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -100,7 +100,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>
connector_request: Option<services::Request>,
business_profile: &domain::Profile,
header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::CompleteAuthorize,
diff --git a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs b/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
index 092be33219..c7dee2ad9e 100644
--- a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
+++ b/crates/router/src/core/payments/flows/incremental_authorization_flow.rs
@@ -87,7 +87,7 @@ impl Feature<api::IncrementalAuthorization, types::PaymentsIncrementalAuthorizat
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::IncrementalAuthorization,
diff --git a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs b/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
index e29739cf01..118dd17a10 100644
--- a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
+++ b/crates/router/src/core/payments/flows/post_session_tokens_flow.rs
@@ -87,7 +87,7 @@ impl Feature<api::PostSessionTokens, types::PaymentsPostSessionTokensData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::PostSessionTokens,
diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rs
index 38fc08a1df..87536525be 100644
--- a/crates/router/src/core/payments/flows/psync_flow.rs
+++ b/crates/router/src/core/payments/flows/psync_flow.rs
@@ -111,7 +111,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::PSync,
@@ -134,7 +134,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
pending_connector_capture_id_list,
call_connector_action,
connector_integration,
- all_keys_required,
+ return_raw_connector_response,
)
.await?;
// Initiating Integrity checks
@@ -156,7 +156,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>
&self,
call_connector_action,
connector_request,
- all_keys_required,
+ return_raw_connector_response,
)
.await
.to_payment_failed_response()?;
@@ -241,7 +241,7 @@ where
types::PaymentsSyncData,
types::PaymentsResponseData,
>,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self>;
}
@@ -259,7 +259,7 @@ impl RouterDataPSync
types::PaymentsSyncData,
types::PaymentsResponseData,
>,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let mut capture_sync_response_map = HashMap::new();
if let payments::CallConnectorAction::HandleResponse(_) = call_connector_action {
@@ -270,7 +270,7 @@ impl RouterDataPSync
self,
call_connector_action.clone(),
None,
- all_keys_required,
+ return_raw_connector_response,
)
.await
.to_payment_failed_response()?;
@@ -289,7 +289,7 @@ impl RouterDataPSync
&cloned_router_data,
call_connector_action.clone(),
None,
- all_keys_required,
+ return_raw_connector_response,
)
.await
.to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/flows/reject_flow.rs b/crates/router/src/core/payments/flows/reject_flow.rs
index 852058dc37..efb34be54b 100644
--- a/crates/router/src/core/payments/flows/reject_flow.rs
+++ b/crates/router/src/core/payments/flows/reject_flow.rs
@@ -79,7 +79,7 @@ impl Feature<api::Reject, types::PaymentsRejectData>
_connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
Err(ApiErrorResponse::NotImplemented {
message: NotImplementedMessage::Reason("Flow not supported".to_string()),
diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs
index a805f455b4..ae0450f28f 100644
--- a/crates/router/src/core/payments/flows/session_flow.rs
+++ b/crates/router/src/core/payments/flows/session_flow.rs
@@ -121,7 +121,7 @@ impl Feature<api::Session, types::PaymentsSessionData> for types::PaymentsSessio
_connector_request: Option<services::Request>,
business_profile: &domain::Profile,
header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
metrics::SESSION_TOKEN_CREATED.add(
1,
diff --git a/crates/router/src/core/payments/flows/session_update_flow.rs b/crates/router/src/core/payments/flows/session_update_flow.rs
index e717ff50c2..cd42f855c1 100644
--- a/crates/router/src/core/payments/flows/session_update_flow.rs
+++ b/crates/router/src/core/payments/flows/session_update_flow.rs
@@ -87,7 +87,7 @@ impl Feature<api::SdkSessionUpdate, types::SdkPaymentsSessionUpdateData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::SdkSessionUpdate,
diff --git a/crates/router/src/core/payments/flows/setup_mandate_flow.rs b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
index a5bcdb4f55..f99d13bd31 100644
--- a/crates/router/src/core/payments/flows/setup_mandate_flow.rs
+++ b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
@@ -117,7 +117,7 @@ impl Feature<api::SetupMandate, types::SetupMandateRequestData> for types::Setup
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- _all_keys_required: Option<bool>,
+ _return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::SetupMandate,
diff --git a/crates/router/src/core/payments/flows/update_metadata_flow.rs b/crates/router/src/core/payments/flows/update_metadata_flow.rs
index a6a3583325..f654b7ead1 100644
--- a/crates/router/src/core/payments/flows/update_metadata_flow.rs
+++ b/crates/router/src/core/payments/flows/update_metadata_flow.rs
@@ -86,7 +86,7 @@ impl Feature<api::UpdateMetadata, types::PaymentsUpdateMetadataData>
connector_request: Option<services::Request>,
_business_profile: &domain::Profile,
_header_payload: hyperswitch_domain_models::payments::HeaderPayload,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> RouterResult<Self> {
let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
api::UpdateMetadata,
@@ -100,7 +100,7 @@ impl Feature<api::UpdateMetadata, types::PaymentsUpdateMetadataData>
&self,
call_connector_action,
connector_request,
- all_keys_required,
+ return_raw_connector_response,
)
.await
.to_payment_failed_response()?;
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 4b7791bb08..5eaee11c18 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -4175,7 +4175,7 @@ pub fn router_data_type_conversion<F1, F2, Req1, Req2, Res1, Res2>(
connector_mandate_request_reference_id: router_data.connector_mandate_request_reference_id,
authentication_id: router_data.authentication_id,
psd2_sca_exemption_type: router_data.psd2_sca_exemption_type,
- whole_connector_response: router_data.whole_connector_response,
+ raw_connector_response: router_data.raw_connector_response,
}
}
diff --git a/crates/router/src/core/payments/operations/payment_confirm_intent.rs b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
index dce33895fd..8ab7ddcfa2 100644
--- a/crates/router/src/core/payments/operations/payment_confirm_intent.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm_intent.rs
@@ -588,6 +588,11 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, PaymentsConfirmInt
.connector_request_reference_id
.clone();
+ let connector_response_reference_id = payment_data
+ .payment_attempt
+ .connector_response_reference_id
+ .clone();
+
let payment_attempt_update = match &payment_data.payment_method {
// In the case of a tokenized payment method, we update the payment attempt with the tokenized payment method details.
Some(payment_method) => {
@@ -611,6 +616,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, PaymentsConfirmInt
merchant_connector_id,
authentication_type,
connector_request_reference_id,
+ connector_response_reference_id,
}
}
};
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index ff618a7b34..939679ef51 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -1412,7 +1412,7 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
.as_mut()
.map(|info| info.status = status)
});
- payment_data.whole_connector_response = router_data.whole_connector_response.clone();
+ payment_data.whole_connector_response = router_data.raw_connector_response.clone();
// TODO: refactor of gsm_error_category with respective feature flag
#[allow(unused_variables)]
diff --git a/crates/router/src/core/payments/operations/proxy_payments_intent.rs b/crates/router/src/core/payments/operations/proxy_payments_intent.rs
index a65f4cdd99..30ea6913c6 100644
--- a/crates/router/src/core/payments/operations/proxy_payments_intent.rs
+++ b/crates/router/src/core/payments/operations/proxy_payments_intent.rs
@@ -409,6 +409,11 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, ProxyPaymentsReque
.connector_request_reference_id
.clone();
+ let connector_response_reference_id = payment_data
+ .payment_attempt
+ .connector_response_reference_id
+ .clone();
+
let payment_attempt_update = hyperswitch_domain_models::payments::payment_attempt::PaymentAttemptUpdate::ConfirmIntent {
status: attempt_status,
updated_by: storage_scheme.to_string(),
@@ -416,6 +421,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentConfirmData<F>, ProxyPaymentsReque
merchant_connector_id,
authentication_type,
connector_request_reference_id,
+ connector_response_reference_id,
};
let updated_payment_intent = db
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 636b1da0bb..71ff92b0bb 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -171,7 +171,7 @@ where
connector_mandate_request_reference_id,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -399,7 +399,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
connector_mandate_request_reference_id,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -563,7 +563,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(
connector_mandate_request_reference_id,
psd2_sca_exemption_type: None,
authentication_id: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -626,6 +626,7 @@ pub async fn construct_router_data_for_psync<'a>(
// TODO: Get the charges object from feature metadata
split_payments: None,
payment_experience: None,
+ connector_reference_id: attempt.connector_response_reference_id.clone(),
};
// TODO: evaluate the fields in router data, if they are required or not
@@ -689,7 +690,7 @@ pub async fn construct_router_data_for_psync<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -871,7 +872,7 @@ pub async fn construct_payment_router_data_for_sdk_session<'a>(
connector_mandate_request_reference_id: None,
psd2_sca_exemption_type: None,
authentication_id: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -1088,7 +1089,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(
connector_mandate_request_reference_id,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -1287,7 +1288,7 @@ where
connector_mandate_request_reference_id,
authentication_id: None,
psd2_sca_exemption_type: payment_data.payment_intent.psd2_sca_exemption_type,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -1477,7 +1478,7 @@ pub async fn construct_payment_router_data_for_update_metadata<'a>(
connector_mandate_request_reference_id,
authentication_id: None,
psd2_sca_exemption_type: payment_data.payment_intent.psd2_sca_exemption_type,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -1524,6 +1525,7 @@ where
Self: Sized,
{
#[cfg(feature = "v2")]
+ #[allow(clippy::too_many_arguments)]
fn generate_response(
self,
state: &SessionState,
@@ -1532,6 +1534,7 @@ where
is_latency_header_enabled: Option<bool>,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
+ connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<Response>;
}
@@ -1549,6 +1552,7 @@ where
is_latency_header_enabled: Option<bool>,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
+ _connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<api_models::payments::PaymentsCaptureResponse> {
let payment_intent = &self.payment_intent;
let payment_attempt = &self.payment_attempt;
@@ -1872,6 +1876,7 @@ where
is_latency_header_enabled: Option<bool>,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
+ connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<api_models::payments::PaymentsResponse> {
let payment_intent = self.payment_intent;
let payment_attempt = self.payment_attempt;
@@ -1897,6 +1902,9 @@ where
let payment_address = self.payment_address;
+ let raw_connector_response =
+ connector_response_data.and_then(|data| data.raw_connector_response);
+
let payment_method_data =
Some(api_models::payments::PaymentMethodDataResponseWithBilling {
payment_method_data: None,
@@ -1951,7 +1959,7 @@ where
payment_method_subtype: Some(payment_attempt.payment_method_subtype),
next_action,
connector_transaction_id: payment_attempt.connector_payment_id.clone(),
- connector_reference_id: None,
+ connector_reference_id: payment_attempt.connector_response_reference_id.clone(),
connector_token_details,
merchant_connector_id,
browser_info: None,
@@ -1965,6 +1973,7 @@ where
shipping: None, //TODO: add this
is_iframe_redirection_enabled: None,
merchant_reference_id: payment_intent.merchant_reference_id.clone(),
+ raw_connector_response,
};
Ok(services::ApplicationResponse::JsonWithHeaders((
@@ -1988,6 +1997,7 @@ where
is_latency_header_enabled: Option<bool>,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
+ connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<api_models::payments::PaymentsResponse> {
let payment_intent = self.payment_intent;
let payment_attempt = &self.payment_attempt;
@@ -2022,6 +2032,9 @@ where
.map(From::from),
});
+ let raw_connector_response =
+ connector_response_data.and_then(|data| data.raw_connector_response);
+
let connector_token_details = self
.payment_attempt
.connector_token_details
@@ -2047,7 +2060,7 @@ where
payment_method_type: Some(payment_attempt.payment_method_type),
payment_method_subtype: Some(payment_attempt.payment_method_subtype),
connector_transaction_id: payment_attempt.connector_payment_id.clone(),
- connector_reference_id: None,
+ connector_reference_id: payment_attempt.connector_response_reference_id.clone(),
merchant_connector_id,
browser_info: None,
connector_token_details,
@@ -2060,6 +2073,7 @@ where
return_url,
is_iframe_redirection_enabled: payment_intent.is_iframe_redirection_enabled,
merchant_reference_id: payment_intent.merchant_reference_id.clone(),
+ raw_connector_response,
};
Ok(services::ApplicationResponse::JsonWithHeaders((
@@ -2083,6 +2097,7 @@ where
_is_latency_header_enabled: Option<bool>,
_merchant_context: &domain::MerchantContext,
_profile: &domain::Profile,
+ _connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<api_models::payments::PaymentAttemptResponse> {
let payment_attempt = self.payment_attempt;
let response = api_models::payments::PaymentAttemptResponse::foreign_from(&payment_attempt);
@@ -2107,6 +2122,7 @@ where
_is_latency_header_enabled: Option<bool>,
_merchant_context: &domain::MerchantContext,
_profile: &domain::Profile,
+ _connector_response_data: Option<common_types::domain::ConnectorResponseData>,
) -> RouterResponse<api_models::payments::PaymentAttemptRecordResponse> {
let payment_attempt = self.payment_attempt;
let payment_intent = self.payment_intent;
@@ -3718,6 +3734,10 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsSyncData
currency: payment_data.currency,
split_payments: payment_data.payment_intent.split_payments,
payment_experience: payment_data.payment_attempt.payment_experience,
+ connector_reference_id: payment_data
+ .payment_attempt
+ .connector_response_reference_id
+ .clone(),
})
}
}
diff --git a/crates/router/src/core/relay/utils.rs b/crates/router/src/core/relay/utils.rs
index effc2178ec..1adacfbe94 100644
--- a/crates/router/src/core/relay/utils.rs
+++ b/crates/router/src/core/relay/utils.rs
@@ -143,7 +143,7 @@ pub async fn construct_relay_refund_router_data<F>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
diff --git a/crates/router/src/core/revenue_recovery/api.rs b/crates/router/src/core/revenue_recovery/api.rs
index 3627d5062c..052f4351c7 100644
--- a/crates/router/src/core/revenue_recovery/api.rs
+++ b/crates/router/src/core/revenue_recovery/api.rs
@@ -31,7 +31,7 @@ pub async fn call_psync_api(
force_sync: false,
param: None,
expand_attempts: true,
- all_keys_required: None,
+ return_raw_connector_response: None,
merchant_connector_details: None,
};
let merchant_context_from_revenue_recovery_data =
@@ -53,7 +53,7 @@ pub async fn call_psync_api(
)
.await?;
- let (payment_data, _req, _, _, _) = Box::pin(payments::payments_operation_core::<
+ let (payment_data, _req, _, _, _, _) = Box::pin(payments::payments_operation_core::<
api_types::PSync,
_,
_,
diff --git a/crates/router/src/core/unified_authentication_service/utils.rs b/crates/router/src/core/unified_authentication_service/utils.rs
index 6c841a02d3..20ac12a994 100644
--- a/crates/router/src/core/unified_authentication_service/utils.rs
+++ b/crates/router/src/core/unified_authentication_service/utils.rs
@@ -124,7 +124,7 @@ pub fn construct_uas_router_data<F: Clone, Req, Res>(
connector_mandate_request_reference_id: None,
authentication_id,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
})
}
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index d1d298bd17..c097b3fbfe 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -234,7 +234,7 @@ pub async fn construct_payout_router_data<'a, F>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -401,7 +401,7 @@ pub async fn construct_refund_router_data<'a, F>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -604,7 +604,7 @@ pub async fn construct_refund_router_data<'a, F>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
@@ -1028,7 +1028,7 @@ pub async fn construct_accept_dispute_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -1126,7 +1126,7 @@ pub async fn construct_submit_evidence_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -1230,7 +1230,7 @@ pub async fn construct_upload_file_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -1353,7 +1353,7 @@ pub async fn construct_payments_dynamic_tax_calculation_router_data<F: Clone>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -1454,7 +1454,7 @@ pub async fn construct_defend_dispute_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
@@ -1549,7 +1549,7 @@ pub async fn construct_retrieve_file_router_data<'a>(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
diff --git a/crates/router/src/core/webhooks/incoming_v2.rs b/crates/router/src/core/webhooks/incoming_v2.rs
index 0cf8b2bfe7..464781876c 100644
--- a/crates/router/src/core/webhooks/incoming_v2.rs
+++ b/crates/router/src/core/webhooks/incoming_v2.rs
@@ -456,31 +456,37 @@ async fn payments_incoming_webhook_flow(
)
.await?;
- let (payment_data, _req, customer, connector_http_status_code, external_latency) =
- Box::pin(payments::payments_operation_core::<
- api::PSync,
- _,
- _,
- _,
- PaymentStatusData<api::PSync>,
- >(
- &state,
- req_state,
- merchant_context.clone(),
- &profile,
- payments::operations::PaymentGet,
- api::PaymentsRetrieveRequest {
- force_sync: true,
- expand_attempts: false,
- param: None,
- all_keys_required: None,
- merchant_connector_details: None,
- },
- get_trackers_response,
- consume_or_trigger_flow,
- HeaderPayload::default(),
- ))
- .await?;
+ let (
+ payment_data,
+ _req,
+ customer,
+ connector_http_status_code,
+ external_latency,
+ connector_response_data,
+ ) = Box::pin(payments::payments_operation_core::<
+ api::PSync,
+ _,
+ _,
+ _,
+ PaymentStatusData<api::PSync>,
+ >(
+ &state,
+ req_state,
+ merchant_context.clone(),
+ &profile,
+ payments::operations::PaymentGet,
+ api::PaymentsRetrieveRequest {
+ force_sync: true,
+ expand_attempts: false,
+ param: None,
+ return_raw_connector_response: None,
+ merchant_connector_details: None,
+ },
+ get_trackers_response,
+ consume_or_trigger_flow,
+ HeaderPayload::default(),
+ ))
+ .await?;
let response = payment_data.generate_response(
&state,
@@ -489,6 +495,7 @@ async fn payments_incoming_webhook_flow(
None,
&merchant_context,
&profile,
+ Some(connector_response_data),
);
lock_action
diff --git a/crates/router/src/core/webhooks/utils.rs b/crates/router/src/core/webhooks/utils.rs
index 4cf0d784a0..c0c362a9dd 100644
--- a/crates/router/src/core/webhooks/utils.rs
+++ b/crates/router/src/core/webhooks/utils.rs
@@ -133,7 +133,7 @@ pub async fn construct_webhook_router_data(
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
};
Ok(router_data)
}
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index e2363633da..163bc2dab2 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -2953,7 +2953,7 @@ pub async fn payment_status(
force_sync: payload.force_sync,
expand_attempts: payload.expand_attempts,
param: payload.param.clone(),
- all_keys_required: payload.all_keys_required,
+ return_raw_connector_response: payload.return_raw_connector_response,
merchant_connector_details: None,
};
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index 57bb8ec242..fabfe3e38d 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -142,7 +142,7 @@ pub async fn execute_connector_processing_step<
req: &'b types::RouterData<T, Req, Resp>,
call_connector_action: payments::CallConnectorAction,
connector_request: Option<Request>,
- all_keys_required: Option<bool>,
+ return_raw_connector_response: Option<bool>,
) -> CustomResult<types::RouterData<T, Req, Resp>, errors::ConnectorError>
where
T: Clone + Debug + 'static,
@@ -302,7 +302,7 @@ where
val + external_latency
}),
);
- if all_keys_required == Some(true) {
+ if return_raw_connector_response == Some(true) {
let mut decoded = String::from_utf8(body.response.as_ref().to_vec())
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
if decoded.starts_with('\u{feff}') {
@@ -310,7 +310,7 @@ where
.trim_start_matches('\u{feff}')
.to_string();
}
- data.whole_connector_response = Some(decoded);
+ data.raw_connector_response = Some(decoded);
}
Ok(data)
}
@@ -1076,13 +1076,17 @@ pub trait Authenticate {
None
}
- fn get_all_keys_required(&self) -> Option<bool> {
+ fn should_return_raw_response(&self) -> Option<bool> {
None
}
}
#[cfg(feature = "v2")]
-impl Authenticate for api_models::payments::PaymentsConfirmIntentRequest {}
+impl Authenticate for api_models::payments::PaymentsConfirmIntentRequest {
+ fn should_return_raw_response(&self) -> Option<bool> {
+ self.return_raw_connector_response
+ }
+}
#[cfg(feature = "v2")]
impl Authenticate for api_models::payments::ProxyPaymentsRequest {}
@@ -1092,7 +1096,9 @@ impl Authenticate for api_models::payments::PaymentsRequest {
self.client_secret.as_ref()
}
- fn get_all_keys_required(&self) -> Option<bool> {
+ fn should_return_raw_response(&self) -> Option<bool> {
+ // In v1, this maps to `all_keys_required` to retain backward compatibility.
+ // The equivalent field in v2 is `return_raw_connector_response`.
self.all_keys_required
}
}
@@ -1123,7 +1129,15 @@ impl Authenticate for api_models::payments::PaymentsPostSessionTokensRequest {
impl Authenticate for api_models::payments::PaymentsUpdateMetadataRequest {}
impl Authenticate for api_models::payments::PaymentsRetrieveRequest {
- fn get_all_keys_required(&self) -> Option<bool> {
+ #[cfg(feature = "v2")]
+ fn should_return_raw_response(&self) -> Option<bool> {
+ self.return_raw_connector_response
+ }
+
+ #[cfg(feature = "v1")]
+ fn should_return_raw_response(&self) -> Option<bool> {
+ // In v1, this maps to `all_keys_required` to retain backward compatibility.
+ // The equivalent field in v2 is `return_raw_connector_response`.
self.all_keys_required
}
}
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index 52e3f267c8..dd64c5b370 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -1151,7 +1151,7 @@ impl<F1, F2, T1, T2> ForeignFrom<(&RouterData<F1, T1, PaymentsResponseData>, T2)
.clone(),
authentication_id: data.authentication_id.clone(),
psd2_sca_exemption_type: data.psd2_sca_exemption_type,
- whole_connector_response: data.whole_connector_response.clone(),
+ raw_connector_response: data.raw_connector_response.clone(),
}
}
}
@@ -1219,7 +1219,7 @@ impl<F1, F2>
psd2_sca_exemption_type: None,
additional_merchant_data: data.additional_merchant_data.clone(),
connector_mandate_request_reference_id: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}
}
diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs
index 62738680b1..02fad384f5 100644
--- a/crates/router/src/types/api/payments.rs
+++ b/crates/router/src/types/api/payments.rs
@@ -5,7 +5,8 @@ pub use api_models::payments::{
};
#[cfg(feature = "v1")]
pub use api_models::payments::{
- PaymentListFilterConstraints, PaymentListResponse, PaymentListResponseV2,
+ PaymentListFilterConstraints, PaymentListResponse, PaymentListResponseV2, PaymentRetrieveBody,
+ PaymentRetrieveBodyWithCredentials,
};
pub use api_models::{
feature_matrix::{
@@ -18,18 +19,17 @@ pub use api_models::{
MandateValidationFields, NextActionType, OpenBankingSessionToken, PayLaterData,
PaymentIdType, PaymentListConstraints, PaymentListFilters, PaymentListFiltersV2,
PaymentMethodData, PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp,
- PaymentRetrieveBody, PaymentRetrieveBodyWithCredentials, PaymentsAggregateResponse,
- PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
- PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
- PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
- PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest,
- PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse,
- PaymentsRedirectRequest, PaymentsRedirectionResponse, PaymentsRejectRequest,
- PaymentsRequest, PaymentsResponse, PaymentsResponseForm, PaymentsRetrieveRequest,
- PaymentsSessionRequest, PaymentsSessionResponse, PaymentsStartRequest,
- PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse, PgRedirectResponse,
- PhoneDetails, RedirectionResponse, SessionToken, UrlDetails, VaultSessionDetails,
- VerifyRequest, VerifyResponse, VgsSessionDetails, WalletData,
+ PaymentsAggregateResponse, PaymentsApproveRequest, PaymentsCancelRequest,
+ PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
+ PaymentsDynamicTaxCalculationRequest, PaymentsDynamicTaxCalculationResponse,
+ PaymentsExternalAuthenticationRequest, PaymentsIncrementalAuthorizationRequest,
+ PaymentsManualUpdateRequest, PaymentsPostSessionTokensRequest,
+ PaymentsPostSessionTokensResponse, PaymentsRedirectRequest, PaymentsRedirectionResponse,
+ PaymentsRejectRequest, PaymentsRequest, PaymentsResponse, PaymentsResponseForm,
+ PaymentsRetrieveRequest, PaymentsSessionRequest, PaymentsSessionResponse,
+ PaymentsStartRequest, PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse,
+ PgRedirectResponse, PhoneDetails, RedirectionResponse, SessionToken, UrlDetails,
+ VaultSessionDetails, VerifyRequest, VerifyResponse, VgsSessionDetails, WalletData,
},
};
pub use common_types::payments::{AcceptanceType, CustomerAcceptance, OnlineMandate};
diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs
index c9be34037c..8298be10aa 100644
--- a/crates/router/src/types/api/verify_connector.rs
+++ b/crates/router/src/types/api/verify_connector.rs
@@ -127,7 +127,7 @@ impl VerifyConnectorData {
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}
}
diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs
index 61272a0587..cf0889931d 100644
--- a/crates/router/tests/connectors/aci.rs
+++ b/crates/router/tests/connectors/aci.rs
@@ -133,7 +133,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}
@@ -206,7 +206,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> {
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index bf9bc35533..db3aeddfb8 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -553,7 +553,7 @@ pub trait ConnectorActions: Connector {
connector_mandate_request_reference_id: None,
psd2_sca_exemption_type: None,
authentication_id: None,
- whole_connector_response: None,
+ raw_connector_response: None,
}
}