Skip to content
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

feat(connector): [Novalnet] add Recurring payment flow for cards #5921

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion crates/hyperswitch_connectors/src/connectors/novalnet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub mod transformers;
use std::collections::HashSet;

use base64::Engine;
use common_enums::enums;
use common_utils::{
Expand All @@ -9,6 +11,7 @@ use common_utils::{
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData,
router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
router_flow_types::{
access_token_auth::AccessTokenAuth,
Expand Down Expand Up @@ -41,7 +44,9 @@ use masking::{ExposeInterface, Mask};
use transformers as novalnet;

use crate::{
constants::headers, types::ResponseRouterData, utils, utils::PaymentsAuthorizeRequestData,
constants::headers,
types::ResponseRouterData,
utils::{self, PaymentMethodDataType, PaymentsAuthorizeRequestData},
};

#[derive(Clone)]
Expand Down Expand Up @@ -183,6 +188,15 @@ impl ConnectorValidation for Novalnet {

Err(errors::ConnectorError::MissingConnectorTransactionID.into())
}
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 ConnectorRedirectResponse for Novalnet {
Expand Down
Loading
Loading