[−][src]Struct stripe::Client
Methods
impl Client
[src]
pub fn new(secret_key: impl Into<String>) -> Client
[src]
Creates a new client pointed to https://api.stripe.com/
pub fn from_url(
scheme_host: impl Into<String>,
secret_key: impl Into<String>
) -> Client
[src]
scheme_host: impl Into<String>,
secret_key: impl Into<String>
) -> Client
Creates a new client posted to a custom scheme://host/
pub fn with_headers(&self, headers: Headers) -> Client
[src]
Clones a new client with different headers.
This is the recommended way to send requests for many different Stripe accounts or with different Meta, Extra, and Expand headers while using the same secret key.
pub fn set_stripe_account<S: Into<String>>(&mut self, account_id: S)
[src]
Sets a value for the Stripe-Account header
This is recommended if you are acting as only one Account for the lifetime of the client.
Otherwise, prefer client.with(Headers{stripe_account: "acct_ABC", ..})
.
pub fn get<T: DeserializeOwned>(&self, path: &str) -> Response<T>
[src]
Make a GET
http request with just a path
pub fn get_query<T: DeserializeOwned, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
[src]
&self,
path: &str,
params: P
) -> Response<T>
Make a GET
http request with url query parameters
pub fn delete<T: DeserializeOwned>(&self, path: &str) -> Response<T>
[src]
Make a DELETE
http request with just a path
pub fn delete_query<T: DeserializeOwned, P: Serialize>(
&self,
path: &str,
params: P
) -> Response<T>
[src]
&self,
path: &str,
params: P
) -> Response<T>
Make a DELETE
http request with url query parameters
pub fn post<T: DeserializeOwned>(&self, path: &str) -> Response<T>
[src]
Make a POST
http request with just a path
pub fn post_form<T: DeserializeOwned, F: Serialize>(
&self,
path: &str,
form: F
) -> Response<T>
[src]
&self,
path: &str,
form: F
) -> Response<T>
Make a POST
http request with urlencoded body
Trait Implementations
Auto Trait Implementations
impl Unpin for Client
impl Sync for Client
impl Send for Client
impl !UnwindSafe for Client
impl !RefUnwindSafe for Client
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self