Skip to content

davidask/bankid-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bankid-rs

A BankID client for Rust based on reqwest.

Example

This package is uses Tokio. Add bankid to your Cargo.toml dependencies.

[dependencies]
bankid = { version = "0.1.0" }
use bankid::{
    Client, Endpoint, PersonalNumber,
    request::{AuthRequest}
};
use std::net::{IpAddr, Ipv4Addr};


#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new(Endpoint::Test);

    let auth_response = client.auth(AuthRequest {
        end_user_ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
        personal_number: Some(PersonalNumber::parse("198710105080")?),
        requirement: None
    }).await?;

    let collect_response = client.collect(auth_response.order_ref).await?;

    client.cancel(auth_response.order_ref).await?;

    Ok(())
}

About

BankID client written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages