Class: Stripe::Treasury::FinancialAccount
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Treasury::FinancialAccount
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/treasury/financial_account.rb
Overview
Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. FinancialAccounts serve as the source and destination of Treasury’s money movement APIs.
Defined Under Namespace
Classes: Balance, CloseParams, CreateParams, FinancialAddress, ListParams, PlatformRestrictions, RetrieveFeaturesParams, StatusDetails, UpdateFeaturesParams, UpdateParams
Constant Summary collapse
- OBJECT_NAME =
"treasury.financial_account"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#active_features ⇒ Object
readonly
The array of paths to active Features in the Features hash.
-
#balance ⇒ Object
readonly
Balance information for the FinancialAccount.
-
#country ⇒ Object
readonly
Two-letter country code ([ISO 3166-1 alpha-2](en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#display_name ⇒ Object
readonly
The display name for the FinancialAccount.
-
#features ⇒ Object
readonly
Encodes whether a FinancialAccount has access to a particular Feature, with a ‘status` enum and associated `status_details`.
-
#financial_addresses ⇒ Object
readonly
The set of credentials that resolve to a FinancialAccount.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#is_default ⇒ Object
readonly
Attribute for field is_default.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#nickname ⇒ Object
readonly
The nickname for the FinancialAccount.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#pending_features ⇒ Object
readonly
The array of paths to pending Features in the Features hash.
-
#platform_restrictions ⇒ Object
readonly
The set of functionalities that the platform can restrict on the FinancialAccount.
-
#restricted_features ⇒ Object
readonly
The array of paths to restricted Features in the Features hash.
-
#status ⇒ Object
readonly
Status of this FinancialAccount.
-
#status_details ⇒ Object
readonly
Attribute for field status_details.
-
#supported_currencies ⇒ Object
readonly
The currencies the FinancialAccount can hold a balance in.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.close(financial_account, params = {}, opts = {}) ⇒ Object
Closes a FinancialAccount.
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new FinancialAccount.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of FinancialAccounts.
- .object_name ⇒ Object
-
.retrieve_features(financial_account, params = {}, opts = {}) ⇒ Object
Retrieves Features information associated with the FinancialAccount.
-
.update(financial_account, params = {}, opts = {}) ⇒ Object
Updates the details of a FinancialAccount.
-
.update_features(financial_account, params = {}, opts = {}) ⇒ Object
Updates the Features associated with a FinancialAccount.
Instance Method Summary collapse
-
#close(params = {}, opts = {}) ⇒ Object
Closes a FinancialAccount.
-
#retrieve_features(params = {}, opts = {}) ⇒ Object
Retrieves Features information associated with the FinancialAccount.
-
#update_features(params = {}, opts = {}) ⇒ Object
Updates the Features associated with a FinancialAccount.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#active_features ⇒ Object (readonly)
The array of paths to active Features in the Features hash.
774 775 776 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 774 def active_features @active_features end |
#balance ⇒ Object (readonly)
Balance information for the FinancialAccount
776 777 778 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 776 def balance @balance end |
#country ⇒ Object (readonly)
Two-letter country code ([ISO 3166-1 alpha-2](en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
778 779 780 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 778 def country @country end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
780 781 782 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 780 def created @created end |
#display_name ⇒ Object (readonly)
The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the ‘nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts.
782 783 784 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 782 def display_name @display_name end |
#features ⇒ Object (readonly)
Encodes whether a FinancialAccount has access to a particular Feature, with a ‘status` enum and associated `status_details`. Stripe or the platform can control Features via the requested field.
785 786 787 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 785 def features @features end |
#financial_addresses ⇒ Object (readonly)
The set of credentials that resolve to a FinancialAccount.
787 788 789 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 787 def financial_addresses @financial_addresses end |
#id ⇒ Object (readonly)
Unique identifier for the object.
789 790 791 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 789 def id @id end |
#is_default ⇒ Object (readonly)
Attribute for field is_default
791 792 793 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 791 def is_default @is_default end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
793 794 795 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 793 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
795 796 797 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 795 def @metadata end |
#nickname ⇒ Object (readonly)
The nickname for the FinancialAccount.
797 798 799 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 797 def nickname @nickname end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
799 800 801 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 799 def object @object end |
#pending_features ⇒ Object (readonly)
The array of paths to pending Features in the Features hash.
801 802 803 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 801 def pending_features @pending_features end |
#platform_restrictions ⇒ Object (readonly)
The set of functionalities that the platform can restrict on the FinancialAccount.
803 804 805 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 803 def platform_restrictions @platform_restrictions end |
#restricted_features ⇒ Object (readonly)
The array of paths to restricted Features in the Features hash.
805 806 807 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 805 def restricted_features @restricted_features end |
#status ⇒ Object (readonly)
Status of this FinancialAccount.
807 808 809 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 807 def status @status end |
#status_details ⇒ Object (readonly)
Attribute for field status_details
809 810 811 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 809 def status_details @status_details end |
#supported_currencies ⇒ Object (readonly)
The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
811 812 813 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 811 def supported_currencies @supported_currencies end |
Class Method Details
.close(financial_account, params = {}, opts = {}) ⇒ Object
Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards.
824 825 826 827 828 829 830 831 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 824 def self.close(financial_account, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s/close", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default.
834 835 836 837 838 839 840 841 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 834 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/treasury/financial_accounts", params: params, opts: opts ) end |
.field_remappings ⇒ Object
912 913 914 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 912 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
903 904 905 906 907 908 909 910 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 903 def self.inner_class_types @inner_class_types = { balance: Balance, financial_addresses: FinancialAddress, platform_restrictions: PlatformRestrictions, status_details: StatusDetails, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of FinancialAccounts.
844 845 846 847 848 849 850 851 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 844 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/treasury/financial_accounts", params: params, opts: opts ) end |
.object_name ⇒ Object
14 15 16 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 14 def self.object_name "treasury.financial_account" end |
.retrieve_features(financial_account, params = {}, opts = {}) ⇒ Object
Retrieves Features information associated with the FinancialAccount.
864 865 866 867 868 869 870 871 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 864 def self.retrieve_features(financial_account, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts ) end |
.update(financial_account, params = {}, opts = {}) ⇒ Object
Updates the details of a FinancialAccount.
874 875 876 877 878 879 880 881 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 874 def self.update(financial_account, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts ) end |
.update_features(financial_account, params = {}, opts = {}) ⇒ Object
Updates the Features associated with a FinancialAccount.
894 895 896 897 898 899 900 901 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 894 def self.update_features(financial_account, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts ) end |
Instance Method Details
#close(params = {}, opts = {}) ⇒ Object
Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards.
814 815 816 817 818 819 820 821 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 814 def close(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s/close", { financial_account: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#retrieve_features(params = {}, opts = {}) ⇒ Object
Retrieves Features information associated with the FinancialAccount.
854 855 856 857 858 859 860 861 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 854 def retrieve_features(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#update_features(params = {}, opts = {}) ⇒ Object
Updates the Features associated with a FinancialAccount.
884 885 886 887 888 889 890 891 |
# File 'lib/stripe/resources/treasury/financial_account.rb', line 884 def update_features(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }), params: params, opts: opts ) end |