<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Dan Bedassa</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/DanBedassa/Atom.aspx" />
    <subtitle type="html"> </subtitle>
    <id>http://geekswithblogs.net/DanBedassa/Default.aspx</id>
    <author>
        <name>DanBedassa</name>
        <uri>http://geekswithblogs.net/DanBedassa/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2010-06-17T15:45:19Z</updated>
    <entry>
        <title>Capturing BizTalk 2004 SQLAdapter failures</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DanBedassa/archive/2010/06/17/capturing-biztalk-2004-sqladapter-failures.aspx" />
        <id>http://geekswithblogs.net/DanBedassa/archive/2010/06/17/capturing-biztalk-2004-sqladapter-failures.aspx</id>
        <published>2010-06-17T15:45:19-05:00:00</published>
        <updated>2010-06-17T15:45:19Z</updated>
        <content type="html">&lt;div&gt;I was recently working on a BizTalk 2004 project where I encountered an issue with capturing exceptions (inside my orchestration) occurring from an external source. Like database server down, non-existing stored procedure, …&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I thought I might write-up this in case it might help someone …&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To reproduce an issue, I just rename the database to something different.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The orchestration was failing at the point where I make a SQL request via a Response-Request Port. The exception handlers were bypassed but I can see a warning in the event log saying:&lt;/div&gt;
&lt;div style="text-indent: 0.5in"&gt;&lt;i&gt;"The adapter failed to transmit message going to send port "&lt;/i&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;After scratching my head for a while (as a newbie to BTS 2004) to find a way to catch the exceptions from the SQLAdapter in an orchestration, here is the solution I had.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Put the Send and Receive shapes inside a &lt;b&gt;Scope&lt;/b&gt; shape&lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Set the Scope’s transaction type to “&lt;b&gt;Long Running&lt;/b&gt;”&lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Add a Catch block expecting type “&lt;b&gt;System.Exception”&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Set the “Delivery Notification” of the associated Port to “&lt;b&gt;Transmitted&lt;/b&gt;”&lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Change the “Retry Count” of the associated port to &lt;b&gt;0 &lt;/b&gt;(This will make sure BizTalk will raise the exception, instead of a warning, and you can capture that)&lt;/div&gt;
&lt;div style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Now capture and do whatever with the exception inside the Catch block&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://geekswithblogs.net/DanBedassa/aggbug/140479.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DanBedassa/comments/140479.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DanBedassa/comments/commentRss/140479.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DanBedassa/services/trackbacks/140479.aspx</trackback:ping>
    </entry>
    <entry>
        <title>LINQ to SQL cache issue</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DanBedassa/archive/2009/02/12/linq-to-sql-cache-issue.aspx" />
        <id>http://geekswithblogs.net/DanBedassa/archive/2009/02/12/linq-to-sql-cache-issue.aspx</id>
        <published>2009-02-12T09:04:36-06:00:00</published>
        <updated>2009-02-12T09:16:18Z</updated>
        <content type="html">&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt;Have you ever encountered that LINQ to SQL is not giving you latest data you just updated on a specific row? &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt;Well apparently, LINQ to SQL is caching your objects on the first call and on subsequent requests for the same row, it gives you the object in the cache – even if you have made updates to that row after your first request. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt;It could be really annoying to see your updates right there in the database but LINQ is giving you your old data. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt;Your solution is to disable object tracking (caching for LINQ) of the data context like so.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.5in"&gt; &lt;/div&gt;
&lt;p style="MARGIN: 0in 0in 0pt 0.5in" align="left"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;myContext.ObjectTrackingEnabled = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt 0.5in" align="left"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;strong&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt 0.5in" align="left"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt 0.5in" align="left"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="MARGIN: 0in 0in 10pt 0.5in"&gt; I did this at the point of data context creation (data Context factory) and my caching issue was resolved. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 10pt 0.5in"&gt;Enjoy.&lt;/div&gt;&lt;img src="http://geekswithblogs.net/DanBedassa/aggbug/129355.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DanBedassa/comments/129355.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DanBedassa/comments/commentRss/129355.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DanBedassa/services/trackbacks/129355.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Dynamically generating Word 2007 (.docx) documents using .net </title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DanBedassa/archive/2009/01/16/dynamically-generating-word-2007-.docx-documents-using-.net.aspx" />
        <id>http://geekswithblogs.net/DanBedassa/archive/2009/01/16/dynamically-generating-word-2007-.docx-documents-using-.net.aspx</id>
        <published>2009-01-16T13:02:22-06:00:00</published>
        <updated>2009-01-16T13:02:22Z</updated>
        <content type="html">&lt;span style="FONT-SIZE: 85%"&gt;This is a step by step instruction on how to dynamically generate MS Word 2007 documents.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%"&gt;&lt;strong&gt;Background on Word 2007 Document Internals&lt;/strong&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 85%"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 85%"&gt;&lt;br /&gt;
