Example #1
0
 public RevenueRecord(Identification identification, Revenue revenue, BillNumber billNumber, bool isFirstAttempt = true, EvidenceMode mode = EvidenceMode.Online)
 {
     Identifier     = Guid.NewGuid();
     Identification = identification;
     Revenue        = revenue;
     BillNumber     = billNumber;
     IsFirstAttempt = isFirstAttempt;
     Mode           = mode;
     Signature      = Convert.ToBase64String(GetSignatureBytes());
     SecurityCode   = GetSecurityCode();
 }
Example #2
0
        public RevenueRecord(Identification identification, Revenue revenue, BillNumber billNumber, bool isFirstAttempt = true, EvidenceMode mode = EvidenceMode.Online)
        {
            Identifier     = Guid.NewGuid();
            Identification = identification;
            Revenue        = revenue;
            BillNumber     = billNumber;
            IsFirstAttempt = isFirstAttempt;
            Mode           = mode;
            Signature      = Convert.ToBase64String(GetSignatureBytes());
            SecurityCode   = GetSecurityCode();

            //// The generated GUID should comply with UUID v4.0. This is meant to be a sanity check just to make sure the EET specs are correct.
            if (!StringHelpers.SafeMatches(Identifier.ToString(), Patterns.UUID))
            {
                throw new ArgumentException("The generated message UUID does not comply with EET requirements.");
            }
        }