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.

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?