pub struct ClientBuilder { /* private fields */ }Expand description
Configuration for a Stripe client.
This builder allows customizing request behavior, headers sent to Stripe, and endpoint targeted. Some defaults can be overridden on a per-request basis.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(secret: impl Into<String>) -> Self
pub fn new(secret: impl Into<String>) -> Self
Create a new ClientBuilder with the given secret key.
Sourcepub fn client_id(self, client_id: ApplicationId) -> Self
pub fn client_id(self, client_id: ApplicationId) -> Self
Set the Stripe client id for the client. This will be sent to stripe with the “client-id” header.
Sourcepub fn account_id(self, account_id: AccountId) -> Self
pub fn account_id(self, account_id: AccountId) -> Self
Set the default Stripe account id used for the client. This will be sent to stripe with the “stripe-account” header, unless it is overridden when customizing a request.
Sourcepub fn request_strategy(self, strategy: RequestStrategy) -> Self
pub fn request_strategy(self, strategy: RequestStrategy) -> Self
Set the default RequestStrategy used when making requests.
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Create a new client pointed at a specific URL. This is useful for testing.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more