mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	refactor: refactor connector auth type failure to 4xx (#2616)
This commit is contained in:
		| @ -239,6 +239,8 @@ pub enum StripeErrorCode { | ||||
|     PaymentLinkNotFound, | ||||
|     #[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "Resource Busy. Please try again later")] | ||||
|     LockTimeout, | ||||
|     #[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "Merchant connector account is configured with invalid {config}")] | ||||
|     InvalidConnectorConfiguration { config: String }, | ||||
|     // [#216]: https://github.com/juspay/hyperswitch/issues/216 | ||||
|     // Implement the remaining stripe error codes | ||||
|  | ||||
| @ -590,6 +592,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode { | ||||
|                 Self::PaymentMethodUnactivated | ||||
|             } | ||||
|             errors::ApiErrorResponse::ResourceBusy => Self::PaymentMethodUnactivated, | ||||
|             errors::ApiErrorResponse::InvalidConnectorConfiguration { config } => { | ||||
|                 Self::InvalidConnectorConfiguration { config } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -656,7 +661,8 @@ impl actix_web::ResponseError for StripeErrorCode { | ||||
|             | Self::FileProviderNotSupported | ||||
|             | Self::CurrencyNotSupported { .. } | ||||
|             | Self::DuplicateCustomer | ||||
|             | Self::PaymentMethodUnactivated => StatusCode::BAD_REQUEST, | ||||
|             | Self::PaymentMethodUnactivated | ||||
|             | Self::InvalidConnectorConfiguration { .. } => StatusCode::BAD_REQUEST, | ||||
|             Self::RefundFailed | ||||
|             | Self::PayoutFailed | ||||
|             | Self::PaymentLinkNotFound | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Arjun Karthik
					Arjun Karthik