diff --git a/src/client/async.rs b/src/client/async.rs index 8f59c5a2..03dca9ed 100644 --- a/src/client/async.rs +++ b/src/client/async.rs @@ -205,6 +205,12 @@ impl Client { HeaderValue::from_str(account).unwrap(), ); } + if let Some(key) = &self.headers.idempotency_key { + headers.insert( + HeaderName::from_static("idempotency-key"), + HeaderValue::from_str(key).unwrap(), + ); + } if let Some(client_id) = &self.headers.client_id { headers.insert( HeaderName::from_static("client-id"), diff --git a/src/params.rs b/src/params.rs index c4cac3e1..2b9ec32f 100644 --- a/src/params.rs +++ b/src/params.rs @@ -21,6 +21,7 @@ pub struct Headers { pub stripe_version: Option, pub stripe_account: Option, pub user_agent: Option, + pub idempotency_key: Option, } /// Implemented by types which represent stripe objects.