TikkieAPI 1.0.0
See the version list below for details.
dotnet add package TikkieAPI --version 1.0.0
NuGet\Install-Package TikkieAPI -Version 1.0.0
<PackageReference Include="TikkieAPI" Version="1.0.0" />
paket add TikkieAPI --version 1.0.0
#r "nuget: TikkieAPI, 1.0.0"
// Install TikkieAPI as a Cake Addin
#addin nuget:?package=TikkieAPI&version=1.0.0
// Install TikkieAPI as a Cake Tool
#tool nuget:?package=TikkieAPI&version=1.0.0
Tikkie API .NET
Unofficial client implementation for communicating with the Tikkie API.
Prerequisites
Tikkie API .NET is a .NET Standard 2.0 library that implements the Tikkie Payment Request API. It follows the technical details described in the official documentation.
The authentication for this API is implemented through signed JSON Web Token (JWT). Every HTTP request contains a header with a token generated after making an authentication request to the API. This client automatically handles the authentication for requests in case they expired.
The API consumer should follow this steps to be able to generate a token:
- Sign up on the Developer ABN-AMRO website.
- Add a new App using the API Product Tikkie.
- Create a public/private key pair using OpenSSL.
#generates RSA private key of 2048 bit size openssl genrsa -out private_rsa.pem 2048 #generates public key from the private key openssl rsa -in private_rsa.pem -outform PEM -pubout -out public_rsa.pem
- Share the public key created along with your app name and developer email to
api.support@nl.abnamro.com
.
Reference: Authentication with Signed JSON Web Token
Getting started
The package can be installed via NuGet:
Install-Package TikkieApi
Usage
Creating the Tikkie API Client
To start using the client there should be created a new instance of TikkieClient
class. The API key (a.k.a. Consumer Key) should be provided together with the path of the private RSA Pem file previously created.
TikkieClient tikkieClient = new TikkieClient(
apiKey: "MyApIKeY",
privateKeyPath: "private_rsa.pem");
By default it is connecting to the Tikkie Production environment. But it is possible to use the Sandbox environment on the client creation by setting the constructor's useTestEnvironment
parameter to true
(it is false
by default):
TikkieClient tikkieClient = new TikkieClient(
apiKey: "MyApIKeY",
privateKeyPath: "private_rsa.pem",
useTestEnvironment: true);
Platforms
Create a new Platform:
PlaformResponse response = await tikkieClient.CreatePlatformAsync(
request: new PlatformRequest
{
Name = "New Platform",
Email = "user@emailaddress.com", // Optional
NotificationUrl = "notifyme@emailaddress.com" // Optional
PhoneNumber = "06xxxxxxxx",
Usage = PlatformUsage.PaymentRequestForMyself
});
Retrieve all existing Platforms:
PlaformResponse[] response = await tikkieClient.GetPlatformsAsync();
Users
Create a new User:
UserResponse response = await tikkieClient.CreateUserAsync(
request: new UserRequest
{
PlatformToken = "platformToken",
Name = "Arya Stark",
PhoneNumber = "06xxxxxxxx",
IBAN = "NLXXXXXXXXXXXXXXXX",
BankAccountLabel = "Personal account"
});
Retrieve all Users from an existing Platform:
UserResponse[] response = await tikkieClient.GetUsersAsync(platformToken: "platformToken");
Payments
Create a new Payment Request for an existing User:
PaymentResponse response = await tikkieClient.CreatePaymentRequestAsync(
request: new PaymentRequest
{
PlatformToken = "platformToken",
UserToken = "userToken",
BankAccountToken = "bankAccountToken",
AmountInCents = 100, // Optional
Currency = "EUR",
Description = "Demo payment request",
ExternalId = "Demo" // Mandatory when PlatformUsage is set to PaymentRequestForMyself
});
It is possible to retrieve all the Payment Requests from an existing User. The results are paginated and the desired offset and limit must be specified as parameters. Filtering is possible based on the date. Example:
UserPaymentResponse response = await tikkieClient.GetUserPaymentRequestsAsync(
request: new UserPaymentRequest
{
PlatformToken = "platformToken",
UserToken = "userToken",
Offset = 0,
Limit = 20,
FromDate = new DateTime(2017, 05, 23), // Optional
ToDate = new DateTime(2017, 05, 24) // Optional
});
Retrieve a single Payment Request:
SinglePaymentRequestResponse response = await tikkieClient.GetPaymentRequestAsync(
request: new SinglePaymentRequest
{
PlatformToken = "platformToken",
UserToken = "userToken",
PaymentRequestToken = "paymentRequestToken"
});
Extra information
Access to configuration parameters on the created client can be accessed via the property TikkieClient.Configuration
.
Access to the current authorization token parameters used for the requests can be accessed via the property TikkieClient.AuthorizationTokenInfo
.
Error handling
Error responses from the Tikkie API are thrown as a TikkieErrorResponseException
, where the errors are gathered.
Example:
try
{
// ...
var response = tikkieClient.GetPlatformsAsync();
// ...
}
catch (TikkieErrorResponseException tikkieErrorResponseException)
{
ErrorResponse[] errorResponses = ex.ErrorResponses;
// Handle exception
}
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
- BouncyCastle.NetCore (>= 1.8.5)
- jose-jwt (>= 2.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial 1.0.0 release