feat(router): add payments create-intent flow for v2 (#6193)

Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
This commit is contained in:
Sai Harsha Vardhan
2024-10-17 15:50:47 +05:30
committed by GitHub
parent 9576ee37a6
commit afa803e0f9
64 changed files with 2004 additions and 282 deletions

View File

@ -485,6 +485,24 @@ impl<T: Clone> Encryptable<T> {
pub fn into_encrypted(self) -> Secret<Vec<u8>, EncryptionStrategy> {
self.encrypted
}
///
/// Deserialize inner value and return new Encryptable object
///
pub fn deserialize_inner_value<U, F>(
self,
f: F,
) -> CustomResult<Encryptable<U>, errors::ParsingError>
where
F: FnOnce(T) -> CustomResult<U, errors::ParsingError>,
U: Clone,
{
// Option::map(self, f)
let inner = self.inner;
let encrypted = self.encrypted;
let inner = f(inner)?;
Ok(Encryptable { inner, encrypted })
}
}
impl<T: Clone> Deref for Encryptable<Secret<T>> {