mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor(connector): added amount framework to paypal, payouts and routing (#4865)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com> Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
@ -343,6 +343,11 @@ impl MinorUnit {
|
||||
self.0
|
||||
}
|
||||
|
||||
/// forms a new minor default unit i.e zero
|
||||
pub fn zero() -> Self {
|
||||
Self(0)
|
||||
}
|
||||
|
||||
/// forms a new minor unit from amount
|
||||
pub fn new(value: i64) -> Self {
|
||||
Self(value)
|
||||
@ -543,6 +548,11 @@ impl StringMajorUnit {
|
||||
.ok_or(ParsingError::DecimalToI64ConversionFailure)?;
|
||||
Ok(MinorUnit::new(amount_i64))
|
||||
}
|
||||
|
||||
/// Get string amount from struct to be removed in future
|
||||
pub fn get_amount_as_string(&self) -> String {
|
||||
self.0.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user