Create the payment settings
To create payment settings for your payment processor, you must perform the following:
- Create a class to represent the payment settings.
In the folder for your custom payment processor, add a new class item.
- Make the class public.
Define the class to use the public access specifier.
- 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.)
- 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.
- 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:
- 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.