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
#[macro_use] extern crate serde_derive; use crate::error::{Error, ErrorCode}; use crate::resources::common::path::{UrlPath, StripePath}; use serde_json::{Value, Map}; mod client; pub mod util; pub mod error; pub mod resources; pub mod prelude; pub use crate::client::Client; pub type Result<T> = ::std::result::Result<T, Error>; pub trait StripeService { fn uri(&self, path: UrlPath, param: &StripePath) -> String { format!("https://api.stripe.com/v1{}{}", path, param) } fn object() -> Value { Value::Object(Map::new()) } fn empty(&self) -> Value { Self::object() } } impl StripeService for Value {}