mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 20:23:43 +08:00
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:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user