Class: Stripe::ApplicationFeeService

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ ApplicationFeeService

Returns a new instance of ApplicationFeeService.



8
9
10
11
# File 'lib/stripe/services/application_fee_service.rb', line 8

def initialize(requestor)
  super(requestor)
  @refunds = Stripe::ApplicationFeeRefundService.new(@requestor)
end

Instance Attribute Details

#refundsObject (readonly)

Returns the value of attribute refunds.



6
7
8
# File 'lib/stripe/services/application_fee_service.rb', line 6

def refunds
  @refunds
end

Instance Method Details

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

Returns a list of application fees you’ve previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.



14
15
16
17
18
19
20
21
22
# File 'lib/stripe/services/application_fee_service.rb', line 14

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

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

Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.



25
26
27
28
29
30
31
32
33
# File 'lib/stripe/services/application_fee_service.rb', line 25

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