mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat(router): added dispute accept api, file module apis and dispute evidence submission api (#900)
Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in> Co-authored-by: sai harsha <sai.harsha@sai.harsha-MacBookPro> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bcbf4c882c
commit
bdf1e5147e
@ -182,6 +182,20 @@ pub enum StripeErrorCode {
|
||||
IncorrectConnectorNameGiven,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "No such {object}: '{id}'")]
|
||||
ResourceMissing { object: String, id: String },
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File validation failed")]
|
||||
FileValidationFailed,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File not found in the request")]
|
||||
MissingFile,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File puropse not found in the request")]
|
||||
MissingFilePurpose,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File content type not found")]
|
||||
MissingFileContentType,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "Dispute id not found in the request")]
|
||||
MissingDisputeId,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File does not exists in our records")]
|
||||
FileNotFound,
|
||||
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "File not available")]
|
||||
FileNotAvailable,
|
||||
// [#216]: https://github.com/juspay/hyperswitch/issues/216
|
||||
// Implement the remaining stripe error codes
|
||||
|
||||
@ -466,6 +480,16 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
|
||||
object: "dispute".to_owned(),
|
||||
id: dispute_id,
|
||||
},
|
||||
errors::ApiErrorResponse::DisputeStatusValidationFailed { reason } => {
|
||||
Self::InternalServerError
|
||||
}
|
||||
errors::ApiErrorResponse::FileValidationFailed { .. } => Self::FileValidationFailed,
|
||||
errors::ApiErrorResponse::MissingFile => Self::MissingFile,
|
||||
errors::ApiErrorResponse::MissingFilePurpose => Self::MissingFilePurpose,
|
||||
errors::ApiErrorResponse::MissingFileContentType => Self::MissingFileContentType,
|
||||
errors::ApiErrorResponse::MissingDisputeId => Self::MissingDisputeId,
|
||||
errors::ApiErrorResponse::FileNotFound => Self::FileNotFound,
|
||||
errors::ApiErrorResponse::FileNotAvailable => Self::FileNotAvailable,
|
||||
errors::ApiErrorResponse::NotSupported { .. } => Self::InternalServerError,
|
||||
}
|
||||
}
|
||||
@ -514,7 +538,14 @@ impl actix_web::ResponseError for StripeErrorCode {
|
||||
| Self::PaymentIntentUnexpectedState { .. }
|
||||
| Self::DuplicatePayment { .. }
|
||||
| Self::IncorrectConnectorNameGiven
|
||||
| Self::ResourceMissing { .. } => StatusCode::BAD_REQUEST,
|
||||
| Self::ResourceMissing { .. }
|
||||
| Self::FileValidationFailed
|
||||
| Self::MissingFile
|
||||
| Self::MissingFileContentType
|
||||
| Self::MissingFilePurpose
|
||||
| Self::MissingDisputeId
|
||||
| Self::FileNotFound
|
||||
| Self::FileNotAvailable => StatusCode::BAD_REQUEST,
|
||||
Self::RefundFailed
|
||||
| Self::InternalServerError
|
||||
| Self::MandateActive
|
||||
|
||||
Reference in New Issue
Block a user