Copied to clipboard

Flag this post as spam?

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


  • Sean Dooley 260 posts 447 karma points
    1 week ago
    Sean Dooley
    0

    Best way to track when payment has been successful

    We are building an e-learning platform and looking to use TeaCommerce for the handling the e-commerce functionality. Part of the scope is to trigger an event when a payment has been successful.

    Looking at the documentation, https://docs.teacommerce.net/3.3.2/api/events/#net-events, there maybe a few options. For example

    NotificationCenter.Order.Finalizing/Finalized NotificationCenter.Order.PaymentStateChanging/Changed NotificationCenter.Order.OrderStatusChanging/Changed

    Would appreciate any advice on which event would be best?

    • Umbraco 7.15.3
    • TeaCommerce 3.3.3
  • Matt Brailsford 2298 posts 11151 karma points MVP 6x c-trib
    1 week ago
    Matt Brailsford
    100

    Hey Sean,

    There are couple of options for sure. I think the key question is what is your definition of successful payment?

    There are 2 events that would be useful depending on this.

    1. Finalized will fire when a checkout is complete and the payment provider has run and successfully completed, however depending on the configuration of the payment provider, this could just be an "Authorized" payment and so actual payment may not yet have been transferred.

    2. PaymentStateChanged will fire when the state of a transaction changes and so if you want to know when money has actually transferred, you could listen for the payment state changing to "Captured".

    These will be the events you want to work with, but as I say, it depends on your definition as to which will be the best option for you.

    Hope this helps

    Matt

  • Sean Dooley 260 posts 447 karma points
    1 week ago
    Sean Dooley
    0

    Sounds like we should be listening to the PaymentStateChanged event. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft