/plexo-dotnet

Plexo.net is a sync/async .NET Standard client for the Plexo API. (Official Library)

Primary LanguageC#GNU Affero General Public License v3.0AGPL-3.0

Plexo.Net

The official Plexo .NET library, supporting Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+.

Installation

Using the Package Manager

Install-Package Plexo.Net

Using the .NET Core command-line interface (CLI) tools

dotnet add package Plexo.Net

From Visual Studio

Open the Solution Explorer. Right-click on a project within your solution. Click on Manage NuGet Packages.... Click on the Browse tab and search for "Plexo.Net". Click on the Plexo.Net package, select the appropriate version and click Install.

Usage

Configuration

We provide an extension that you can easily add to your startup where your appsettings configuration will be automaticaly bind with the specified section.

services.AddPlexoClient(options => Configuration.GetSection("PlexoSettings").Bind(options));

PlexoSettings can be replaced with any custom name.

Optionally you can also set each property value manually.

services.AddPlexoClient(options =>
          {
              options.ClientName = "MyCommerce";
              options.CertificateName = "mycommerce_production";
              options.CertificatePassword = "R4ndomStr0ngPa$$word";
              options.GatewayUrl = "https://pagos.plexo.com.uy:4043/SecurePaymentGateway.svc";
          });

Required fields

  • ClientName Name of the client to configure
  • CertificateName Name of the certificate on the certificate store
  • CertificatePassword Password of the certicate
  • GatewayUrl Gateway endpoint for the selected environment (refer to available gateway endpoints)

Optional fields

  • CertificatePath Custom path to locate the certificate, must be relative to the project's root

Available gateway endpoints

Certificates

Plexo requires the use certificate signing on requests and responses, with is handled by the library for you.

Contact our support team and they will provide you with a PKCS#1 certificate (PFX) for the requested environment and assistance if required.

Automatic certificate provision

The current user personal store must contain a certificate with the value of CertificateName. As fallback the library will attempt to locate the certificate on a custom file path relative to the application's base path.

Windows

CurrentUser\My

Linux

/{currentUser}/.dotnet/corefx/cryptography/x509stores/my
/{currentUser}/.dotnet/corefx/cryptography/x509stores/root

Fallback (relative path)

Certificate/

Current limitations

  • No built-in support for automatic retries.
  • There's no support for multiple clients certificates on the same application.