Developer forum

Forum » CMS - Standard features » Authorize.net orders with empty state

Authorize.net orders with empty state

Rui Silva
Reply

I’ve some customers using the Authorize.net payment provider and the orders completed with this provider do not get a proper state id in the end. The field becomes empty, and after some digging in the sources we found that this seems to be related to the fact that Authorize.net does not use the base class method SetOrderComplete, instead it has is own version of it. The base class method uses a method in the order UpdateCartToOrder and Authorize.net the does not make this.

We have confirmed this behavior in versions 9.3.13 and 9.4.6.


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

The issue is reproduced as well as for Authorize.net AIM provider in fact. New TFS 48325, 48326 have been created against the bug, will be fixed on further DW hotfix/release. Thanks for observing.

BR, Oleg QA

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Not sure if you already saw this, but i earlier research we found the following information on this issue that might help:

The Authorize.net provider has this:

        private new void SetOrderComplete(Order order)
        {
            if (!order.Complete)
            {
                // Set complete
                order.Complete = true;
                order.SaveOrderComplete(true);
            }
        }

Notice the new keyword (yuck).

Other gateways, such as Stripe, don’t have this method but instead call the one in the base:

SetOrderComplete(order);

Which does this:

        Protected Sub SetOrderComplete(ByVal order As Order)
                …
            If Frontend.KeepOrderInContext Then
                order.UpdateCartToOrder(order.ID)
               …

Which does this:

Friend Sub UpdateCartToOrder(NewOrderID As String)
                …
            SetDefaultState()

which does this:

       Friend Sub SetDefaultState()
            Dim flow As OrderFlow
            If String.IsNullOrEmpty(ShopID) Then
                flow = OrderFlow.GetDefault()
            Else
                Dim sh As eCommerce.Shops.Shop = eCommerce.Common.Application.Shop(ShopID)
                flow = New OrderFlow(sh.OrderFlowID)
            End If

           Dim states As OrderStateCollection = OrderState.getDefaultOrderstate(flow.ID)
           If states.Count > 0 Then
                StateID = states.Item(0).ID
                Database.ExecuteNonQuery(String.Format("UPDATE EcomOrders SET OrderStateID = '{0}' WHERE OrderID = '{1}'", StateID, Me.ID), "Ecom.mdb")
                NotifyOrderStateChanged()
            End If
        End Sub

So it seems that in case of Authorize.net no call is made to set the default order state as it overwrites (using new) the method in the base class.

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Rui

The problem regarding #48326+#48325 "Authorize.net AIM orders with empty state" has now been resolved in Dynamicweb version 9.4.8

To upgrade please choose this version from download 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

Votes for this answer: 1
 
Rui Silva
Reply

Hi Kristian,

Thanks for the update. Can you confirm if the fix will be available for 9.3.x branch?

Thanks,

Rui Silva

 

You must be logged in to post in the forum