/// <summary>
        /// Unstructured Remittance Information
        /// </summary>
        public override List <string> Ustrd(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod, bool extendedText)
        {
            var ustrdText = StandardPaymentFunctions.RegularExpressionReplace(externalAdvText, allowedCharactersRegEx, replaceCharactersRegEx);

            int           maxLines   = 0;
            int           maxStrLen  = 0;
            List <string> resultList = new List <string>();

            switch (companyBankEnum)
            {
            case CompanyBankENUM.SEB:      //Setup as Danske Bank
                maxLines  = 4;
                maxStrLen = 35;
                break;

            default:
                maxLines  = 1;
                maxStrLen = 140;
                break;
            }

            if (ustrdText != string.Empty)
            {
                if (ustrdText.Length > maxLines * maxStrLen)
                {
                    ustrdText = ustrdText.Substring(0, maxLines * maxStrLen);
                }

                resultList = ustrdText.Select((x, i) => i)
                             .Where(i => i % maxStrLen == 0)
                             .Select(i => ustrdText.Substring(i, ustrdText.Length - i >= maxStrLen ? maxStrLen : ustrdText.Length - i)).ToList <string>();
            }

            return(resultList);
        }
        /// <summary>
        /// Specifies a pre-agreed service or level of service between the parties, as
        /// published in an external service level code list
        /// Allowed Codes:
        /// NURG Non-urgent payment
        /// SDVA SameDayValue
        /// SEPA SingleEuroPaymentsArea
        /// URGP Urgent Payment.
        /// </summary>
        public virtual string ExtServiceCode(ISO20022PaymentTypes paymentType)
        {
            if (paymentType == ISO20022PaymentTypes.SEPA)
            {
                return(BaseDocument.EXTSERVICECODE_SEPA);
            }

            return(BaseDocument.EXTSERVICECODE_NURG);
        }
