React Quickly to Fraudulent Credit Card Charges using ASP.NET, OFX, and RSS
page 4 of 5
by Eric Madariaga
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 23444/ 50

Downloading Transactions and Building the RSS Feed

After setting the card properties, calling the GetStatement method causes the CCStatement component to connect to the server specified by the FIUrl and request the specified transaction set.  After completing the statement request, one is presented with an array of transactions that can be used to build the RSS feed of recent transactions.

Code Listing 3

card.GetStatement();

for (int i = 1; i <= card.TxCount; i++)
{
   string title = string.Format("{0} : {1} - {2} - {3}",
                  card.FIOrganization,
                  formatCurrency(card.TxAmount[i]),
                  card.TxPayeeName[i],
                  formatDate(card.TxDatePosted[i]) );
   string description = string.Format(
                        "<table border=0>" + 
                        "<tr><td>Date:<td>{0}<tr><td>Type:<td>{1}" +
                        "<tr><td>Amount:<td>{2}<tr><td>Payee:<td>{3}" +
                        "</table>\r\n",
                        formatDate(card.TxDatePosted[i]),
                        card.TxTypeDescription[i],
                        formatCurrency(card.TxAmount[i]),
                        card.TxPayeeName[i] );
   rss.AddItem (title, description, "");
   rss.ItemPubDate[1] = formatDate(card.TxDatePosted[i]);
   rss.ItemGuid[1]    = card.TxFITID[i];
}

While iterating over the credit card transaction, we can simultaneously build our RSS feed using the IP*Works! RSS component. All we are doing at this point is formatting the returned transaction information and adding each transaction as an RSS item.  The date and currency formatting functions called above are used to normalize dates and currencies provided in the credit card transaction set.

One thing to note here is that the AddItem method of the RSS object adds RSS items to the beginning of the item list. Every iteration over the Credit Card transaction set inserts a new RSS item to our feed.  After inserting the RSS item, set the ItemPubDate and the ItemGuid so that the transactions are listed correctly in our feed reader as they are returned from the credit card company. 

Using the formatting above, RSS items will show though your feed reader with the following title and item body:

---------------------------------
AMEX : - $19.43 – OUTBACK STEAKHOUSE #0172 RICHMOND -
7/16/2005 8:00:00 PM

Date :      7/16/2005 8:00:00 PM
Type :      Debit
Amount :    - $19.43
Payee :     OUTBACK STEAKHOUSE #0172 RICHMOND
---------------------------------


View Entire Article

User Comments

Title: Help please...   
Name: Michael G
Date: 2007-01-10 5:18:05 PM
Comment:
Great article. I have downloaded OFX integrator and RSS. Is it possible for you to provide the source. n/software provides one example. Also, I want to try my own accounts for test. I have not been able to find the additional information to populate the parameters.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-04-16 10:10:45 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search