Class: Stripe::V2::Core::AccountService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/v2/core/account_service.rb

Defined Under Namespace

Classes: CloseParams, CreateParams, ListParams, RetrieveParams, UpdateParams

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ AccountService

Returns a new instance of AccountService.



10
11
12
13
# File 'lib/stripe/services/v2/core/account_service.rb', line 10

def initialize(requestor)
  super
  @persons = Stripe::V2::Core::Accounts::PersonService.new(@requestor)
end

Instance Attribute Details

#personsObject (readonly)

Returns the value of attribute persons.



8
9
10
# File 'lib/stripe/services/v2/core/account_service.rb', line 8

def persons
  @persons
end

Instance Method Details

#close(id, params = {}, opts = {}) ⇒ Object

Removes access to the Account and its associated resources.



4082
4083
4084
4085
4086
4087
4088
4089
4090
# File 'lib/stripe/services/v2/core/account_service.rb', line 4082

def close(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/core/accounts/%<id>s/close", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient.



4093
4094
4095
4096
4097
4098
4099
4100
4101
# File 'lib/stripe/services/v2/core/account_service.rb', line 4093

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v2/core/accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Returns a list of Accounts.



4104
4105
4106
4107
4108
4109
4110
4111
4112
# File 'lib/stripe/services/v2/core/account_service.rb', line 4104

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v2/core/accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Retrieves the details of an Account.



4115
4116
4117
4118
4119
4120
4121
4122
4123
# File 'lib/stripe/services/v2/core/account_service.rb', line 4115

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v2/core/accounts/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Updates the details of an Account.



4126
4127
4128
4129
4130
4131
4132
4133
4134
# File 'lib/stripe/services/v2/core/account_service.rb', line 4126

def update(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v2/core/accounts/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end