TransferZero.Sdk
1.0.0
See the version list below for details.
dotnet add package TransferZero.Sdk --version 1.0.0
NuGet\Install-Package TransferZero.Sdk -Version 1.0.0
<PackageReference Include="TransferZero.Sdk" Version="1.0.0" />
paket add TransferZero.Sdk --version 1.0.0
#r "nuget: TransferZero.Sdk, 1.0.0"
// Install TransferZero.Sdk as a Cake Addin
#addin nuget:?package=TransferZero.Sdk&version=1.0.0
// Install TransferZero.Sdk as a Cake Tool
#tool nuget:?package=TransferZero.Sdk&version=1.0.0
TransferZero.Sdk - the C# library for the TransferZero API
TransferZero API
- API version: 1.0
Reference documentation for the TransferZero API V1
For more information, please visit:
This .NET SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
Frameworks supported
- .NET 4.5 or later
- .NET Core >=2.0
Dependencies
- RestSharp - 105.1.0 or later
- Json.NET - 10.0.3 or later
- JsonSubTypes - 1.2.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Installation
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using TransferZero.Sdk.Api;
using TransferZero.Sdk.Client;
using TransferZero.Sdk.Model;
Packaging
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out TransferZero.Sdk.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
Getting Started
Please follow the installation instruction.
You can find examples in the examples
directory on the features required by the Onboarding documentation for the following languages:
- C# on .NET 4.5
- VB.NET on .NET 4.5
- C# on .NET Core 2.0
Webhooks
To parse webhooks you can use the following snippet:
C#
string webhookContent = "<data from webhook>";
string url = "<url of the webhook endpoint>";
Dictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("Authorization-Nonce", "<nonce from webhook headers>");
headers.Add("Authorization-Signature", "<signature from webhook headerse>");
headers.Add("Authorization-Key", "<key from webhook headers>");
if (configuration.ValidWebhookRequest(url, webhookContent, headers)) {
Webhook webhook = configuration.ParseString<Webhook>(webhookContent);
if (webhook.Event.StartsWith("transaction"))
{
TransactionWebhook transactionWebhook = configuration.ParseString<TransactionWebhook>(webhookContent);
System.Console.WriteLine(transactionWebhook);
}
else if (webhook.Event.StartsWith("recipient"))
{
RecipientWebhook recipientWebhook = configuration.ParseString<RecipientWebhook>(webhookContent);
System.Console.WriteLine(recipientWebhook);
}
else if (webhook.Event.StartsWith("sender"))
{
SenderWebhook senderWebhook = configuration.ParseString<SenderWebhook>(webhookContent);
System.Console.WriteLine(senderWebhook);
}
else if (webhook.Event.StartsWith("document"))
{
DocumentWebhook documentWebhook = configuration.ParseString<DocumentWebhook>(webhookContent);
System.Console.WriteLine(documentWebhook);
}
else if (webhook.Event.StartsWith("payout_method"))
{
PayoutMethodWebhook payoutMethodWebhook = configuration.ParseString<PayoutMethodWebhook>(webhookContent);
System.Console.WriteLine(payoutMethodWebhook);
}
}
VB.NET
Dim webhookContent As String = "{<data from webhook>}"
Dim url As String = "<url of webhook request>"
Dim headers As Dictionary(Of String, String) = New Dictionary(Of String, String)()
headers.Add("Authorization-Nonce", "<nonce from webhook headers>")
headers.Add("Authorization-Signature", "<signature from webhook headers>")
headers.Add("Authorization-Key", "<key from webhook headers>")
If configuration.ValidWebhookRequest(url, webhookContent, headers) Then
Dim webhook As Webhook = configuration.ParseString(Of Webhook)(webhookContent)
If webhook.[Event].StartsWith("transaction") Then
Dim transactionWebhook As TransactionWebhook = configuration.ParseString(Of TransactionWebhook)(webhookContent)
System.Console.WriteLine(transactionWebhook)
ElseIf webhook.[Event].StartsWith("recipient") Then
Dim recipientWebhook As RecipientWebhook = configuration.ParseString(Of RecipientWebhook)(webhookContent)
System.Console.WriteLine(recipientWebhook)
ElseIf webhook.[Event].StartsWith("sender") Then
Dim senderWebhook As SenderWebhook = configuration.ParseString(Of SenderWebhook)(webhookContent)
System.Console.WriteLine(senderWebhook)
ElseIf webhook.[Event].StartsWith("document") Then
Dim documentWebhook As DocumentWebhook = configuration.ParseString(Of DocumentWebhook)(webhookContent)
System.Console.WriteLine(documentWebhook)
ElseIf webhook.[Event].StartsWith("payout_method") Then
Dim payoutMethodWebhook As PayoutMethodWebhook = configuration.ParseString(Of PayoutMethodWebhook)(webhookContent)
System.Console.WriteLine(payoutMethodWebhook)
End If
End If
Documentation for Authorization
You can set the API Key and Secret on the Configuration object for authentication:
C#
Configuration configuration = new Configuration();
configuration.ApiKey = "<key>";
configuration.ApiSecret = "<secret>";
configuration.BasePath = "https://api-sandbox.transferzero.com/v1";
VB.NET
Dim configuration As Configuration = New Configuration()
configuration.ApiKey = "<key>"
configuration.ApiSecret = "<secret>"
configuration.BasePath = "https://api-sandbox.transferzero.com/v1"
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- JsonSubTypes (>= 1.2.0)
- NewtonSoft.Json (>= 10.0.3)
- RestSharp (>= 105.1.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 |
---|---|---|
1.34.4 | 93 | 4/11/2024 |
1.34.3 | 186 | 3/6/2024 |
1.34.2 | 107 | 2/22/2024 |
1.34.1 | 88 | 2/5/2024 |
1.34.0 | 79 | 1/25/2024 |
1.33.2 | 94 | 1/16/2024 |
1.33.1 | 136 | 11/24/2023 |
1.33.0 | 119 | 11/6/2023 |
1.32.1 | 96 | 10/31/2023 |
1.32.0 | 91 | 10/30/2023 |
1.31.0 | 129 | 10/24/2023 |
1.30.3 | 129 | 10/24/2023 |
1.30.2 | 119 | 10/20/2023 |
1.30.1 | 127 | 10/9/2023 |
1.30.0 | 107 | 10/2/2023 |
1.29.1 | 155 | 8/16/2023 |
1.29.0 | 124 | 8/2/2023 |
1.28.2 | 139 | 7/20/2023 |
1.28.1 | 144 | 7/10/2023 |
1.28.0 | 151 | 7/5/2023 |
1.27.9 | 126 | 6/23/2023 |
1.27.8 | 137 | 6/15/2023 |
1.27.6 | 137 | 6/9/2023 |
1.27.5 | 136 | 5/12/2023 |
1.27.3 | 177 | 4/20/2023 |
1.27.1 | 493 | 3/28/2023 |
1.27.0 | 211 | 3/23/2023 |
1.26.1 | 229 | 3/6/2023 |
1.25.0 | 233 | 2/17/2023 |
1.24.0 | 251 | 2/3/2023 |
1.23.5 | 279 | 1/19/2023 |
1.23.4 | 329 | 12/1/2022 |
1.23.3 | 321 | 11/21/2022 |
1.23.0 | 381 | 10/3/2022 |
1.22.1 | 408 | 9/13/2022 |
1.22.0 | 384 | 8/30/2022 |
1.21.0 | 409 | 8/15/2022 |
1.20.0 | 425 | 6/15/2022 |
1.19.4 | 411 | 5/24/2022 |
1.19.2 | 445 | 4/12/2022 |
1.19.1 | 447 | 2/22/2022 |
1.19.0 | 422 | 2/17/2022 |
1.18.0 | 380 | 12/14/2021 |
1.17.0 | 7,146 | 10/18/2021 |
1.16.1 | 303 | 9/23/2021 |
1.16.0 | 316 | 9/20/2021 |
1.15.1 | 348 | 8/4/2021 |
1.15.0 | 331 | 7/23/2021 |
1.14.1 | 373 | 6/15/2021 |
1.14.0 | 327 | 6/4/2021 |
1.13.0 | 339 | 3/19/2021 |
1.12.2 | 353 | 2/26/2021 |
1.12.0 | 376 | 2/25/2021 |
1.11.0 | 365 | 2/10/2021 |
1.10.0 | 400 | 1/22/2021 |
1.9.0 | 431 | 11/11/2020 |
1.8.0 | 497 | 9/14/2020 |
1.7.0 | 655 | 5/29/2020 |
1.6.0 | 594 | 3/11/2020 |
1.5.0 | 497 | 2/18/2020 |
1.4.0 | 542 | 12/17/2019 |
1.3.0 | 581 | 8/20/2019 |
1.2.0 | 518 | 8/6/2019 |
1.0.0 | 584 | 5/16/2019 |