Class: Stripe::Treasury::OutboundTransfer::TestHelpers

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

Constant Summary collapse

RESOURCE_CLASS =
OutboundTransfer

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(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



323
324
325
326
327
328
329
330
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 323

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

.post(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



343
344
345
346
347
348
349
350
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 343

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

.resource_classObject



318
319
320
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 318

def self.resource_class
  "OutboundTransfer"
end

.return_outbound_transfer(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



363
364
365
366
367
368
369
370
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 363

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

.update(outbound_transfer, params = {}, opts = {}) ⇒ Object

Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.



383
384
385
386
387
388
389
390
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 383

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

Instance Method Details

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

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



333
334
335
336
337
338
339
340
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 333

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

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

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



353
354
355
356
357
358
359
360
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 353

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

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

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



373
374
375
376
377
378
379
380
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 373

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

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

Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.



393
394
395
396
397
398
399
400
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 393

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