mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
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:
committed by
GitHub
parent
9576ee37a6
commit
afa803e0f9
@ -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>> {
|
||||
|
||||
Reference in New Issue
Block a user