mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
feat: handle no connector txn id (#39)
This commit is contained in:
committed by
GitHub
parent
473d8f7a1b
commit
f47c06a517
@ -67,6 +67,9 @@ pub(crate) enum ErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such merchant account")]
|
||||
MerchantAccountNotFound,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such resource ID")]
|
||||
ResourceIdNotFound,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such merchant connector account")]
|
||||
MerchantConnectorAccountNotFound,
|
||||
|
||||
@ -327,6 +330,7 @@ impl From<ApiErrorResponse> for ErrorCode {
|
||||
ApiErrorResponse::PaymentNotFound => ErrorCode::PaymentNotFound,
|
||||
ApiErrorResponse::PaymentMethodNotFound => ErrorCode::PaymentMethodNotFound,
|
||||
ApiErrorResponse::MerchantAccountNotFound => ErrorCode::MerchantAccountNotFound,
|
||||
ApiErrorResponse::ResourceIdNotFound => ErrorCode::ResourceIdNotFound,
|
||||
ApiErrorResponse::MerchantConnectorAccountNotFound => {
|
||||
ErrorCode::MerchantConnectorAccountNotFound
|
||||
}
|
||||
@ -402,6 +406,7 @@ impl actix_web::ResponseError for ErrorCode {
|
||||
| ErrorCode::DuplicateMandate
|
||||
| ErrorCode::SuccessfulPaymentNotFound
|
||||
| ErrorCode::AddressNotFound
|
||||
| ErrorCode::ResourceIdNotFound
|
||||
| ErrorCode::PaymentIntentUnexpectedState { .. } => StatusCode::BAD_REQUEST,
|
||||
ErrorCode::RefundFailed | ErrorCode::InternalServerError => {
|
||||
StatusCode::INTERNAL_SERVER_ERROR
|
||||
|
||||
Reference in New Issue
Block a user