Struct culqi::Token
[−]
[src]
pub struct Token {}
Methods
impl Token
[src]
Examples
let client = culqi::Client::new("{KEY}");
let new_token = culqi::Token::new("4111111111111111","123",9,2020,"test@test.com", None);
let create_token = culqi::Token::create(&client, &new_token);
let get_token = culqi::Token::retrieve(&client, "{ID}");
Here you are the list of filters you can use for get Tokens
use std::collections::HashMap;
let mut token_filter: HashMap<String, String>; token_filter = HashMap::new(); token_filter.insert("card_brand".to_string(), "VISA".to_string()); token_filter.insert("card_type".to_string(), "DEBITO".to_string()); token_filter.insert("device_type".to_string(), "DESKTOP".to_string()); token_filter.insert("bin".to_string(), "411111".to_string()); token_filter.insert("country_code".to_string(), "PE".to_string());
It must uses Unix Timestamp
token_filter.insert("creation_date".to_string(), "1484006400".to_string()); token_filter.insert("creation_date_from".to_string(), "1479600000".to_string()); token_filter.insert("creation_date_to".to_string(), "1484006400".to_string());
let all_tokens = culqi::Token::all(&client, Some(token_filter), None, None, None);
fn new<S: Into<String>>(
card_number: S,
cvv: S,
expiration_month: i32,
expiration_year: i32,
email: S,
metadata: Option<HashMap<String, Value>>
) -> HashMap<String, Value>
card_number: S,
cvv: S,
expiration_month: i32,
expiration_year: i32,
email: S,
metadata: Option<HashMap<String, Value>>
) -> HashMap<String, Value>
fn create(client: &Client, token: &HashMap<String, Value>) -> String
fn retrieve(client: &Client, id: &str) -> String
fn all(
client: &Client,
query_params: Option<HashMap<String, String>>,
limit: Option<String>,
before: Option<String>,
after: Option<String>
) -> String
client: &Client,
query_params: Option<HashMap<String, String>>,
limit: Option<String>,
before: Option<String>,
after: Option<String>
) -> String