feat(router): add payments manual-update api (#5045)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sai Harsha Vardhan
2024-06-26 19:10:09 +05:30
committed by GitHub
parent 2e1167acbc
commit ed021c1d99
13 changed files with 292 additions and 8 deletions

View File

@ -14,8 +14,9 @@ use crate::{
PaymentListResponse, PaymentListResponseV2, PaymentsApproveRequest, PaymentsCancelRequest,
PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
PaymentsExternalAuthenticationRequest, PaymentsExternalAuthenticationResponse,
PaymentsIncrementalAuthorizationRequest, PaymentsRejectRequest, PaymentsRequest,
PaymentsResponse, PaymentsRetrieveRequest, PaymentsStartRequest, RedirectionResponse,
PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest,
PaymentsRejectRequest, PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest,
PaymentsStartRequest, RedirectionResponse,
},
};
impl ApiEventMetric for PaymentsRetrieveRequest {
@ -239,3 +240,11 @@ impl ApiEventMetric for PaymentsExternalAuthenticationRequest {
}
impl ApiEventMetric for ExtendedCardInfoResponse {}
impl ApiEventMetric for PaymentsManualUpdateRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Payment {
payment_id: self.payment_id.clone(),
})
}
}

View File

@ -4653,6 +4653,25 @@ pub struct PaymentsExternalAuthenticationRequest {
pub threeds_method_comp_ind: ThreeDsCompletionIndicator,
}
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
pub struct PaymentsManualUpdateRequest {
/// The identifier for the payment
#[serde(skip)]
pub payment_id: String,
/// The identifier for the payment attempt
pub attempt_id: String,
/// Merchant ID
pub merchant_id: String,
/// The status of the attempt
pub attempt_status: Option<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>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
pub enum ThreeDsCompletionIndicator {
/// 3DS method successfully completed