コード例 #1
0
        public void ShouldKeepProvidedData()
        {
            const decimal amount                = 100m;
            const string  currency              = "USD";
            const string  id                    = "Batch1";
            const string  endToEndId            = "Batch1/Row2";
            const string  remittanceInformation = "Sample";

            var data = new SepaCreditTransferTransaction
            {
                Creditor              = _iBanData,
                Amount                = amount,
                Currency              = currency,
                Id                    = id,
                EndToEndId            = endToEndId,
                RemittanceInformation = remittanceInformation
            };

            Assert.AreEqual(currency, data.Currency);
            Assert.AreEqual(amount, data.Amount);
            Assert.AreEqual(id, data.Id);
            Assert.AreEqual(endToEndId, data.EndToEndId);
            Assert.AreEqual(remittanceInformation, data.RemittanceInformation);
            Assert.AreEqual(Bic, data.Creditor.Bic);
            Assert.AreEqual(Iban, data.Creditor.Iban);

            var data2 = data.Clone() as SepaCreditTransferTransaction;

            Assert.NotNull(data2);
            Assert.AreEqual(currency, data2.Currency);
            Assert.AreEqual(amount, data2.Amount);
            Assert.AreEqual(id, data2.Id);
            Assert.AreEqual(endToEndId, data2.EndToEndId);
            Assert.AreEqual(remittanceInformation, data2.RemittanceInformation);
            Assert.AreEqual(Bic, data2.Creditor.Bic);
            Assert.AreEqual(Iban, data2.Creditor.Iban);
        }
コード例 #2
0
        public void ShouldKeepProvidedData()
        {
            const decimal amount = 100m;
            const string currency = "USD";
            const string id = "Batch1";
            const string endToEndId = "Batch1/Row2";
            const string remittanceInformation = "Sample";

            var data = new SepaCreditTransferTransaction
                {
                    Creditor = _iBanData,
                    Amount = amount,
                    Currency = currency,
                    Id = id,
                    EndToEndId = endToEndId,
                    RemittanceInformation = remittanceInformation
                };

            Assert.AreEqual(currency, data.Currency);
            Assert.AreEqual(amount, data.Amount);
            Assert.AreEqual(id, data.Id);
            Assert.AreEqual(endToEndId, data.EndToEndId);
            Assert.AreEqual(remittanceInformation, data.RemittanceInformation);
            Assert.AreEqual(Bic, data.Creditor.Bic);
            Assert.AreEqual(Iban, data.Creditor.Iban);

            var data2 = data.Clone() as SepaCreditTransferTransaction;

            Assert.NotNull(data2);
            Assert.AreEqual(currency, data2.Currency);
            Assert.AreEqual(amount, data2.Amount);
            Assert.AreEqual(id, data2.Id);
            Assert.AreEqual(endToEndId, data2.EndToEndId);
            Assert.AreEqual(remittanceInformation, data2.RemittanceInformation);
            Assert.AreEqual(Bic, data2.Creditor.Bic);
            Assert.AreEqual(Iban, data2.Creditor.Iban);
        }
