CoComment with dotText

by Erik Lane 31. March 2006 10:38

I've just recently started using coCommnet to track my comments.  Actually, only two conversations so far but I like it enough that I want to integrate it with my blog and my wife's blog (both dotText).  CoComment does a good job of explaining the integration so it should be straight forward.  Jayson's already done the work on CommunityServer and Joel has done same for b2Evelution so I guess I'll add to the pile.

Giddy Up!

Tags:

Emoticon?

by Erik Lane 31. March 2006 07:04

Funny thing with "webwords".  We always see them written and rarely get the chance to her someone say it and have to pronounce it.  I had that opportunity last week.  I said something to my wife about emoticons.  I pronounced it emo.ti.kahn and my wife looked at me a little weird.  She suggested it was pronounced emo.shi.kahn because it was combining of emotion and icon.  Seemingly. Seemingly, to the untrained eye, I can fully understand how you [she] got that impression (Seinfeld quote). 

We did some quick searching and found that emoticon is pronounced emo.ti.kahn and is actually a combination of emotion and console.  :-)

[edit] Looks like someone changed history in Wikipedia.  To get the real history (from what I know) you need to look at the June 5, 2006 entry before it was changed.

Giddy Up!

CAPTCHA for Community Server 2.0

by Erik Lane 30. March 2006 05:32

Upgraded to CS 2.0 and still want CAPTCHADave has you covered!

Tags:

iPod or No iPod?

by Erik Lane 30. March 2006 05:07

 

If you read my earlier post you know that my exercise habits have increased over the last few weeks. With that my "need" for portable music increased as well. Way back I bought a Diamond Rio 500 and it was good to go. I mean, with 64MB of memory I should be set for a long time! Come to find out, somewhere along the way the Rio 500 stopped working in Windows XP (at least for me). I've been over to Rio world and tried everything they had, I even used the special USB cable that came with the device, but that darn thing still wouldn't show up in XP.

What to do? Obviously iPods are the "in" thing right now. For me, that normally means something I'll shy away from. I don't like to feel I'm following the crowd just for sake of following. I like to do my own thing. I was just about set to buy the Sansa m240 but I realized that it only allows one playlist. With 1GB of memory that's a lot of songs to sort through to find the ones you want. I want to load a bunch of songs and be able to select, based on a playlist, the type of music I'm in the mood for. I don't want to reload a playlist everyday or be stuck with just one.

Because of my requirement I ended up following the crowd and picked up the black iPod Nano. The flexibility it brings is unmatched and not to mention the support for Podcasts (new to me). Any number of playlists, play by artist, album, etc, etc.. The sound quality is good and dial is pretty easy to use once you get the hang of it. My next venture is the world of Podcasting since I now have support for Podcast subscriptions.

If anyone has suggestions on cool iPod tips & tricks or good developer-type Podcasts please share.

Tags:

Windows Live Messenger beta

by Erik Lane 29. March 2006 04:39

Windows Live Messenger - Beta

I've blogged before about my love for Trillian.  However, there were times when it was less than responsive and after a while it started to really bug me.  After I heard that MSN Messenger 7.0 had added message history I had to give it another try.  I've been back on MSN Messenger ever since and I've just had to live without my other favorite features.

The hardest one for me to live without was having the ability to rename a contact.  I just dealt with it the best I could and moved on.  Well, yesterday I finally installed Windows Live Messenger beta and it has a feature called "nickname".  Hrm...what is this for?  Yep, it lets you add a nickname to a contact but more that; the nickname is what's displayed in your contact list.  I'm a happy camper again.

Giddy Up!

Tags:

Awesome Benefit and Motivator

by Erik Lane 27. March 2006 07:06

Over the last few years activity like going to the gym or riding my bike slowely stopped.  I'm not proud of the lack of exercise but it's the truth.  This month things changed.

A group of us from worked pitched in $25 each to do a 12 week challenge to see who could lose the biggest percentage of body weight and first place will get a good chunk of change.  Also, this past month my employer offered to pay for everyone in the company to have a gym membership at 24 hour fitness.  Dang!  That's an awesome deal.  There is one caveat....you must average 3 visits a week or they will cancel the membership.

So I signed up for the membership and have lost about 5.5% of my weight.  I know I would like for this to become a habit again..like it was when I was in the Air Force.

Giddy Up!

Tags:
Categories: Faith and Family

Speaking in Design Patterns

by Erik Lane 22. March 2006 04:54

A while back I was asked how much I knew about "MVC" or sometimes called "MVP".  I had to answer honestly and say that I wasn't sure what they were talking about and I felt pretty bad about it.  So I started digging around (read googling) and still didn't find anything concrete because I didn't know it was a design pattern.  Yes, I can admit it.

Well, after reading through chapter 2 of Dissecting a C# Application: Inside SharpDevelop, I finally realized what the heck MVC was.  It is the Model-View-Controller pattern.  I came to realize I know a lot about it and use it in any application of decent size.  I might be short selling the actually definition but it just describes the basic 3-tier architecture:  presentation layer, a business layer, and data layer.  Those layers are something I really try and keep separate from each other and is one of the hardest hit areas for me when refactoring code.  Its also a pet peeve of mine for the presentation layer to have any knowledge of the business layer; other than getting the information it needs to display on the screen.

