Knowledge BasePayment Methods and PSP Gateway

Payment Methods and PSP Gateway

Sana Commerce 8.3
Your provider


Below you can find the classes diagram of the payment library:

Classes Diagram
Classes dealing with payment pipelines that have been left out for the sake of clarity, they will be explained in another chapter below: Pipelines.
The Payment Service class is the entry point for all payments. It contains two important methods:
Method Description
StartPayment Start any payment of the order, the payment module to use can be supplied in the parameters. A payment should always be started by this method.
CreatePaymentModule Creates a new payment module class of the supplied payment module Id (as set in the configuration).
Next there are two classes dealing with configuration of payment methods. The most important of this is the 'ConfigurationPaymentModuleCreator'. This class is used indirectly when creating a concrete implementation of any payment module. It will create the module based on the configuration of the module in the 'web.config'. But this class can be customized easily to create a payment module from different sources like a database or a text-file.
The library also contains utilities containing common task like logging, creating payment modules and information about payment status.
  • PaymentLog: Logging of any message or errors that occur during the payment process;
  • PaymentStatus:  Enumeration containing all payment status used in the system for easy reference;
  • PaymentModuleCreator: Creates concrete implementations of payment modules using reflection.
Finally the payment library contains some 'standard' implementations of payment modules.  It is important to note that there is a distinction between two types of payment modules:
External payment modules: These modules make use of a payment service provider. Payment will be done on the page of the PSP and will span multiple pages/requests.
Internal payment modules: These can be used for all other types of payments. In the most common cases they will be completely handled by the commerce framework in a single request and are a little less complex than external payment modules.
The options available and the way payment should be implemented depend heavily on the type of a payment module.
Knowledge BasePayment Methods and PSP Gateway