mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(connector): [Novalnet] add Payment flows for cards (#5726)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local>
This commit is contained in:
@ -2146,6 +2146,107 @@ impl Default for super::settings::RequiredFields {
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Novalnet,
|
||||
RequiredFieldFinal {
|
||||
mandate: HashMap::new(),
|
||||
non_mandate: HashMap::new(),
|
||||
common: HashMap::from(
|
||||
[
|
||||
(
|
||||
"browser_info.language".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "browser_info.language".to_string(),
|
||||
display_name: "browser_info_language".to_string(),
|
||||
field_type: enums::FieldType::BrowserLanguage,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"browser_info.ip_address".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "browser_info.ip_address".to_string(),
|
||||
display_name: "browser_info_ip_address".to_string(),
|
||||
field_type: enums::FieldType::BrowserIp,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line1".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line1".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine1,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line2".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line2".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine2,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.city".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.city".to_string(),
|
||||
display_name: "city".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCity,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.zip".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.zip".to_string(),
|
||||
display_name: "zip".to_string(),
|
||||
field_type: enums::FieldType::UserAddressPincode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.first_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.first_name".to_string(),
|
||||
display_name: "first_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.last_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.last_name".to_string(),
|
||||
display_name: "last_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.phone.country_code".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.phone.country_code".to_string(),
|
||||
display_name: "dialing_code".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumberCountryCode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.email".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.email".to_string(),
|
||||
display_name: "email_address".to_string(),
|
||||
field_type: enums::FieldType::UserEmailAddress,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
]
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Nuvei,
|
||||
RequiredFieldFinal {
|
||||
@ -5018,6 +5119,107 @@ impl Default for super::settings::RequiredFields {
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Novalnet,
|
||||
RequiredFieldFinal {
|
||||
mandate: HashMap::new(),
|
||||
non_mandate: HashMap::new(),
|
||||
common: HashMap::from(
|
||||
[
|
||||
(
|
||||
"browser_info.language".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "browser_info.language".to_string(),
|
||||
display_name: "browser_info_language".to_string(),
|
||||
field_type: enums::FieldType::BrowserLanguage,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"browser_info.ip_address".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "browser_info.ip_address".to_string(),
|
||||
display_name: "browser_info_ip_address".to_string(),
|
||||
field_type: enums::FieldType::BrowserIp,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line1".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line1".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine1,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line2".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line2".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine2,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.city".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.city".to_string(),
|
||||
display_name: "city".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCity,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.zip".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.zip".to_string(),
|
||||
display_name: "zip".to_string(),
|
||||
field_type: enums::FieldType::UserAddressPincode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.first_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.first_name".to_string(),
|
||||
display_name: "first_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.last_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.last_name".to_string(),
|
||||
display_name: "last_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.phone.country_code".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.phone.country_code".to_string(),
|
||||
display_name: "dialing_code".to_string(),
|
||||
field_type: enums::FieldType::UserPhoneNumberCountryCode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.email".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.email".to_string(),
|
||||
display_name: "email_address".to_string(),
|
||||
field_type: enums::FieldType::UserEmailAddress,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
]
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Nuvei,
|
||||
RequiredFieldFinal {
|
||||
|
||||
@ -1393,6 +1393,10 @@ impl<'a> ConnectorAuthTypeAndMetadataValidation<'a> {
|
||||
noon::transformers::NoonAuthType::try_from(self.auth_type)?;
|
||||
Ok(())
|
||||
}
|
||||
api_enums::Connector::Novalnet => {
|
||||
novalnet::transformers::NovalnetAuthType::try_from(self.auth_type)?;
|
||||
Ok(())
|
||||
}
|
||||
api_enums::Connector::Nuvei => {
|
||||
nuvei::transformers::NuveiAuthType::try_from(self.auth_type)?;
|
||||
Ok(())
|
||||
|
||||
@ -1320,8 +1320,22 @@ pub fn build_redirection_form(
|
||||
input type="hidden" name=(field) value=(value);
|
||||
}
|
||||
}
|
||||
|
||||
(PreEscaped(format!("<script type=\"text/javascript\"> {logging_template} var frm = document.getElementById(\"payment_form\"); window.setTimeout(function () {{ frm.submit(); }}, 300); </script>")))
|
||||
(PreEscaped(format!(r#"
|
||||
<script type="text/javascript"> {logging_template}
|
||||
var frm = document.getElementById("payment_form");
|
||||
var formFields = frm.querySelectorAll("input");
|
||||
|
||||
if (frm.method.toUpperCase() === "GET" && formFields.length === 0) {{
|
||||
window.setTimeout(function () {{
|
||||
window.location.href = frm.action;
|
||||
}}, 300);
|
||||
}} else {{
|
||||
window.setTimeout(function () {{
|
||||
frm.submit();
|
||||
}}, 300);
|
||||
}}
|
||||
</script>
|
||||
"#)))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,7 +422,9 @@ impl ConnectorData {
|
||||
enums::Connector::Mollie => Ok(ConnectorEnum::Old(Box::new(&connector::Mollie))),
|
||||
enums::Connector::Nmi => Ok(ConnectorEnum::Old(Box::new(connector::Nmi::new()))),
|
||||
enums::Connector::Noon => Ok(ConnectorEnum::Old(Box::new(connector::Noon::new()))),
|
||||
// enums::Connector::Novalnet => Ok(ConnectorEnum::Old(Box::new(connector::Novalnet))),
|
||||
enums::Connector::Novalnet => {
|
||||
Ok(ConnectorEnum::Old(Box::new(connector::Novalnet::new())))
|
||||
}
|
||||
enums::Connector::Nuvei => Ok(ConnectorEnum::Old(Box::new(&connector::Nuvei))),
|
||||
enums::Connector::Opennode => {
|
||||
Ok(ConnectorEnum::Old(Box::new(&connector::Opennode)))
|
||||
|
||||
@ -305,7 +305,7 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
|
||||
// api_enums::Connector::Nexixpay => Self::Nexixpay,
|
||||
api_enums::Connector::Nmi => Self::Nmi,
|
||||
api_enums::Connector::Noon => Self::Noon,
|
||||
// api_enums::Connector::Novalnet => Self::Novalnet,
|
||||
api_enums::Connector::Novalnet => Self::Novalnet,
|
||||
api_enums::Connector::Nuvei => Self::Nuvei,
|
||||
api_enums::Connector::Opennode => Self::Opennode,
|
||||
api_enums::Connector::Paybox => Self::Paybox,
|
||||
|
||||
Reference in New Issue
Block a user