fix(router): pop bugs in the payments confirm flow (#157)

This commit is contained in:
ItsMeShashank
2022-12-16 15:52:20 +05:30
committed by GitHub
parent 3bad58b0d3
commit 4e433a49f2
8 changed files with 371 additions and 110 deletions

View File

@ -64,6 +64,9 @@ pub(crate) enum ErrorCode {
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such refund")]
RefundNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "client_secret_invalid", message = "Expected client secret to be included in the request")]
ClientSecretNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such customer")]
CustomerNotFound,
@ -353,6 +356,7 @@ impl From<ApiErrorResponse> for ErrorCode {
ApiErrorResponse::CustomerNotFound => ErrorCode::CustomerNotFound,
ApiErrorResponse::PaymentNotFound => ErrorCode::PaymentNotFound,
ApiErrorResponse::PaymentMethodNotFound => ErrorCode::PaymentMethodNotFound,
ApiErrorResponse::ClientSecretNotGiven => ErrorCode::ClientSecretNotFound,
ApiErrorResponse::MerchantAccountNotFound => ErrorCode::MerchantAccountNotFound,
ApiErrorResponse::ResourceIdNotFound => ErrorCode::ResourceIdNotFound,
ApiErrorResponse::MerchantConnectorAccountNotFound => {
@ -420,6 +424,7 @@ impl actix_web::ResponseError for ErrorCode {
| ErrorCode::DuplicateRefundRequest
| ErrorCode::RefundNotFound
| ErrorCode::CustomerNotFound
| ErrorCode::ClientSecretNotFound
| ErrorCode::PaymentNotFound
| ErrorCode::PaymentMethodNotFound
| ErrorCode::MerchantAccountNotFound