Esempio n. 3
0
        /// <summary>
        /// Exclude section CdtrAgt
        /// Nordea: CdtrAgt is only allowed when BIC is included.
        /// </summary>
        public override bool ExcludeSectionCdtrAgt(ISO20022PaymentTypes ISOPaymType, string creditorSWIFT)
        {
            if (companyBankEnum == CompanyBankENUM.Nordea_DK && creditorSWIFT == string.Empty)
            {
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Instruction for the payment type. Some codes are linked to the service level.This element can either be used here or at the transaction(credit)
        /// level, but not both.SALA or PENS only valid at this level.All credits must be the same.See document Payment Types for more information on codes.
        /// Allowed Codes:
        /// CORT Financial payment
        /// INTC Intra company payment
        /// PENS Pension payment
        /// SALA Salary payment
        /// SUPP Supplier payment (Default Value)
        /// TREA Financial payment
        /// </summary>
        public override string ExtCategoryPurpose(ISO20022PaymentTypes ISOPaymType)
        {
            switch (companyBankEnum)
            {
            case CompanyBankENUM.DNB_Bank:
                return(string.Empty);    //Not used by DNB Norway

            default:
                return(BaseDocument.EXTCATEGORYPURPOSE_SUPP);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// This reference will be presented on Creditor’s account statement.
        /// UK Danske bank Max 18 characters payment types 'Fast transfer' and 'Internal payment'
        /// </summary>
        public override string RemittanceInfo(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod)
        {
            string remittanceInfo = StandardPaymentFunctions.RegularExpressionReplace(externalAdvText, allowedCharactersRegEx, replaceCharactersRegEx);

            if (remittanceInfo != string.Empty && remittanceInfo.Length > 18)
            {
                remittanceInfo = remittanceInfo.Substring(0, 18);
            }

            return(remittanceInfo);
        }
        /// <summary>
        /// Nordea: Reference quoted on statement. This reference will be presented on Creditor’s account statement. It may only be used for domestic payments. Only used by Norway, Denmark and Sweden.
        /// Max 20 characters
        /// </summary>
        public override string RemittanceInfo(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod)
        {
            string remittanceInfo = StandardPaymentFunctions.RegularExpressionReplace(externalAdvText, allowedCharactersRegEx, replaceCharactersRegEx);

            if (remittanceInfo != string.Empty && ISOPaymType == ISO20022PaymentTypes.DOMESTIC)
            {
                switch (paymentMethod)
                {
                case PaymentTypes.VendorBankAccount:
                    if (remittanceInfo.Length > 20)
                    {
                        remittanceInfo = remittanceInfo.Substring(0, 20);
                    }
                    break;

                case PaymentTypes.IBAN:
                    if (remittanceInfo.Length > 20)
                    {
                        remittanceInfo = remittanceInfo.Substring(0, 20);
                    }
                    break;

                case PaymentTypes.PaymentMethod3:     //FIK71
                    remittanceInfo = string.Empty;
                    break;

                case PaymentTypes.PaymentMethod5:     //FIK75
                    remittanceInfo = string.Empty;
                    break;

                case PaymentTypes.PaymentMethod4:     //FIK73
                    remittanceInfo = string.Empty;
                    break;

                case PaymentTypes.PaymentMethod6:     //FIK04
                    remittanceInfo = string.Empty;
                    break;
                }
            }
            else
            {
                remittanceInfo = string.Empty;
            }

            return(remittanceInfo);
        }
        /// <summary>
        /// Unstructured Remittance Information
        /// </summary>
        public virtual List <string> Ustrd(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod, bool extendedText)
        {
            var ustrdText = StandardPaymentFunctions.RegularExpressionReplace(externalAdvText, allowedCharactersRegEx, replaceCharactersRegEx);

            int           maxLines   = 1;
            int           maxStrLen  = 140;
            List <string> resultList = new List <string>();

            if (ustrdText != string.Empty)
            {
                if (ustrdText.Length > maxLines * maxStrLen)
                {
                    ustrdText = ustrdText.Substring(0, maxLines * maxStrLen);
                }

                resultList = ustrdText.Select((x, i) => i)
                             .Where(i => i % maxStrLen == 0)
                             .Select(i => ustrdText.Substring(i, ustrdText.Length - i >= maxStrLen ? maxStrLen : ustrdText.Length - i)).ToList <string>();
            }

            return(resultList);
        }
Esempio n. 8
0
        /// <summary>
        /// Validate PaymentType
        /// </summary>
        private void ISOPaymentType(string paymentCcy, string companyIBAN, PaymentTypes paymentType, string creditorCountryId)
        {
            companyIBAN       = companyIBAN ?? string.Empty;
            companyCountryId  = companyCountryId ?? string.Empty;
            creditorCountryId = creditorCountryId ?? string.Empty;

            isoPaymentType = BankSpecificSettings.ISOPaymentType(paymentCcy, companyIBAN, creditorIBAN, creditorSWIFT, creditorCountryId, companyCountryId);

            if (credPaymFormat._ExportFormat == (byte)ExportFormatType.ISO20022_DK && (CompanyBankEnum == CompanyBankENUM.DanskeBank || CompanyBankEnum == CompanyBankENUM.Nordea_DK || CompanyBankEnum == CompanyBankENUM.Nordea_NO))
            {
                if (paymentType != PaymentTypes.IBAN && isoPaymentType == ISO20022PaymentTypes.DOMESTIC && paymentCcy == BaseDocument.CCYEUR)
                {
                    checkErrors.Add(new CheckError(String.Format("It's required to use IBAN as creditor account for Domestic EUR payments.")));
                }

                //Nordea
                if ((CompanyBankEnum == CompanyBankENUM.Nordea_DK || CompanyBankEnum == CompanyBankENUM.Nordea_NO) && (paymentType != PaymentTypes.IBAN && isoPaymentType == ISO20022PaymentTypes.SEPA))
                {
                    checkErrors.Add(new CheckError(String.Format("It's required to use IBAN as creditor account for SEPA payments.")));
                }
            }
            else if (credPaymFormat._ExportFormat == (byte)ExportFormatType.ISO20022_DK)
            {
                if (paymentType == PaymentTypes.IBAN && isoPaymentType == ISO20022PaymentTypes.DOMESTIC) //Not sure which banks has this requirement.
                {
                    checkErrors.Add(new CheckError(String.Format("It's not allowed to use IBAN as creditor account for domestic payments.")));
                }
            }

            if (credPaymFormat._ExportFormat == (byte)ExportFormatType.ISO20022_LT && bankSpecificSettings.CompanyBankEnum == CompanyBankENUM.Standard)
            {
                if (isoPaymentType != ISO20022PaymentTypes.SEPA)
                {
                    checkErrors.Add(new CheckError(String.Format("Only SEPA payments are allowed")));
                }
            }
        }
Esempio n. 9
0
 /// <summary>
 ///This reference will be presented on Creditor’s account statement.
 /// Max 20 characters
 /// Lithuania: Not used
 /// </summary>
 public override string RemittanceInfo(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod)
 {
     return(string.Empty);
 }
Esempio n. 10
0
 /// <summary>
 ///
 /// </summary>
 public override string ExtCategoryPurpose(ISO20022PaymentTypes ISOPaymType)
 {
     return(string.Empty);
 }
Esempio n. 11
0
        /// <summary>
        /// Unstructured Remittance Information
        /// UK Danske bank not used for payment types 'Fast transfer' and 'Internal payment'
        /// </summary>
        public override List <string> Ustrd(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod, bool extendedText)
        {
            List <string> resultList = new List <string>();

            return(resultList);
        }
Esempio n. 12
0
        /// <summary>
        /// Unstructured Remittance Information
        /// </summary>
        public override List <string> Ustrd(string externalAdvText, ISO20022PaymentTypes ISOPaymType, PaymentTypes paymentMethod, bool extendedText)
        {
            var ustrdText = StandardPaymentFunctions.RegularExpressionReplace(externalAdvText, allowedCharactersRegEx, replaceCharactersRegEx);

            if (ustrdText == null)
            {
                return(null);
            }

            //Extended notification
            if (ISOPaymType == ISO20022PaymentTypes.DOMESTIC)
            {
                if (extendedText)
                {
                    if (ustrdText.Length <= 20)
                    {
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }

            int           maxLines   = 0;
            int           maxStrLen  = 0;
            List <string> resultList = new List <string>();

            switch (companyBankEnum)
            {
            case CompanyBankENUM.Nordea_DK:
                if (ISOPaymType == ISO20022PaymentTypes.DOMESTIC)
                {
                    return(resultList);
                }

                maxLines  = 4;
                maxStrLen = 35;
                if (paymentMethod == PaymentTypes.PaymentMethod6 || paymentMethod == PaymentTypes.PaymentMethod3)     //Not allowed for FIK71 and Giro04
                {
                    return(resultList);
                }
                break;

            case CompanyBankENUM.Handelsbanken:
                maxLines  = 1;
                maxStrLen = 140;
                if (paymentMethod == PaymentTypes.PaymentMethod6 || paymentMethod == PaymentTypes.PaymentMethod3)     //Not allowed for FIK71 and Giro04
                {
                    return(resultList);
                }
                break;

            case CompanyBankENUM.DanskeBank:
                maxLines  = 4;
                maxStrLen = 35;
                break;

            case CompanyBankENUM.BankConnect:
                maxLines  = 41;
                maxStrLen = 35;
                break;

            default:
                maxLines  = 1;
                maxStrLen = 140;
                break;
            }

            if (ustrdText != string.Empty)
            {
                if (ustrdText.Length > maxLines * maxStrLen)
                {
                    ustrdText = ustrdText.Substring(0, maxLines * maxStrLen);
                }

                resultList = ustrdText.Select((x, i) => i)
                             .Where(i => i % maxStrLen == 0)
                             .Select(i => ustrdText.Substring(i, ustrdText.Length - i >= maxStrLen ? maxStrLen : ustrdText.Length - i)).ToList <string>();
            }

            return(resultList);
        }
 /// <summary>
 /// Exclude section CdtrAgt
 /// DNB Norway: CdtrAgt isn't needed for Domestic paymenst and if included BIC or Address need to be provided.
 /// </summary>
 public virtual bool ExcludeSectionCdtrAgt(ISO20022PaymentTypes ISOPaymType, string creditorSWIFT)
 {
     return(false);
 }
 /// <summary>
 /// Instruction for the payment type. Some codes are linked to the service level.This element can either be used here or at the transaction(credit)
 /// level, but not both.SALA or PENS only valid at this level.All credits must be the same.See document Payment Types for more information on codes.
 /// Allowed Codes:
 /// CORT Financial payment
 /// INTC Intra company payment
 /// PENS Pension payment
 /// SALA Salary payment
 /// SUPP Supplier payment (Default Value)
 /// TREA Financial payment
 /// </summary>
 public virtual string ExtCategoryPurpose(ISO20022PaymentTypes ISOPaymType)
 {
     return(BaseDocument.EXTCATEGORYPURPOSE_SUPP);
 }