mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
refactor(router): add connector_transaction_id, send response body and use admin_api_auth_with_merchant_id for payments manual update flow (#5658)
This commit is contained in:
committed by
GitHub
parent
da5102efe2
commit
5be0c2bfd2
@ -22,9 +22,9 @@ use crate::{
|
||||
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
|
||||
PaymentsCompleteAuthorizeRequest, PaymentsExternalAuthenticationRequest,
|
||||
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
|
||||
PaymentsManualUpdateRequest, PaymentsRejectRequest, PaymentsRequest, PaymentsResponse,
|
||||
PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
|
||||
RedirectionResponse,
|
||||
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse, PaymentsRejectRequest,
|
||||
PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse,
|
||||
PaymentsStartRequest, RedirectionResponse,
|
||||
},
|
||||
};
|
||||
impl ApiEventMetric for PaymentsRetrieveRequest {
|
||||
@ -262,6 +262,14 @@ impl ApiEventMetric for PaymentsManualUpdateRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for PaymentsManualUpdateResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl ApiEventMetric for PaymentsSessionResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
|
||||
@ -5054,6 +5054,29 @@ pub struct PaymentsManualUpdateRequest {
|
||||
pub error_message: Option<String>,
|
||||
/// Error reason of the connector
|
||||
pub error_reason: Option<String>,
|
||||
/// A unique identifier for a payment provided by the connector
|
||||
pub connector_transaction_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
|
||||
pub struct PaymentsManualUpdateResponse {
|
||||
/// The identifier for the payment
|
||||
pub payment_id: String,
|
||||
/// The identifier for the payment attempt
|
||||
pub attempt_id: String,
|
||||
/// Merchant ID
|
||||
#[schema(value_type = String)]
|
||||
pub merchant_id: id_type::MerchantId,
|
||||
/// The status of the attempt
|
||||
pub attempt_status: enums::AttemptStatus,
|
||||
/// Error code of the connector
|
||||
pub error_code: Option<String>,
|
||||
/// Error message of the connector
|
||||
pub error_message: Option<String>,
|
||||
/// Error reason of the connector
|
||||
pub error_reason: Option<String>,
|
||||
/// A unique identifier for a payment provided by the connector
|
||||
pub connector_transaction_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
|
||||
|
||||
Reference in New Issue
Block a user