Example #1
0
        /// <summary>
        /// Gets bank statement ofx payload.
        /// </summary>
        /// <param name="args">Date range and account filter.</param>
        /// <returns>
        /// Strongly typed deserialized statement model.
        /// </returns>
        public async Task <Statement> GetStatement(BankStatementArgs args)
        {
            var response = await GetStatementOfx(args);

            var ofxPayload = _serializer.Deserialize(response);

            // check for code

            return(OfxStatementParser.Parse(ofxPayload));
        }
Example #2
0
        public void BankAccount()
        {
            // Arrange
            var creditCardStatement =
                EmbeddedResourceReader.ReadResponseAsString("bankTransactions", OfxVersionEnum.Version1x);
            var serializer = new DefaultOfxSerializerFactory().Create(OfxVersionEnum.Version1x);
            var ofxPayload = serializer.Deserialize(creditCardStatement);

            // Act
            var statement = OfxStatementParser.Parse(ofxPayload);

            // Assert
            Assert.Equal("0000000000003158", statement.AccountNumber);
            Assert.Equal("USD", statement.Currency);
            Assert.Equal(1322.42m, statement.AvailableBalance);
            Assert.Equal(1327.42m, statement.LedgerBalance);
            Assert.Equal(2, statement.Transactions.Length);
        }