pub struct Account {Show 22 fields
pub id: AccountId,
pub business_profile: Option<BusinessProfile>,
pub business_type: Option<AccountBusinessType>,
pub capabilities: Option<AccountCapabilities>,
pub charges_enabled: Option<bool>,
pub company: Option<Company>,
pub controller: Option<AccountUnificationAccountController>,
pub country: Option<String>,
pub created: Option<Timestamp>,
pub default_currency: Option<Currency>,
pub deleted: bool,
pub details_submitted: Option<bool>,
pub email: Option<String>,
pub external_accounts: List<ExternalAccount>,
pub future_requirements: Option<AccountFutureRequirements>,
pub individual: Option<Person>,
pub metadata: Metadata,
pub payouts_enabled: Option<bool>,
pub requirements: Option<AccountRequirements>,
pub settings: Option<AccountSettings>,
pub tos_acceptance: Option<TosAcceptance>,
pub type_: Option<AccountType>,
}
Expand description
The resource representing a Stripe “Account”.
For more details see https://stripe.com/docs/api/accounts/object
Fields
id: AccountId
Unique identifier for the object.
business_profile: Option<BusinessProfile>
Business information about the account.
business_type: Option<AccountBusinessType>
The business type.
capabilities: Option<AccountCapabilities>
charges_enabled: Option<bool>
Whether the account can create live charges.
company: Option<Company>
controller: Option<AccountUnificationAccountController>
country: Option<String>
The account’s country.
created: Option<Timestamp>
Time at which the account was connected.
Measured in seconds since the Unix epoch.
default_currency: Option<Currency>
Three-letter ISO currency code representing the default currency for the account.
This must be a currency that Stripe supports in the account’s country.
deleted: bool
details_submitted: Option<bool>
Whether account details have been submitted.
Standard accounts cannot receive payouts before this is true.
email: Option<String>
An email address associated with the account.
You can treat this as metadata: it is not used for authentication or messaging account holders.
external_accounts: List<ExternalAccount>
External accounts (bank accounts and debit cards) currently attached to this account.
future_requirements: Option<AccountFutureRequirements>
individual: Option<Person>
metadata: Metadata
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
payouts_enabled: Option<bool>
Whether Stripe can send payouts to this account.
requirements: Option<AccountRequirements>
settings: Option<AccountSettings>
Options for customizing how the account functions within Stripe.
tos_acceptance: Option<TosAcceptance>
type_: Option<AccountType>
The Stripe account type.
Can be standard
, express
, or custom
.
Implementations
sourceimpl Account
impl Account
sourcepub fn list(
client: &Client,
params: &ListAccounts<'_>
) -> Response<List<Account>>
pub fn list(
client: &Client,
params: &ListAccounts<'_>
) -> Response<List<Account>>
Returns a list of accounts connected to your platform via Connect.
If you’re not a platform, the list is empty.
sourcepub fn create(client: &Client, params: CreateAccount<'_>) -> Response<Account>
pub fn create(client: &Client, params: CreateAccount<'_>) -> Response<Account>
With Connect, you can create Stripe accounts for your users. To do this, you’ll first need to register your platform.
Examples found in repository?
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
async fn main() {
let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env");
let client = Client::new(secret_key);
let account = Account::create(
&client,
CreateAccount {
type_: Some(AccountType::Express),
capabilities: Some(CreateAccountCapabilities {
card_payments: Some(CreateAccountCapabilitiesCardPayments {
requested: Some(true),
}),
transfers: Some(CreateAccountCapabilitiesTransfers { requested: Some(true) }),
..Default::default()
}),
..Default::default()
},
)
.await
.unwrap();
let link = AccountLink::create(
&client,
CreateAccountLink {
account: account.id.clone(),
type_: AccountLinkType::AccountOnboarding,
collect: None,
expand: &[],
refresh_url: Some("https://test.com/refresh"),
return_url: Some("https://test.com/return"),
},
)
.await
.unwrap();
println!("created a stripe connect link at {}", link.url);
}
sourcepub fn retrieve(
client: &Client,
id: &AccountId,
expand: &[&str]
) -> Response<Account>
pub fn retrieve(
client: &Client,
id: &AccountId,
expand: &[&str]
) -> Response<Account>
Retrieves the details of an account.
sourcepub fn update(
client: &Client,
id: &AccountId,
params: UpdateAccount<'_>
) -> Response<Account>
pub fn update(
client: &Client,
id: &AccountId,
params: UpdateAccount<'_>
) -> Response<Account>
Updates a connected account by setting the values of the parameters passed.
Any parameters not provided are left unchanged. Most parameters can be changed only for Custom accounts. (These are marked Custom Only below.) Parameters marked Custom and Express are not supported for Standard accounts. To update your own account, use the Dashboard. Refer to our Connect documentation to learn more about updating accounts.
sourcepub fn delete(client: &Client, id: &AccountId) -> Response<Deleted<AccountId>>
pub fn delete(client: &Client, id: &AccountId) -> Response<Deleted<AccountId>>
With Connect, you can delete accounts you manage.
Accounts created using test-mode keys can be deleted at any time.
Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. If you want to delete your own account, use the account information tab in your account settings instead.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more