lib/stripe/resources/account.rb in stripe-10.8.0.pre.beta.1 vs lib/stripe/resources/account.rb in stripe-10.8.0
- old
+ new
@@ -8,11 +8,10 @@
#
# For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that
# account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions),
# some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
class Account < APIResource
- extend Gem::Deprecate
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
extend Stripe::APIOperations::NestedResource
@@ -192,8 +191,69 @@
false, true))
update_hash[i.to_s] = update
end
update_hash
+ end
+
+ # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
+ # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
+ #
+ # If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
+ # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
+ # You can prefill any information on the account.
+ def self.create(params = {}, opts = {})
+ request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
+ end
+
+ # With [Connect](https://stripe.com/docs/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](https://dashboard.stripe.com/settings/account) instead.
+ def self.delete(id, params = {}, opts = {})
+ request_stripe_object(
+ method: :delete,
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
+ params: params,
+ opts: opts
+ )
+ end
+
+ # With [Connect](https://stripe.com/docs/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](https://dashboard.stripe.com/settings/account) instead.
+ def delete(params = {}, opts = {})
+ request_stripe_object(
+ method: :delete,
+ path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
+ params: params,
+ opts: opts
+ )
+ end
+
+ # Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
+ def self.list(filters = {}, opts = {})
+ request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
+ end
+
+ # Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
+ # left unchanged.
+ #
+ # For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
+ # account has started to go through Connect Onboarding. Once you create an [Account Link or <a href="/docs/api/account_sessions">Account Session](https://stripe.com/docs/api/account_links),
+ # some properties can only be changed or updated for Custom accounts.
+ #
+ # To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
+ # [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
+ def self.update(id, params = {}, opts = {})
+ request_stripe_object(
+ method: :post,
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
+ params: params,
+ opts: opts
+ )
end
end
end