[package]
name = "payrix"
version = "0.3.0"
edition = "2024"
license = "MIT"
repository = "https://github.com/outlawpractice/payrix-rs"
description = "Rust client for the Payrix payment processing API"
documentation = "https://docs.rs/payrix"
readme = "../../README.md"
keywords = ["payrix", "payments", "api", "worldpay", "payment-processing"]
categories = ["api-bindings", "web-programming"]
exclude = ["tests/", "TESTING.md"]
[features]
default = []
sqlx = ["dep:sqlx"]
financial = []
terminal = []
full = ["financial", "terminal"]
webhooks = ["dep:axum", "dep:tower", "dep:tower-http", "dep:ipnet", "dep:async-trait"]
webhook-cli = ["webhooks", "dep:clap", "dep:tracing-subscriber", "tokio/full"]
cli = ["dep:clap", "dep:tracing-subscriber", "tokio/full"]
cache = ["sqlx", "dep:async-trait"]
[dependencies]
base64 = "0.22"
chrono = { version = "0.4", features = ["serde"] }
payrix-macros = { version = "0.1", path = "../payrix-macros" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_repr = "0.1"
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "chrono"], optional = true }
thiserror = "1.0"
tokio = { version = "1", features = ["rt", "time", "sync"] }
tracing = "0.1"
uuid = { version = "1.11", features = ["v4", "serde"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
clap = { version = "4.5", features = ["derive"], optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json"] }
uuid = { version = "1.11", features = ["v4", "serde", "js"] }
getrandom = { version = "0.3", features = ["wasm_js"] }
async-trait = { version = "0.1", optional = true }
axum = { version = "0.7", optional = true }
tower = { version = "0.5", optional = true }
tower-http = { version = "0.6", features = ["trace"], optional = true }
ipnet = { version = "2.10", optional = true }
[[bin]]
name = "payrix"
path = "src/bin/payrix.rs"
required-features = ["cli"]
[[bin]]
name = "payrix-webhooks"
path = "src/bin/payrix-webhooks.rs"
required-features = ["webhook-cli"]
[[example]]
name = "webhook_dispute_handler"
required-features = ["webhooks"]
[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
wiremock = "0.6"
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]