Skip to content

Commit

Permalink
feat(connector): [Novalnet] add Recurring payment flow for cards (#5921)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookieg13 authored Sep 19, 2024
1 parent c7f7d3c commit 6a6ce17
Show file tree
Hide file tree
Showing 4 changed files with 514 additions and 119 deletions.
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

0 comments on commit 6a6ce17

Please sign in to comment.