Developer forum

Forum » Ecommerce - Standard features » Exception in Charge Logic checkout handler

Exception in Charge Logic checkout handler

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

We're seeing a .NET exception when we use charge logic for checkout. The error comes from GetPostedInfo in CheckoutHandler.vb:

Protected Overridable Function GetPostedInfo(ByVal order As Order) As String

            Dim formXML As New Xml.XmlDocument()
            Dim rootNode As Xml.XmlElement = formXML.CreateElement("result")
            formXML.AppendChild(rootNode)
            If HttpContext.Current.Request.Form.Count > 0 Then
                For Each formKey As String In HttpContext.Current.Request.Form.Keys
                    Try
                        Dim node As Xml.XmlElement = formXML.CreateElement(Xml.XmlConvert.EncodeName(formKey))
                        node.InnerText = Database.SqlEscapeInjection(HttpContext.Current.Request.Form(formKey))
                        rootNode.AppendChild(node)
                    Catch ex As Exception
                        LogError(order, ex, "Error getting post variables: {0}", ex.Message)
                    End Try
                Next

it looks like this:

[7/14/2016 6:26:18 AM]:
Order DEVORDER10000215: Error getting post variables: Object reference not set to an instance of an object.

Logging 'Exception':
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace:    at System.Xml.XmlNode.SplitName(String name, String& prefix, String& localName)
   at System.Xml.XmlDocument.CreateElement(String name)
   at Dynamicweb.eCommerce.Cart.CheckoutHandler.GetPostedInfo(Order order)

The Query String for the page looks like this:

    Item 7: [owin.RequestQueryString, ID=109&CheckoutHandlerOrderID=DEVORDER10000215&&Action=Approve&HostedPaymentID=%7B6A8C46F1-863C-4766-8EFD-7332DDC783C3%7D&ConfirmationID=343F7521-6362-486E-972A-A7CCA459C2B7&MaskedAccountNumber=424242XXXXXX4242&Token=6338BB24CF8C460D8DD5E31CA0D94D4E&ExpirationMonth=01&ExpirationYear=17&AccountType=Visa]


And the keys collection looks lke this:

        QueryString: (18) [System.Web.HttpValueCollection]
            AllKeys: [System.String[]]
            Count: 11
            Keys: [System.Collections.Specialized.NameObjectCollectionBase+KeysCollection]
            Item 0: 'ID'
            Item 1: 'CheckoutHandlerOrderID'
            Item 2: null
            Item 3: 'Action'
            Item 4: 'HostedPaymentID'
            Item 5: 'ConfirmationID'
            Item 6: 'MaskedAccountNumber'
            Item 7: 'Token'
            Item 8: 'ExpirationMonth'
            Item 9: 'ExpirationYear'
            Item 10: 'AccountType'


I think the double ampersand is causing the null key.

Any ideas?

Imar


Replies

 
Nicolai Høeg Pedersen
Reply

That is a bug, Bug TFS#24765 created and fixed, ready with next 8.8.1 hotfix.

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Wow, that was fast. 19 minutes between a report and a fix notification. Thanks!

Imar

 
Nicolai Høeg Pedersen
Reply

I should be having a F1-car !!

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Imar

A little later this was implemented in Dynamicweb version 8.9.0.0+ versions

To upgrade please choose this version from backend or download from here:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum