Query payment processor providers

The topic contains the following: 

  • Querying payment processor providers by name
  • Querying payment processor providers by ID
  • Querying all payment processor providers

Querying payment processor providers by name

To set the PaymentProcessorId property of the payment method, you have to query the desired payment processor provider and use its ID. In the Ecommerce module there are the following payment processor providers:

  • Authorize.Net
  • Sage pay
  • Payflow Pro

To get the Id of the provider you must first get an instance of its provider settings. This is done by the name of the provider. Here is a list of the names of the providers:

  • Authorize.Net – AUTHNETAIM
  • Sage pay – SAGEPAY
  • Payflow Pro – PAYFLOWPRO

To get the provider by name, you must perform the following:

  1. Get the payment processors section.
    To do this, call the Get method of the Config class and pass the PaymentProcessorConfig type as the generic argument.
  2. Get the specified payment processor provider.
    To do this, filter the Values collection of the section by the name of the provider.
Here is a code example:

Querying payment processor providers by ID

For example, when deserializing the payment processor settings, you need to get an instance of the payment processor provider. In this case you have the ID of the provider stored in the PaymentProcessorId property of the payment method instance.

To get the payment processor provider by ID, you must perform the following:

  1. Get the payment processors section.
    To do this, call the Get method of the Config class and pass the PaymentProcessorConfig type as the generic argument.
  2. Get the specified payment processor provider.
    To do this, filter the Values collection of the section by the ID of the provider.

Here is a code example:

Querying all payment processor providers

To query all payment processor providers you must perform the following:

  1. Get the payment processors section.
    To do this, call the Get method of the Config class and pass the PaymentProcessorConfig type as the generic argument. .
  2. Get the payment processor providers.
    The payment processor providers are stored in the Values collection of the section.
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?