I posted about Design Patterns before and have even started reading Head First book on Design Patterns (very good btw).  Its all too funny that the more read I and understand design patterns the more I see areas of my code where I've used them without knowing it.

More than knowing them so I can use them - I need to know them so I can "speak in design patterns".  This isn't just to impress my friends but I can see real value and having that ability.  Its like a common ground or an assumed knowledge so that less time can be spent on the explanation of a potential solution and more time fixing the issue or code smell.

Giddy Up!

Tags:

Part 3 - Integrating Plug 'N Pay with Storefront Shopping Cart

by Erik Lane 17. March 2006 09:06

This is the last post from a short “How-To“ on integrating Plung 'N Pay (PNP) payment processing service into The Storefront.net 6.0 (SF6) shopping cart.

On to step #4:  Handling the Results of the Transaction.  Every payment processing service uses different technology and different methods of integration.  I'm going to describing how I did it with PNP.  The SF6 documentation says there are four basic categories of tasks you will need to accomplish.

This is the code that I’m using to accomplish the four tasks:

            Public Overloads Sub sendRequest()

            Dim strPNPUrl As String

            Dim strResponse As String

            strPNPUrl = String.Format(

MyBase.URI, MyBase.MerchantID, MyBase.UserID, MyBase.m_oOrder.BillAddress.Name, MyBase.m_oOrder.OrderPayment.CreditCardNumber, MyBase.m_oOrder.BillAddress.TotalBilled, MyBase.m_oOrder.OrderPayment.ExpireMonth, Right(MyBase.m_oOrder.OrderPayment.ExpireYear, 2))

strResponse = m_objPlugNPay.doTransaction

(

String.Empty, strPNPUrl, String.Empty, String.Empty

)

            setResponse(strResponse)

        End Sub

Task #1:  You will need a way to access the information stored for your payment processor in the PaymentProcessors table of the database.

The CProcessorBase class contains properties that gives you the access you need.  As I mentioned just a minute a ago, the call to fillProcessorInfo() populates these properties.  The SF6 documentation gives a full list of properties but below are the ones I'm using for PNP:  URI, MerchantID, and UserID.  I’m using these to tell me where to post my transaction to PNP and provide the authentication.

 

Task #2:  You will need a way to access information about the contents of the order being processed.

You can access information about the order by accessing properties of the objOrder object that was passed to the constructor.  The objOrder has two properties that contain the information we need about our order:  BillAddress and OrderPayment.  I’m using these to get the specifics about the credit card and amount to bill the card.

Task #3:  You will need a way to access information about the customer placing the order.

The BillAddress property returns an object of type StoreFront.SystemBase.AddressOrder, which contains those useful properties and you can see how I’m using them for PNP.

Task #4:  You will need to handle the response from the processor and record it in the store’s database.

The StoreFront.SystemBase namespace contains a class designed specifically for handling the results of payment processor transactions: CProcessorResponse. A CProcessorResponse object called m_objProcessResponse is a member of our base class so it's already available within your processor class. We’ll pass the results of the transaction returned from PNP to our overloaded setResponse method so we can parse the transaction, set the properties of m_objProcessResponse, and insert the response into the database.

       Public Overloads Sub setResponse(ByVal PNPResponse As String)

            Dim arResponses As Array, htResults As Hashtable

m_objprocessorresponse.OrderID = m_oOrder.UID

m_objProcessorResponse.ErrorLocation = "PlugNPay"

m_objProcessorResponse.FullResponse = PNPResponse

            arResponses = Split(PNPResponse, "&")

            htResults = GetResults(arResponses)

            With m_objProcessorResponse

.ActionCode = CStr(htResults.Item("FinalStatus"))

                .AuthorizationNo = CStr(htResults.Item("auth-code"))

                .AVSResult = CStr(htResults.Item("avs-code"))

                .CVVResult = CStr(htResults.Item("cvvresp"))

                .ErrorMessage = CStr(htResults.Item("MErrMsg"))

                .MerchTransNo = CStr(htResults.Item("orderID"))

                .OrderDate = CStr(htResults.Item("auth_date"))

                .Success = CBool(htResults.Item("FinalStatus") = "success")

            End With

            ' Track all responses

            If m_objProcessorResponse.Success Then

                m_objProcessorResponse.ErrorMessage = String.Empty

                ProcessorResponseAccess.InsertProcessorResponse(m_objProcessorResponse)

            Else

                ErrorMessage = m_objprocessorresponse.ErrorMessage

                ProcessorResponseAccess.InsertProcessorResponse(m_objProcessorResponse)

                Throw New SystemBase.AppException.PaymentGatewayException(ErrorMessage)

            End If

        End Sub