Word 2007 document is based on the Office Open XML file formats. As you will see, the Office Open XML file formats are based on standard ZIP file technology. Each top-level file is saved as a ZIP archive, which means you will be able to open a Word document just as you would any other ZIP file and look inside.&lt;br /&gt;
Note that the 2007 Microsoft Office system applications such as Word and Excel have introduced file extensions for documents that use the new format. For example, the .docx extension is used for Word documents stored in the Office Open XML file formats while the more familiar .doc extension continues to be used for Word docs stored in the binary format.&lt;br /&gt;
&lt;br /&gt;
Let’s create a new document in Word 2007 and add "Hello Word" as the text. Save the document using the default format to a new file named Hello.docx and close Word. Next, locate Hello.docx using Windows Explorer and rename it Hello.zip. Open Hello.zip and see the structure of folders and files that Word has created inside (see Figure).&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_cnjPBISGkuk/SWeKJ3VlhxI/AAAAAAAAAAM/nd1G8wBdE3A/s1600-h/bl1.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5289348189447882514" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 192px" alt="" border="0" src="http://2.bp.blogspot.com/_cnjPBISGkuk/SWeKJ3VlhxI/AAAAAAAAAAM/nd1G8wBdE3A/s320/bl1.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 DOCX File is a ZIP Archive&lt;br /&gt;
&lt;br /&gt;
The top-level file (Hello.docx) is known as a package. Since a package is implemented as a standard ZIP archive, it automatically provides compression and it makes its contents instantly accessible to many existing utilities and APIs on both Windows platforms and other platforms alike.&lt;br /&gt;
&lt;br /&gt;
Inside a package there are two kinds of internal components: parts and items. In general, parts contain content and items contain metadata describing the parts.&lt;br /&gt;
&lt;br /&gt;
A basic package contains an XML file called [Content_Types].xml at the root, along with three directories: _rels, docProps, and a directory specific for the document type (for example, in a .docx word processing package, there would be a word directory). The word directory contains the document.xml file which is the core content of the document.&lt;br /&gt;
&lt;br /&gt;
A part is named using a Uniform Resource Identifier (URI) that contains its relative path within the package file combined with the part file name. For example, the main part within the package for a Word document is /word/document.xml. Here are a few more typical part names you will find inside the package for a simple Word document:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;/[Content_Types].xml&lt;br /&gt;
    This file describes the contents of the package. It also contains a mapping for file extensions and overrides for specific URIs. &lt;/li&gt;
    &lt;li&gt;_rels&lt;br /&gt;
    This directory contains relationships for the files within the package. To find the relationships for a specific file, look for the _rels directory that is a sibling of the file, and then for a file that has the original file name with a .rels appended to it. For example, if the content types file had any relationships, there would be a file called [Content_Types].xml.rels inside the _rels directory. &lt;/li&gt;
    &lt;li&gt;/_rels/.rels&lt;br /&gt;
    This file is where the package relationships are located. Applications look here first. Viewing in a text editor, one will see it outlines each relationship for that section. In a minimal document containing only the basic document.xml file, the relationships detailed are metadata and document.xml. &lt;/li&gt;
    &lt;li&gt;/docProps/core.xml&lt;br /&gt;
    This file contains the core properties for any Office Open XML document. &lt;/li&gt;
    &lt;li&gt;/word/document.xml&lt;br /&gt;
    This file is the main part for any Word document – which we will be manipulating in our code. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The Project&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;We will be using Visual Studio 2008, .NET Framework 3.5, the NorthWind database and a simple Word template in our application.&lt;br /&gt;
