pub struct SharedConfigBuilder {
pub stripe_version: ApiVersion,
pub app_info_str: Option<String>,
pub client_id: Option<ApplicationId>,
pub account_id: Option<AccountId>,
pub request_strategy: Option<RequestStrategy>,
pub secret: String,
pub api_base: Option<String>,
}
Expand description
Shared configuration utilities for implementing a Stripe client.
This is meant for internal use when implementing compatible clients, so it may be more unstable with respect to semver.
Fields§
§stripe_version: ApiVersion
The stripe version being used.
app_info_str: Option<String>
The user-provided part of the user-agent we’ll use.
client_id: Option<ApplicationId>
The client id to send requests with.
account_id: Option<AccountId>
The account id to send requests with.
request_strategy: Option<RequestStrategy>
The default request strategy to use.,
secret: String
The secret key for authorizing requests.
api_base: Option<String>
The base URL to send requests to.
Implementations§
Sourcepub fn new(secret: impl Into<String>) -> Self
pub fn new(secret: impl Into<String>) -> Self
Create a new SharedConfigBuilder
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
Sets the default RequestStrategy
used when making requests.
Trait Implementations§
Source§fn clone(&self) -> SharedConfigBuilder
fn clone(&self) -> SharedConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more