Own Payment Method

  • Payment methods are implemented as plugins in nopCommerce.
  • So actually a payment method is an ordinary plugin which implements an IPaymentMethod interface (Nop.Services.Payments namespace).
  • It contains some methods which are specific only for payment methods such as ProcessPayment() or GetAdditionalHandlingFee().
  • So add a new payment plugin project (class library) to solution and let's get started.

Payment processing.

  • Now you need to create a class which implements IPaymentMethod interface.
  • This is the class that will be doing all the actual work of communicating with your payment gateway.
  • When someone creates an order either the ProcessPayment or PostProcessPayment methods of your class will be called.
  • Here is how CashOnDeliveryPaymentProcessor class is defined ("Cash on delivery" payment method)
/// /// CashOnDelivery payment processor /// public class CashOnDeliveryPaymentProcessor : BasePlugin, IPaymentMethod {...

NopCommerce Blogs


What is plug in? Change behaviour or functionality of NopCommerce

Read More