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
66
67
68
69
70
71
72
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulationResponseWrapper<T> {
pub payment_methods: Vec<T>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulatePayload {
pub token_account: String,
pub price: String,
pub type_response: String,
}
impl SimulatePayload {
pub fn new<T>(token_account: String, total_amount: T) -> SimulatePayload
where
T: ToString,
{
Self {
token_account,
price: total_amount.to_string(),
type_response: "J".to_string(),
}
}
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PaymentTaxResponse {
pub splittings: Vec<SplitResponse>,
pub price_customer: String,
pub price_seller: String,
pub price_original: String,
pub split: i64,
pub payment_method_name: String,
pub payment_method_id: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SplitResponse {
pub split: i64,
pub value_split: String,
pub value_transaction: String,
pub addition_retention: String,
pub split_rate: serde_json::Value,
pub price_seller: String,
}
#[cfg(test)]
mod tests {
}