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.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?