Skip to main content

platega_io_sdk/
lib.rs

1//! # Platega Rust SDK
2//!
3//! > **Unofficial SDK.** Independent, community-maintained port of
4//! > [platega-sdk-python](https://docs.platega.io/llms.txt); not affiliated
5//! > with or endorsed by Platega.io.
6//!
7//! Client for creating payments, querying statuses and validating callbacks
8//! of the [Platega.io](https://platega.io) payment system.
9//!
10//! Authentication uses the `X-MerchantId` / `X-Secret` headers (issued by the
11//! manager or available in the dashboard). The only external dependency is
12//! `reqwest` (plus `hmac`/`sha2`/`base64`/`hex` for the HMAC-signed
13//! `get_cards` endpoint).
14//!
15//! ## Payment methods
16//!
17//! | Constant | Value | Description |
18//! |----------|-------|-------------|
19//! | `PaymentMethod::SberQR` | 2 | SBP (QR) + Sberpay |
20//! | `PaymentMethod::Erip` | 3 | ERIP |
21//! | `PaymentMethod::CardAcquiring` | 11 | Card acquiring |
22//! | `PaymentMethod::International` | 12 | International payments |
23//! | `PaymentMethod::Crypto` | 13 | Cryptocurrency |
24//!
25//! Without a payment method the payment is created via
26//! `/v2/transaction/process` (the method is chosen on the Platega side).
27//!
28//! See [`docs/index.md`](https://github.com/ByFox213/platega-io-sdk) for the full
29//! usage guide.
30
31mod callback;
32mod client;
33mod error;
34mod types;
35
36pub use callback::{CallbackPayload, PlategaCallback};
37pub use client::{CreatePayment, CreatePaymentBuilder, Platega};
38pub use error::{PlategaError, PlategaResult};
39pub use types::{
40    Balance, Card, ChargeMetrics, CreatePaymentResponse, Metadata, PaymentMethod, PaymentStatus,
41    Subscription, SubscriptionInterval, SubscriptionPage, SubscriptionSummary, TransactionStatus,
42};
43
44pub const VERSION: &str = env!("CARGO_PKG_VERSION");
45
46pub const API_URL: &str = "https://app.platega.io";