예제 #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);
        }
예제 #2
0
        private FinancialTransaction CreatePrepayFinancialTransaction()
        {
            FinancialTransactionCollection transactionsCollection = new FinancialTransactionCollection();
            FinancialTransaction           transaction            = new FinancialTransaction();

            transaction.CustomerId             = _customerId;
            transaction.FinancialAccountId     = _financialAccountId;
            transaction.BaseAmount             = _voucherAmount;
            transaction.LedgerAccountId        = _setting.PrepaidVoucherLedgerAccountId;
            transaction.CurrencyId             = _setting.PrepaidVoucherCurrencyId;
            transaction.PaymentReferenceNumber = _voucherTicketNumber.ToString();

            transactionsCollection.Add(transaction);

            IFinanceService financeService = GetFinanceService();

            transactionsCollection = financeService.CreatePaymentTransactions(transactionsCollection, PaymentReceiptNumberingMethod.Automatic);
            if (transactionsCollection.Items.Any())
            {
                return(transactionsCollection.Items[0]);
            }
            return(null);
        }