Create a payment provider class

The payment provider is the most important part of a payment plugin and implements the main functions of a payment method. A plugin can contain any number of payment providers and thus any number of payment methods. The provider should inherit from class PaymentMethodBase and optionally from IConfigurable. Decorate the provider with required attributes:

Example:

[SystemName("Payments.PayoneCreditCard")]
[FriendlyName("Payone credit card")]
[DisplayOrder(10)]
[DependentWidgets("Widgets.Payone")]
public class CreditCardProvider : PaymentMethodBase

Develop the core implementation of your payment method by overriding the properties and methods of PaymentMethodBase

Properties of PaymentMethodBase

Values of PaymentMethodType

Methods of PaymentMethodBase

Values of PaymentStatus

Create a payment controller

Create a controller class and inherit from PaymentControllerBase. Add an action method PaymentInfo that returns a partial view with information about your payment method displayed in checkout payment list. Optional (if required): Add endpoints for the payment gateway of your payment method. For instance IPN (instant payment notification) should be handled here.

Methods of PaymentControllerBase

Tips & Tricks

Add order notes for each data exchange you have with the payment gateway. This allows the merchant to track which and when data has been exchanged with the payment provider.

Log all errors (in detail) that occurred while exchange data with the payment gateway. This information makes it easier for the payment provider's support to determine the cause of a payment problem.

Optionally store and use payment indentifiers on order level:

These identifiers are displayed on the order page in the backend, but they are not further processed or used in any other way by SmartStore.NET.

Add order notes for each IPN (instant payment notification) you receive from the payment gateway. Set HasNewPaymentNotification of the order entity to true if you receive a new IPN. A small info badge appears in the order list indicating that a new IPN has been received for this order.

If required, use the entity GenericAttribute (with KeyGroup set to Order) to store any extra payment data for an order. Typically the payment data is JSON serialized in this case.