Create payment methods

This topic contains the following:

  • Creating a payment method that uses a payment processor
  • Creating an offline payment method

For more information about payment processor and payment processor settings, see the For developers: Payment processors section.

Creating a payment method that uses a payment process

To create a payment method that uses a payment processor, you must perform the following:

  1. Get the orders manager.
    Get an instance of the OrdersManager object.
  2. Create new payment method.
    To create a new payment method, call the CreatePaymentMethod method of the orders manager.
  3. Set the properties of the payment method.
    In this example the following properties of the PaymentMethod instance are set:
    • Title
      Gets or sets the title of the payment method.
    • PaymentMethod
      Gets or sets whether the payment is offline or uses payment processor. In this example the property is set to PaymentMethodType.PaymentProcessor.
    • Description
      Gets or sets the description of the payment method.
    • IsActive
      Specifies whether the payment method is active and can be used.
  4. Set the payment processor.
    To set the payment processor, you must perform the following:
    1. Set the ID of the processor.
      For more information about how to get the ID of one of the available payment processor providers, see For developers: Query payment processor providers.
    2. Set the processor settings.
      For the PaymentProcessorSettings property, you must specify a string in JSON format. For more information how to create settings for the different payment processors, see the For developers: Payment processors section.
  5. Save the changes.
    Save the changes to the orders manager.
Here is a code example:


Creating an offline payment method

To create an offline payment method, you must perform the following:

  1. Get the orders manager.
    Get an instance of the OrdersManager object.
  2. Create new payment method.
    To create a new payment method, call the CreatePaymentMethod method of the orders manager.
  3. Set the properties of the payment method.
    In this example the following properties of the PaymentMethod instance are set:
    • Title
      Gets or sets the title of the payment method.
    • PaymentMethod
      Gets or sets whether the payment is offline or uses payment processor. In this example the property is set to PaymentMethodType.Offline.
    • Description
      Gets or sets the description of the payment method.
    • IsActive
      Specifies whether the payment method is active and can be used.
  4. Save the changes.
    Save the changes to the orders manager.
Here is a code example:


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

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to 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?