mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
feat(customers): add customer list endpoint (#2564)
Co-authored-by: Bernard Eugine <114725419+bernard-eugine@users.noreply.github.com>
This commit is contained in:
@ -69,6 +69,9 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "customer_redacted", message = "Customer has redacted")]
|
||||
CustomerRedacted,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "customer_already_exists", message = "Customer with the given customer_id already exists")]
|
||||
DuplicateCustomer,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such refund")]
|
||||
RefundNotFound,
|
||||
|
||||
@ -652,6 +655,7 @@ impl actix_web::ResponseError for StripeErrorCode {
|
||||
| Self::FileNotAvailable
|
||||
| Self::FileProviderNotSupported
|
||||
| Self::CurrencyNotSupported { .. }
|
||||
| Self::DuplicateCustomer
|
||||
| Self::PaymentMethodUnactivated => StatusCode::BAD_REQUEST,
|
||||
Self::RefundFailed
|
||||
| Self::PayoutFailed
|
||||
@ -730,6 +734,7 @@ impl ErrorSwitch<StripeErrorCode> for CustomersErrorResponse {
|
||||
Self::InternalServerError => SC::InternalServerError,
|
||||
Self::MandateActive => SC::MandateActive,
|
||||
Self::CustomerNotFound => SC::CustomerNotFound,
|
||||
Self::CustomerAlreadyExists => SC::DuplicateCustomer,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user