feat(core): populate connector raw response and connector_response_reference_id for razorpay (#8499)

Co-authored-by: Swangi Kumari <swangi.kumari@juspay.in>
Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
This commit is contained in:
Aishwariyaa Anand
2025-07-03 17:18:33 +05:30
committed by GitHub
parent 417039d175
commit 2253d981c8
53 changed files with 577 additions and 409 deletions

View File

@ -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.