scanpay 1.0.0

Scanpay .NET client library

Install-Package scanpay -Version 1.0.0
dotnet add package scanpay --version 1.0.0
<PackageReference Include="scanpay" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add scanpay --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Scanpay .NET library

Documentation

See the docs.

Installation

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.

Usage

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;;

New Payment Link

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.

Scanpay .NET library

Documentation

See the docs.

Installation

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.

Usage

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;;

New Payment Link

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.

Release Notes

Initial release.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 26 9/10/2019
0.1.6 358 2/12/2018
0.1.5 219 2/9/2018
0.1.4 219 2/9/2018
0.1.3 226 2/2/2018
0.1.2 239 2/1/2018
0.1.1 244 1/31/2018