WomPlatform.Connector
4.4.5
dotnet add package WomPlatform.Connector --version 4.4.5
NuGet\Install-Package WomPlatform.Connector -Version 4.4.5
<PackageReference Include="WomPlatform.Connector" Version="4.4.5" />
paket add WomPlatform.Connector --version 4.4.5
#r "nuget: WomPlatform.Connector, 4.4.5"
// Install WomPlatform.Connector as a Cake Addin
#addin nuget:?package=WomPlatform.Connector&version=4.4.5
// Install WomPlatform.Connector as a Cake Tool
#tool nuget:?package=WomPlatform.Connector&version=4.4.5
WOM platform connector for .NET
.NET Standard connector to the WOM platform.
Installation
Install via NuGet:
dotnet add package WomPlatform.Connector
Guide
The connector must be used through its main WomPlatform.Connector.Client
class. A new instance can be constructed as follows:
var client = new Client("dev.wom.social", new LoggerFactory());
where dev.wom.social
is the WOM platform domain to use and LoggerFactory
is an implementation of the standard Microsoft.Extensions.Logging.ILoggerFactory
interface that allows you to log events from the connector.
Using an instrument to generate WOM vouchers
Once you have a client, you can use it to create a WOM instrument.
AsymmetricCipherKeyPair keys = null;
using(var fs = new FileStream("PATH-TO-PRIVATE-KEY", FileMode.Open)) {
using(var txReader = new StreamReader(fs)) {
var reader = new PemReader(txReader);
keys = reader.ReadObject() as AsymmetricCipherKeyPair;
}
}
var instrument = client.CreateInstrument("YOUR-SOURCE-ID", keys.Private);
where PemReader
is the Bouncy Castle PEM reader (Org.BouncyCastle.OpenSsl
namespace) that allows you to read the private key text file.
Once the instrument is constructed, you can use it to create a voucher generation request:
var response = await instrument.RequestVouchers(new VoucherCreatePayload.VoucherInfo[] {
new VoucherCreatePayload.VoucherInfo {
Aim = "E",
Count = 100,
Latitude = 43.72621,
Longitude = 12.63633,
Timestamp = DateTime.UtcNow
}
});
return (response.OtcGen, response.Password, response.Link);
You can supply any number of VoucherCreatePayload.VoucherInfo
to the voucher generation request, each of which can contain different voucher parameters.
Each single VoucherCreatePayload.VoucherInfo
can specify the voucher's Aim (a string identifying the instrument's aim that is being rewarded), the Count of vouchers, the coordinates (Latitude and Longitude) and the Timestamp (vouchers can be generated for past contributions).
The response contains three fields: OtcGen (the unique one-time code expressed as a GUID value), Password (the PIN code that must be displayed to the user in order to retrieve the vouchers), and the Link (an URL identifying the voucher generation, which can be presented to the user as a link or as a QR Code).
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. |
.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
- Microsoft.Extensions.Logging (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- Portable.BouncyCastle (>= 1.9.0)
- RestSharp (>= 106.15.0)
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 | |
---|---|---|---|
4.4.5 | 213 | 8/22/2023 | |
4.4.4 | 178 | 7/13/2023 | |
4.4.3 | 444 | 7/18/2022 | |
4.4.2 | 426 | 7/18/2022 | |
4.4.1 | 446 | 7/18/2022 | |
4.4.0 | 487 | 3/7/2022 | |
4.3.1 | 349 | 11/17/2021 | |
4.3.0 | 314 | 11/15/2021 | |
4.2.3 | 333 | 7/21/2021 | |
4.2.2 | 355 | 7/13/2021 | |
4.2.1 | 594 | 8/8/2020 | |
4.2.0 | 602 | 8/8/2020 | |
4.1.0 | 410 | 7/31/2020 | |
4.0.0 | 428 | 7/31/2020 | |
3.0.0 | 613 | 4/3/2020 | |
2.1.1 | 456 | 3/19/2020 | |
2.1.0 | 494 | 3/18/2020 | |
2.0.3 | 447 | 2/25/2020 | |
2.0.2 | 511 | 2/25/2020 | |
2.0.1 | 434 | 2/25/2020 | |
2.0.0 | 476 | 2/24/2020 | |
1.0.0 | 490 | 11/12/2019 | |
0.1.1 | 486 | 10/2/2019 | |
0.1.0 | 476 | 9/20/2019 |