Class: Stripe::ApplicationFeeService

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

Defined Under Namespace

Classes: ListParams, RetrieveParams

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



71
72
73
74
75
76
77
78
79
# File 'lib/stripe/services/application_fee_service.rb', line 71

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.



82
83
84
85
86
87
88
89
90
# File 'lib/stripe/services/application_fee_service.rb', line 82

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