Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Crowdy 35 posts 96 karma points
    22 days ago
    Paul Crowdy
    0

    Events Notification Handler

    Hi Matt,

    I am looking to implement a Notification Event Handler for when an order payment status moves to "Captured".

    So far the closest I have found is the OrderUpdatedNotification event with the following:

    if (evt.Order.OrderStatusCode == Vendr.Core.Models.OrderStatusCode.Ok && evt.Order.TransactionInfo.PaymentStatus.HasValue && evt.Order.TransactionInfo.PaymentStatus.Value == Vendr.Core.Models.PaymentStatus.Captured)

    But how can I prevent anything within that if statement from firing again if the order is updated? Am I using the wrong event?

    Thanks again,

    Paul.

  • Matt Brailsford 3041 posts 15765 karma points MVP 7x c-trib
    21 days ago
    Matt Brailsford
    1

    Hi Paul,

    You might be better off using the OrderTransactionUpdatedNotification which is fired whenever the transaction information of an order changes, including the payment status.

    The event should provide a PaymentStatus property which has a From and To value on it so you can see what the status is changing from and to. You can then use this to ensure your event only triggers it's behavior when moving between specific payment statuses (ie, moving from Authorized to Captured.

    Hope this helps

    Matt

  • Paul Crowdy 35 posts 96 karma points
    20 days ago
    Paul Crowdy
    0

    Thanks Matt - that sounds like what I was looking for!

Please Sign in or register to post replies

Write your reply to:

Draft