Open puresystems opened 4 years ago
Hmmm... DNN should not have a direct impact on this extension point.
Agreed, it doesn't make much sense.
We're looking to rebuild our PaymentGateway code against HC 3.4.1 to test further and one issue is that this helper is now missing:
var HccApp2 = HccAppHelper.InitHccApp();
It's obviously depreciated but what can we use instead? We are using it to find the HC order which we're processing payment for using this:
var results = HccApp2.OrderServices.Orders.FindByCriteria(new OrderSearchCriteria()
{
OrderNumber = t.MerchantInvoiceNumber
});
var order = HccApp2.OrderServices.Orders.FindForCurrentStore(results[0].bvin);
Here is one way to get it:
Here is the other way to get it, which may be more relevant to your use case:
Thanks for the pointers.
We've retested on a working version of the site (Dnn 9.3.2) which was on HC 3.2.3 and upgraded to HC 3.4.1 and the CustomProperties value is being lost once it leaves our custom PaymentGateway. We can pause the code after we add the custom property and check the Order table and the CustomProperties field contains our new value.
But once it leaves and completes, the CustomProperties field reverts back to it's previous state.
So in this isntance we have left Dnn on 9.3.2 and only upgraded HC. It's as if the code after our Payment Gateway is using a cached version of the Order and so is missing our new custom property.
Thanks, Dan. We'll look into this as soon as we can. :)
Describe the bug
When using order.CustomProperties.SetProperty or order.CustomProperties.Add in a PaymentGateway CreateCharge method, calling HccApp.OrderServices.Orders.Update(order) will update the corresponding xml in the CustomProperties field in the hcc_Order table correctly.
We would then access this CustomProperty from the OrderPaid: OrderTask class in the PaymentProvider via context.Order object.
But if we upgrade Dnn to v9.4.4 or above this functionality now fails at some point after leaving the our PaymentGateway code and hitting our PaymentProvider code. The hcc_order.CustomProperties database field is still updated correctly in the CreateCharge method when we call HccApp.OrderServices.Orders.Update(order), but once it hits our OrderPaid: OrderTask class, the order has lost this CustomProperty and checking the database field confirms this. So something is updating the database field without our CustomProperty.
Is this something which you are able to replicate? Should we be using a different way of updating CustomProperties?
Software Versions
To Reproduce
Steps to reproduce the behavior:
var prop = context.Order.CustomProperties.GetProperty(DEVELOPERID, "xref");
This should retrieve the CustomProperty from the order. But after the Dnn upgrade, at this stage the CustomProperty has been removed from the CustomProperties field in the hcc_Order database table.