I'm trying to dynamic types to the HashMap but when i try using the Box struct i get this error.
{
let mut payload: HashMap<&str, Box<dyn Display + 'static>> = HashMap::new();
payload.insert("reference", Box::new(reference));
payload.insert("amount", Box::new(amount));
payload.insert("customer_name", Box::new(customer_name));
payload.insert("customer_email", Box::new(customer_email));
payload.insert("coin", Box::new(coin));
payload.insert("currency", Box::new(currency));
payload.insert("api_public_key", Box::new(api_public_key.unwrap()));
payload.insert("accept_partial_payment", Box::new(accept_partial_payment));
let client = Client::new();
let response = client.post(API_URL_INIT_TRANSACTION)
.json(&payload)
.headers(self.construct_headers(true))
.send()
.await.unwrap();
response
}
trait serde::ser::Serialize
is not implemented for dyn std::fmt::Display