RoodFluweel.PAYNLSDK 1.0.45

There is a newer version of this package available.
See the version list below for details.
dotnet add package RoodFluweel.PAYNLSDK --version 1.0.45
                    
NuGet\Install-Package RoodFluweel.PAYNLSDK -Version 1.0.45
                    
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="RoodFluweel.PAYNLSDK" Version="1.0.45" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RoodFluweel.PAYNLSDK" Version="1.0.45" />
                    
Directory.Packages.props
<PackageReference Include="RoodFluweel.PAYNLSDK" />
                    
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 RoodFluweel.PAYNLSDK --version 1.0.45
                    
#r "nuget: RoodFluweel.PAYNLSDK, 1.0.45"
                    
#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 RoodFluweel.PAYNLSDK@1.0.45
                    
#: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=RoodFluweel.PAYNLSDK&version=1.0.45
                    
Install as a Cake Addin
#tool nuget:?package=RoodFluweel.PAYNLSDK&version=1.0.45
                    
Install as a Cake Tool

Pay.nl C# SDK



This SDK is available as DotNet Assembly.

With this SDK you will be able to start transactions and retrieve transactions with their status for the Pay.nl payment service provider.

Installation

You can use this package as a nuget package:

From nuget:

Install-Package RoodFluweel.PAYNLSDK

Or if you want bleeding edge:

PM> Install-Package RoodFluweel.PAYNLSDK -Source https://www.myget.org/F/paynl/api/v3/index.json

Usage

Setting the configuration:

var client = new Client("e41f83b246b706291ea9ad798ccfd9f0fee5e0ab", "SL-3490-4320")

Getting a list of available payment methods, use the Getservice.

var response = PAYNLSDK.Transaction.GetService(paymentMethodId);
//paymentMethodId: is optional
//The ID of the payment method. Only the payment options linked to the provided payment method ID will be returned if an ID is provided.
//If omitted, all available payment options are returned. Use the following IDs to filter the options:
//1. SMS.
//2. Pay fixed price.
//3. Pay per call.
//4. Pay per transaction
//5. Pay per minute.

Starting a transaction:


PAYNLSDK.API.Transaction.Start.Request request = PAYNLSDK.Transaction.CreateTransactionRequest("127.0.0.1", "http://example.org/visitor-return-after-payment");
request.Amount = 621;

