mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
feat(connector): fail payment authorize when capture_method is manual_method (#1893)
Co-authored-by: hrithikeshvm <vmhrithikesh@gmail.com> Co-authored-by: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com>
This commit is contained in:
@ -10,6 +10,7 @@ use common_utils::{
|
||||
errors::ReportSwitchExt,
|
||||
pii::{self, Email, IpAddress},
|
||||
};
|
||||
use diesel_models::enums;
|
||||
use error_stack::{report, IntoReport, ResultExt};
|
||||
use masking::{ExposeInterface, Secret};
|
||||
use once_cell::sync::Lazy;
|
||||
@ -972,6 +973,25 @@ pub fn to_currency_base_unit(
|
||||
.change_context(errors::ConnectorError::RequestEncodingFailed)
|
||||
}
|
||||
|
||||
pub fn construct_not_implemented_error_report(
|
||||
capture_method: enums::CaptureMethod,
|
||||
connector_name: &str,
|
||||
) -> error_stack::Report<errors::ConnectorError> {
|
||||
errors::ConnectorError::NotImplemented(format!("{} for {}", capture_method, connector_name))
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn construct_not_supported_error_report(
|
||||
capture_method: enums::CaptureMethod,
|
||||
connector_name: &'static str,
|
||||
) -> error_stack::Report<errors::ConnectorError> {
|
||||
errors::ConnectorError::NotSupported {
|
||||
message: capture_method.to_string(),
|
||||
connector: connector_name,
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn to_currency_base_unit_with_zero_decimal_check(
|
||||
amount: i64,
|
||||
currency: diesel_models::enums::Currency,
|
||||
|
||||
Reference in New Issue
Block a user