This is the private method GetResults to parse the PNP transaction.  I’m parsing the response according the PNP documentation.

        Private Function GetResults(ByVal PNPResponses As Array) As Hashtable

            Dim htResults As New Hashtable

            Dim i As Integer, pos As Integer

            Dim key As String, val As String

            For i = 0 To UBound(PNPResponses)

                PNPResponses(i) = Replace(PNPResponses(i), "+", " ")

                PNPResponses(i) = Replace(PNPResponses(i), "%20", " ")

                PNPResponses(i) = Replace(PNPResponses(i), "%21", "!")

                PNPResponses(i) = Replace(PNPResponses(i), "%23", "#")

                PNPResponses(i) = Replace(PNPResponses(i), "%24", "$")

                PNPResponses(i) = Replace(PNPResponses(i), "%25", "%")

                PNPResponses(i) = Replace(PNPResponses(i), "%26", "&")

                PNPResponses(i) = Replace(PNPResponses(i), "%27", "'")

                PNPResponses(i) = Replace(PNPResponses(i), "%28", "(")

                PNPResponses(i) = Replace(PNPResponses(i), "%29", ")")

                PNPResponses(i) = Replace(PNPResponses(i), "%2c", ",")

                PNPResponses(i) = Replace(PNPResponses(i), "%2d", "-")

                PNPResponses(i) = Replace(PNPResponses(i), "%2e", ".")

                PNPResponses(i) = Replace(PNPResponses(i), "%3a", ":")

                PNPResponses(i) = Replace(PNPResponses(i), "%40", "@")

                pos = InStr(1, PNPResponses(i), "=")

                If (pos > 1) Then

                    key = Left(PNPResponses(i), pos - 1)

                    val = Mid(PNPResponses(i), pos + 1)

                    htResults.Item(key) = val

                End If

            Next

            Return htResults

        End Function

 

Step 5: Indicating the Success of a Transaction

The final step in processing a transaction is to indicate to SF6 whether or not the transaction was a success or failure.  I also use this step to add the transaction to the database.  The SF6 documentation says all you have to do is set the ErrorMessage property of the m_objProcessorResponse object.  It (SF6) will know an error occurred if the ErrorMessage is not Empty or NULL.  I just throw an exception with the ErrorMessage.

            ' Track all responses

            If m_objProcessorResponse.Success Then

                m_objProcessorResponse.ErrorMessage = String.Empty

                ProcessorResponseAccess.InsertProcessorResponse(m_objProcessorResponse)

            Else

                ErrorMessage = m_objprocessorresponse.ErrorMessage

                ProcessorResponseAccess.InsertProcessorResponse(m_objProcessorResponse)

                Throw New SystemBase.AppException.PaymentGatewayException(ErrorMessage)

            End If

The steps required to process a transaction have been completed. The existing SF6 logic will pick up from this point, allowing the user to complete their order (if the transaction processed successfully), or returning them to the payments.aspx page and displaying the error message returned by the processing service.

 

Giddy Up!

Tags:

Microsoft Certification Second Chance Offer

by Erik Lane 7. March 2006 18:35

I saw these floating around last fall and it appears that Microsoft is offering second chances again this summer.  The offer expires June 30th, 2006.

[via Jason Haley]

 

Tags:

Part 2 - Integrating Plug 'N Pay with Storefront Shopping Cart

by Erik Lane 7. March 2006 17:28

This is post number two in the process of integrating a new payment system into Storefront 6.0 (SF6).  The payment system we are integrating is Plug 'N Pay (PNP).  Last time we completed steps one and two in the five step process.  Just as a reminder here are the 5 steps needed to accomplish this task.

Step 1: Adding the Payment Processing Service to the Store's Database
Step 2: Add a new case to CProcessor.CallProcessor()
Step 3: Creating a New Processor Class
Step 4: Handling the Results of the Transaction
Step 5: Indicating the Success of a Transaction

Lets start step  #3:  Creating the New Processor Class.  Our new Processor Class will encapsulate all of the functionality to process the payment through PNP and log the transaction into the SF6 database.  Create an empty class file (I saved it to XEBusinessRules\Processors) and have it inherit from BusinessRule.Processors.CProcessorBase.  In the code snippet below I'm doing this, providing the constructor that accepts object of type COrder, added a protected PNP object, and instantiate it.

Imports StoreFront.SystemBase
Imports StoreFront.BusinessRule.Orders

    Public Class CPlugNPay
        Inherits BusinessRule.Processors.CProcessorBase
 Protected m_objPlugNPay As PNPCOMLib.mainClass
 
        Sub New(ByVal objOrder As Orders.COrder)
            MyBase.New(objOrder)
            Me.fillProcessorInfo("PlugNPay")
            m_objPlugNPay = New PNPCOMLib.mainClass
        End Sub

We are also importing namespaces that contain useful tools for payment processor integration.  The Order is passed to the constructor of our base class, CProcessorBase. CProcessorBase uses the information stored in objOrder to retrieve the payment method used by the customer, then the FillProcessorInfo method is called to retrieve the information stored for my processor in the PaymentProcessors table (see Step 1).

Part 3 will cover Handling the Results of the Transaction.

Tags: