feat(stripe): add setup intent in connector integration (stripe) (#50)

Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Nishant Joshi
2022-12-07 11:59:40 +05:30
committed by GitHub
parent cbbba37909
commit c208cd2be7
15 changed files with 586 additions and 38 deletions

View File

@ -118,6 +118,12 @@ pub(crate) enum ErrorCode {
)]
PaymentFailed,
#[error(
error_type = StripeErrorType::InvalidRequestError, code = "",
message = "The verification did not succeeded"
)]
VerificationFailed { data: Option<serde_json::Value> },
#[error(
error_type = StripeErrorType::InvalidRequestError, code = "",
message = "Reached maximum refund attempts"
@ -322,6 +328,7 @@ impl From<ApiErrorResponse> for ErrorCode {
| ApiErrorResponse::PaymentAuthenticationFailed { data } => {
ErrorCode::PaymentIntentAuthenticationFailure { data }
}
ApiErrorResponse::VerificationFailed { data } => ErrorCode::VerificationFailed { data },
ApiErrorResponse::PaymentCaptureFailed { data } => {
ErrorCode::PaymentIntentPaymentAttemptFailed { data }
}
@ -408,6 +415,7 @@ impl actix_web::ResponseError for ErrorCode {
| ErrorCode::DuplicateMerchantConnectorAccount
| ErrorCode::DuplicatePaymentMethod
| ErrorCode::PaymentFailed
| ErrorCode::VerificationFailed { .. }
| ErrorCode::MaximumRefundCount
| ErrorCode::PaymentIntentInvalidParameter { .. }
| ErrorCode::SerdeQsError { .. }