This document is a guide for developers to the payment plugins of GrandNode. Payment plugins allow to use external payment infrastructure to pay for cart items requested by enduser.
PaymentController inherits from BasePaymentController
Its declaration is pretty simple, it requires only 2 Actions to be implemented – one for getting payment info, second for validation
Let’s look at a simple Payment Plugin Controller’s Actions
GET and POST Configure()
for changing Settings (ConfigurationModel) in admin\configuration
after user press continue in 4 section of Checkout, here is passed FormCollection with user input you can define your
own logic what to do with received values inside FormCollection
returns .cshtml with ViewModel (custom form and information for endcustomer)
gets usually a FormCollection and validate it, returns IList<string> warnings
Other Payment Plugins can have more Actions, mostly depending on Provider Logic (PayPal, IPay, Przelewy24)
Sometimes Controller can contain custom Actions depending on provider’s business logic, e.g. PayPal can make request to your app and return you result (success or denied) of transaction
In this case, you have to register routes
Processor exists as mechanism that allows the plugin to be installed (adding locale string resources) and used by application.
It inherit from BasePlugin abstract, and IPaymentMethod interface.
IPaymentMethod interface is pretty complex but to get it work, only few of its Methods must be implemented.
The essential (a must) are
changes status to PaymentStatus.Pending
returns typical payment info (credit card type, number, expiration etc.)
among other custom things
And optional Methods and Properties are (you can implement these to get extra behavior of your payment plugin)
The standard (as in other plugins) are