Giter Site home page Giter Site logo

sbanken.dotnet's Introduction

Sbanken.DotNet

Build status Test stats NuGet

Unofficial .NET (C#) client library for Sbanken API

What is Sbanken.DotNet?

Sbanken.DotNet is a lightweight C# wrapper for the Sbanken API endpoints:

https://api.sbanken.no/exec.bank/swagger https://api.sbanken.no/exec.customers/swagger

Features

  • Automatic access token renewal
  • Supports >= .NET Standard 1.4

Usage

Install latest package from nuget using the package manager

Install-Package Sbanken.DotNet

or the .NET CLI

dotnet add package Sbanken.DotNet

Register at https://sbanken.no/bruke/utviklerportalen to get CLIENT_ID and SECRET. The CUSTOMER_ID is your SSN (fødselsnummer).

using Sbanken.DotNet;

using (var client = new SbankenClient(CLIENT_ID, SECRET)) {
    
    // Fetch customer metadata
    var customer = await client.Customers.Get(CUSTOMER_ID);

    // Fetch all bank accounts and balances
    var accounts = await client.Bank.GetAccounts(CUSTOMER_ID);

    // Loop accounts and print balance
    foreach (var account in accounts.Items) {
        Console.WriteLine($"Got account {account.Name} with balance {account.Balance}");
    }

    // Transfer amount (399 NOK) between accounts
    await client.Bank.Transfer(
        CUSTOMER_ID,
        FROM_ACCOUNT_ID,
        TO_ACCOUT_ID,
        399.0m,
        "More U save, more U earn");
}

Currently, the Sbanken API only supports operations on accounts you own.

Links

sbanken.dotnet's People

Contributors

anderaus avatar esp0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

havheg esp0

sbanken.dotnet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.