Skip to main content

iyzipay_rust/
options.rs

1#[derive(Debug, Clone, Default)]
2pub struct Options {
3    api_key: &'static str,
4    secret_key: &'static str,
5    base_url: &'static str,
6}
7
8impl Options {
9    pub fn new() -> Options {
10        Options::default()
11    }
12
13    pub fn api_key(&self) -> &'static str {
14        &self.api_key
15    }
16
17    pub fn secret_key(&self) -> &'static str {
18        &self.secret_key
19    }
20
21    pub fn base_url(&self) -> &'static str {
22        &self.base_url
23    }
24
25    pub fn set_api_key(&mut self, api_key: &'static str) {
26        self.api_key = api_key;
27    }
28
29    pub fn set_secret_key(&mut self, secret_key: &'static str) {
30        self.secret_key = secret_key;
31    }
32
33    pub fn set_base_url(&mut self, base_url: &'static str) {
34        self.base_url = base_url;
35    }
36}