RyftPay.Net 1.1.0

dotnet add package RyftPay.Net --version 1.1.0
                    
NuGet\Install-Package RyftPay.Net -Version 1.1.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="RyftPay.Net" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RyftPay.Net" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="RyftPay.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RyftPay.Net --version 1.1.0
                    
#r "nuget: RyftPay.Net, 1.1.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.
#:package RyftPay.Net@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RyftPay.Net&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=RyftPay.Net&version=1.1.0
                    
Install as a Cake Tool

Ryft .NET SDK

Build & Test Integration Test License: MIT NuGet version

The Ryft .Net SDK allows you to consume our payments API within your .Net applications

Prerequisites

The SDK supports the following targets:

  • .NET 8.0 and above
  • .NET Framework 4.8 and above
  • .netstandard2.0

Note that it has been tested against .NET 8.0 and .NET Framework 4.8.

These targets or later are recommended.

Installation

The SDK is available on NuGet

with NuGet

PM> Install-Package RyftPay.Net -Version x.x.x

Usage

Each resource from our API is provided individually. For example, to begin interfacing with our /payment-sessions resources, initialise the API client:

Initialisation

All API clients require an instance of IRyftApiClient, which can be constructed in several ways:

var apiClient = new RyftApiClient();

// or with your own HttpClient
var apiClient = new RyftApiClient(new HttpClient());

// or with IHttpClientFactory
var apiClient = new RyftApiClient(httpClientFactory);

You API key can be supplied on either the RyftApiClient or per-request.

var apiClient = new RyftApiClient(
    requestSettings: new ClientRequestSettings { ApiKey = "<your API key>" }
);
var paymentSessionsApiClient = new PaymentSessionsApiClient(apiClient);
Making requests
var request = new CreatePaymentSessionRequest(500, "GBP")
{
  CaptureFlow = CaptureFlow.Manual,
  CustomerEmail = "test@ryftpay.com"
};
var paymentSession = await paymentSessionsApiClient.CreateAsync(request);

// request with API key supplied

var paymentSession = await paymentSessionsApiClient.CreateAsync(
    request,
    requestSettings: new ClientRequestSettings { ApiKey = "<your API key>" }
);

Handling Webhook Events

Note that the SDK does not support Event objects persisted prior to August 2025

Every webhook event is delivered with a Signature header which you can use to verify the integrity of the message.

This header value is derived from calculating a HMAC-SHA256 of the raw response body alongside your webhook secret.

You can leverage our built-in class to perform this check as follows:

string signature = Request.Headers['Signature'];
string webhookSecret = "<dervie this from your backend (e.g. env var)>";
string payload = "<supply the unmodified raw string (JSON) from the request>";
var webhookHandler = new WebhookHandler();
bool isValid = webhookHandler.IsSignatureValid(webhookSecret, signature, payload);

Parsing the event

To parse the incoming event, you can again leverage the WebhookHandler class as follows:

string payload = "<supply the unmodified raw string (JSON) from the request>";
var webhookHandler = new WebhookHandler();
try
{
    var @event = webhookHandler.ConstructEvent(payload);
    // you can then access the underlying API response model based on the event type, e.g.
    if (@event.EventType == EventTypes.CustomerCreated)
    {
        var customer = @event.Data.Object as Customer;
    }
    // always return a 200 status code to confirm you have received the event successfully
    return Ok();
}
catch (RyftDotNetException e)
{
    // the event could not be parsed/constructed
}

Notes on design decisions

Enumeration Types

We consider adding new enums to our API as non-breaking and non-major upgrades. Keep this in mind when using the SDK.

We have intentionally:

  • avoided using strict Enum values for use on request and response models
  • opted for enumeration classes instead.

This allows for requests to be more easily discover which values are available whilst at the same time, new values can be returned from our API without the SDK erroring. We will release a minor version update when new values are introduced.

Constructors vs Properties

Constructor parameters map to required fields on our API reference. Property setters are utilised for optional parameters.

e.g. When creating a payment session, amount and currency are required fields.

var request = new CreatePaymentSessionRequest(500, "GBP");

To supply any additional (optional) parameters, use the properties available:

var request = new CreatePaymentSessionRequest(500, "GBP")
{
  CaptureFlow = CaptureFlow.Manual,
  CustomerEmail = "test@ryftpay.com"
};

Contributing

We welcome contributors, please see our Contributing guidelines

Code of Conduct

Please refer to Code of Conduct

Licensing

MIT

Product 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 is compatible.  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 is compatible.  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.

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.1.0 138 8/20/2025
1.0.0 87 8/3/2025
0.0.1 84 8/3/2025