1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! The official Rust client for the [Ha Tang](https://hatang.dev) (Hạ Tầng) API: transactional email, live chat
//! and support CRM, plans and purchases on the customer's profile, the AI chatbot's knowledge, VietQR payments and
//! webhook verification. Async (Tokio) and blocking.
//!
//! ```no_run
//! use hatang::{Hatang, Platform, SubscriptionUpsert};
//!
//! # async fn run() -> hatang::Result<()> {
//! let hatang = Hatang::from_env()?; // reads HATANG_API_KEY; or Hatang::new("ht_…")
//!
//! // What a customer pays for, from your backend (web sales included).
//! hatang.chat.subscriptions.upsert(Platform::Web, "sub_123", &SubscriptionUpsert {
//! status: "active".into(),
//! sku: Some("PRO-1M".into()), // finds the product in your catalog
//! external_user_id: Some("user-42".into()), // the id you pass to identify() in the chat
//! current_period_end: Some("2026-12-01T00:00:00Z".into()),
//! amount: Some(99000.0),
//! currency: Some("VND".into()),
//! ..Default::default()
//! }).await?;
//! # Ok(()) }
//! ```
//!
//! - [`Hatang`] is async (any runtime that drives `reqwest`, Tokio in practice). With the `blocking` feature,
//! `blocking::Hatang` has the same methods and returns results directly.
//! - Bodies take `impl Serialize`: the typed structs in this crate, or `serde_json::json!` for anything else.
//! Responses are `serde_json::Value`, as the API sends them.
//! - Errors are [`Error`]; [`Error::retryable`] tells outages (unreachable, 429, 5xx) from mistakes.
//! - [`verify_webhook`] and [`verify_ipn`] check what Ha Tang sends to your endpoints.
pub use ;
pub use ;
pub use ;
pub use Contact;
pub use Blocking;
pub use Req;
pub use ;
pub use *;
pub use ;
;