pub struct Client { /* private fields */ }
Implementations§
source§impl Client
impl Client
sourcepub fn new(secret_key: impl Into<String>) -> Self
pub fn new(secret_key: impl Into<String>) -> Self
Create a new account with the given secret key.
sourcepub fn from_url<'a>(
url: impl Into<&'a str>,
secret_key: impl Into<String>
) -> Self
pub fn from_url<'a>(
url: impl Into<&'a str>,
secret_key: impl Into<String>
) -> Self
Create a new account pointed at a specific URL. This is useful for testing.
sourcepub fn with_client_id(self, id: ApplicationId) -> Self
pub fn with_client_id(self, id: ApplicationId) -> Self
Set the client id for the client.
sourcepub fn with_stripe_account(self, id: AccountId) -> Self
pub fn with_stripe_account(self, id: AccountId) -> Self
Set the stripe account for the client.
sourcepub fn with_strategy(self, strategy: RequestStrategy) -> Self
pub fn with_strategy(self, strategy: RequestStrategy) -> Self
Set the request strategy for the client.
sourcepub fn with_app_info(
self,
name: String,
version: Option<String>,
url: Option<String>
) -> Self
pub fn with_app_info(
self,
name: String,
version: Option<String>,
url: Option<String>
) -> Self
Set the application info for the client.
It is recommended that applications set this so that stripe is able to undestand usage patterns from your user agent.
sourcepub fn get<T: DeserializeOwned + Send + 'static>(
&self,
path: &str
) -> Response<T>
pub fn get<T: DeserializeOwned + Send + 'static>(
&self,
path: &str
) -> Response<T>
Make a GET
http request with just a path
sourcepub fn get_query<T: DeserializeOwned + Send + 'static, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
pub fn get_query<T: DeserializeOwned + Send + 'static, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
Make a GET
http request with url query parameters
sourcepub fn delete<T: DeserializeOwned + Send + 'static>(
&self,
path: &str
) -> Response<T>
pub fn delete<T: DeserializeOwned + Send + 'static>(
&self,
path: &str
) -> Response<T>
Make a DELETE
http request with just a path
sourcepub fn delete_query<T: DeserializeOwned + Send + 'static, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
pub fn delete_query<T: DeserializeOwned + Send + 'static, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
Make a DELETE
http request with url query parameters