PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 5/15/2018 12:24 PM by  Will Strohl
Access to custom Order properties from PaymentGateway
 1 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages





New Member






--
5/3/2018 12:07 PM
    Hi, using HC 1.8.7.

    We have an issue where by an occasional order has a status of paid when in fact it hasn't been paid for so our workflow tasks are processing the order based on the status. We can't find a reason for this, it's not hitting the payment gateway so something is going wrong before that but it's only about once in 100 transactions.

    So we wanted to set a custom order property from the PaymentGateway code like so:

    var order = HccApp.OrderServices.Orders.FindForCurrentStore(bvin);
    order.CustomProperties.Add(DEVELOPERID, "xref", "referencecodehere");
    HccApp.OrderServices.Orders.Update(order);

    This works ok but when we access the order from the OrderTask via the OrderTaskContext or by loading it in again as above, the CustomProperty isn't there.

    The reason we're looking at doing this is so that we know a transaction has been successful as we'll record the reference from the payment gateway and use this to double check an order has been paid for along with the current OrderPaymentStatus.Paid status check.

    Thanks
    Dan





    Veteran Member






    --
    5/15/2018 12:24 PM
    The code you pasted looks okay. The key is to update the order after you update any properties it has. Are you able to verify the value is there when you look at the order in the database?

    Outside of that, I highly suggest that you upgrade to the latest version (which is 3.2 as of today), or at least to version 01.10.04. This may be a bug since this is such an old release.
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes
    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: