CarrotCat.PosVelocityDotnet
0.0.2-beta
Prefix Reserved
dotnet add package CarrotCat.PosVelocityDotnet --version 0.0.2-beta
NuGet\Install-Package CarrotCat.PosVelocityDotnet -Version 0.0.2-beta
<PackageReference Include="CarrotCat.PosVelocityDotnet" Version="0.0.2-beta" />
<PackageVersion Include="CarrotCat.PosVelocityDotnet" Version="0.0.2-beta" />
<PackageReference Include="CarrotCat.PosVelocityDotnet" />
paket add CarrotCat.PosVelocityDotnet --version 0.0.2-beta
#r "nuget: CarrotCat.PosVelocityDotnet, 0.0.2-beta"
#:package CarrotCat.PosVelocityDotnet@0.0.2-beta
#addin nuget:?package=CarrotCat.PosVelocityDotnet&version=0.0.2-beta&prerelease
#tool nuget:?package=CarrotCat.PosVelocityDotnet&version=0.0.2-beta&prerelease
PosVelocityDotnet
v0.0.1-beta
Please review LICENSE
file before using this library.
What is PosVelocityDotnet?
PosVelocityDotnet is a API client that provides comprehensive and convenient way to make requests with PosVelocity API.
Compatibility
PaymentGatewayDotnet is .NET Standard 2.0 library. You can check .NET Standard 2.0 compatibility with your version of .NET on this page
How to get Started?
- Install
CarrotCat.PosVelocityDotnet
nuget package via package manager or command
dotnet add package CarrotCat.PaymentGatewayDotnet
- Add
IPosVelocityApiClient
service as typed or named HttpClient.
Here is an example how to add it as typed HttpClient:
// Register Service
builder.Services.AddScoped<IPosVelocityApiClient, PosVelocityApiClient>(); // Transient, Scoped, or Singleton as needed.
// Register HttpClient with settings
builder.Services.AddHttpClient<IPosVelocityApiClient, PosVelocityApiClient>((serviceProvider, client) =>
{
client.BaseAddress = new Uri("https://sandbox.posvelocity.com"); // or https://semi.posvelocity.com for production API
});
Usage
Inject the API client to your controller or service:
public class Foo{
private readonly IPosVelocityApiClient _posVelocityApiClient;
public Foo(IPosVelocityApiClient posVelocityApiClient)
{
_posVelocityApiClient = posVelocityApiClient;
}
//ToDo: Implement rest of the class methods
}
You can now use it in your class:
var auth = new PosVelocityAuthParameters("your-api-key");
var device = new PosVelocityDeviceTarget(
"terminal-serial",
PosVelocityDeviceReferenceType.Serial
);
var request = new PaymentTransactionRequest(
amount: 1.01m,
new PaymentOptions(capture: true),
final: true,
external: "123");
PosVelocityResult<PaymentResponse> response = await _posVelocityApiClient.ProcessPaymentTransactionAsync(auth, device, request, pos: null, timeout: 60);
Requests
There are some API requests that are not supported by this API client yet. Unsupported requests are marked as Obsolete
with specific reason provided. If you try to use those methods, you will encounter NotImplementedException
and again the specific reason will be provided.
Currently the unsuported list is:
- GetPrintersAsync
- GetAccountTransactionsAsync
- GetPaymentReceiptAsync
- GetCustomerInputAsync
Results
API results are wrapped in PosVelocityResult<T>
object which is basic implementation of the result pattern. Within this object you will have the IsError
and IsSuccess
flags, and either TransactionError
or response data value of type T
PosVelocityResult<PaymentResponse> result = await _posVelocityClient.ProcessPaymentTransactionAsync(auth, device, request);
if (result.IsError)
{
// do error handling
var error = result.Error;
_logger.LogError(error.Message);
}
// do successful result handling
PaymentResponse response = result.Value;
Note: This client will catch and process JSON deserialization exceptions, but not HttpClient
exceptions. Do implement exceptions handling as reqiured by your project.
Contributors
Versions and Changes
v0.0.1
- Initial release
- Implemented most of the endpoints
v0.0.2
- Extended Options object in Payment Request to accommodate braking changes introduced within the same API version. Also added default values to avoid bracing changes in this library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.0.2-beta | 72 | 7/4/2025 |
0.0.1-beta | 68 | 5/30/2025 |