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.



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

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



349
350
351
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 349

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.



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

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.



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

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.



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

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.



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

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.



404
405
406
407
408
409
410
411
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 404

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