Skip to content

Commit

Permalink
refactor: do not check for connector validation since feature matrix …
Browse files Browse the repository at this point in the history
…is enabled (core does not call validation if feature matrix is implemented)
  • Loading branch information
pixincreate committed Feb 24, 2025
1 parent e5a1f28 commit 7f0f983
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 63 deletions.
19 changes: 1 addition & 18 deletions crates/hyperswitch_connectors/src/connectors/coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,7 @@ impl ConnectorCommon for Coinbase {
}
}

impl ConnectorValidation for Coinbase {
fn validate_connector_against_payment_request(
&self,
capture_method: Option<enums::CaptureMethod>,
_payment_method: enums::PaymentMethod,
_pmt: Option<enums::PaymentMethodType>,
) -> CustomResult<(), errors::ConnectorError> {
let capture_method = capture_method.unwrap_or_default();
match capture_method {
enums::CaptureMethod::Automatic
| enums::CaptureMethod::Manual
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
utils::construct_not_supported_error_report(capture_method, self.id()),
),
}
}
}
impl ConnectorValidation for Coinbase {}

impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
for Coinbase
Expand Down
28 changes: 1 addition & 27 deletions crates/hyperswitch_connectors/src/connectors/nexixpay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,33 +207,7 @@ impl ConnectorCommon for Nexixpay {
}
}

impl ConnectorValidation for Nexixpay {
fn validate_connector_against_payment_request(
&self,
capture_method: Option<enums::CaptureMethod>,
_payment_method: enums::PaymentMethod,
_pmt: Option<enums::PaymentMethodType>,
) -> CustomResult<(), errors::ConnectorError> {
let capture_method = capture_method.unwrap_or_default();
match capture_method {
enums::CaptureMethod::Automatic
| enums::CaptureMethod::Manual
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
utils::construct_not_implemented_error_report(capture_method, self.id()),
),
}
}
fn validate_mandate_payment(
&self,
pm_type: Option<enums::PaymentMethodType>,
pm_data: PaymentMethodData,
) -> CustomResult<(), errors::ConnectorError> {
let mandate_supported_pmd: HashSet<PaymentMethodDataType> =
HashSet::from([PaymentMethodDataType::Card]);
utils::is_mandate_supported(pm_data, pm_type, mandate_supported_pmd, self.id())
}
}
impl ConnectorValidation for Nexixpay {}

impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Nexixpay {}

Expand Down
19 changes: 1 addition & 18 deletions crates/hyperswitch_connectors/src/connectors/square.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,7 @@ impl ConnectorCommon for Square {
}
}

impl ConnectorValidation for Square {
fn validate_connector_against_payment_request(
&self,
capture_method: Option<enums::CaptureMethod>,
_payment_method: enums::PaymentMethod,
_pmt: Option<enums::PaymentMethodType>,
) -> CustomResult<(), errors::ConnectorError> {
let capture_method = capture_method.unwrap_or_default();
match capture_method {
enums::CaptureMethod::Automatic
| enums::CaptureMethod::Manual
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
utils::construct_not_implemented_error_report(capture_method, self.id()),
),
}
}
}
impl ConnectorValidation for Square {}

impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Square {
//TODO: implement sessions flow
Expand Down

0 comments on commit 7f0f983

Please sign in to comment.