Skip to content

cblach/dotnet-scanpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scanpay .NET library

Documentation

See the docs.

Installation

Usage

Define a Scanpay client:

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

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",
            price    = "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, opts);
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);;

About

Scanpay .NET client library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages