Plugin Implementation

Create a new class library using the following naming convention:
Apaya.Connector.Clients.[ConnectorName] - ConnectorName is the connector name agreed upon with the Apaya team.
Make sure to base your project on .NET 5.0/6.0 class Library. After installing the Core library NuGet package, and after identifying the type of action that will be implemented, reference the NuGet package in your code. Create a new class, and make sure to extend the action you want to develop.
The connector plugin should implement the relevant actions requested by Apaya, linking into the corresponding integration methods from the Connector. See the downloadable for an example plugin.

Example: public class MyService : IProcessPaymentAction

At the top of the class, make sure you have the needed configurations defined, since these values will be validated in the following section:
protected string Connector => "[ConnectorName]";
protected string[] RequiredMerchantConfigKeys => new[] {/* Insert your required merchant configuration keys here, if any */};
protected string[] RequiredProductConfigKeys => new string[] {/* Insert your required product configuration keys here, if any */};

Implement the missing members from the interface. This will create a new function in your code, which looks something like the following:
public Task<ProcessPaymentResponse> ProcessPaymentAsync(ProcessPaymentRequest request, AvailableConnectorConfiguration configuration, CancellationToken cancellationToken)
{
throw new System.NotImplementedException();
}

This will define how to proceed with your code implementation.
To allow Apaya to identify this action, we need to create a Resolver class which extends the interface of the action resolver, provided in this NuGet package. In this example, we will extend the IProcessPaymentActionResolver.
This new resolver class, in the GetHandler() function, needs to return the implementation of the action developed by the third-party.
Example:
public class ProcessPaymentActionResolver : IProcessPaymentActionProvider
{
public IProcessPaymentAction GetHandler()
{
return new ProcessPaymentAction();
}
}

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.