&lt;strong&gt;Step 1 – Create a Word 2007 template.&lt;/strong&gt;&lt;br /&gt;
Create a simple Word 2007 file with placeholders enclosed between two #’s (like #ORDERID#) and save it as ‘MyTemplate.docx’&lt;br /&gt;
Below is the content I used: &lt;/p&gt;
&lt;p&gt;&lt;em&gt;From: My Company&lt;br /&gt;
#ADDRESS#&lt;br /&gt;
#CITY#, #REGION#, #POSTCODE#&lt;br /&gt;
#COUNTRY#&lt;br /&gt;
Dear #CUSTOMERID#&lt;br /&gt;
We're pleased to inform you that your order number #ORDERID# is going to be shipped on #SHIPPEDDATE#.&lt;br /&gt;
If you have any questions or comments, please feel free to give us a call at #HOMEPHONE#&lt;br /&gt;
Regards,&lt;br /&gt;
#FIRSRNAME# #LASTNAME#&lt;br /&gt;
#TITLE# &lt;/em&gt;&lt;/p&gt;
&lt;em&gt;
&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;For More information&lt;/strong&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;a href="http://openxmldeveloper.org/"&gt;&lt;span style="FONT-SIZE: 85%"&gt;http://openxmldeveloper.org/&lt;/span&gt;&lt;/a&gt;&lt;span style="FONT-SIZE: 85%"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 85%"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;a href="http://www.codeproject.com/KB/cs/GenerateWord2007.aspx"&gt;&lt;span style="FONT-SIZE: 85%"&gt;http://www.codeproject.com/KB/cs/GenerateWord2007.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="FONT-SIZE: 85%"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Office_Open_XML"&gt;&lt;span style="FONT-SIZE: 85%"&gt;http://en.wikipedia.org/wiki/Office_Open_XML&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%"&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163526.aspx#S1"&gt;&lt;span style="FONT-SIZE: 85%"&gt;http://msdn.microsoft.com/en-us/magazine/cc163526.aspx#S1&lt;/span&gt;&lt;/a&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 85%"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/em&gt;We will replace the place holders with values from the Orders table of the Northwind database.&lt;br /&gt;
&lt;strong&gt;Step 2 – Create an OrderInformation class&lt;br /&gt;
&lt;/strong&gt;This class simply represents an Order object with properties for OrderID, CustomerID,….&lt;br /&gt;
&lt;strong&gt;Step 3 – Create a GenerateDocument class&lt;/strong&gt;&lt;br /&gt;
A main method, public void GenerateWord( OrderInformation orderInfo), is implemented to generate the new document named after the value of OrderID of the current Order.&lt;br /&gt;
In this class, System.IO.Package is used to replicate the template, replacing the place holder variables in the /word/document.xml file with the actual values from the current Order.&lt;br /&gt;
Below is the code:&lt;br /&gt;
public void GenerateWord( OrderInformation orderInfo)&lt;br /&gt;
{&lt;br /&gt;
string templateDoc = string.Format("{0}{1}", ConfigurationManager.AppSettings["TemplateFolder"], ConfigurationManager.AppSettings["TemplateFile"]);&lt;br /&gt;
string filename = string.Format("{0}{1}.docx", ConfigurationManager.AppSettings["OutputFolder"], orderInfo.OrderID);&lt;br /&gt;
&lt;br /&gt;
// Copy a new file name from template file&lt;br /&gt;
File.Copy(templateDoc, filename, true);&lt;br /&gt;
&lt;br /&gt;
// Open the new Package&lt;br /&gt;
Package pkg = Package.Open(filename, FileMode.Open, FileAccess.ReadWrite);&lt;br /&gt;
&lt;br /&gt;
// Specify the URI of the part to be read&lt;br /&gt;
Uri uri = new Uri("/word/document.xml", UriKind.Relative);&lt;br /&gt;
PackagePart part = pkg.GetPart(uri);&lt;br /&gt;
&lt;br /&gt;
XmlDocument xmlMainXMLDoc = new XmlDocument();&lt;br /&gt;
xmlMainXMLDoc.Load(part.GetStream(FileMode.Open,FileAccess.Read));&lt;br /&gt;
&lt;br /&gt;
xmlMainXMLDoc.InnerXml = ReplacePlaceHoldersInTemplate(orderInfo, xmlMainXMLDoc.InnerXml);&lt;br /&gt;
&lt;br /&gt;
// Open the stream to write document&lt;br /&gt;
StreamWriter partWrt = new StreamWriter(part.GetStream(FileMode.Open, FileAccess.Write));&lt;br /&gt;
//doc.Save(partWrt);&lt;br /&gt;
xmlMainXMLDoc.Save(partWrt);&lt;br /&gt;
&lt;br /&gt;
partWrt.Flush();&lt;br /&gt;
partWrt.Close();&lt;br /&gt;
pkg.Close();&lt;br /&gt;
}&lt;br /&gt;
private string ReplacePlaceHoldersInTemplate(OrderInformation orderInfo, string templateBody)&lt;br /&gt;
{&lt;br /&gt;
//#ADDRESS#&lt;br /&gt;
templateBody = templateBody.Replace("#ADDRESS#", orderInfo.FirstName);&lt;br /&gt;
&lt;br /&gt;
//#CITY#&lt;br /&gt;
templateBody = templateBody.Replace("#CITY#", orderInfo.City);&lt;br /&gt;
…&lt;br /&gt;
}&lt;br /&gt;
&lt;strong&gt;Step 4 – Implement a web or WinForms application utilizing the above classes&lt;br /&gt;
&lt;/strong&gt;Here is a sample button_Click handler:&lt;br /&gt;
protected void btnFrom_Click(object sender, EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
string orderID = “1234”;// lstOrders.SelectedValue;&lt;br /&gt;
&lt;br /&gt;
//generate documet&lt;br /&gt;
OrderInformation orderInfo;&lt;br /&gt;
GenerateDocument doc = new GenerateDocument();&lt;br /&gt;
orderInfo = doc.GetOrderInformation(orderID);&lt;br /&gt;
doc.GenerateWord(orderInfo);&lt;br /&gt;
&lt;br /&gt;
} &lt;/span&gt;&lt;img src="http://geekswithblogs.net/DanBedassa/aggbug/128727.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DanBedassa/comments/128727.aspx</wfw:comment>
        <slash:comments>15</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DanBedassa/comments/commentRss/128727.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DanBedassa/services/trackbacks/128727.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Implementing Authorize.NET Payment Provider for DashCommerce </title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/DanBedassa/archive/2009/01/16/implementing-authorize.net-payment-provider-for-dashcommerce.aspx" />
        <id>http://geekswithblogs.net/DanBedassa/archive/2009/01/16/implementing-authorize.net-payment-provider-for-dashcommerce.aspx</id>
        <published>2009-01-16T13:01:10-06:00:00</published>
        <updated>2009-01-16T13:01:10Z</updated>
        <content type="html">&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt;As an example of how to create a provider for dashCommerce, I have implemented an Authorize.NET Payment Provider for dashCommerce based on Advanced Integration Method guidelines from Authorize.NET &lt;/span&gt;&lt;a href="http://developer.authorize.net/guides/AIM/"&gt;&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt;http://developer.authorize.net/guides/AIM/&lt;/span&gt;&lt;/a&gt;&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt; and following the structure of the existing providers in dashCommerce.&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt;Below is the general outline of the implementation:&lt;br /&gt;
