feat(router): implement API endpoints for managing API keys (#511)

This commit is contained in:
Sanchith Hegde
2023-02-10 14:20:57 +05:30
committed by GitHub
parent 903b452146
commit 1bdc8955c2
35 changed files with 1759 additions and 99 deletions

View File

@ -94,6 +94,9 @@ pub enum StripeErrorCode {
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such mandate")]
MandateNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such API key")]
ApiKeyNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "parameter_missing", message = "Return url is not available")]
ReturnUrlUnavailable,
@ -383,6 +386,7 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
Self::MerchantConnectorAccountNotFound
}
errors::ApiErrorResponse::MandateNotFound => Self::MandateNotFound,
errors::ApiErrorResponse::ApiKeyNotFound => Self::ApiKeyNotFound,
errors::ApiErrorResponse::MandateValidationFailed { reason } => {
Self::PaymentIntentMandateInvalid { message: reason }
}
@ -453,6 +457,7 @@ impl actix_web::ResponseError for StripeErrorCode {
| Self::MerchantAccountNotFound
| Self::MerchantConnectorAccountNotFound
| Self::MandateNotFound
| Self::ApiKeyNotFound
| Self::DuplicateMerchantAccount
| Self::DuplicateMerchantConnectorAccount
| Self::DuplicatePaymentMethod