pub struct PaymentID { /* private fields */ }
Expand description
Payment Structure based on مستندات طرح هماهنگ پرداخت الکترونیکی قبوض - کمیسیون انفورماتیک بانکها \
Amount in thousands Maximum Length: 8 | Year Code Length: 1 | Period Code Length: 2 | Checksum1 Length: 1 | Checksum2 Length: 1 |
---|
Checksums are calculated via ISSN Modulo 11 check digit
Checksum1 is the checksum for Payment ID itself and only checks digits in Payment ID
Checksum2 is the checksum for Bill ID and Payment ID concatenated together and checks validity of relation between two IDs
Implementations§
Source§impl PaymentID
impl PaymentID
Sourcepub fn new(
amount: u64,
year: u8,
period: u8,
bill_id: &BillID,
) -> Result<Self, BillError>
pub fn new( amount: u64, year: u8, period: u8, bill_id: &BillID, ) -> Result<Self, BillError>
Builds Bill ID from scratch and calculates checksum automatically
pub fn get_amount(&self) -> u64
pub fn get_year(&self) -> u8
pub fn get_period(&self) -> u8
pub fn get_checksum1(&self) -> u8
pub fn get_checksum2(&self) -> u8
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PaymentID
impl<'de> Deserialize<'de> for PaymentID
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for PaymentID
impl FromStr for PaymentID
impl Copy for PaymentID
impl Eq for PaymentID
impl StructuralPartialEq for PaymentID
Auto Trait Implementations§
impl Freeze for PaymentID
impl RefUnwindSafe for PaymentID
impl Send for PaymentID
impl Sync for PaymentID
impl Unpin for PaymentID
impl UnwindSafe for PaymentID
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more