Class: Stripe::Treasury::FinancialAccountService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/treasury/financial_account_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ FinancialAccountService

Returns a new instance of FinancialAccountService.



9
10
11
12
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 9

def initialize(requestor)
  super
  @features = Stripe::Treasury::FinancialAccountFeaturesService.new(@requestor)
end

Instance Attribute Details

#featuresObject (readonly)

Returns the value of attribute features.



7
8
9
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 7

def features
  @features
end

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



15
16
17
18
19
20
21
22
23
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 15

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

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

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



26
27
28
29
30
31
32
33
34
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 26

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/treasury/financial_accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Returns a list of FinancialAccounts.



37
38
39
40
41
42
43
44
45
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 37

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/treasury/financial_accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(financial_account, params = {}, opts = {}) ⇒ Object

Retrieves the details of a FinancialAccount.



48
49
50
51
52
53
54
55
56
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 48

def retrieve(, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/treasury/financial_accounts/%<financial_account>s", { financial_account: CGI.escape() }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#update(financial_account, params = {}, opts = {}) ⇒ Object

Updates the details of a FinancialAccount.



59
60
61
62
63
64
65
66
67
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 59

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