Beispiel #1
0
 public DeliveryParty()
 {
     PartyLegalEntities         = new List <PartyLegalEntity>();
     PartyLegalEntity_CompanyID = new PartyLegalEntity_CompanyID();
     PartyIdentification        = new PartyIdentification();
     Person = new Person();
 }
 public AgentParty()
 {
     PartyIdentification = new PartyIdentification();
     PartyName = new PartyName();
     PostalAddress = new PostalAddress();
     PartyLegalEntity = new PartyLegalEntity();
 }
Beispiel #3
0
 public SignatoryParty()
 {
     PartyIdentification = new PartyIdentification();
     PartyName           = new PartyName();
 }
Beispiel #4
0
        /// <summary>
        /// Devuelve los datos binarios del xml conformado en arreglo a las
        /// especificaciones de la versión 3.
        /// </summary>
        /// <returns></returns>
        private byte[] GetXmlV03()
        {
            // PREPARAMOS LA CABECERA Y DIMENSIONAMOS REGISTROS

            var document = new Xml.Pain.CustomerCreditTransferInitiationV03.Document();

            var debtor = new PartyIdentification()
            {
                Nm = Debtor.Name,
                Id = new PartyChoice()
                {
                    Item = new OrganisationIdentification()
                    {
                        Othr = new GenericOrganisationIdentification[1]
                        {
                            new GenericOrganisationIdentification()
                            {
                                Id = Debtor.Identification
                            }
                        }
                    }
                }
            };

            document.CstmrCdtTrfInitn.GrpHdr = new GroupHeader()
            {
                MsgId            = MessageIdentification,       // Id. mensaje
                CreDtTm          = CreationDateTime,            // Creación
                CtrlSum          = ControlSum,                  // Importe total
                CtrlSumSpecified = true,
                NbOfTxs          = $"{NumberOfTransactions}",   // Número de transacciones
                InitgPty         = debtor
            };

            document.CstmrCdtTrfInitn.PmtInf = new PaymentInstruction[1]
            {
                new PaymentInstruction()
                {
                    PmtInfId           = PaymentInformationIdentification,
                    PmtMtd             = PaymentMethodCode.TRF,
                    BtchBookg          = true,
                    BtchBookgSpecified = true,
                    NbOfTxs            = $"{NumberOfTransactions}",
                    CtrlSum            = ControlSum,
                    CtrlSumSpecified   = true,
                    PmtTpInf           = new PaymentTypeInformation()
                    {
                        SvcLvl = new CdOrPrtryTypeChoice()
                        {
                            Item = ServiceLevel
                        }
                    },
                    ReqdExctnDt = RequestedExecutionDate,
                    Dbtr        = debtor,
                    DbtrAcct    = new CashAccount()
                    {
                        Id = new AccountIdentificationChoice()
                        {
                            Item            = Debtor.IBAN,
                            ItemElementName = AccountIdentificationType.IBAN
                        }
                    },
                    DbtrAgt = new BranchAndFinancialInstitutionIdentification()
                    {
                        FinInstnId = new FinancialInstitutionIdentification()
                        {
                            BIC = Debtor.BIC
                        }
                    },
                    CdtTrfTxInf = new CreditTransferTransactionInformation[NumberOfTransactions]
                }
            };

            if (CategoryPurpose != null)
            {
                document.CstmrCdtTrfInitn.PmtInf[0].PmtTpInf.CtgyPurp = new CdOrPrtryTypeChoice()
                {
                    Item = CategoryPurpose
                };
                document.CstmrCdtTrfInitn.PmtInf[0].PmtTpInf.CtgyPurpSpecified = true;
            }

            int index = 0;

            foreach (var creditTransferTransaction in CreditTransferTransactions)
            {
                if (index > 999)
                {
                    throw new Exception("Max CreditTransferTransactions number (1000) exceded.");
                }

                creditTransferTransaction.PaymentIdentification = $"{MessageIdentification}-" + $"{index + 1}".PadLeft(3, '0');

                document.CstmrCdtTrfInitn.PmtInf[0].CdtTrfTxInf[index++] = new CreditTransferTransactionInformation()
                {
                    PmtId = new PaymentIdentification()
                    {
                        EndToEndId = creditTransferTransaction.PaymentIdentification,
                        InstrId    = creditTransferTransaction.PaymentIdentification
                    },
                    Amt = new PaymentTransactionInformation()
                    {
                        InstdAmt = new ActiveOrHistoricCurrencyAndAmount()
                        {
                            Ccy   = creditTransferTransaction.Currency,
                            Value = creditTransferTransaction.Amount
                        }
                    },
                    CdtrAgt = new BranchAndFinancialInstitutionIdentification()
                    {
                        FinInstnId = new FinancialInstitutionIdentification()
                        {
                            BIC = creditTransferTransaction.Creditor.BIC
                        }
                    },
                    Cdtr = new PartyIdentification()
                    {
                        Nm = creditTransferTransaction.Creditor.Name
                    },
                    CdtrAcct = new CashAccount()
                    {
                        Id = new AccountIdentificationChoice()
                        {
                            Item            = creditTransferTransaction.Creditor.IBAN,
                            ItemElementName = AccountIdentificationType.IBAN
                        }
                    },
                    RmtInf = new RemittanceInformation()
                    {
                        Ustrd = creditTransferTransaction.RemittanceInformation
                    },
                };

                if (CategoryPurpose != null)
                {
                    document.CstmrCdtTrfInitn.PmtInf[0].CdtTrfTxInf[index - 1].Purp = new CdOrPrtryTypeChoice()
                    {
                        Item = CategoryPurpose
                    };
                }
            }

            return(XmlParser <Xml.Pain.CustomerCreditTransferInitiationV03.Document> .ToXml(document));
        }