Class: Stripe::Treasury::InboundTransfer::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/treasury/inbound_transfer.rb

Constant Summary collapse

RESOURCE_CLASS =
InboundTransfer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Stripe::APIResourceTestHelpers

Class Method Details

.fail(id, params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.



234
235
236
237
238
239
240
241
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 234

def self.fail(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.resource_classObject



229
230
231
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 229

def self.resource_class
  "InboundTransfer"
end

.return_inbound_transfer(id, params = {}, opts = {}) ⇒ Object

Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.



254
255
256
257
258
259
260
261
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 254

def self.return_inbound_transfer(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.succeed(id, params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.



274
275
276
277
278
279
280
281
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 274

def self.succeed(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

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

Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.



244
245
246
247
248
249
250
251
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 244

def fail(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.



264
265
266
267
268
269
270
271
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 264

def return_inbound_transfer(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.



284
285
286
287
288
289
290
291
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 284

def succeed(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end