Create the payment settings

  • Username
  • Password

To create payment settings for your payment processor, you must perform the following:

  1. Create a class to represent the payment settings.
    In the folder for your custom payment processor, add a new class item.
  2. Make the class public.
    Define the class to use the public access specifier.
  3. Implement the IPaymentSettings interface.
    The IPaymentSettings interface requires the following properties:
    • string[] ProcessorCards
      Gets or sets an array containing the supported credit cards.
    • string PaymentType
      Gets or sets the type of the payment. (sale, authorize, capture, authorize and capture, etc.)
  4. Create the following properties:
    • string ProcessingMode
      Gets or sets whether the payment method is in live or test mode. The possible values for this property are “test” and “live”.
    • bool TestMode
      Returns true if the value of the ProcessingMode property is equal to “test”.
    • double Timeout
      Gets or sets the timeout for post to the payment processor.

      NOTE: If you intend not to use test and live properties, you can skip the ProcessingMode and the TestMode properties. In this case you have to skip their representation in the configuration control too. For more information about the configuration control, see For developers: Create the settings control.

  5. Create the payment processor specific properties.
    Create properties for the values required by the payment processor. It is recommended to create properties for both live and test values:
    • TestUsername and LiveUsername
    • TestPassword and LivePassword

      NOTE: If you intent not to use only live properties, create only one set of these properties and remove the prefixes from their names.

  6. Create wrapper properties.
    Create wrapper properties that return the value of either the test or the live property based on the value of the TestMode property. This allows you to easily access the value of the needed property for the specified mode.

Following is a code example of a CustomPaymentProcessorSettings class.

NOTE: Make sure that you set the CustomPaymentProcessorSettings class as a public class.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?