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
#[doc(hidden)]
pub mod helper;
#[cfg(feature = "balance")]
pub mod balance;
#[cfg(feature = "balance_transaction")]
pub mod balance_transaction;
#[cfg(feature = "dispute")]
pub mod dispute;
#[cfg(feature = "mandate")]
pub mod mandate;
#[cfg(feature = "payment_intent")]
pub mod payment_intent;
#[cfg(feature = "payout")]
pub mod payout;
#[cfg(feature = "refund")]
pub mod refund;
pub mod error;

include!("client.rs");

/// Create an easy body format for API requests.
/// 
/// # Example
/// ```
/// #[macro_use] extern crate ezstripe;
/// 
/// fn main() {
///   let body = ezbody!(
///       "amount" => 2000,
///       "currency" => "eur"
///     );
/// 
///   println!("{}", body); // amount=2000;currency=eur;
/// }
/// ```
#[macro_export]
macro_rules! ezbody {
  {$($k: expr => $v: expr),* $(,)?} => {
    {
      let mut result = String::new();

      $(
        result += concat!($k, '=', $v, ';');
      )*

      result
    }
  };
}