-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(connector): remove default cases for Authorizedotnet, Braintree and Fiserv Connector #2796
Changes from 7 commits
e887b58
5c9b912
1c2b7fe
69d6ee0
ae74893
7e6b09b
68eaddf
1ff7a2c
ba2cb45
7b7f851
af559f1
b60a77c
b0344dc
a909aeb
2cb0bf8
6f3005d
98a38db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,10 +166,23 @@ fn get_pm_and_subsequent_auth_detail( | |
}); | ||
Ok((payment_details, processing_options, subseuent_auth_info)) | ||
} | ||
_ => Err(errors::ConnectorError::NotSupported { | ||
message: format!("{:?}", item.router_data.request.payment_method_data), | ||
connector: "AuthorizeDotNet", | ||
})?, | ||
api::PaymentMethodData::CardRedirect(_) | ||
| api::PaymentMethodData::Wallet(_) | ||
| api::PaymentMethodData::PayLater(_) | ||
| api::PaymentMethodData::BankRedirect(_) | ||
| api::PaymentMethodData::BankDebit(_) | ||
| api::PaymentMethodData::BankTransfer(_) | ||
| api::PaymentMethodData::Crypto(_) | ||
| api::PaymentMethodData::MandatePayment | ||
| api::PaymentMethodData::Reward | ||
| api::PaymentMethodData::Upi(_) | ||
| api::PaymentMethodData::Voucher(_) | ||
| api::PaymentMethodData::GiftCard(_) | ||
| api::PaymentMethodData::CardToken(_) => { | ||
Err(errors::ConnectorError::NotImplemented( | ||
utils::get_unimplemented_payment_method_error_message("authorizedotnet"), | ||
))? | ||
} | ||
} | ||
} | ||
_ => match item.router_data.request.payment_method_data { | ||
|
@@ -195,10 +208,20 @@ fn get_pm_and_subsequent_auth_detail( | |
None, | ||
None, | ||
)), | ||
_ => Err(errors::ConnectorError::NotSupported { | ||
message: format!("{:?}", item.router_data.request.payment_method_data), | ||
connector: "AuthorizeDotNet", | ||
})?, | ||
api::PaymentMethodData::CardRedirect(_) | ||
| api::PaymentMethodData::PayLater(_) | ||
| api::PaymentMethodData::BankRedirect(_) | ||
| api::PaymentMethodData::BankDebit(_) | ||
| api::PaymentMethodData::BankTransfer(_) | ||
| api::PaymentMethodData::Crypto(_) | ||
| api::PaymentMethodData::MandatePayment | ||
| api::PaymentMethodData::Reward | ||
| api::PaymentMethodData::Upi(_) | ||
| api::PaymentMethodData::Voucher(_) | ||
| api::PaymentMethodData::GiftCard(_) | ||
| api::PaymentMethodData::CardToken(_) => Err(errors::ConnectorError::NotImplemented( | ||
utils::get_unimplemented_payment_method_error_message("authorizedotnet"), | ||
))?, | ||
}, | ||
} | ||
} | ||
|
@@ -295,7 +318,9 @@ impl From<enums::CaptureMethod> for AuthorizationType { | |
fn from(item: enums::CaptureMethod) -> Self { | ||
match item { | ||
enums::CaptureMethod::Manual => Self::Pre, | ||
_ => Self::Final, | ||
euclid::enums::CaptureMethod::Automatic | ||
| enums::CaptureMethod::ManualMultiple | ||
| enums::CaptureMethod::Scheduled => Self::Final, | ||
} | ||
} | ||
} | ||
|
@@ -904,7 +929,14 @@ impl From<SyncStatus> for enums::RefundStatus { | |
match transaction_status { | ||
SyncStatus::RefundSettledSuccessfully => Self::Success, | ||
SyncStatus::RefundPendingSettlement => Self::Pending, | ||
_ => Self::Failure, | ||
SyncStatus::AuthorizedPendingCapture | ||
| SyncStatus::CapturedPendingSettlement | ||
| SyncStatus::SettledSuccessfully | ||
| SyncStatus::Declined | ||
| SyncStatus::Voided | ||
| SyncStatus::CouldNotVoid | ||
| SyncStatus::GeneralError | ||
| SyncStatus::FDSPendingReview => Self::Failure, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why FDSPendingReview, SettledSuccessfully, AuthorizedPendingCapture, CapturedPendingSettlement, Voided should be mapped to Failure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @deepanshu-iiitu will handle the status mapping modifications in the pull request where he is addressing the connector audit fixes. |
||
} | ||
} | ||
} | ||
|
@@ -919,7 +951,9 @@ impl From<SyncStatus> for enums::AttemptStatus { | |
SyncStatus::Voided => Self::Voided, | ||
SyncStatus::CouldNotVoid => Self::VoidFailed, | ||
SyncStatus::GeneralError => Self::Failure, | ||
_ => Self::Pending, | ||
SyncStatus::RefundSettledSuccessfully | ||
| SyncStatus::RefundPendingSettlement | ||
| SyncStatus::FDSPendingReview => Self::Pending, | ||
} | ||
} | ||
} | ||
|
@@ -1164,9 +1198,33 @@ fn get_wallet_data( | |
cancel_url: return_url.to_owned(), | ||
})) | ||
} | ||
_ => Err(errors::ConnectorError::NotImplemented( | ||
"Payment method".to_string(), | ||
))?, | ||
api_models::payments::WalletData::AliPayQr(_) | ||
| api_models::payments::WalletData::AliPayRedirect(_) | ||
| api_models::payments::WalletData::AliPayHkRedirect(_) | ||
| api_models::payments::WalletData::MomoRedirect(_) | ||
| api_models::payments::WalletData::KakaoPayRedirect(_) | ||
| api_models::payments::WalletData::GoPayRedirect(_) | ||
| api_models::payments::WalletData::GcashRedirect(_) | ||
| api_models::payments::WalletData::ApplePayRedirect(_) | ||
| api_models::payments::WalletData::ApplePayThirdPartySdk(_) | ||
| api_models::payments::WalletData::DanaRedirect {} | ||
| api_models::payments::WalletData::GooglePayRedirect(_) | ||
| api_models::payments::WalletData::GooglePayThirdPartySdk(_) | ||
| api_models::payments::WalletData::MbWayRedirect(_) | ||
| api_models::payments::WalletData::MobilePayRedirect(_) | ||
| api_models::payments::WalletData::PaypalSdk(_) | ||
| api_models::payments::WalletData::SamsungPay(_) | ||
| api_models::payments::WalletData::TwintRedirect {} | ||
| api_models::payments::WalletData::VippsRedirect {} | ||
| api_models::payments::WalletData::TouchNGoRedirect(_) | ||
| api_models::payments::WalletData::WeChatPayRedirect(_) | ||
| api_models::payments::WalletData::WeChatPayQr(_) | ||
| api_models::payments::WalletData::CashappQr(_) | ||
| api_models::payments::WalletData::SwishQr(_) => { | ||
Err(errors::ConnectorError::NotImplemented( | ||
utils::get_unimplemented_payment_method_error_message("authorizedotnet"), | ||
))? | ||
} | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,9 +182,25 @@ impl TryFrom<&FiservRouterData<&types::PaymentsAuthorizeRouterData>> for FiservP | |
}; | ||
Source::PaymentCard { card } | ||
} | ||
_ => Err(errors::ConnectorError::NotImplemented( | ||
"Payment Methods".to_string(), | ||
api::PaymentMethodData::Wallet(_) | ||
| api::PaymentMethodData::PayLater(_) | ||
| api::PaymentMethodData::BankRedirect(_) | ||
| api::PaymentMethodData::BankDebit(_) => Err(errors::ConnectorError::NotImplemented( | ||
utils::get_unimplemented_payment_method_error_message("fiserv"), | ||
swangi-kumari marked this conversation as resolved.
Show resolved
Hide resolved
|
||
))?, | ||
api::PaymentMethodData::CardRedirect(_) | ||
| api::PaymentMethodData::BankTransfer(_) | ||
| api::PaymentMethodData::Crypto(_) | ||
| api::PaymentMethodData::MandatePayment | ||
| api::PaymentMethodData::Reward | ||
| api::PaymentMethodData::Upi(_) | ||
| api::PaymentMethodData::Voucher(_) | ||
| api::PaymentMethodData::GiftCard(_) | ||
| api::PaymentMethodData::CardToken(_) => { | ||
Err(errors::ConnectorError::NotImplemented( | ||
utils::get_unimplemented_payment_method_error_message("braintree"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is supposed to be |
||
)) | ||
}?, | ||
}; | ||
Ok(Self { | ||
amount, | ||
|
@@ -306,7 +322,7 @@ impl From<FiservPaymentStatus> for enums::RefundStatus { | |
| FiservPaymentStatus::Authorized | ||
| FiservPaymentStatus::Captured => Self::Success, | ||
FiservPaymentStatus::Declined | FiservPaymentStatus::Failed => Self::Failure, | ||
_ => Self::Pending, | ||
FiservPaymentStatus::Voided | FiservPaymentStatus::Processing => Self::Pending, | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManualMultiple and Scheduled is not supported by the connector. In such cases throw error