Class: Stripe::Treasury::OutboundTransferService

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

Defined Under Namespace

Classes: CancelParams, CreateParams, ListParams, RetrieveParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#cancel(outbound_transfer, params = {}, opts = {}) ⇒ Object

An OutboundTransfer can be canceled if the funds have not yet been paid out.



132
133
134
135
136
137
138
139
140
# File 'lib/stripe/services/treasury/outbound_transfer_service.rb', line 132

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

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

Creates an OutboundTransfer.



143
144
145
146
147
148
149
150
151
# File 'lib/stripe/services/treasury/outbound_transfer_service.rb', line 143

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

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

Returns a list of OutboundTransfers sent from the specified FinancialAccount.



154
155
156
157
158
159
160
161
162
# File 'lib/stripe/services/treasury/outbound_transfer_service.rb', line 154

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

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

Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list.



165
166
167
168
169
170
171
172
173
# File 'lib/stripe/services/treasury/outbound_transfer_service.rb', line 165

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