[][src]Struct stripe::Client

pub struct Client { /* fields omitted */ }

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]

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]

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]

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]

Make a POST http request with urlencoded body

Trait Implementations

impl Clone for Client[src]

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T> Same<T> for T

type Output = T

Should always be Self