Class: Stripe::Treasury::FinancialAccountService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Treasury::FinancialAccountService
- Defined in:
- lib/stripe/services/treasury/financial_account_service.rb
Defined Under Namespace
Classes: CloseParams, CreateParams, ListParams, RetrieveParams, UpdateParams
Instance Attribute Summary collapse
-
#features ⇒ Object
readonly
Returns the value of attribute features.
Instance Method Summary collapse
-
#close(financial_account, params = {}, opts = {}) ⇒ Object
Closes a FinancialAccount.
-
#create(params = {}, opts = {}) ⇒ Object
Creates a new FinancialAccount.
-
#initialize(requestor) ⇒ FinancialAccountService
constructor
A new instance of FinancialAccountService.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of FinancialAccounts.
-
#retrieve(financial_account, params = {}, opts = {}) ⇒ Object
Retrieves the details of a FinancialAccount.
-
#update(financial_account, params = {}, opts = {}) ⇒ Object
Updates the details of a FinancialAccount.
Methods inherited from StripeService
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
#features ⇒ Object (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.
503 504 505 506 507 508 509 510 511 |
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 503 def close(financial_account, params = {}, opts = {}) request( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s/close", { financial_account: CGI.escape(financial_account) }), 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.
514 515 516 517 518 519 520 521 522 |
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 514 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.
525 526 527 528 529 530 531 532 533 |
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 525 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.
536 537 538 539 540 541 542 543 544 |
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 536 def retrieve(financial_account, params = {}, opts = {}) request( method: :get, path: format("/v1/treasury/financial_accounts/%<financial_account>s", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts, base_address: :api ) end |
#update(financial_account, params = {}, opts = {}) ⇒ Object
Updates the details of a FinancialAccount.
547 548 549 550 551 552 553 554 555 |
# File 'lib/stripe/services/treasury/financial_account_service.rb', line 547 def update(financial_account, params = {}, opts = {}) request( method: :post, path: format("/v1/treasury/financial_accounts/%<financial_account>s", { financial_account: CGI.escape(financial_account) }), params: params, opts: opts, base_address: :api ) end |