Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if BankingInternationalPayeeBankDetails instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingInternationalPayeeBankDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingInternationalPayeeBankDetails other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                     ) &&
                 (
                     AccountNumber == other.AccountNumber ||
                     AccountNumber != null &&
                     AccountNumber.Equals(other.AccountNumber)
                 ) &&
                 (
                     BankAddress == other.BankAddress ||
                     BankAddress != null &&
                     BankAddress.Equals(other.BankAddress)
                 ) &&
                 (
                     BeneficiaryBankBIC == other.BeneficiaryBankBIC ||
                     BeneficiaryBankBIC != null &&
                     BeneficiaryBankBIC.Equals(other.BeneficiaryBankBIC)
                 ) &&
                 (
                     FedWireNumber == other.FedWireNumber ||
                     FedWireNumber != null &&
                     FedWireNumber.Equals(other.FedWireNumber)
                 ) &&
                 (
                     SortCode == other.SortCode ||
                     SortCode != null &&
                     SortCode.Equals(other.SortCode)
                 ) &&
                 (
                     ChipNumber == other.ChipNumber ||
                     ChipNumber != null &&
                     ChipNumber.Equals(other.ChipNumber)
                 ) &&
                 (
                     RoutingNumber == other.RoutingNumber ||
                     RoutingNumber != null &&
                     RoutingNumber.Equals(other.RoutingNumber)
                 ) &&
                 (
                     LegalEntityIdentifier == other.LegalEntityIdentifier ||
                     LegalEntityIdentifier != null &&
                     LegalEntityIdentifier.Equals(other.LegalEntityIdentifier)
                 ));
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (IsValidCrypto)
            {
                sb.AppendLine($"Currency: {CurrencyCode}");
                sb.AppendLine("Address:");
                sb.AppendLine(CryptoAddress);
            }
            else if (IsValidBankAccount)
            {
                sb.AppendLine("Currency:");
                sb.AppendLine(CurrencyCode);
                sb.AppendLine("Beneficiary full name:");
                sb.AppendLine(BeneficiaryAccountFullname);
                if (string.IsNullOrWhiteSpace(BankIban) == false)
                {
                    sb.AppendLine("IBAN:");
                    sb.AppendLine(BankIban);
                }
                if (string.IsNullOrWhiteSpace(BankAccount) == false)
                {
                    sb.AppendLine("Bank Account:");
                    sb.AppendLine(BankAccount);
                }
                if (string.IsNullOrWhiteSpace(BicSwift) == false)
                {
                    sb.AppendLine("Bic/Swift:");
                    sb.AppendLine(BicSwift);
                }
                if (string.IsNullOrWhiteSpace(BankRoutingNumber) == false)
                {
                    sb.AppendLine("Routing Number:");
                    sb.AppendLine(BankRoutingNumber);
                }
                if (string.IsNullOrWhiteSpace(BankSortCode) == false)
                {
                    sb.AppendLine("Sort Code:");
                    sb.AppendLine(BankSortCode);
                }
                if (BankAddress != null)
                {
                    sb.AppendLine("Bank Address:");
                    sb.AppendLine(BankAddress.ToString());
                }
                if (BeneficiaryAddress != null)
                {
                    sb.AppendLine("Beneficiary address:");
                    sb.AppendLine(BeneficiaryAddress.ToString());
                }
            }
            return(sb.ToString());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         if (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         if (BankAddress != null)
         {
             hashCode = hashCode * 59 + BankAddress.GetHashCode();
         }
         if (BeneficiaryBankBIC != null)
         {
             hashCode = hashCode * 59 + BeneficiaryBankBIC.GetHashCode();
         }
         if (FedWireNumber != null)
         {
             hashCode = hashCode * 59 + FedWireNumber.GetHashCode();
         }
         if (SortCode != null)
         {
             hashCode = hashCode * 59 + SortCode.GetHashCode();
         }
         if (ChipNumber != null)
         {
             hashCode = hashCode * 59 + ChipNumber.GetHashCode();
         }
         if (RoutingNumber != null)
         {
             hashCode = hashCode * 59 + RoutingNumber.GetHashCode();
         }
         if (LegalEntityIdentifier != null)
         {
             hashCode = hashCode * 59 + LegalEntityIdentifier.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            if (!(obj is Beneficiary))
            {
                return(false);
            }

            var beneficiary = obj as Beneficiary;

            return(Id == beneficiary.Id &&
                   BankAccountHolderName == beneficiary.BankAccountHolderName &&
                   Name == beneficiary.Name &&
                   Email == beneficiary.Email &&
                   PaymentTypes.SequenceEqual(beneficiary.PaymentTypes) &&
                   BeneficiaryAddress.SequenceEqual(beneficiary.BeneficiaryAddress) &&
                   BeneficiaryCountry == beneficiary.BeneficiaryCountry &&
                   BeneficiaryEntityType == beneficiary.BeneficiaryEntityType &&
                   BeneficiaryCompanyName == beneficiary.BeneficiaryCompanyName &&
                   BeneficiaryFirstName == beneficiary.BeneficiaryFirstName &&
                   BeneficiaryLastName == beneficiary.BeneficiaryLastName &&
                   BeneficiaryCity == beneficiary.BeneficiaryCity &&
                   BeneficiaryPostcode == beneficiary.BeneficiaryPostcode &&
                   BeneficiaryStateOrProvince == beneficiary.BeneficiaryStateOrProvince &&
                   BeneficiaryDateOfBirth == beneficiary.BeneficiaryDateOfBirth &&
                   BeneficiaryIdentificationType == beneficiary.BeneficiaryIdentificationType &&
                   BeneficiaryIdentificationValue == beneficiary.BeneficiaryIdentificationValue &&
                   BankCountry == beneficiary.BankCountry &&
                   BankName == beneficiary.BankName &&
                   BankAccountType == beneficiary.BankAccountType &&
                   Currency == beneficiary.Currency &&
                   AccountNumber == beneficiary.AccountNumber &&
                   RoutingCodeType1 == beneficiary.RoutingCodeType1 &&
                   RoutingCodeValue1 == beneficiary.RoutingCodeValue1 &&
                   RoutingCodeType2 == beneficiary.RoutingCodeType2 &&
                   RoutingCodeValue2 == beneficiary.RoutingCodeValue2 &&
                   BicSwift == beneficiary.BicSwift &&
                   Iban == beneficiary.Iban &&
                   DefaultBeneficiary == beneficiary.DefaultBeneficiary &&
                   CreatorContactId == beneficiary.CreatorContactId &&
                   BankAddress.SequenceEqual(beneficiary.BankAddress) &&
                   CreatedAt == beneficiary.CreatedAt &&
                   UpdatedAt == beneficiary.UpdatedAt &&
                   BeneficiaryExternalReference == beneficiary.BeneficiaryExternalReference);
        }
        public override bool Equals(object obj)
        {
            if (!(obj is SettlementAccount))
            {
                return(false);
            }

            var settlementAccount = obj as SettlementAccount;

            return(BankAccountHolderName == settlementAccount.BankAccountHolderName &&
                   BeneficiaryAddress.SequenceEqual(settlementAccount.BeneficiaryAddress) &&
                   BeneficiaryCountry == settlementAccount.BeneficiaryCountry &&
                   BankName == settlementAccount.BankName &&
                   BankAddress.SequenceEqual(settlementAccount.BankAddress) &&
                   BankCountry == settlementAccount.BankCountry &&
                   Currency == settlementAccount.Currency &&
                   BicSwift == settlementAccount.BicSwift &&
                   Iban == settlementAccount.Iban &&
                   AccountNumber == settlementAccount.AccountNumber &&
                   RoutingCodeType1 == settlementAccount.RoutingCodeType1 &&
                   RoutingCodeValue1 == settlementAccount.RoutingCodeValue1 &&
                   RoutingCodeType2 == settlementAccount.RoutingCodeType2 &&
                   RoutingCodeValue2 == settlementAccount.RoutingCodeValue2);
        }
Ejemplo n.º 6
0
 public override string ToString()
 {
     return($"{RomAddress.ToString("X")} ({BankAddress.ToString("X")}): {General.CommandByteArrayToString(ToArray())}");
 }