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

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.



705
706
707
# File 'lib/stripe/resources/treasury/financial_account.rb', line 705

def active_features
  @active_features
end

#balanceObject (readonly)

Balance information for the FinancialAccount



707
708
709
# File 'lib/stripe/resources/treasury/financial_account.rb', line 707

def balance
  @balance
end

#countryObject (readonly)

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



709
710
711
# File 'lib/stripe/resources/treasury/financial_account.rb', line 709

def country
  @country
end

#createdObject (readonly)

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



711
712
713
# File 'lib/stripe/resources/treasury/financial_account.rb', line 711

def created
  @created
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.



714
715
716
# File 'lib/stripe/resources/treasury/financial_account.rb', line 714

def features
  @features
end

#financial_addressesObject (readonly)

The set of credentials that resolve to a FinancialAccount.



716
717
718
# File 'lib/stripe/resources/treasury/financial_account.rb', line 716

def financial_addresses
  @financial_addresses
end

#idObject (readonly)

Unique identifier for the object.



718
719
720
# File 'lib/stripe/resources/treasury/financial_account.rb', line 718

def id
  @id
end

#is_defaultObject (readonly)

Attribute for field is_default



720
721
722
# File 'lib/stripe/resources/treasury/financial_account.rb', line 720

def is_default
  @is_default
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.



722
723
724
# File 'lib/stripe/resources/treasury/financial_account.rb', line 722

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.



724
725
726
# File 'lib/stripe/resources/treasury/financial_account.rb', line 724

def 
  @metadata
end

#nicknameObject (readonly)

The nickname for the FinancialAccount.



726
727
728
# File 'lib/stripe/resources/treasury/financial_account.rb', line 726

def nickname
  @nickname
end

#objectObject (readonly)

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



728
729
730
# File 'lib/stripe/resources/treasury/financial_account.rb', line 728

def object
  @object
end

#pending_featuresObject (readonly)

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



730
731
732
# File 'lib/stripe/resources/treasury/financial_account.rb', line 730

def pending_features
  @pending_features
end

#platform_restrictionsObject (readonly)

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



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

def platform_restrictions
  @platform_restrictions
end

#restricted_featuresObject (readonly)

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



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

def restricted_features
  @restricted_features
end

#statusObject (readonly)

Status of this FinancialAccount.



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

def status
  @status
end

#status_detailsObject (readonly)

Attribute for field status_details



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

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.



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

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.



753
754
755
756
757
758
759
760
# File 'lib/stripe/resources/treasury/financial_account.rb', line 753

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

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

Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default.



763
764
765
766
767
768
769
770
# File 'lib/stripe/resources/treasury/financial_account.rb', line 763

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.



773
774
775
776
777
778
779
780
# File 'lib/stripe/resources/treasury/financial_account.rb', line 773

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.



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

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(financial_account, params = {}, opts = {}) ⇒ Object

Updates the details of a FinancialAccount.



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

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

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

Updates the Features associated with a FinancialAccount.



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

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

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



743
744
745
746
747
748
749
750
# File 'lib/stripe/resources/treasury/financial_account.rb', line 743

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.



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

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.



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

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