コード例 #3
0
        public void ShouldManageMultipleTransactionsTransfer()
        {
            var transfert = new SepaCreditTransfer
            {
                CreationDate           = new DateTime(2010, 02, 20, 9, 30, 5),
                RequestedExecutionDate = new DateTime(2010, 02, 28),
                MessageIdentification  = "REF/789456/CCT001",
                PaymentInfoId          = "LOT123456",
                InitiatingPartyName    = "TOTO Distribution SA",
                Debtor = new SepaIbanData
                {
                    Bic  = "BANKFRPP",
                    Iban = "FR7621479632145698745632145",
                    Name = "Societe S"
                },
                IsInternational = true,
                ChargeBearer    = SepaChargeBearer.DEBT,
            };

            const decimal amount = 20000m;
            var           trans  = new SepaCreditTransferTransaction
            {
                Id       = "Virement 458A",
                Creditor = new SepaIbanData
                {
                    Bic  = "PNPBUS33",
                    Iban = "US29NWBK60161331926819",
                    Name = "USA Factory"
                },
                Amount                     = amount,
                Currency                   = "USD",
                EndToEndId                 = "SOC/1478/CC/TI001/01",
                RemittanceInformation      = "En reglement des factures numeros : 123456789 987456321 258741369",
                SepaInstructionForCreditor = new SepaInstructionForCreditor()
                {
                    Code = SepaInstructionForCreditor.SepaInstructionForCreditorCode.PHOB
                },
                Purpose = "SCVE",
                RegulatoryReportingCode = "150"
            };

            trans.EndToEndId = "SOC/1478/CC/TI001/01";
            transfert.AddCreditTransfer(trans);

            const decimal amount2 = 1500000m;

            trans = new SepaCreditTransferTransaction
            {
                Id       = "Virement 458B",
                Creditor = new SepaIbanData
                {
                    Bic  = "BANKDEFF",
                    Iban = "DE89370400440532013000",
                    Name = "Japan Society"
                },
                Amount                  = amount2,
                Currency                = "JPY",
                EndToEndId              = "SOC/1478/CC/TI001/02",
                RemittanceInformation   = "En reglement des factures numeros : 321456789A 789456321B  852741370C",
                Purpose                 = "SCVE",
                RegulatoryReportingCode = "150"
            };
            transfert.AddCreditTransfer(trans);

            const decimal total = (amount + amount2) * 100;

            Assert.AreEqual(total, transfert.HeaderControlSumInCents);
            Assert.AreEqual(total, transfert.PaymentControlSumInCents);

            Assert.AreEqual(RESULT, transfert.AsXmlString());
        }
コード例 #4
0
        public void ShouldManageMultipleTransactionsTransfer()
        {
            var transfert = new SepaCreditTransfer
            {
                CreationDate = new DateTime(2010, 02, 20, 9, 30, 5),
                RequestedExecutionDate = new DateTime(2010, 02, 28),
                MessageIdentification = "REF/789456/CCT001",
                PaymentInfoId = "LOT123456",
                InitiatingPartyName = "TOTO Distribution SA",
                Debtor = new SepaIbanData
                {
                    Bic = "BANKFRPP",
                    Iban = "FR7621479632145698745632145",
                    Name = "Societe S"
                },
                IsInternational = true,
                ChargeBearer = SepaChargeBearer.DEBT,
               };

            const decimal amount = 20000m;
            var trans = new SepaCreditTransferTransaction
            {
                Id = "Virement 458A",
                Creditor = new SepaIbanData
                {
                    Bic = "PNPBUS33",
                    Iban = "US29NWBK60161331926819",
                    Name = "USA Factory"
                },
                Amount = amount,
                Currency = "USD",
                EndToEndId = "SOC/1478/CC/TI001/01",
                RemittanceInformation = "En reglement des factures numeros : 123456789 987456321 258741369",
                SepaInstructionForCreditor = new SepaInstructionForCreditor() { Code = SepaInstructionForCreditor.SepaInstructionForCreditorCode.PHOB },
                Purpose = "SCVE",
                RegulatoryReportingCode = "150"
            };
            trans.EndToEndId = "SOC/1478/CC/TI001/01";
            transfert.AddCreditTransfer(trans);

            const decimal amount2 = 1500000m;
            trans = new SepaCreditTransferTransaction
            {
                Id = "Virement 458B",
                Creditor = new SepaIbanData
                {
                    Bic = "BANKDEFF",
                    Iban = "DE89370400440532013000",
                    Name = "Japan Society"
                },
                Amount = amount2,
                Currency = "JPY",
                EndToEndId = "SOC/1478/CC/TI001/02",
                RemittanceInformation = "En reglement des factures numeros : 321456789A 789456321B  852741370C",
                Purpose = "SCVE",
                RegulatoryReportingCode = "150"
            };
            transfert.AddCreditTransfer(trans);

            const decimal total = (amount + amount2)*100;

            Assert.AreEqual(total, transfert.HeaderControlSumInCents);
            Assert.AreEqual(total, transfert.PaymentControlSumInCents);

            Assert.AreEqual(RESULT, transfert.AsXmlString());
        }
コード例 #5
0
        public void ShouldHaveADefaultCurrency()
        {
            var data = new SepaCreditTransferTransaction();

            Assert.AreEqual("EUR", data.Currency);
        }
コード例 #6
0
        public void ShouldHaveADefaultCurrency()
        {
            var data = new SepaCreditTransferTransaction();

            Assert.AreEqual("EUR", data.Currency);
        }