SumUp Rust SDK
IMPORTANT: This SDK is under heavy development and subject to breaking changes.
The Rust SDK for the SumUp API.
Requirements
Rust 1.82.0 or higher. We follow Firefox MSRV policy.
Installation
Install with:
Quick Start
use Client;
async
Authentication
use ;
// Read SUMUP_API_KEY from the environment
let client = default;
// Or set an explicit API key
let client = default
.with_authorization;
HTTP Configuration
The SDK uses reqwest as its HTTP transport. You can provide a configured
reqwest::Client for settings such as proxies, custom TLS roots, connection
pooling, redirect policy, or request timeouts.
Start from Client::http_client_builder() to keep the SDK's default headers:
use Client;
let http_client = http_client_builder
.pool_max_idle_per_host
.build
.expect;
let client = default.with_client;
Features
By default the SDK enables chrono datetime support and reqwest's default TLS
backend:
[]
= "0.5"
Use jiff for datetime types:
[]
= { = "0.5", = false, = ["jiff", "reqwest-default-tls"] }
Use rustls instead of reqwest's default TLS backend:
[]
= { = "0.5", = false, = ["chrono", "reqwest-rustls-tls"] }
Examples
You can find all examples under examples/. To run an example, use: