/// <summary> /// Gets credit card statement ofx payload. /// </summary> /// <param name="args">Date range and account filter.</param> /// <returns> /// Raw OFX Payload /// </returns> public async Task <string> GetStatementOfx(CreditCardStatementArgs args) { var request = PrepareCreditCardStatementOfxRequest(args); var response = await _utils.PostRequest(_opts.ApiUrl, request); return(response); }
/// <summary> /// Gets credit card statement. /// </summary> /// <param name="args">Date range and account filter.</param> /// <returns> /// Strongly typed deserialized statement model. /// </returns> public async Task <Statement> GetStatement(CreditCardStatementArgs args) { var response = await GetStatementOfx(args); var ofxPayload = _serializer.Deserialize(response); // check for code return(OfxStatementParser.Parse(ofxPayload)); }
internal IRequestBuilder GetCreditCardStatementRequest(CreditCardStatementArgs args) => _utils.Requests.GetRequestBuilder <CreditCardStatementRequestBuilder>() .Account(args.AccountNumber) .Filter(args.StartDate.ToString(_utils.DateFormat), args.EndDate.ToString(_utils.DateFormat)) .TransactionId(_utils.GenerateTransactionId());
internal string PrepareCreditCardStatementOfxRequest(CreditCardStatementArgs args) { return(PrepareOfxRequest(AuthRequest(), GetCreditCardStatementRequest(args))); }