Beispiel #1
0
        public AqTransaction(SWIGTYPE_p_AB_TRANSACTION aqTransactionHandle)
        {
            this.aqTransaction = aqTransactionHandle;
            var val = AB.AB_Transaction_GetValue(aqTransaction);

            this.Amount   = (float)AB.AB_Value_GetValueAsDouble(val);
            this.Currency = AB.AB_Value_GetCurrency(val);

            this.ValutaDate = AqHelper.fromGwenTimeToDateTime(AB.AB_Transaction_GetValutaDate(aqTransaction));
            this.Date       = AqHelper.fromGwenTimeToDateTime(AB.AB_Transaction_GetDate(aqTransaction));

            // populate ToAccount
            this.AqToAccount = new AqBankAccount();
            // AccountNumber & IBAN
            this.AqToAccount.IBAN          = AB.AB_Transaction_GetRemoteIban(aqTransaction);
            this.AqToAccount.AccountNumber = AB.AB_Transaction_GetRemoteAccountNumber(aqTransaction);
            // BankCode & BIC
            this.AqToAccount.BLZ       = AB.AB_Transaction_GetRemoteBankCode(aqTransaction);
            this.AqToAccount.BIC       = AB.AB_Transaction_GetRemoteBic(aqTransaction);
            this.AqToAccount.OwnerName = AqHelper.fromGwenStringList(AB.AB_Transaction_GetRemoteName(aqTransaction));
            this.AqToAccount.BankName  = AB.AB_Transaction_GetRemoteBankName(aqTransaction);

            // populate FromAccount
            this.AqFromAccount = new AqBankAccount();
            this.AqFromAccount.AccountNumber     = AB.AB_Transaction_GetLocalAccountNumber(aqTransaction);
            this.AqFromAccount.IBAN              = AB.AB_Transaction_GetLocalIban(aqTransaction);
            this.AqFromAccount.BLZ               = AB.AB_Transaction_GetLocalBankCode(aqTransaction);
            this.AqFromAccount.BIC               = AB.AB_Transaction_GetLocalBic(aqTransaction);
            this.AqFromAccount.AccountIdentifier = AB.AB_Transaction_GetLocalAccountNumber(aqTransaction);
            this.AqFromAccount.OwnerName         = new List <string> ();
            this.AqFromAccount.OwnerName.Add(AB.AB_Transaction_GetLocalName(aqTransaction));

            this.Purposes = AqHelper.fromGwenStringList(AB.AB_Transaction_GetPurpose(aqTransaction));
        }
Beispiel #2
0
        public void Perform()
        {
            // narrow the timespam from which we retrieve the transactions
            AB.AB_JobGetTransactions_SetFromTime(AqJobHandle, AqHelper.convertToGwenTime(FromTime));
            AB.AB_JobGetTransactions_SetToTime(AqJobHandle, AqHelper.convertToGwenTime(ToTime));

            // create a new aqbanking job for transaction retrieving
            SWIGTYPE_p_AB_JOB_LIST2 list = AB.AB_Job_List2_new();

            AB.AB_Job_List2_PushBack(list, this.AqJobHandle);


            var ctx = AB.AB_ImExporterContext_new();
            int rv  = AB.AB_Banking_ExecuteJobs(abHandle, list, ctx);

            if (rv < 0)
            {
                throw new Exception("Aqbanking ExecuteJobs() failed with return code: " + rv);
            }

            var accinfo = AB.AB_ImExporterContext_GetAccountInfo(ctx, Account.BankIdentifier, Account.AccountIdentifier);

            // fill our transactions list from aqbanking
            var trans = AB.AB_ImExporterAccountInfo_GetFirstTransaction(accinfo);

            while (trans != null)
            {
                AqTransaction transaction = new AqTransaction(trans);
                this.Transactions.Add((ITransaction)transaction);
                trans = AB.AB_ImExporterAccountInfo_GetNextTransaction(accinfo);
            }
        }