feat(connector): add connector nmi with card, applepay and googlepay support (#771)

Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
Co-authored-by: ShashiKant <shashitnak@gmail.com>
Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com>
Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
This commit is contained in:
Pa1NarK
2023-05-11 16:47:00 +05:30
committed by GitHub
parent a904d2b4d9
commit baf5fd91cf
20 changed files with 2022 additions and 7 deletions

View File

@ -5,6 +5,7 @@
use error_stack::{IntoReport, ResultExt};
use masking::{ExposeInterface, Secret, Strategy};
use quick_xml::de;
use serde::{Deserialize, Serialize};
use crate::errors::{self, CustomResult};
@ -392,3 +393,22 @@ impl ConfigExt for String {
self.trim().is_empty()
}
}
/// Extension trait for deserializing XML strings using `quick-xml` crate
pub trait XmlExt {
///
/// Deserialize an XML string into the specified type `<T>`.
///
fn parse_xml<T>(self) -> Result<T, quick_xml::de::DeError>
where
T: serde::de::DeserializeOwned;
}
impl XmlExt for &str {
fn parse_xml<T>(self) -> Result<T, quick_xml::de::DeError>
where
T: serde::de::DeserializeOwned,
{
de::from_str(self)
}
}