示例#1
0
        public void RealFTTest()
        {
            XmlNode settings               = GetNode("TestMessages/MessageGroup[@name='PrepaidVoucher']/Message[@name='RealFTTest']/MessageContent/CustomContent/Settings");
            int     customerId             = Int32.Parse(XmlUtilities.SafeSelectText(settings, "CustomerId"));
            int     financialAccountId     = Int32.Parse(XmlUtilities.SafeSelectText(settings, "FinancialAccountId"));
            decimal baseAmount             = Decimal.Parse(XmlUtilities.SafeSelectText(settings, "BaseAmount"));
            int     ledgerAccountId        = Int32.Parse(XmlUtilities.SafeSelectText(settings, "LedgerAccountId"));
            int     currencyId             = Int32.Parse(XmlUtilities.SafeSelectText(settings, "CurrencyId"));
            string  paymentReferenceNumber = XmlUtilities.SafeSelectText(settings, "PaymentReferenceNumber");

            FinancialTransactionCollection transactionsCollection = new FinancialTransactionCollection();
            FinancialTransaction           transaction            = new FinancialTransaction();

            transaction.CustomerId             = customerId;
            transaction.FinancialAccountId     = financialAccountId;
            transaction.BaseAmount             = baseAmount;
            transaction.LedgerAccountId        = ledgerAccountId;
            transaction.CurrencyId             = currencyId;
            transaction.PaymentReferenceNumber = paymentReferenceNumber;

            transactionsCollection.Add(transaction);

            IFinanceService financeService = ServiceUtilities.GetService <IFinanceService>(_context);

            financeService.CreatePaymentTransactions(transactionsCollection, PaymentReceiptNumberingMethod.Automatic);
        }