RL.PaymentProviders.Api.SumUp
51.0.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
dotnet add package RL.PaymentProviders.Api.SumUp --version 51.0.0
NuGet\Install-Package RL.PaymentProviders.Api.SumUp -Version 51.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RL.PaymentProviders.Api.SumUp" Version="51.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RL.PaymentProviders.Api.SumUp --version 51.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RL.PaymentProviders.Api.SumUp, 51.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RL.PaymentProviders.Api.SumUp as a Cake Addin
#addin nuget:?package=RL.PaymentProviders.Api.SumUp&version=51.0.0
// Install RL.PaymentProviders.Api.SumUp as a Cake Tool
#tool nuget:?package=RL.PaymentProviders.Api.SumUp&version=51.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
.Net Client for SumUp payment provider
How to use it
- First of all we need a token to work with SumUp Web Api. This token we can get on SumUp API keys page
- And that's all. If you have a token, you just need insert code as follows and use SumUp client for all your needs:
using RL.PaymentProviders.Api.SumUp;
[Test]
public async Task When_getting_transaction_by_transaction_code_Then_return_ok_response_with_transaction_data()
{
var api = SumUpApiClient.Create(ApiKey);
var transaction = await api.RetrieveTransactionAsync(transactionCode: "TDZQ9KGV96");
Assert.That(transaction.IsSuccessStatusCode, Is.True);
Assert.That(transaction.Content, Is.Not.Null);
}
How to handle api response
Each client's method return folowing structure:
public class SumUpApiResponse
{
/// <summary>
/// If IsSuccessStatusCode = true return deserialized object by SumUp request, otherwise return null
/// </summary>
public TContent? Content { get; internal set; }
/// <summary>
/// If IsSuccessStatusCode = false return deserialized error object with description by SumUp request, otherwise return null
/// </summary>
public SumUpApiError? Error { get; internal set; }
/// <summary>
/// Sometimes SumUp api server return an array of errors instead of 1 error
/// </summary>
public SumUpApiError[]? Errors { get; internal set; }
/// <summary>
/// Http status code
/// </summary>
public HttpStatusCode? StatusCode { get; internal set; }
/// <summary>
/// True if StatusCode = HttpStatusCode.OK
/// </summary>
public bool IsSuccessStatusCode { get; internal set; }
}
So you just need to look into Content, and if it's null than it was an error and you can get it from Error/Errors.
How to log api calls
- Implement your own logger based on IApiLogger
- Create SumUp api client using your api token and logger created previously
using RL.PaymentProviders.Api.Core;
class MyCustomLogger : IApiLogger
{
}
var apiSettings = new SumUpApiSettings{ApiToken = "your api token"};
var myCustomLogger = new MyCustomLogger();
var sumUpApi = new SumUpApiClient(apiSettings, myCustomLogger);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
- Refit.Newtonsoft.Json (>= 6.3.2)
- RL.PaymentProviders.Api.Core (>= 4.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETStandard 2.0
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
- Refit.Newtonsoft.Json (>= 6.3.2)
- RL.PaymentProviders.Api.Core (>= 4.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETStandard 2.1
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
- Refit.Newtonsoft.Json (>= 6.3.2)
- RL.PaymentProviders.Api.Core (>= 4.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net6.0
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
- Refit.Newtonsoft.Json (>= 6.3.2)
- RL.PaymentProviders.Api.Core (>= 4.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net7.0
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
- Refit.Newtonsoft.Json (>= 6.3.2)
- RL.PaymentProviders.Api.Core (>= 4.0.0)
- System.ComponentModel.Annotations (>= 5.0.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 |
---|---|---|
51.0.0 | 272 | 8/3/2023 |
50.0.0 | 160 | 7/26/2023 |
47.0.0 | 152 | 7/25/2023 |
45.0.0 | 171 | 7/24/2023 |
44.0.0 | 160 | 7/24/2023 |
43.0.0 | 152 | 7/24/2023 |
42.0.0 | 164 | 7/24/2023 |
41.0.0 | 163 | 7/24/2023 |
40.0.0 | 168 | 7/24/2023 |
39.0.0 | 155 | 7/24/2023 |
38.0.0 | 161 | 7/24/2023 |
34.0.0 | 156 | 7/24/2023 |
22.0.0 | 167 | 7/24/2023 |