Class: Stripe::Treasury::FinancialAccount

Inherits:
APIResource show all
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, CreateParams, FinancialAddress, ListParams, PlatformRestrictions, RetrieveFeaturesParams, RetrieveParams, StatusDetails, UpdateFeaturesParams, UpdateParams

Constant Summary collapse

OBJECT_NAME =
"treasury.financial_account"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #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

included

Methods inherited from StripeObject

#==, #[], #[]=, 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_featuresObject (readonly)

The array of paths to active Features in the Features hash.



733
734
735
# File 'lib/stripe/resources/treasury/financial_account.rb', line 733

def active_features
  @active_features
end

#balanceObject (readonly)

Balance information for the FinancialAccount



736
737
738
# File 'lib/stripe/resources/treasury/financial_account.rb', line 736

def balance
  @balance
end

#countryObject (readonly)

Two-letter country code ([ISO 3166-1 alpha-2](en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).



739
740
741
# File 'lib/stripe/resources/treasury/financial_account.rb', line 739

def country
  @country
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



742
743
744
# File 'lib/stripe/resources/treasury/financial_account.rb', line 742

def created
  @created
end

#display_nameObject (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.



745
746
747
# File 'lib/stripe/resources/treasury/financial_account.rb', line 745

def display_name
  @display_name
end

#featuresObject (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.



749
750
751
# File 'lib/stripe/resources/treasury/financial_account.rb', line 749

def features
  @features
end

#financial_addressesObject (readonly)

The set of credentials that resolve to a FinancialAccount.



752
753
754
# File 'lib/stripe/resources/treasury/financial_account.rb', line 752

def financial_addresses
  @financial_addresses
end

#idObject (readonly)

Unique identifier for the object.



755
756
757
# File 'lib/stripe/resources/treasury/financial_account.rb', line 755

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



758
759
760
# File 'lib/stripe/resources/treasury/financial_account.rb', line 758

def livemode
  @livemode
end

#metadataObject (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.



761
762
763
# File 'lib/stripe/resources/treasury/financial_account.rb', line 761

def 
  @metadata
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



764
765
766
# File 'lib/stripe/resources/treasury/financial_account.rb', line 764

def object
  @object
end

#pending_featuresObject (readonly)

The array of paths to pending Features in the Features hash.



767
768
769
# File 'lib/stripe/resources/treasury/financial_account.rb', line 767

def pending_features
  @pending_features
end

#platform_restrictionsObject (readonly)

The set of functionalities that the platform can restrict on the FinancialAccount.



770
771
772
# File 'lib/stripe/resources/treasury/financial_account.rb', line 770

def platform_restrictions
  @platform_restrictions
end

#restricted_featuresObject (readonly)

The array of paths to restricted Features in the Features hash.



773
774
775
# File 'lib/stripe/resources/treasury/financial_account.rb', line 773

def restricted_features
  @restricted_features
end

#statusObject (readonly)

Status of this FinancialAccount.



776
777
778
# File 'lib/stripe/resources/treasury/financial_account.rb', line 776

def status
  @status
end

#status_detailsObject (readonly)

Attribute for field status_details



779
780
781
# File 'lib/stripe/resources/treasury/financial_account.rb', line 779

def status_details
  @status_details
end

#supported_currenciesObject (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.



782
783
784
# File 'lib/stripe/resources/treasury/financial_account.rb', line 782

def supported_currencies
  @supported_currencies
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount.



785
786
787
788
789
790
791
792
# File 'lib/stripe/resources/treasury/financial_account.rb', line 785

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/treasury/financial_accounts",
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

Returns a list of FinancialAccounts.



795
796
797
798
799
800
801
802
# File 'lib/stripe/resources/treasury/financial_account.rb', line 795

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/treasury/financial_accounts",
    params: params,
    opts: opts
  )
end

.object_nameObject



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.



815
816
817
818
819
820
821
822
# File 'lib/stripe/resources/treasury/financial_account.rb', line 815

def self.retrieve_features(, params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape() }),
    params: params,
    opts: opts
  )
end

.update(id, params = {}, opts = {}) ⇒ Object

Updates the details of a FinancialAccount.



825
826
827
828
829
830
831
832
# File 'lib/stripe/resources/treasury/financial_account.rb', line 825

def self.update(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/treasury/financial_accounts/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.update_features(financial_account, params = {}, opts = {}) ⇒ Object

Updates the Features associated with a FinancialAccount.



845
846
847
848
849
850
851
852
# File 'lib/stripe/resources/treasury/financial_account.rb', line 845

def self.update_features(, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape() }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#retrieve_features(params = {}, opts = {}) ⇒ Object

Retrieves Features information associated with the FinancialAccount.



805
806
807
808
809
810
811
812
# File 'lib/stripe/resources/treasury/financial_account.rb', line 805

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.



835
836
837
838
839
840
841
842
# File 'lib/stripe/resources/treasury/financial_account.rb', line 835

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