&lt;strong&gt;1. Implement the &lt;em&gt;&lt;span style="FONT-SIZE: 78%"&gt;Store.Services.PaymentService.IPaymentProvider&lt;/span&gt;&lt;/em&gt; interface.&lt;/strong&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 85%; FONT-FAMILY: verdana"&gt;
&lt;ul&gt;
    &lt;li&gt;The provider must implement this interface, specifically the &lt;strong&gt;Authorize&lt;/strong&gt;, &lt;strong&gt;Charge&lt;/strong&gt; and &lt;strong&gt;Refund&lt;/strong&gt; methods. You can see the code at &lt;em&gt;&lt;span style="FONT-SIZE: 78%"&gt;Store.Services\PaymentService\AuthorizeNetPaymentProvider.cs&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;The actual implementation of the above methods is in Store\Services\PaymentService\AuthorizeNET\AuthorizeNetService.cs and the provider has a reference to this class. &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;The class instance has a constructor with parameters matching the configuration properties stored (for Authorize.NET, we need to store atleast API Version, API LoginID, TransactionKey and IsTestMode).&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;The implementation for Authorize, Charge and Refund methods are almost the same except on some parameters to Authorize.NET services like transaction type "x_type" ("AUTH_ONLY" = Authorize, "AUTH_CAPTURE" = Charge, "CREDIT" = Refund). For a complete implementation, please see the code. Below is a rough implementation guideline:&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 78%"&gt;i. use a NameValueCollection and build up the arguments like so NameValueCollection objInf = new NameValueCollection(30);&lt;br /&gt;
