scanpay 1.0.2

.NET Framework 4.0
NuGet\Install-Package scanpay -Version 1.0.2
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.
dotnet add package scanpay --version 1.0.2
<PackageReference Include="scanpay" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add scanpay --version 1.0.2
#r "nuget: scanpay, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install scanpay as a Cake Addin
#addin nuget:?package=scanpay&version=1.0.2

// Install scanpay as a Cake Tool
#tool nuget:?package=scanpay&version=1.0.2

Scanpay .NET library


See the docs.


From the command line:

$ nuget install scanpay

From Package Manager:

PM>  Install-Package scanpay

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "scanpay".
  5. Click on the scanpay package, select the appropriate version in the right-tab and click Install.


Define a Scanpay client:

var apikey = "1089:bx2a4DATi8ad87Nm4uaxg5nggYA8J/Hv99CON977YiEdvYa6DmMwdoRPoYWyBJSi";
var client = new Scanpay.Client(apikey);

The Scanpay API requires TLS 1.2 support. If you do not use the latest .NET version, you may have to explicitly enable TLS 1.2 by adding the following to your main function:

ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

If SecurityProtocolType.Tls12 is undefined in your .NET version, you can attempt the following:

ServicePointManager.SecurityProtocol |= (SecurityProtocolType)3072;;

Create a payment link to which you can redirect customers.

var data = new Scanpay.NewURLReq
    orderid = "999",
    items = new Scanpay.Item[]
        new Scanpay.Item
            name     = "Ultra Bike 7000",
            total    = "1337.01 DKK",
            quantity = 2,
var url = client.newURL(data);
Console.WriteLine("Payment URL is " + url);

Seq Request

Get an array with a number of changes since the supplied sequence number:

var oldSeq = 3
var seqRes = client.seq(oldSeq);
foreach(var change in seqRes.changes)
    // Update your database with change...
Console.WriteLine("New seq number is " + seqRes.seq);

Handle Pings

Verify the ping signature and extract the seq number.

var ping = client.handlePing(body, request.Headers["X-Signature"]);
Console.WriteLine("Ping seq=" + ping.seq + ", shopid=" + ping.shopid);

See the tests/ folder for more advanced examples.

Product Versions
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
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.0.2 259 6/7/2021
1.0.1 216 3/12/2021
1.0.0 541 9/10/2019
0.1.6 891 2/12/2018
0.1.5 745 2/9/2018
0.1.4 731 2/9/2018
0.1.3 734 2/2/2018
0.1.2 762 2/1/2018
0.1.1 759 1/31/2018

Initial release.