Handle a Successful Payment of an Item or Items

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hey guys, new to Nop development here, I need to trap a successful payment for an item and then fire off a call to another API (external to NOP) so that the shipping team can be notified, etc.  via another Web API....  I took a look at the Nop dev docs but wasn't sure of the type of IPlugin to inherit from?  IPaymentMethod or IMiscPlugin?    2nd part to that is - is there a hook of some sort to know when an item was successfully purchased?
4 years ago
You can raise an event of OrderPaidEvent. Check here for example.
4 years ago
bbqchickenrobot wrote:
  I took a look at the Nop dev docs but wasn't sure of the type of IPlugin to inherit from?  IPaymentMethod or IMiscPlugin?  

IPaymentMethod  is required when you are developing a payment method plugin. You can just inherit the abstract class BasePlugin and override the install and unistall method in your plugin class and use event handler OrderPaidEvent to perform the functionality you want after the order is paid.
4 years ago
You do not want to " raise an event of OrderPaidEvent", you want to handle it.

This is old, but the concept should still apply (may just need to change some code to be compatible with your nopCommerce version)  :
https://www.nopcommerce.com/boards/topic/24186/orderpaidevent-handling


Also you want to use IMiscPlugin.  Your plugin is not a PaymentMethod, it's an event handler.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.