objInf.Add("x_version", account.AuthNetVersion);&lt;br /&gt;
objInf.Add("x_login", account.AuthNetLoginID);&lt;br /&gt;
objInf.Add("x_card_num", order.CreditCardNumber);&lt;br /&gt;
objInf.Add("x_amount", order.Total.ToString());&lt;br /&gt;
…&lt;br /&gt;
ii. Pass them to the UploadValues method of the WebClient class, which returns a byte[] response&lt;br /&gt;
WebClient objRequest = new WebClient();&lt;br /&gt;
objRetBytes = objRequest.UploadValues(objRequest.BaseAddress, "POST", objInf);&lt;br /&gt;
iii. Parse that using the Encoding.Ascii.GetString. Split the string by "," and eliminate the field delimiters "".&lt;br /&gt;
objRetVals = System.Text.Encoding.ASCII.GetString(objRetBytes).Split(",".ToCharArray());&lt;br /&gt;
&lt;br /&gt;
iv. Process the return values and handle accordingly&lt;br /&gt;
// Process Return Values&lt;br /&gt;
response.ReturnCode = objRetVals[0].Trim(char.Parse(""));&lt;br /&gt;
&lt;br /&gt;
if (objRetVals[0].Trim(char.Parse("")) == "1")&lt;br /&gt;
{&lt;br /&gt;
// Returned Authorisation Code&lt;br /&gt;
response.AuthorizationCode = objRetVals[4].Trim(char.Parse(""));&lt;br /&gt;
// Returned Transaction ID&lt;br /&gt;
response.TransactionID = objRetVals[6].Trim(char.Parse(""));&lt;br /&gt;
strMessage = "Transaction completed successfully.";&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{//look into the code. There are hundreds of possible errors … can’t put them here … &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Add a control that creates and saves the configuration settings for the provider in the same order they are used in the class instance above. &lt;/strong&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;You can see the code at &lt;em&gt;&lt;span style="FONT-SIZE: 78%"&gt;Web\admin\controls\configuration\paymentproviders\authorizenetconfiguration.ascx.cs&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;When we save/configure the providers, the properties need to be added to the AuthorizeNetPaymentProvider’s ProviderSettings in the order they are expected by the constructor of the payment service above.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 85%"&gt;3. Configuring the Authorize.NET Payment Provider in Your dashCommerce site:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%"&gt;After this just go ahead and configure the new payment provider as you would with any additional provider.&lt;br /&gt;
1. Log In to your dashCommerce web site using your administrator account. Proceed to Payment Configuration -&amp;gt; Configure Payment Providers. Select the AuthorizeNetPaymentProvider from the dropdown list in the PaymentProvider Configuration section and click “Configure Provider”. This will then display the AuthorizeNet Payment Provider Configuration panel, as seen below:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%"&gt;&lt;a href="http://2.bp.blogspot.com/_cnjPBISGkuk/SWePD0ZB2fI/AAAAAAAAAAU/wRaafXpLhvA/s1600-h/bl1.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5289353583135939058" style="WIDTH: 462px; CURSOR: hand; HEIGHT: 238px" alt="" border="0" src="http://2.bp.blogspot.com/_cnjPBISGkuk/SWePD0ZB2fI/AAAAAAAAAAU/wRaafXpLhvA/s320/bl1.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;
2. Put in the values from your Authorize.NET account in the appropriate boxes.&lt;br /&gt;
3. If you are ready to go live with your site, then ensure you check “Is Live”.&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 85%"&gt;4. Press Save when done.&lt;/span&gt; &lt;/span&gt;&lt;img src="http://geekswithblogs.net/DanBedassa/aggbug/128726.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/DanBedassa/comments/128726.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/DanBedassa/comments/commentRss/128726.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/DanBedassa/services/trackbacks/128726.aspx</trackback:ping>
    </entry>
</feed>
