PaymentResponse
.Failed(
new Error(
ErrorCode.ReservedAccountsCreationInProgress.ToString(),
ErrorCode.ReservedAccountsCreationInProgress.GetDescription()),
(int)HttpStatusCode.TooManyRequests);
каждый раз с разными кодами ошибок, например:
-
return PaymentResponse
.Failed(
new Error(ErrorCode.ProviderError.ToString(), ErrorCode.ProviderError.GetDescription()),
(int)HttpStatusCode.BadRequest); -
return PaymentResponse.Failed(
new Error(ErrorCode.CustomerNinNotFound.ToString(), ErrorCode.CustomerNinNotFound.GetDescription()),
(int)HttpStatusCode.BadRequest);
Метод-оболочка, который я думал, будет таким:
FailedResponse(ErrorCode.CustomerNinNotFound, HttpStatusCode.BadRequest);
И определяется как:
private PaymentResponse FailedResponse(ErrorCode errorCode, HttpStatusCode statusCode) =>
PaymentResponse.Failed(
new Error(errorCode.ToString(), errorCode.GetDescription()),
(int)statusCode);
Подробнее здесь: https://stackoverflow.com/questions/791 ... ean-code-p