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.
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.
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.
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.
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?
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.
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.
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
Sounds like we should be listening to the PaymentStateChanged event. Thanks.
is working on a reply...