// Optional values
options.store("paymentMethod", 10;
options.store("description", "demo payment";
options.store("language","EN";

// Transaction data
request.Transaction = new PAYNLSDK.Objects.TransactionData();
request.Transaction.Currency = "EUR";
request.Transaction.CostsVat = null;
request.Transaction.OrderExchangeUrl = "https://example.org/exchange.php";
request.Transaction.Description = "TEST PAYMENT";
request.Transaction.ExpireDate = DateTime.Now.AddDays(14);

// Optional Stats data
request.StatsData = new PAYNLSDK.Objects.StatsDetails();
request.StatsData.Info = "your information";
request.StatsData.Tool = "C#.NET";
request.StatsData.Extra1 = "X";
request.StatsData.Extra2 = "Y";
request.StatsData.Extra3 = "Z";

// Initialize Salesdata
request.SalesData = new PAYNLSDK.Objects.SalesData();
request.SalesData.InvoiceDate = DateTime.Now;
request.SalesData.DeliveryDate = DateTime.Now;
request.SalesData.OrderData = new System.Collections.Generic.List<PAYNLSDK.Objects.OrderData>();

// Add products
request.SalesData.OrderData.Add(new PAYNLSDK.Objects.OrderData("SKU-8489", "Testproduct 1", 2995, "H", 1));
request.SalesData.OrderData.Add(new PAYNLSDK.Objects.OrderData("SKU-8421", "Testproduct 2", 995, "H", 1));
request.SalesData.OrderData.Add(new PAYNLSDK.Objects.OrderData("SKU-2359", "Testproduct 3", 2499, "H", 1));

// enduser
request.Enduser = new PAYNLSDK.Objects.EndUser();
request.Enduser.Language = "NL";
request.Enduser.Initials = "J.";
request.Enduser.Lastname = "Buyer";
request.Enduser.Gender = PAYNLSDK.Enums.Gender.Male;
request.Enduser.BirthDate = new DateTime(1991, 1, 23, 0, 0, 0, DateTimeKind.Local);
request.Enduser.PhoneNumber = "0612345678";
request.Enduser.EmailAddress = "email@domain.com";
request.Enduser.BankAccount = "";
request.Enduser.IBAN = "NL08INGB0000000555";
request.Enduser.BIC = "";

// enduser address
request.Enduser.Address = new PAYNLSDK.Objects.Address();
request.Enduser.Address.StreetName = "Streetname";
request.Enduser.Address.StreetNumber = "8";
request.Enduser.Address.ZipCode = "1234AB";
request.Enduser.Address.City = "City";
request.Enduser.Address.CountryCode = "NL";

// invoice address
request.Enduser.InvoiceAddress = new PAYNLSDK.Objects.Address();
request.Enduser.InvoiceAddress.Initials = "J.";
request.Enduser.InvoiceAddress.LastName = "Jansen";
request.Enduser.InvoiceAddress.Gender = PAYLSDK.Enums.Gender.Male;
request.Enduser.InvoiceAddress.StreetName = "InvoiceStreetname";
request.Enduser.InvoiceAddress.StreetNumber = "10";
request.Enduser.InvoiceAddress.ZipCode = "1234BC";
request.Enduser.InvoiceAddress.City = "City";
request.Enduser.InvoiceAddress.CountryCode = "NL";

// Do the call
var transaction = new PAYNLSDK.Transaction(client).Start(request);

// do whatever you need to do
var transactionId = transaction.Transaction.TransactionId;
var redirectToUrl = transaction.Transaction.PaymentURL;

To determine if a transaction has been paid, you can use:

var transactionInfo = new PAYNLSDK.Transaction(client).Info(transactionId);
var paid = transactionInfo.PaymentDetails.State == PaymentStatus.PAID;

// or use the extentionmethods by adding "using PAYNLSDK.API.Transaction.Info;" at the top of your file

if (transactionInfo.IsPaid() || transactionInfo.IsPending())
{
    // redirect user to thank you page
}
else
{
    // it has not been paid yet, so redirect user back to checkout
}

When implementing the exchange script (where you should process the order in your backend):

var info = PAYNLSDK.Transaction.Info(response.transactionId);
PAYNLSDK.Enums.PaymentStatus result = info.PaymentDetails.State;

if (PAYNLSDK.Transaction.IsPaid(result))
{
    // process the payment
}
else 
{
 if(PAYNLSDK.Transaction.IsCancelled(result)){
    // payment canceled, restock items
 }
}

response.Write("TRUE| ");
// Optionally you can send a message after TRUE|, you can view these messages in the logs.
// https://admin.pay.nl/logs/payment_state
response.Write("Paid");

Contributing

Feel free to do pull requests and create issues when you please.

License

This project is available as open source under the terms of the MIT License.

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 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.  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 is compatible.  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 net46 is compatible.  net461 was computed.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  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.

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
2.0.0-beta003 171 10/27/2025
1.8.1 1,943 7/24/2023
1.8.0-alpha-003 260 11/6/2022
1.8.0-alpha-002 269 10/10/2022
1.8.0-alpha 263 10/10/2022
1.7.7 165 10/16/2025
1.7.6 292 10/9/2025
1.7.5 248 2/24/2025
1.7.4 164 12/2/2024
1.7.3 1,473 7/26/2023
1.7.2 1,803 7/19/2022
1.7.1 517 11/12/2021
1.7.0 632 9/20/2021
1.6.1 570 9/20/2021
1.6.0 481 8/24/2021
1.5.2 668 8/24/2021
1.5.0 450 8/24/2021
1.4.3 523 10/5/2020
1.4.2 287 7/21/2020
1.4.1 288 3/15/2020
1.3.3 934 3/26/2019
1.3.1 28,167 1/25/2019
1.2.88 1,093 12/23/2018
1.2.86 899 12/23/2018
1.1.80 964 12/11/2018
1.1.73 932 12/10/2018
1.1.72 947 12/10/2018
1.1.69 982 12/6/2018
1.1.68 945 12/6/2018
1.1.67 967 11/9/2018
1.0.51 1,034 11/4/2018
1.0.49 1,328 9/2/2018
1.0.47 1,088 8/28/2018
1.0.46 1,167 8/16/2018
1.0.45 1,195 8/3/2018
1.0.43 1,744 6/25/2018
1.0.42 1,526 6/24/2018
1.0.37 1,446 6/14/2018
1.0.35 1,434 5/3/2018
1.0.34 1,614 4/30/2018
1.0.29 1,492 4/29/2018
1.0.27 1,319 4/28/2018
1.0.24 1,612 4/28/2018
1.0.23 1,482 4/16/2018
1.0.20 1,611 4/14/2018
1.0.14 1,660 4/14/2018
1.0.13 1,621 4/14/2018
1.0.10 1,244 3/19/2018